3.0.5387 Beta

pull/702/head
Luke Pulverenti 10 years ago
parent 8e41325dca
commit 0bc84b7d41

@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Intros
{
if (i is Movie)
{
return true;
return !IsDuplicate(item, i);
}
}
return false;
@ -162,7 +162,7 @@ namespace MediaBrowser.Server.Implementations.Intros
{
return false;
}
return true;
return !IsDuplicate(item, i.Item);
})
.OrderByDescending(i => i.Score)
.ThenBy(i => Guid.NewGuid())
@ -172,6 +172,23 @@ namespace MediaBrowser.Server.Implementations.Intros
.Concat(customIntros.Take(1));
}
private bool IsDuplicate(BaseItem playingContent, BaseItem test)
{
var id = playingContent.GetProviderId(MetadataProviders.Imdb);
if (!string.IsNullOrWhiteSpace(id) && string.Equals(id, test.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase))
{
return true;
}
id = playingContent.GetProviderId(MetadataProviders.Tmdb);
if (!string.IsNullOrWhiteSpace(id) && string.Equals(id, test.GetProviderId(MetadataProviders.Tmdb), StringComparison.OrdinalIgnoreCase))
{
return true;
}
return false;
}
private CinemaModeConfiguration GetOptions()
{
return _serverConfig.GetConfiguration<CinemaModeConfiguration>("cinemamode");

@ -1417,6 +1417,10 @@ namespace MediaBrowser.Server.Implementations.Session
{
_jsonSerializer.SerializeToFile(capabilities, path);
}
catch (Exception ex)
{
_logger.ErrorException("Error saving to {0}", ex, path);
}
finally
{
_capabilitiesLock.Release();

Loading…
Cancel
Save