fixed failing scan

This commit is contained in:
Luke Pulverenti 2014-02-01 01:18:16 -05:00
parent 67fde8c16d
commit 53776b332c
8 changed files with 17 additions and 18 deletions

View file

@ -36,10 +36,6 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
/// <summary>
/// The unknown album
/// </summary>
private static readonly MusicAlbum UnknownAlbum = new MusicAlbum { Name = "<Unknown>" };
/// <summary>
/// Override this to return the folder that should be used to construct a container
/// for this item in an index. GroupInIndex should be true as well.
@ -50,7 +46,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
get
{
return Parent is MusicAlbum ? Parent : Album != null ? new MusicAlbum { Name = Album, PrimaryImagePath = PrimaryImagePath } : UnknownAlbum;
return Parents.OfType<MusicAlbum>().FirstOrDefault() ?? new MusicAlbum { Name = "<Unknown>" };
}
}

View file

@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the primary image path.
/// </summary>
/// <value>The primary image path.</value>
string PrimaryImagePath { get; set; }
string PrimaryImagePath { get; }
/// <summary>
/// Gets the preferred metadata language.

View file

@ -1,6 +1,5 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System.Threading;
using System.Threading.Tasks;

View file

@ -258,7 +258,7 @@ namespace MediaBrowser.Providers.Manager
if (localItem.HasMetadata)
{
MergeData(localItem.Item, temp, new List<MetadataFields>(), false, true);
MergeData(localItem.Item, temp, new List<MetadataFields>(), !options.ReplaceAllMetadata, true);
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
// Only one local provider allowed per item
@ -287,7 +287,10 @@ namespace MediaBrowser.Providers.Manager
await ExecuteRemoteProviders(item, temp, providers.OfType<IRemoteMetadataProvider<TItemType>>(), refreshResult, cancellationToken).ConfigureAwait(false);
}
if (refreshResult.UpdateType > ItemUpdateType.Unspecified)
{
MergeData(temp, item, item.LockedFields, true, true);
}
return refreshResult;
}

View file

@ -177,7 +177,7 @@ namespace MediaBrowser.Providers.MediaInfo
}
// Image is already in the cache
item.PrimaryImagePath = path;
item.SetImagePath(ImageType.Primary, path);
}
/// <summary>

View file

@ -227,7 +227,7 @@ namespace MediaBrowser.Providers.MediaInfo
}
// Image is already in the cache
item.PrimaryImagePath = path;
item.SetImagePath(ImageType.Primary, path);
}
/// <summary>
@ -256,7 +256,7 @@ namespace MediaBrowser.Providers.MediaInfo
await _mediaEncoder.ExtractImage(inputPath, type, false, video.Video3DFormat, imageOffset, path, cancellationToken).ConfigureAwait(false);
video.PrimaryImagePath = path;
video.SetImagePath(ImageType.Primary, path);
}
finally
{

View file

@ -116,7 +116,7 @@ namespace MediaBrowser.Providers.TV
if (!File.Exists(path))
{
episode.PrimaryImagePath = null;
episode.SetImagePath(ImageType.Primary, null);
}
}
@ -137,7 +137,7 @@ namespace MediaBrowser.Providers.TV
if (file != null)
{
item.PrimaryImagePath = file.FullName;
item.SetImagePath(ImageType.Primary, file.FullName);
return;
}
}
@ -154,7 +154,7 @@ namespace MediaBrowser.Providers.TV
if (file != null)
{
item.PrimaryImagePath = file.FullName;
item.SetImagePath(ImageType.Primary, file.FullName);
return;
}
}

View file

@ -2,6 +2,7 @@
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System.Globalization;
using System.IO;
@ -90,7 +91,7 @@ namespace MediaBrowser.Providers.TV
if (File.Exists(filename))
{
item.PrimaryImagePath = filename;
item.SetImagePath(ImageType.Primary, 0, filename);
}
}
break;