diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-09-03 11:01:55 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2021-09-03 11:01:55 -0600 |
| commit | ff9d14c8119f6cf77f21e4ebcc97c5580725b882 (patch) | |
| tree | 8ca7b09583a1195e507d347bcbddbabb039f47fc /Emby.Server.Implementations/Data/SqliteItemRepository.cs | |
| parent | 88157fcc77dc6cd47b4defda95089677403241ba (diff) | |
| parent | 95ca1d54876e928dc654736ff5a279728c0f9ed0 (diff) | |
Merge remote-tracking branch 'upstream/master' into authenticationdb-efcore
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 2cb10765f..0e6b7fb82 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -75,6 +75,12 @@ namespace Emby.Server.Implementations.Data /// <summary> /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// </summary> + /// <param name="config">Instance of the <see cref="IServerConfigurationManager"/> interface.</param> + /// <param name="appHost">Instance of the <see cref="IServerApplicationHost"/> interface.</param> + /// <param name="logger">Instance of the <see cref="ILogger{SqliteItemRepository}"/> interface.</param> + /// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param> + /// <param name="imageProcessor">Instance of the <see cref="IImageProcessor"/> interface.</param> + /// <exception cref="ArgumentNullException">config is null.</exception> public SqliteItemRepository( IServerConfigurationManager config, IServerApplicationHost appHost, @@ -1135,15 +1141,25 @@ namespace Emby.Server.Implementations.Data Path = RestorePath(path.ToString()) }; - if (long.TryParse(dateModified, NumberStyles.Any, CultureInfo.InvariantCulture, out var ticks)) + if (long.TryParse(dateModified, NumberStyles.Any, CultureInfo.InvariantCulture, out var ticks) + && ticks >= DateTime.MinValue.Ticks + && ticks <= DateTime.MaxValue.Ticks) { image.DateModified = new DateTime(ticks, DateTimeKind.Utc); } + else + { + return null; + } if (Enum.TryParse(imageType.ToString(), true, out ImageType type)) { image.Type = type; } + else + { + return null; + } // Optional parameters: width*height*blurhash if (nextSegment + 1 < value.Length - 1) @@ -4879,7 +4895,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type foreach (var t in _knownTypes) { - dict[t.Name] = t.FullName ; + dict[t.Name] = t.FullName; } dict["Program"] = typeof(LiveTvProgram).FullName; |
