limit series pooling to common libraries

This commit is contained in:
Luke Pulverenti 2016-08-12 15:30:04 -04:00
parent d9ee4f81fd
commit e0e6c98e43
4 changed files with 28 additions and 25 deletions

View File

@ -53,5 +53,11 @@ namespace MediaBrowser.Controller.Entities
bool RequiresRefresh();
bool EnableForceSaveOnDateModifiedChange { get; }
string PresentationUniqueKey { get; set; }
string GetPresentationUniqueKey();
string CreatePresentationUniqueKey();
}
}

View File

@ -109,17 +109,16 @@ namespace MediaBrowser.Controller.Entities.TV
private string AddLibrariesToPresentationUniqueKey(string key)
{
return key;
//var folders = LibraryManager.GetCollectionFolders(this)
// .Select(i => i.Id.ToString("N"))
// .ToArray();
var folders = LibraryManager.GetCollectionFolders(this)
.Select(i => i.Id.ToString("N"))
.ToArray();
//if (folders.Length == 0)
//{
// return key;
//}
if (folders.Length == 0)
{
return key;
}
//return key + "-" + string.Join("-", folders);
return key + "-" + string.Join("-", folders);
}
private static string GetUniqueSeriesKey(BaseItem series)

View File

@ -284,6 +284,13 @@ namespace MediaBrowser.Providers.Manager
updateType |= SaveCumulativeRunTimeTicks(item, isFullRefresh, currentUpdateType);
updateType |= SaveDateLastMediaAdded(item, isFullRefresh, currentUpdateType);
var presentationUniqueKey = item.CreatePresentationUniqueKey();
if (!string.Equals(item.PresentationUniqueKey, presentationUniqueKey, StringComparison.Ordinal))
{
item.PresentationUniqueKey = presentationUniqueKey;
updateType |= ItemUpdateType.MetadataImport;
}
return updateType;
}

View File

@ -35,26 +35,17 @@ namespace MediaBrowser.Providers.TV
updateType |= SaveIsVirtualItem(item, episodes);
}
if (updateType <= ItemUpdateType.None)
if (!string.Equals(item.SeriesName, item.FindSeriesName(), StringComparison.Ordinal))
{
if (!string.Equals(item.SeriesName, item.FindSeriesName(), StringComparison.Ordinal))
{
updateType |= ItemUpdateType.MetadataImport;
}
updateType |= ItemUpdateType.MetadataImport;
}
if (updateType <= ItemUpdateType.None)
if (!string.Equals(item.SeriesSortName, item.FindSeriesSortName(), StringComparison.Ordinal))
{
if (!string.Equals(item.SeriesSortName, item.FindSeriesSortName(), StringComparison.Ordinal))
{
updateType |= ItemUpdateType.MetadataImport;
}
updateType |= ItemUpdateType.MetadataImport;
}
if (updateType <= ItemUpdateType.None)
if (item.SeriesId != item.FindSeriesId())
{
if (item.SeriesId != item.FindSeriesId())
{
updateType |= ItemUpdateType.MetadataImport;
}
updateType |= ItemUpdateType.MetadataImport;
}
return updateType;