From aa983e496767981860615a117349042e86bffb92 Mon Sep 17 00:00:00 2001 From: Harshith Mohan Date: Tue, 28 Nov 2023 00:12:12 +0530 Subject: [PATCH] Fix syntax in `WithAnime` queries in AnimeEpisodeRepository, also fix typo --- .../Repositories/Cached/AnimeEpisodeRepository.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shoko.Server/Repositories/Cached/AnimeEpisodeRepository.cs b/Shoko.Server/Repositories/Cached/AnimeEpisodeRepository.cs index b297cb351..362d65fd7 100644 --- a/Shoko.Server/Repositories/Cached/AnimeEpisodeRepository.cs +++ b/Shoko.Server/Repositories/Cached/AnimeEpisodeRepository.cs @@ -91,9 +91,9 @@ public List GetByHash(string hash) } private const string IgnoreVariationsWithAnimeQuery = - @"SELECT ani.EpisodeID FROM VideoLocal AS vl JOIN CrossRef_File_Episode ani ON vl.Hash = ani.Hash WHERE ani.AnimeID == :animeID AND vl.IsVariation = 0 AND vl.Hash != '' GROUP BY ani.EpisodeID HAVING COUNT(ani.EpisodeID) > 1"; - private const string CountVariationsAithAnimeQuery = - @"SELECT ani.EpisodeID FROM VideoLocal AS vl JOIN CrossRef_File_Episode ani ON vl.Hash = ani.Hash WHERE ani.AnimeID == :animeID AND vl.Hash != '' GROUP BY ani.EpisodeID HAVING COUNT(ani.EpisodeID) > 1"; + @"SELECT ani.EpisodeID FROM VideoLocal AS vl JOIN CrossRef_File_Episode ani ON vl.Hash = ani.Hash WHERE ani.AnimeID = :animeID AND vl.IsVariation = 0 AND vl.Hash != '' GROUP BY ani.EpisodeID HAVING COUNT(ani.EpisodeID) > 1"; + private const string CountVariationsWithAnimeQuery = + @"SELECT ani.EpisodeID FROM VideoLocal AS vl JOIN CrossRef_File_Episode ani ON vl.Hash = ani.Hash WHERE ani.AnimeID = :animeID AND vl.Hash != '' GROUP BY ani.EpisodeID HAVING COUNT(ani.EpisodeID) > 1"; private const string IgnoreVariationsQuery = @"SELECT ani.EpisodeID FROM VideoLocal AS vl JOIN CrossRef_File_Episode ani ON vl.Hash = ani.Hash WHERE vl.IsVariation = 0 AND vl.Hash != '' GROUP BY ani.EpisodeID HAVING COUNT(ani.EpisodeID) > 1"; private const string CountVariationsQuery = @@ -106,7 +106,7 @@ public List GetWithSoftDuplicates(bool ignoreVariations, int? using var session = DatabaseFactory.SessionFactory.OpenSession(); if (animeID.HasValue && animeID.Value > 0) { - var animeQuery = ignoreVariations ? IgnoreVariationsWithAnimeQuery : CountVariationsAithAnimeQuery; + var animeQuery = ignoreVariations ? IgnoreVariationsWithAnimeQuery : CountVariationsWithAnimeQuery; return session.CreateSQLQuery(animeQuery) .AddScalar("EpisodeID", NHibernateUtil.Int32) .SetParameter("animeID", animeID.Value)