support extrathumbs folder
This commit is contained in:
parent
6a3b31a1b0
commit
bb265f129d
|
@ -29,7 +29,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
return ItemUpdateType.ImageUpdate;
|
return ItemUpdateType.ImageUpdate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Supportses the specified item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -72,7 +72,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
return BaseItem.SupportedImageExtensions;
|
return BaseItem.SupportedImageExtensions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches metadata and returns true or false indicating if any work that requires persistence was done
|
/// Fetches metadata and returns true or false indicating if any work that requires persistence was done
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -104,7 +104,6 @@ namespace MediaBrowser.Providers.TV
|
||||||
/// Validates the primary image path still exists
|
/// Validates the primary image path still exists
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="episode">The episode.</param>
|
/// <param name="episode">The episode.</param>
|
||||||
/// <param name="metadataFolderPath">The metadata folder path.</param>
|
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||||
private void ValidateImage(Episode episode)
|
private void ValidateImage(Episode episode)
|
||||||
{
|
{
|
||||||
|
@ -130,18 +129,34 @@ namespace MediaBrowser.Providers.TV
|
||||||
/// <param name="episodeFileName">Name of the episode file.</param>
|
/// <param name="episodeFileName">Name of the episode file.</param>
|
||||||
private void SetPrimaryImagePath(Episode item, Folder parent, string metadataFolder, string episodeFileName)
|
private void SetPrimaryImagePath(Episode item, Folder parent, string metadataFolder, string episodeFileName)
|
||||||
{
|
{
|
||||||
// Look for the image file in the metadata folder, and if found, set PrimaryImagePath
|
foreach (var extension in BaseItem.SupportedImageExtensions)
|
||||||
var imageFiles = new[] {
|
|
||||||
Path.Combine(metadataFolder, Path.ChangeExtension(episodeFileName, ".jpg")),
|
|
||||||
Path.Combine(metadataFolder, Path.ChangeExtension(episodeFileName, ".png"))
|
|
||||||
};
|
|
||||||
|
|
||||||
var file = parent.ResolveArgs.GetMetaFileByPath(imageFiles[0]) ??
|
|
||||||
parent.ResolveArgs.GetMetaFileByPath(imageFiles[1]);
|
|
||||||
|
|
||||||
if (file != null)
|
|
||||||
{
|
{
|
||||||
item.PrimaryImagePath = file.FullName;
|
var path = Path.Combine(metadataFolder, Path.ChangeExtension(episodeFileName, extension));
|
||||||
|
|
||||||
|
var file = parent.ResolveArgs.GetMetaFileByPath(path);
|
||||||
|
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
item.PrimaryImagePath = file.FullName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var seasonFolder = Path.GetDirectoryName(item.Path);
|
||||||
|
|
||||||
|
foreach (var extension in BaseItem.SupportedImageExtensions)
|
||||||
|
{
|
||||||
|
var imageFilename = Path.GetFileNameWithoutExtension(episodeFileName) + "-thumb" + extension;
|
||||||
|
|
||||||
|
var path = Path.Combine(seasonFolder, imageFilename);
|
||||||
|
|
||||||
|
var file = parent.ResolveArgs.GetMetaFileByPath(path);
|
||||||
|
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
item.PrimaryImagePath = file.FullName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
"ps3_update",
|
"ps3_update",
|
||||||
"ps3_vprm",
|
"ps3_vprm",
|
||||||
"adv_obj",
|
"adv_obj",
|
||||||
"extrafanart"
|
"extrafanart",
|
||||||
|
"extrathumbs"
|
||||||
|
|
||||||
}.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
}.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user