aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2019-12-14 15:01:14 +0900
committerdkanada <dkanada@users.noreply.github.com>2020-06-04 21:30:09 +0900
commit8d7e9ab5152a1f17d746c770cc3fec6374dd4a34 (patch)
tree82c4848fde9e4c6d92e507999e9a4e241b0bc7cf
parent21505377d5af7e83bf8386831be78441be3e1b9a (diff)
minor refactoring
-rw-r--r--Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs6
-rw-r--r--Emby.Server.Implementations/UserViews/FolderImageProvider.cs8
-rw-r--r--Jellyfin.Drawing.Skia/SkiaEncoder.cs10
3 files changed, 9 insertions, 15 deletions
diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
index fd50f156a..9bbd71b96 100644
--- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
+++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
@@ -194,7 +194,8 @@ namespace Emby.Server.Implementations.Images
return outputPath;
}
- protected virtual string CreateImage(BaseItem item,
+ protected virtual string CreateImage(
+ BaseItem item,
IReadOnlyCollection<BaseItem> itemsWithImages,
string outputPathWithoutExtension,
ImageType imageType,
@@ -225,7 +226,7 @@ namespace Emby.Server.Implementations.Images
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))
{
@@ -236,6 +237,7 @@ namespace Emby.Server.Implementations.Images
{
return true;
}
+
if (SupportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb))
{
return true;
diff --git a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs b/Emby.Server.Implementations/UserViews/FolderImageProvider.cs
index 58a023638..e12603b36 100644
--- a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs
+++ b/Emby.Server.Implementations/UserViews/FolderImageProvider.cs
@@ -77,16 +77,12 @@ namespace Emby.Server.Implementations.UserViews
return false;
}
- if (item is Folder folder)
+ if (item is Folder && item.IsTopParent)
{
- if (folder.IsTopParent)
- {
- return false;
- }
+ return false;
}
return true;
- //return item.SourceType == SourceType.Library;
}
}
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
index dae0e94d4..ccee5c5b9 100644
--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs
+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
@@ -53,9 +53,7 @@ namespace Jellyfin.Drawing.Skia
"jpeg",
"jpg",
"png",
-
"dng",
-
"webp",
"gif",
"bmp",
@@ -64,10 +62,8 @@ namespace Jellyfin.Drawing.Skia
"ktx",
"pkm",
"wbmp",
-
- // TODO
- // Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
-
+ // TODO: check if these are supported on multiple platforms
+ // https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// working on windows at least
"cr2",
"nef",
@@ -272,7 +268,7 @@ namespace Jellyfin.Drawing.Skia
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));
File.Copy(path, tempPath, true);