Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Runtime/Classes/SearchFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class SearchFilter
internal int pageSize;
internal List<string> searchPhrases = new List<string>();
internal List<string> tags = new List<string>();
internal List<string> excludedTags = new List<string>();
internal List<long> users = new List<long>();
#endregion
/// <summary>
Expand All @@ -33,6 +34,11 @@ public void AddSearchPhrase(string phrase)
searchPhrases.Add(phrase);
}

public void ExcludeTag(string tag)
{
excludedTags.Add(tag);
}

/// <summary>
/// Adds a tag to be used in filtering mods for a request.
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions Runtime/ModIO.Implementation/Statics/FilterUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public static string ConvertToURL(SearchFilter searchFilter)
url += $"&{Filtering.FullTextSearch}{phrase}";
}
}

if(searchFilter.excludedTags != null && searchFilter.excludedTags.Count > 0)
{
url += "&tags-not-in=";
foreach(string tag in searchFilter.excludedTags)
{
url += $"{tag},";
}
url = url.Trim(',');
}

// add tags to filter
if(searchFilter.tags.Count > 0)
{
Expand Down