Skip to content

Commit

Permalink
misc: fix up the complaints from my IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Jan 7, 2024
1 parent ef08bfb commit a1313f9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Shoko.Server/Utilities/SeriesSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ public static List<SearchResult<SVR_AnimeSeries>> SearchSeries(SVR_JMMUser user,
var forbiddenTags = user.GetHideCategories();

//search by anime id
if (int.TryParse(query, out int animeID))
if (int.TryParse(query, out var animeID))
{
var series = RepoFactory.AnimeSeries.GetByAnimeID(animeID);
var anime = series.GetAnime();
var tags = anime?.GetAllTags();
if (anime != null && !tags.FindInEnumerable(forbiddenTags))
return new List<SearchResult<SVR_AnimeSeries>>
{
new SearchResult<SVR_AnimeSeries>
new()
{
ExactMatch = true,
Match = series.AniDB_ID.ToString(),
Expand Down Expand Up @@ -284,7 +284,7 @@ private static List<SearchResult<SVR_AnimeSeries>> SearchTagsExact(string query,
var series = RepoFactory.AnimeSeries.GetByAnimeID(xref.CrossRefID);
var anime = series?.GetAnime();
var tags = anime?.GetAllTags();
if (anime == null || (tags.Count == 0 || tags.FindInEnumerable(forbiddenTags)))
if (anime == null || tags.Count == 0 || tags.FindInEnumerable(forbiddenTags))
return null;

return new SearchResult<SVR_AnimeSeries>
Expand All @@ -310,7 +310,7 @@ private static List<SearchResult<SVR_AnimeSeries>> SearchTagsExact(string query,
var series = RepoFactory.AnimeSeries.GetByAnimeID(xref.AnimeID);
var anime = series?.GetAnime();
var tags = anime?.GetAllTags();
if (anime == null || (tags.Count == 0 || tags.FindInEnumerable(forbiddenTags)))
if (anime == null || tags.Count == 0 || tags.FindInEnumerable(forbiddenTags))
return null;

return new SearchResult<SVR_AnimeSeries>
Expand Down Expand Up @@ -358,7 +358,7 @@ private static List<SearchResult<SVR_AnimeSeries>> SearchTagsFuzzy(string query,
var series = RepoFactory.AnimeSeries.GetByAnimeID(xref.CrossRefID);
var anime = series?.GetAnime();
var tags = anime?.GetAllTags();
if (anime == null || (tags.Count == 0 || tags.FindInEnumerable(forbiddenTags)))
if (anime == null || tags.Count == 0 || tags.FindInEnumerable(forbiddenTags))
return null;

return new SearchResult<SVR_AnimeSeries>
Expand Down Expand Up @@ -396,7 +396,7 @@ private static List<SearchResult<SVR_AnimeSeries>> SearchTagsFuzzy(string query,
var series = RepoFactory.AnimeSeries.GetByAnimeID(xref.AnimeID);
var anime = series?.GetAnime();
var tags = anime?.GetAllTags();
if (anime == null || (tags.Count == 0 || tags.FindInEnumerable(forbiddenTags)))
if (anime == null || tags.Count == 0 || tags.FindInEnumerable(forbiddenTags))
return null;

return new SearchResult<SVR_AnimeSeries>
Expand Down Expand Up @@ -492,19 +492,19 @@ public int CompareTo(SearchResult<T> other)
if (otherIsEmpty)
return -1;

int exactMatchComparison = ExactMatch == other.ExactMatch ? 0 : ExactMatch ? -1 : 1;
var exactMatchComparison = ExactMatch == other.ExactMatch ? 0 : ExactMatch ? -1 : 1;
if (exactMatchComparison != 0)
return exactMatchComparison;

int indexComparison = Index.CompareTo(other.Index);
var indexComparison = Index.CompareTo(other.Index);
if (indexComparison != 0)
return indexComparison;

int distanceComparison = Distance.CompareTo(other.Distance);
var distanceComparison = Distance.CompareTo(other.Distance);
if (distanceComparison != 0)
return distanceComparison;

int lengthDifferenceComparison = LengthDifference.CompareTo(other.LengthDifference);
var lengthDifferenceComparison = LengthDifference.CompareTo(other.LengthDifference);
if (lengthDifferenceComparison != 0)
return lengthDifferenceComparison;

Expand Down

0 comments on commit a1313f9

Please sign in to comment.