mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
minor cleanup
This commit is contained in:
@@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// Only do this for artists accessed by name. Folder-based artists use ArtistInfoFromSongsProvider
|
||||
// Only do this for artists accessed by name. Folder-based artists get it from the normal refresh
|
||||
if (artist.IsAccessedByName && !artist.LockedFields.Contains(MetadataFields.Genres))
|
||||
{
|
||||
// Avoid implicitly captured closure
|
||||
@@ -91,9 +91,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
.ToList();
|
||||
}
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(artist, null, allItems.OfType<IHasArtist>());
|
||||
|
||||
foreach (var lib in userLibraries)
|
||||
{
|
||||
SetItemCounts(artist, lib.Item1, lib.Item2);
|
||||
|
||||
@@ -16,10 +16,9 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GameGenresPostScanTask"/> class.
|
||||
/// Initializes a new instance of the <see cref="GameGenresPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public GameGenresPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
|
||||
@@ -47,9 +47,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(null, allLibraryItems, masterDictionary);
|
||||
|
||||
progress.Report(2);
|
||||
|
||||
var numComplete = 0;
|
||||
@@ -98,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
private async Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
private Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
{
|
||||
var itemByName = _libraryManager.GetGameGenre(name);
|
||||
|
||||
@@ -109,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||
}
|
||||
|
||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
return itemByName.RefreshMetadata(cancellationToken);
|
||||
}
|
||||
|
||||
private void SetItemCounts(Guid userId, IEnumerable<BaseItem> allItems, Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>> masterDictionary)
|
||||
|
||||
@@ -48,9 +48,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(null, allLibraryItems, masterDictionary);
|
||||
|
||||
progress.Report(2);
|
||||
|
||||
var numComplete = 0;
|
||||
@@ -99,7 +96,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
private async Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
private Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
{
|
||||
var itemByName = _libraryManager.GetGenre(name);
|
||||
|
||||
@@ -110,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||
}
|
||||
|
||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
return itemByName.RefreshMetadata(cancellationToken);
|
||||
}
|
||||
|
||||
private void SetItemCounts(Guid userId, IEnumerable<BaseItem> allItems, Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>> masterDictionary)
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// Initializes a new instance of the <see cref="ArtistsPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public MusicGenresPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
|
||||
@@ -48,9 +48,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(null, allLibraryItems, masterDictionary);
|
||||
|
||||
progress.Report(2);
|
||||
|
||||
var numComplete = 0;
|
||||
@@ -99,7 +96,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
private async Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
private Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
{
|
||||
var itemByName = _libraryManager.GetMusicGenre(name);
|
||||
|
||||
@@ -110,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||
}
|
||||
|
||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
return itemByName.RefreshMetadata(cancellationToken);
|
||||
}
|
||||
|
||||
private void SetItemCounts(Guid userId, IEnumerable<BaseItem> allItems, Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>> masterDictionary)
|
||||
|
||||
@@ -53,9 +53,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(null, allLibraryItems, masterDictionary);
|
||||
|
||||
progress.Report(2);
|
||||
|
||||
var numComplete = 0;
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// Initializes a new instance of the <see cref="ArtistsPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public StudiosPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
|
||||
@@ -47,9 +47,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Populate counts of items
|
||||
//SetItemCounts(null, allLibraryItems, masterDictionary);
|
||||
|
||||
progress.Report(2);
|
||||
|
||||
var numComplete = 0;
|
||||
@@ -98,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
private async Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
private Task UpdateItemByNameCounts(string name, CancellationToken cancellationToken, Dictionary<Guid, Dictionary<CountType, int>> counts)
|
||||
{
|
||||
var itemByName = _libraryManager.GetStudio(name);
|
||||
|
||||
@@ -109,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||
}
|
||||
|
||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
return itemByName.RefreshMetadata(cancellationToken);
|
||||
}
|
||||
|
||||
private void SetItemCounts(Guid userId, IEnumerable<BaseItem> allItems, Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>> masterDictionary)
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
.Distinct()
|
||||
.ToList();
|
||||
|
||||
progress.Report(10);
|
||||
|
||||
var count = allYears.Count;
|
||||
var numComplete = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user