minor refactoring

This commit is contained in:
dkanada 2019-12-14 15:01:14 +09:00
parent 21505377d5
commit 8d7e9ab515
3 changed files with 9 additions and 15 deletions

View File

@ -194,7 +194,8 @@ namespace Emby.Server.Implementations.Images
return outputPath; return outputPath;
} }
protected virtual string CreateImage(BaseItem item, protected virtual string CreateImage(
BaseItem item,
IReadOnlyCollection<BaseItem> itemsWithImages, IReadOnlyCollection<BaseItem> itemsWithImages,
string outputPathWithoutExtension, string outputPathWithoutExtension,
ImageType imageType, ImageType imageType,
@ -225,7 +226,7 @@ namespace Emby.Server.Implementations.Images
throw new ArgumentException("Unexpected image type", nameof(imageType)); throw new ArgumentException("Unexpected image type", nameof(imageType));
} }
public bool HasChanged(BaseItem item, IDirectoryService directoryServicee) public bool HasChanged(BaseItem item, IDirectoryService directoryService)
{ {
if (!Supports(item)) if (!Supports(item))
{ {
@ -236,6 +237,7 @@ namespace Emby.Server.Implementations.Images
{ {
return true; return true;
} }
if (SupportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb)) if (SupportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb))
{ {
return true; return true;

View File

@ -77,16 +77,12 @@ namespace Emby.Server.Implementations.UserViews
return false; return false;
} }
if (item is Folder folder) if (item is Folder && item.IsTopParent)
{ {
if (folder.IsTopParent) return false;
{
return false;
}
} }
return true; return true;
//return item.SourceType == SourceType.Library;
} }
} }

View File

@ -53,9 +53,7 @@ namespace Jellyfin.Drawing.Skia
"jpeg", "jpeg",
"jpg", "jpg",
"png", "png",
"dng", "dng",
"webp", "webp",
"gif", "gif",
"bmp", "bmp",
@ -64,10 +62,8 @@ namespace Jellyfin.Drawing.Skia
"ktx", "ktx",
"pkm", "pkm",
"wbmp", "wbmp",
// TODO: check if these are supported on multiple platforms
// TODO // https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// working on windows at least // working on windows at least
"cr2", "cr2",
"nef", "nef",
@ -272,7 +268,7 @@ namespace Jellyfin.Drawing.Skia
return path; return path;
} }
var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path) ?? string.Empty); var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path));
Directory.CreateDirectory(Path.GetDirectoryName(tempPath)); Directory.CreateDirectory(Path.GetDirectoryName(tempPath));
File.Copy(path, tempPath, true); File.Copy(path, tempPath, true);