Skip to content

Commit

Permalink
Attempt to fix an issue with tags in APIv2
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Oct 18, 2023
1 parent 222a417 commit 768dfbd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Shoko.Server/API/v2/Models/common/Filters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ internal static Filters GenerateFromGroupFilter(HttpContext ctx, FilterPreset gf
var f = new Filters { id = gf.FilterPresetID, name = gf.Name };
var hideCategories = ctx.GetUser().GetHideCategories();
var gfs = RepoFactory.FilterPreset.GetByParentID(f.id).AsParallel().Where(a =>
!a.Hidden && !((a.FilterType & GroupFilterType.Tag) != 0 &&
(!hideCategories.Contains(a.Name) || TagFilter.IsTagBlackListed(a.Name, tagfilter))))
{
if (a.Hidden) return false;
// return true if it's not a tag
if ((a.FilterType & GroupFilterType.Tag) == 0) return true;
if (hideCategories.Contains(a.Name)) return false;
return !TagFilter.IsTagBlackListed(a.Name, tagfilter);
})
.ToList();

if (evaluatedResults == null)
Expand Down

0 comments on commit 768dfbd

Please sign in to comment.