using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Providers.Music
{
///
/// Class ArtistsPostScanTask
///
public class ArtistsPostScanTask : ILibraryPostScanTask
{
///
/// The _library manager
///
private readonly ILibraryManager _libraryManager;
///
/// Initializes a new instance of the class.
///
/// The library manager.
public ArtistsPostScanTask(ILibraryManager libraryManager)
{
_libraryManager = libraryManager;
}
///
/// Runs the specified progress.
///
/// The progress.
/// The cancellation token.
/// Task.
public async Task Run(IProgress progress, CancellationToken cancellationToken)
{
var allItems = _libraryManager.RootFolder.RecursiveChildren.ToList();
var allArtists = await GetAllArtists(allItems).ConfigureAwait(false);
progress.Report(10);
var allMusicArtists = allItems.OfType().ToList();
var allSongs = allItems.OfType