From 1ee7bc6689ddf7eee209bca4967bf0071de25836 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Sat, 14 Dec 2024 19:37:14 +0100 Subject: [PATCH] chore: use `[]` instead of `new()` in tmdb image repository --- .../Cached/TMDB_ImageRepository.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Shoko.Server/Repositories/Cached/TMDB_ImageRepository.cs b/Shoko.Server/Repositories/Cached/TMDB_ImageRepository.cs index eddb19516..2a9a1afeb 100644 --- a/Shoko.Server/Repositories/Cached/TMDB_ImageRepository.cs +++ b/Shoko.Server/Repositories/Cached/TMDB_ImageRepository.cs @@ -23,55 +23,55 @@ public class TMDB_ImageRepository : BaseCachedRepository private PocoIndex? _tmdbRemoteFileNames; public IReadOnlyList GetByTmdbMovieID(int? movieId) - => movieId.HasValue ? ReadLock(() => _tmdbMovieIDs!.GetMultiple(movieId)) ?? new() : new(); + => movieId.HasValue ? ReadLock(() => _tmdbMovieIDs!.GetMultiple(movieId)) ?? [] : []; public IReadOnlyList GetByTmdbMovieIDAndType(int? movieId, ImageEntityType type) => GetByTmdbMovieID(movieId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbEpisodeID(int? episodeId) - => episodeId.HasValue ? ReadLock(() => _tmdbEpisodeIDs!.GetMultiple(episodeId)) ?? new() : new(); + => episodeId.HasValue ? ReadLock(() => _tmdbEpisodeIDs!.GetMultiple(episodeId)) ?? [] : []; public IReadOnlyList GetByTmdbEpisodeIDAndType(int? episodeId, ImageEntityType type) => GetByTmdbEpisodeID(episodeId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbSeasonID(int? seasonId) - => seasonId.HasValue ? ReadLock(() => _tmdbSeasonIDs!.GetMultiple(seasonId)) ?? new() : new(); + => seasonId.HasValue ? ReadLock(() => _tmdbSeasonIDs!.GetMultiple(seasonId)) ?? [] : []; public IReadOnlyList GetByTmdbSeasonIDAndType(int? seasonId, ImageEntityType type) => GetByTmdbSeasonID(seasonId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbShowID(int? showId) - => showId.HasValue ? ReadLock(() => _tmdbShowIDs!.GetMultiple(showId)) ?? new() : new(); + => showId.HasValue ? ReadLock(() => _tmdbShowIDs!.GetMultiple(showId)) ?? [] : []; public IReadOnlyList GetByTmdbShowIDAndType(int? showId, ImageEntityType type) => GetByTmdbShowID(showId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbCollectionID(int? collectionId) - => collectionId.HasValue ? ReadLock(() => _tmdbCollectionIDs!.GetMultiple(collectionId)) ?? new() : new(); + => collectionId.HasValue ? ReadLock(() => _tmdbCollectionIDs!.GetMultiple(collectionId)) ?? [] : []; public IReadOnlyList GetByTmdbCollectionIDAndType(int? collectionId, ImageEntityType type) => ReadLock(() => _tmdbCollectionIDs!.GetMultiple(collectionId)).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbNetworkID(int? networkId) - => networkId.HasValue ? ReadLock(() => _tmdbNetworkIDs!.GetMultiple(networkId.Value)) ?? new() : new(); + => networkId.HasValue ? ReadLock(() => _tmdbNetworkIDs!.GetMultiple(networkId.Value)) ?? [] : []; public IReadOnlyList GetByTmdbNetworkIDAndType(int? networkId, ImageEntityType type) => GetByTmdbNetworkID(networkId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbCompanyID(int? companyId) - => companyId.HasValue ? ReadLock(() => _tmdbCompanyIDs!.GetMultiple(companyId.Value)) ?? new() : new(); + => companyId.HasValue ? ReadLock(() => _tmdbCompanyIDs!.GetMultiple(companyId.Value)) ?? [] : []; public IReadOnlyList GetByTmdbCompanyIDAndType(int? companyId, ImageEntityType type) => GetByTmdbCompanyID(companyId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByTmdbPersonID(int? personId) - => personId.HasValue ? ReadLock(() => _tmdbPersonIDs!.GetMultiple(personId.Value)) ?? new() : new(); + => personId.HasValue ? ReadLock(() => _tmdbPersonIDs!.GetMultiple(personId.Value)) ?? [] : []; public IReadOnlyList GetByTmdbPersonIDAndType(int? personId, ImageEntityType type) => GetByTmdbPersonID(personId).Where(image => image.ImageType == type).ToList(); public IReadOnlyList GetByType(ImageEntityType type) - => ReadLock(() => _tmdbTypes!.GetMultiple(type)) ?? new(); + => ReadLock(() => _tmdbTypes!.GetMultiple(type)) ?? []; public IReadOnlyList GetByForeignID(int? id, ForeignEntityType foreignType) => foreignType switch