From fbe0353205a2797ab469421aa0a71d12287da00d Mon Sep 17 00:00:00 2001 From: da3dsoul Date: Tue, 19 Mar 2024 16:32:48 -0400 Subject: [PATCH] Fix a bunch of possible errors --- .../Scheduling/Delegates/SQLiteDelegate.cs | 4 ++-- .../Scheduling/Delegates/SqlServerDelegate.cs | 4 ++-- .../Jobs/AniDB/AddFileToMyListJob.cs | 2 +- .../Scheduling/Jobs/AniDB/GetAniDBAnimeJob.cs | 2 +- .../Scheduling/Jobs/AniDB/GetAniDBFileJob.cs | 2 +- .../Jobs/AniDB/GetAniDBImagesJob.cs | 2 +- .../AniDB/GetAniDBReleaseGroupStatusJob.cs | 2 +- .../Jobs/AniDB/UpdateMyListFileStatusJob.cs | 11 ++++++--- .../Jobs/AniDB/VoteAniDBAnimeJob.cs | 2 +- .../Jobs/Shoko/DeleteImportFolderJob.cs | 2 +- .../Scheduling/Jobs/Shoko/ManualLinkJob.cs | 24 +++++++++---------- .../Scheduling/Jobs/Shoko/MediaInfoJob.cs | 2 +- .../Scheduling/Jobs/Shoko/ProcessFileJob.cs | 2 +- .../Jobs/Shoko/RenameMoveFileJob.cs | 2 +- .../Scheduling/Jobs/Shoko/ScanFolderJob.cs | 2 +- .../Jobs/TMDB/SearchTMDBSeriesJob.cs | 2 +- .../Jobs/Trakt/SearchTraktSeriesJob.cs | 2 +- .../Trakt/SyncTraktCollectionEpisodeJob.cs | 9 ++++--- .../Trakt/SyncTraktCollectionSeriesJob.cs | 2 +- .../Jobs/Trakt/SyncTraktEpisodeHistoryJob.cs | 7 ++++-- .../Jobs/TvDB/DownloadTvDBImageJob.cs | 2 +- .../Scheduling/Jobs/TvDB/GetTvDBImagesJob.cs | 2 +- .../Scheduling/Jobs/TvDB/GetTvDBSeriesJob.cs | 2 +- .../Scheduling/Jobs/TvDB/LinkTvDBSeriesJob.cs | 4 ++-- .../Jobs/TvDB/SearchTvDBSeriesJob.cs | 2 +- 25 files changed, 54 insertions(+), 45 deletions(-) diff --git a/Shoko.Server/Scheduling/Delegates/SQLiteDelegate.cs b/Shoko.Server/Scheduling/Delegates/SQLiteDelegate.cs index 6daf369db..b9eca795b 100644 --- a/Shoko.Server/Scheduling/Delegates/SQLiteDelegate.cs +++ b/Shoko.Server/Scheduling/Delegates/SQLiteDelegate.cs @@ -423,7 +423,7 @@ public virtual async Task> SelectJobTypeCounts(ConnectionA } } - await using var rs = await cmd.ExecuteReaderAsync(System.Data.CommandBehavior.SequentialAccess, cancellationToken).ConfigureAwait(false); + await using var rs = await cmd.ExecuteReaderAsync(cancellationToken); var results = new List<(IJobDetail, bool)>(); while (await rs.ReadAsync(cancellationToken).ConfigureAwait(false)) @@ -435,7 +435,7 @@ public virtual async Task> SelectJobTypeCounts(ConnectionA var jobType = loadHelper.LoadType(rs.GetString(ColumnJobClass)!)!; var isDurable = GetBooleanFromDbValue(rs[ColumnIsDurable]); var requestsRecovery = GetBooleanFromDbValue(rs[ColumnRequestsRecovery]); - var map = await ReadMapFromReader(rs, 6).ConfigureAwait(false); + var map = await ReadMapFromReader(rs, 6); var jobDataMap = map != null ? new JobDataMap(map) : null; var blocked = GetBooleanFromDbValue(rs[Blocked]); diff --git a/Shoko.Server/Scheduling/Delegates/SqlServerDelegate.cs b/Shoko.Server/Scheduling/Delegates/SqlServerDelegate.cs index 51bf9d2f1..3741e92c2 100644 --- a/Shoko.Server/Scheduling/Delegates/SqlServerDelegate.cs +++ b/Shoko.Server/Scheduling/Delegates/SqlServerDelegate.cs @@ -422,7 +422,7 @@ public virtual async Task> SelectJobTypeCounts(ConnectionA } } - await using var rs = await cmd.ExecuteReaderAsync(System.Data.CommandBehavior.SequentialAccess, cancellationToken).ConfigureAwait(false); + await using var rs = await cmd.ExecuteReaderAsync(cancellationToken); var results = new List<(IJobDetail, bool)>(); while (await rs.ReadAsync(cancellationToken).ConfigureAwait(false)) @@ -434,7 +434,7 @@ public virtual async Task> SelectJobTypeCounts(ConnectionA var jobType = loadHelper.LoadType(rs.GetString(ColumnJobClass)!)!; var isDurable = GetBooleanFromDbValue(rs[ColumnIsDurable]); var requestsRecovery = GetBooleanFromDbValue(rs[ColumnRequestsRecovery]); - var map = await ReadMapFromReader(rs, 6).ConfigureAwait(false); + var map = await ReadMapFromReader(rs, 6); var jobDataMap = map != null ? new JobDataMap(map) : null; var blocked = GetBooleanFromDbValue(rs[Blocked]); diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/AddFileToMyListJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/AddFileToMyListJob.cs index 3856f43a2..8fa978077 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/AddFileToMyListJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/AddFileToMyListJob.cs @@ -46,7 +46,7 @@ public override void PostInit() public override Dictionary Details => new() { { - "File Path", Utils.GetDistinctPath(_videoLocal.GetBestVideoLocalPlace()?.FullServerPath) + "File Path", Utils.GetDistinctPath(_videoLocal?.GetBestVideoLocalPlace()?.FullServerPath) ?? Hash } }; diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBAnimeJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBAnimeJob.cs index dbbd63356..37b049a6b 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBAnimeJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBAnimeJob.cs @@ -49,7 +49,7 @@ public class GetAniDBAnimeJob : BaseJob public override void PostInit() { // We have the title helper. May as well use it to provide better info for the user - _animeName = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle; + _animeName = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle; } public override string TypeName => "Get AniDB Anime Data"; diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBFileJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBFileJob.cs index b84c4d3ae..0cb05fd1e 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBFileJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBFileJob.cs @@ -43,7 +43,7 @@ public override void PostInit() public override Dictionary Details => new() { { - "Filename", _vlocal.FileName + "Filename", _vlocal?.FileName ?? VideoLocalID.ToString() } }; diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBImagesJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBImagesJob.cs index 9d426e439..491f051f0 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBImagesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBImagesJob.cs @@ -48,7 +48,7 @@ public class GetAniDBImagesJob : BaseJob public override void PostInit() { - _anime = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID); + _anime = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID); _title = _anime?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle; } diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBReleaseGroupStatusJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBReleaseGroupStatusJob.cs index 66c129981..d5b2414ca 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBReleaseGroupStatusJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/GetAniDBReleaseGroupStatusJob.cs @@ -36,7 +36,7 @@ public class GetAniDBReleaseGroupStatusJob : BaseJob public override void PostInit() { - _anime = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID); + _anime = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID); _animeName = _anime?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle; } diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/UpdateMyListFileStatusJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/UpdateMyListFileStatusJob.cs index e0b2c42f1..46e4ecd00 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/UpdateMyListFileStatusJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/UpdateMyListFileStatusJob.cs @@ -34,16 +34,21 @@ public class UpdateMyListFileStatusJob : BaseJob public override void PostInit() { - FullFileName = RepoFactory.FileNameHash.GetByHash(Hash).FirstOrDefault()?.FileName; + FullFileName = RepoFactory.FileNameHash?.GetByHash(Hash).FirstOrDefault()?.FileName; } public override string Title => "Updating AniDB MyList Status for File"; - public override Dictionary Details => new() + public override Dictionary Details => FullFileName != null ? new() { { "Filename", FullFileName } - }; + } : new() + { + { + "Hash", Hash + } + } ; public override Task Process() { diff --git a/Shoko.Server/Scheduling/Jobs/AniDB/VoteAniDBAnimeJob.cs b/Shoko.Server/Scheduling/Jobs/AniDB/VoteAniDBAnimeJob.cs index ed01be00c..2250147f6 100644 --- a/Shoko.Server/Scheduling/Jobs/AniDB/VoteAniDBAnimeJob.cs +++ b/Shoko.Server/Scheduling/Jobs/AniDB/VoteAniDBAnimeJob.cs @@ -29,7 +29,7 @@ public class VoteAniDBAnimeJob : BaseJob public override void PostInit() { - _animeName = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); + _animeName = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? _titleHelper.SearchAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); } public override string TypeName => "Rate Anime"; diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/DeleteImportFolderJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/DeleteImportFolderJob.cs index 224df9af9..8980958e5 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/DeleteImportFolderJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/DeleteImportFolderJob.cs @@ -20,7 +20,7 @@ internal class DeleteImportFolderJob : BaseJob public override Dictionary Details => new() { { - "Import Folder", RepoFactory.ImportFolder.GetByID(ImportFolderID)?.ImportFolderName ?? ImportFolderID.ToString() + "Import Folder", RepoFactory.ImportFolder?.GetByID(ImportFolderID)?.ImportFolderName ?? ImportFolderID.ToString() } }; diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/ManualLinkJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/ManualLinkJob.cs index 711a75ac4..7af3f3df2 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/ManualLinkJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/ManualLinkJob.cs @@ -34,20 +34,18 @@ public class ManualLinkJob : BaseJob public override string TypeName => "Manually Link File"; public override string Title => "Manually Linking Episode"; - public override Dictionary Details - { - get + public override Dictionary Details => _episode != null ? + new() { - var result = new Dictionary - { - { "File Path", Utils.GetDistinctPath(_vlocal.GetBestVideoLocalPlace()?.FullServerPath) }, - { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(_episode.AniDB_Episode.AnimeID).AnimeID }, - { "Episode Type", _episode.AniDB_Episode.EpisodeType.ToString() }, - { "Episode Number", _episode.AniDB_Episode.EpisodeNumber } - }; - return result; - } - } + { "File Path", Utils.GetDistinctPath(_vlocal.GetBestVideoLocalPlace()?.FullServerPath) }, + { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(_episode.AniDB_Episode.AnimeID)?.PreferredTitle }, + { "Episode Type", _episode.AniDB_Episode.EpisodeType.ToString() }, + { "Episode Number", _episode.AniDB_Episode.EpisodeNumber } + } : new() + { + { "VideoLocalID", VideoLocalID }, + { "EpisodeID", EpisodeID }, + }; public override void PostInit() { diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/MediaInfoJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/MediaInfoJob.cs index dd7bb973b..f46eb6c00 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/MediaInfoJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/MediaInfoJob.cs @@ -32,7 +32,7 @@ public override void PostInit() } public override string Title => "Reading MediaInfo for File"; - public override Dictionary Details => new() { { "File Path", _fileName } }; + public override Dictionary Details => new() { { "File Path", _fileName ?? VideoLocalID.ToString() } }; public override Task Process() { diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/ProcessFileJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/ProcessFileJob.cs index 72fe2be39..62cd87170 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/ProcessFileJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/ProcessFileJob.cs @@ -49,7 +49,7 @@ public override void PostInit() } public override string Title => "Get XRefs for File"; - public override Dictionary Details => new() { { "File Path", _fileName } }; + public override Dictionary Details => new() { { "File Path", _fileName ?? VideoLocalID.ToString() } }; public override async Task Process() { diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/RenameMoveFileJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/RenameMoveFileJob.cs index 6d3aa0a31..113a1f446 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/RenameMoveFileJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/RenameMoveFileJob.cs @@ -31,7 +31,7 @@ public override void PostInit() _fileName = Utils.GetDistinctPath(_vlocal?.GetBestVideoLocalPlace()?.FullServerPath); } public override string Title => "Renaming/Moving File"; - public override Dictionary Details => new() { { "File Path", _fileName } }; + public override Dictionary Details => new() { { "File Path", _fileName ?? VideoLocalID.ToString() } }; public override Task Process() diff --git a/Shoko.Server/Scheduling/Jobs/Shoko/ScanFolderJob.cs b/Shoko.Server/Scheduling/Jobs/Shoko/ScanFolderJob.cs index 375b9dac6..a5d587749 100644 --- a/Shoko.Server/Scheduling/Jobs/Shoko/ScanFolderJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Shoko/ScanFolderJob.cs @@ -18,7 +18,7 @@ internal class ScanFolderJob : BaseJob public int ImportFolderID { get; set; } public override string TypeName => "Scan Folder"; public override string Title => "Scanning Import Folder"; - public override Dictionary Details => new() { { "Import Folder", RepoFactory.ImportFolder.GetByID(ImportFolderID)?.ImportFolderName ?? ImportFolderID.ToString() } }; + public override Dictionary Details => new() { { "Import Folder", RepoFactory.ImportFolder?.GetByID(ImportFolderID)?.ImportFolderName ?? ImportFolderID.ToString() } }; public override async Task Process() { diff --git a/Shoko.Server/Scheduling/Jobs/TMDB/SearchTMDBSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/TMDB/SearchTMDBSeriesJob.cs index 25e8ff12b..87dd709ae 100644 --- a/Shoko.Server/Scheduling/Jobs/TMDB/SearchTMDBSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TMDB/SearchTMDBSeriesJob.cs @@ -25,7 +25,7 @@ public class SearchTMDBSeriesJob : BaseJob public override void PostInit() { - _animeTitle = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); + _animeTitle = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); } public override string TypeName => "Search TMDB Series"; diff --git a/Shoko.Server/Scheduling/Jobs/Trakt/SearchTraktSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/Trakt/SearchTraktSeriesJob.cs index 00be3a343..93808c8c1 100644 --- a/Shoko.Server/Scheduling/Jobs/Trakt/SearchTraktSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Trakt/SearchTraktSeriesJob.cs @@ -29,7 +29,7 @@ public class SearchTraktSeriesJob : BaseJob public override string TypeName => "Get Trakt Series"; public override string Title => "Searching for Trakt Series"; - public override Dictionary Details => new() { { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString() } }; + public override Dictionary Details => new() { { "Anime", RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString() } }; public override Task Process() { diff --git a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionEpisodeJob.cs b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionEpisodeJob.cs index 778ca8c24..27a47f8fb 100644 --- a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionEpisodeJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionEpisodeJob.cs @@ -29,10 +29,13 @@ public override Dictionary Details { get { - var episode = RepoFactory.AnimeEpisode.GetByID(AnimeEpisodeID).AniDB_Episode; - return new() + var episode = RepoFactory.AnimeEpisode?.GetByID(AnimeEpisodeID)?.AniDB_Episode; + return episode == null ? new() { - { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(episode.AnimeID) }, + { "EpisodeID", AnimeEpisodeID } + } : new() + { + { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(episode.AnimeID)?.PreferredTitle }, { "Episode Type", ((EpisodeType)episode.EpisodeType).ToString() }, { "Episode Number", episode.EpisodeNumber } }; diff --git a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionSeriesJob.cs index 25d050456..946810b4e 100644 --- a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktCollectionSeriesJob.cs @@ -25,7 +25,7 @@ public class SyncTraktCollectionSeriesJob : BaseJob public override void PostInit() { - _seriesName = RepoFactory.AnimeSeries.GetByID(AnimeSeriesID)?.GetSeriesName() ?? AnimeSeriesID.ToString(); + _seriesName = RepoFactory.AnimeSeries?.GetByID(AnimeSeriesID)?.GetSeriesName() ?? AnimeSeriesID.ToString(); } public override string Title => "Syncing Series to Trakt Collection"; diff --git a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktEpisodeHistoryJob.cs b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktEpisodeHistoryJob.cs index 23bec3e44..8166b8dcb 100644 --- a/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktEpisodeHistoryJob.cs +++ b/Shoko.Server/Scheduling/Jobs/Trakt/SyncTraktEpisodeHistoryJob.cs @@ -29,8 +29,11 @@ public override Dictionary Details { get { - var episode = RepoFactory.AnimeEpisode.GetByID(AnimeEpisodeID).AniDB_Episode; - return new() + var episode = RepoFactory.AnimeEpisode?.GetByID(AnimeEpisodeID)?.AniDB_Episode; + return episode == null ? new() + { + { "EpisodeID", AnimeEpisodeID } + } : new() { { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(episode.AnimeID) }, { "Episode Type", ((EpisodeType)episode.EpisodeType).ToString() }, diff --git a/Shoko.Server/Scheduling/Jobs/TvDB/DownloadTvDBImageJob.cs b/Shoko.Server/Scheduling/Jobs/TvDB/DownloadTvDBImageJob.cs index 42d4ce460..8d63c7372 100644 --- a/Shoko.Server/Scheduling/Jobs/TvDB/DownloadTvDBImageJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TvDB/DownloadTvDBImageJob.cs @@ -39,7 +39,7 @@ public class DownloadTvDBImageJob : BaseJob, IImageDownloadJob public override void PostInit() { - Anime = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); + Anime = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); } public override string TypeName => "Download TvDB Image"; diff --git a/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBImagesJob.cs b/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBImagesJob.cs index 3fd3445f0..1ac74d797 100644 --- a/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBImagesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBImagesJob.cs @@ -24,7 +24,7 @@ public class GetTvDBImagesJob : BaseJob public override Dictionary Details => new() { { - "Series", RepoFactory.TvDB_Series.GetByTvDBID(TvDBSeriesID)?.SeriesName ?? TvDBSeriesID.ToString() + "Series", RepoFactory.TvDB_Series?.GetByTvDBID(TvDBSeriesID)?.SeriesName ?? TvDBSeriesID.ToString() } }; diff --git a/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBSeriesJob.cs index 780957c12..05193366a 100644 --- a/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TvDB/GetTvDBSeriesJob.cs @@ -26,7 +26,7 @@ public class GetTvDBSeriesJob : BaseJob public override Dictionary Details => new() { { - "Series", RepoFactory.TvDB_Series.GetByTvDBID(TvDBSeriesID)?.SeriesName ?? TvDBSeriesID.ToString() + "Series", RepoFactory.TvDB_Series?.GetByTvDBID(TvDBSeriesID)?.SeriesName ?? TvDBSeriesID.ToString() } }; diff --git a/Shoko.Server/Scheduling/Jobs/TvDB/LinkTvDBSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/TvDB/LinkTvDBSeriesJob.cs index 073d5f8ff..576b52a7d 100644 --- a/Shoko.Server/Scheduling/Jobs/TvDB/LinkTvDBSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TvDB/LinkTvDBSeriesJob.cs @@ -25,8 +25,8 @@ public class LinkTvDBSeriesJob : BaseJob public override string Title => "Linking TvDB Series"; public override Dictionary Details => new() { - { "Anime", RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString() }, - { "TvDB Series", RepoFactory.TvDB_Series.GetByTvDBID(TvDBID)?.SeriesName ?? TvDBID.ToString() } + { "Anime", RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString() }, + { "TvDB Series", RepoFactory.TvDB_Series?.GetByTvDBID(TvDBID)?.SeriesName ?? TvDBID.ToString() } }; public override async Task Process() diff --git a/Shoko.Server/Scheduling/Jobs/TvDB/SearchTvDBSeriesJob.cs b/Shoko.Server/Scheduling/Jobs/TvDB/SearchTvDBSeriesJob.cs index a1875ad92..6167fcaeb 100644 --- a/Shoko.Server/Scheduling/Jobs/TvDB/SearchTvDBSeriesJob.cs +++ b/Shoko.Server/Scheduling/Jobs/TvDB/SearchTvDBSeriesJob.cs @@ -35,7 +35,7 @@ public class SearchTvDBSeriesJob : BaseJob public override void PostInit() { - _title = RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); + _title = RepoFactory.AniDB_Anime?.GetByAnimeID(AnimeID)?.PreferredTitle ?? AnimeID.ToString(); } public override string Title => "Searching for TvDB Series";