The Free Software Media System - Server Backend & API
Backport pull request #15032 from jellyfin/release-10.11.z
Shadowghost9e53f46ad26b
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateKeyframeData.cs b/Jellyfin.Server/Migrations/Routines/MigrateKeyframeData.csindex c199ee4d6b..612da05214 100644--- a/Jellyfin.Server/Migrations/Routines/MigrateKeyframeData.cs+++ b/Jellyfin.Server/Migrations/Routines/MigrateKeyframeData.cs@@ -135,14 +135,21 @@ public class MigrateKeyframeData : IDatabaseMigrationRoutinereturn Path.Join(keyframeCachePath, prefix, filename);}- private static bool TryReadFromCache(string? cachePath, [NotNullWhen(true)] out MediaEncoding.Keyframes.KeyframeData? cachedResult)+ private bool TryReadFromCache(string? cachePath, [NotNullWhen(true)] out MediaEncoding.Keyframes.KeyframeData? cachedResult){if (File.Exists(cachePath)){- var bytes = File.ReadAllBytes(cachePath);- cachedResult = JsonSerializer.Deserialize<MediaEncoding.Keyframes.KeyframeData>(bytes, _jsonOptions);+ try+ {+ var bytes = File.ReadAllBytes(cachePath);+ cachedResult = JsonSerializer.Deserialize<MediaEncoding.Keyframes.KeyframeData>(bytes, _jsonOptions);- return cachedResult is not null;+ return cachedResult is not null;+ }+ catch (JsonException jsonException)+ {+ _logger.LogWarning(jsonException, "Failed to read {Path}", cachePath);+ }}cachedResult = null;