validate artist images in post scan task

This commit is contained in:
Luke Pulverenti 2013-09-08 13:10:17 -04:00
parent a254df9760
commit aa03e8e14a
2 changed files with 7 additions and 6 deletions

View file

@ -98,12 +98,12 @@ namespace MediaBrowser.Providers
var args = GetResolveArgsContainingImages(item); var args = GetResolveArgsContainingImages(item);
// Make sure current image paths still exist // Make sure current image paths still exist
ValidateImages(item, args); ValidateImages(item);
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
// Make sure current backdrop paths still exist // Make sure current backdrop paths still exist
ValidateBackdrops(item, args); ValidateBackdrops(item);
ValidateScreenshots(item, args); ValidateScreenshots(item, args);
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
@ -132,8 +132,7 @@ namespace MediaBrowser.Providers
/// Validates that images within the item are still on the file system /// Validates that images within the item are still on the file system
/// </summary> /// </summary>
/// <param name="item">The item.</param> /// <param name="item">The item.</param>
/// <param name="args">The args.</param> internal static void ValidateImages(BaseItem item)
private void ValidateImages(BaseItem item, ItemResolveArgs args)
{ {
// Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below // Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below
var deletedKeys = item.Images var deletedKeys = item.Images
@ -153,8 +152,7 @@ namespace MediaBrowser.Providers
/// Validates that backdrops within the item are still on the file system /// Validates that backdrops within the item are still on the file system
/// </summary> /// </summary>
/// <param name="item">The item.</param> /// <param name="item">The item.</param>
/// <param name="args">The args.</param> internal static void ValidateBackdrops(BaseItem item)
private void ValidateBackdrops(BaseItem item, ItemResolveArgs args)
{ {
// Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below // Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below
var deletedImages = item.BackdropImagePaths var deletedImages = item.BackdropImagePaths

View file

@ -63,6 +63,9 @@ namespace MediaBrowser.Providers.Music
backdrops.InsertRange(0, artist.BackdropImagePaths); backdrops.InsertRange(0, artist.BackdropImagePaths);
artist.BackdropImagePaths = backdrops.Distinct(StringComparer.OrdinalIgnoreCase) artist.BackdropImagePaths = backdrops.Distinct(StringComparer.OrdinalIgnoreCase)
.ToList(); .ToList();
ImageFromMediaLocationProvider.ValidateImages(artist);
ImageFromMediaLocationProvider.ValidateBackdrops(artist);
} }
if (!artist.LockedFields.Contains(MetadataFields.Genres)) if (!artist.LockedFields.Contains(MetadataFields.Genres))