xbmc image fixes

This commit is contained in:
Luke Pulverenti 2013-10-17 11:35:39 -04:00
parent 6d68612e47
commit 005b6c92aa
2 changed files with 12 additions and 5 deletions

View File

@ -160,7 +160,7 @@ namespace MediaBrowser.Providers.TV
} }
} }
var anyRemoved = await RemoveObsoleteMissingEpsiodes(series, existingEpisodes, cancellationToken).ConfigureAwait(false); var anyRemoved = await RemoveObsoleteMissingEpisodes(series, existingEpisodes, cancellationToken).ConfigureAwait(false);
if (hasChanges || anyRemoved) if (hasChanges || anyRemoved)
{ {
@ -236,7 +236,7 @@ namespace MediaBrowser.Providers.TV
/// <summary> /// <summary>
/// Removes the virtual entry after a corresponding physical version has been added /// Removes the virtual entry after a corresponding physical version has been added
/// </summary> /// </summary>
private async Task<bool> RemoveObsoleteMissingEpsiodes(Series series, List<Episode> existingEpisodes, CancellationToken cancellationToken) private async Task<bool> RemoveObsoleteMissingEpisodes(Series series, List<Episode> existingEpisodes, CancellationToken cancellationToken)
{ {
var physicalEpisodes = existingEpisodes var physicalEpisodes = existingEpisodes
.Where(i => i.LocationType != LocationType.Virtual) .Where(i => i.LocationType != LocationType.Virtual)

View File

@ -197,7 +197,7 @@ namespace MediaBrowser.Server.Implementations.Providers
{ {
if (_config.Configuration.ImageSavingConvention == ImageSavingConvention.Legacy || !saveLocally) if (_config.Configuration.ImageSavingConvention == ImageSavingConvention.Legacy || !saveLocally)
{ {
return new[] { GetLegacySavePath(item, type, imageIndex, mimeType, saveLocally) }; return new[] { GetStandardSavePath(item, type, imageIndex, mimeType, saveLocally) };
} }
return GetCompatibleSavePaths(item, type, imageIndex, mimeType); return GetCompatibleSavePaths(item, type, imageIndex, mimeType);
@ -303,7 +303,7 @@ namespace MediaBrowser.Server.Implementations.Providers
/// or /// or
/// imageIndex /// imageIndex
/// </exception> /// </exception>
private string GetLegacySavePath(BaseItem item, ImageType type, int? imageIndex, string mimeType, bool saveLocally) private string GetStandardSavePath(BaseItem item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
{ {
string filename; string filename;
@ -426,6 +426,13 @@ namespace MediaBrowser.Server.Implementations.Providers
if (type == ImageType.Primary) if (type == ImageType.Primary)
{ {
if (item is Series)
{
var imageFilename = "poster" + extension;
return new[] { Path.Combine(item.Path, imageFilename) };
}
if (item is Season && item.IndexNumber.HasValue) if (item is Season && item.IndexNumber.HasValue)
{ {
var seriesFolder = Path.GetDirectoryName(item.Path); var seriesFolder = Path.GetDirectoryName(item.Path);
@ -490,7 +497,7 @@ namespace MediaBrowser.Server.Implementations.Providers
} }
// All other paths are the same // All other paths are the same
return new[] { GetLegacySavePath(item, type, imageIndex, mimeType, true) }; return new[] { GetStandardSavePath(item, type, imageIndex, mimeType, true) };
} }
/// <summary> /// <summary>