summaryrefslogtreecommitdiff
path: root/Services
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-04-16 02:22:56 +1000
committerJake Mannens <jake@asger.xyz>2026-04-16 02:22:56 +1000
commitba86ba12732b3290eaa74936950a370966b41ac5 (patch)
treefcb1fb3df3a0edc1d0a27a5336c8cadaef593507 /Services
parentd59e751c5b7c23f0dce2a146b6b8ced80231a0cb (diff)
v0.10av0.10a
Diffstat (limited to 'Services')
-rw-r--r--Services/ConfigService.cs4
-rw-r--r--Services/MediaService.cs8
2 files changed, 8 insertions, 4 deletions
diff --git a/Services/ConfigService.cs b/Services/ConfigService.cs
index d2d1a06..752f9f5 100644
--- a/Services/ConfigService.cs
+++ b/Services/ConfigService.cs
@@ -2,6 +2,7 @@
public interface IConfigService {
public string DataPath { get; }
+ public string KeyPath { get; }
public string DbConnectionString { get; }
public string MediaBasePath { get; }
public string ThumbnailBasePath { get; }
@@ -38,6 +39,9 @@ public class ConfigService : IConfigService {
}
}
+ public string KeyPath =>
+ Path.Join(DataPath, "keys");
+
public string DbConnectionString =>
config.GetConnectionString("DefaultConnection") ??
throw new HBException("Unable to get default connection string");
diff --git a/Services/MediaService.cs b/Services/MediaService.cs
index 2f7eac6..27c77d6 100644
--- a/Services/MediaService.cs
+++ b/Services/MediaService.cs
@@ -285,10 +285,10 @@ public class MediaService : IMediaService {
using var image = new MagickImage(GetPath(mediaId));
- if(width > image.Width || height > image.Height)
- throw new ThumbnailException(
- "Requested thumbnail size is larger than original media",
- mediaId);
+ if(width > image.Width || height > image.Height) {
+ width = (int) image.Width;
+ height = (int) image.Height;
+ }
image.Thumbnail((uint) (width ?? -1), (uint) (height ?? -1));
image.Write(thumbPath, MagickFormat.Jpeg);