This commit is contained in:
Zel
2025-02-23 22:09:07 +08:00
parent f664c43d35
commit 4ceaabaf2c

View File

@@ -79,7 +79,7 @@ namespace ZelWiki.Repository
using var stream = assembly.GetManifestResourceStream(updateScriptName); using var stream = assembly.GetManifestResourceStream(updateScriptName);
using var reader = new StreamReader(stream.EnsureNotNull()); using var reader = new StreamReader(stream.EnsureNotNull());
var scriptText = reader.ReadToEnd(); var scriptText = reader.ReadToEnd();
var scriptNameParts = fullScriptName.Split('^'); var scriptNameParts = fullScriptName.Split('^');
var databaseName = scriptNameParts[1]; var databaseName = scriptNameParts[1];
@@ -182,10 +182,10 @@ namespace ZelWiki.Repository
return false; return false;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static bool GetCryptoCheck() public static bool GetCryptoCheck()
{ {
var value = ManagedDataStorage.Config.QueryFirstOrDefault<string>("GetCryptoCheck.sql") ?? string.Empty; var value = ManagedDataStorage.Config.QueryFirstOrDefault<string>("GetCryptoCheck.sql") ?? string.Empty;
@@ -205,9 +205,9 @@ namespace ZelWiki.Repository
return false; return false;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public static void SetCryptoCheck() public static void SetCryptoCheck()
{ {
var param = new var param = new
@@ -229,7 +229,7 @@ namespace ZelWiki.Repository
ManagedDataStorage.Config.Execute("SaveConfigurationEntryValueByGroupAndEntry.sql", param); ManagedDataStorage.Config.Execute("SaveConfigurationEntryValueByGroupAndEntry.sql", param);
ConfigurationRepository.ReloadEverything(); ReloadEverything();
} }
public static List<ConfigurationNest> GetConfigurationNest() public static List<ConfigurationNest> GetConfigurationNest()
@@ -447,10 +447,10 @@ namespace ZelWiki.Repository
var (Width, Height) = Utility.ScaleToMaxOf(img.Width, img.Height, var (Width, Height) = Utility.ScaleToMaxOf(img.Width, img.Height,
GlobalConfiguration.DefaultEmojiHeight); GlobalConfiguration.DefaultEmojiHeight);
Height = (int)(Height * (customScalePercent / 100.0)); Height = (int)(Height * (customScalePercent / 100.0));
Width = (int)(Width * (customScalePercent / 100.0)); Width = (int)(Width * (customScalePercent / 100.0));
if (Height < 16) if (Height < 16)
{ {
Height += 16 - Height; Height += 16 - Height;
@@ -462,7 +462,7 @@ namespace ZelWiki.Repository
Height += 16 - Width; Height += 16 - Width;
Width += 16 - Width; Width += 16 - Width;
} }
var resized = Images.ResizeGifImage(decompressedImageBytes, Width, Height); var resized = Images.ResizeGifImage(decompressedImageBytes, Width, Height);
var itemCache = new ImageCacheItem(resized, "image/gif"); var itemCache = new ImageCacheItem(resized, "image/gif");
WikiCache.Put(scaledImageCacheKey, itemCache, new CacheItemPolicy()); WikiCache.Put(scaledImageCacheKey, itemCache, new CacheItemPolicy());