update audio sync params

This commit is contained in:
Luke Pulverenti
2017-04-15 15:45:33 -04:00
parent 508edad222
commit 8eb4c034b4
9 changed files with 207 additions and 56 deletions

View File

@@ -9,6 +9,7 @@ using MediaBrowser.Model.Serialization;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.Entities.Audio
{
@@ -227,7 +228,39 @@ namespace MediaBrowser.Controller.Entities.Audio
// Refresh current item
await RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);
if (!refreshOptions.IsAutomated)
{
await RefreshArtists(refreshOptions, cancellationToken).ConfigureAwait(false);
}
progress.Report(100);
}
private async Task RefreshArtists(MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
{
var artists = AllArtists.Select(i =>
{
// This should not be necessary but we're seeing some cases of it
if (string.IsNullOrWhiteSpace(i))
{
return null;
}
var artist = LibraryManager.GetArtist(i);
if (!artist.IsAccessedByName)
{
return null;
}
return artist;
}).Where(i => i != null).ToList();
foreach (var artist in artists)
{
await artist.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
}
}
}
}