本文整理汇总了C#中IHasImages.GetInternalMetadataPath方法的典型用法代码示例。如果您正苦于以下问题:C# IHasImages.GetInternalMetadataPath方法的具体用法?C# IHasImages.GetInternalMetadataPath怎么用?C# IHasImages.GetInternalMetadataPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHasImages
的用法示例。
在下文中一共展示了IHasImages.GetInternalMetadataPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImages
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
{
var path = item.GetInternalMetadataPath();
try
{
return new LocalImageProvider(_fileSystem).GetImages(item, path, true, directoryService);
}
catch (DirectoryNotFoundException)
{
return new List<LocalImageInfo>();
}
}
示例2: GetStandardSavePath
//.........这里部分代码省略.........
var imageFilename = "season" + seasonMarker + "-landscape" + extension;
return Path.Combine(seriesFolder, imageFilename);
}
if (item.IsInMixedFolder)
{
return GetSavePathForItemInMixedFolder(item, type, "landscape", extension);
}
return Path.Combine(item.ContainingFolderPath, "landscape" + extension);
}
if (type == ImageType.Banner && saveLocally)
{
if (season != null && season.IndexNumber.HasValue)
{
var seriesFolder = season.SeriesPath;
var seasonMarker = season.IndexNumber.Value == 0
? "-specials"
: season.IndexNumber.Value.ToString("00", UsCulture);
var imageFilename = "season" + seasonMarker + "-banner" + extension;
return Path.Combine(seriesFolder, imageFilename);
}
}
string filename;
var folderName = item is MusicAlbum || item is MusicArtist ? "folder" : "poster";
switch (type)
{
case ImageType.Art:
filename = "clearart";
break;
case ImageType.BoxRear:
filename = "back";
break;
case ImageType.Thumb:
filename = "landscape";
break;
case ImageType.Disc:
filename = item is MusicAlbum ? "cdart" : "disc";
break;
case ImageType.Primary:
filename = item is Episode ? _fileSystem.GetFileNameWithoutExtension(item.Path) : folderName;
break;
case ImageType.Backdrop:
filename = GetBackdropSaveFilename(item.GetImages(type), "backdrop", "backdrop", imageIndex);
break;
case ImageType.Screenshot:
filename = GetBackdropSaveFilename(item.GetImages(type), "screenshot", "screenshot", imageIndex);
break;
default:
filename = type.ToString().ToLower();
break;
}
if (string.Equals(extension, ".jpeg", StringComparison.OrdinalIgnoreCase))
{
extension = ".jpg";
}
extension = extension.ToLower();
string path = null;
if (saveLocally)
{
if (item is Episode)
{
path = Path.Combine(Path.GetDirectoryName(item.Path), "metadata", filename + extension);
}
else if (item.IsInMixedFolder)
{
path = GetSavePathForItemInMixedFolder(item, type, filename, extension);
}
if (string.IsNullOrEmpty(path))
{
path = Path.Combine(item.ContainingFolderPath, filename + extension);
}
}
// None of the save local conditions passed, so store it in our internal folders
if (string.IsNullOrEmpty(path))
{
if (string.IsNullOrEmpty(filename))
{
filename = folderName;
}
path = Path.Combine(item.GetInternalMetadataPath(), filename + extension);
}
return path;
}
示例3: GetChapterImagesPath
/// <summary>
/// Gets the chapter images data path.
/// </summary>
/// <value>The chapter images data path.</value>
private string GetChapterImagesPath(IHasImages item)
{
return Path.Combine(item.GetInternalMetadataPath(), "chapters");
}
示例4: GetStandardSavePath
/// <summary>
/// Gets the save path.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="mimeType">Type of the MIME.</param>
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
/// <returns>System.String.</returns>
/// <exception cref="System.ArgumentNullException">
/// imageIndex
/// or
/// imageIndex
/// </exception>
private string GetStandardSavePath(IHasImages item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
{
string filename;
switch (type)
{
case ImageType.Art:
filename = "clearart";
break;
case ImageType.BoxRear:
filename = "back";
break;
case ImageType.Disc:
filename = item is MusicAlbum ? "cdart" : "disc";
break;
case ImageType.Primary:
filename = item is Episode ? _fileSystem.GetFileNameWithoutExtension(item.Path) : "folder";
break;
case ImageType.Backdrop:
filename = GetBackdropSaveFilename(item.GetImages(type), "backdrop", "backdrop", imageIndex);
break;
case ImageType.Screenshot:
filename = GetBackdropSaveFilename(item.GetImages(type), "screenshot", "screenshot", imageIndex);
break;
default:
filename = type.ToString().ToLower();
break;
}
var extension = mimeType.Split('/').Last();
if (string.Equals(extension, "jpeg", StringComparison.OrdinalIgnoreCase))
{
extension = "jpg";
}
extension = "." + extension.ToLower();
string path = null;
if (saveLocally)
{
if (item is Episode)
{
path = Path.Combine(Path.GetDirectoryName(item.Path), "metadata", filename + extension);
}
else if (item.IsInMixedFolder)
{
path = GetSavePathForItemInMixedFolder(item, type, filename, extension);
}
if (string.IsNullOrEmpty(path))
{
path = Path.Combine(item.ContainingFolderPath, filename + extension);
}
}
// None of the save local conditions passed, so store it in our internal folders
if (string.IsNullOrEmpty(path))
{
if (string.IsNullOrEmpty(filename))
{
filename = "folder";
}
path = Path.Combine(item.GetInternalMetadataPath(), filename + extension);
}
return path;
}
示例5: GetCacheKeyPath
private string GetCacheKeyPath(IHasImages item, ImageType type, string mimeType, string key)
{
var extension = MimeTypes.ToExtension(mimeType);
return Path.Combine(item.GetInternalMetadataPath(), type.ToString().ToLower() + "_key_" + key + extension);
}