mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Fix change in filter behaviour
This commit is contained in:
parent
45e499778f
commit
8704dc3505
@ -34,13 +34,17 @@ namespace osu.Game.Beatmaps
|
||||
foreach (var filter in filters)
|
||||
{
|
||||
if (filter.Matches(beatmapInfo.DifficultyName))
|
||||
return true;
|
||||
continue;
|
||||
|
||||
if (BeatmapMetadataInfoExtensions.Match(beatmapInfo.Metadata, filters))
|
||||
return true;
|
||||
if (BeatmapMetadataInfoExtensions.Match(beatmapInfo.Metadata, filter))
|
||||
continue;
|
||||
|
||||
// failed to match a single filter at all - fail the whole match.
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
// got through all filters without failing any - pass the whole match.
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string getVersionString(IBeatmapInfo beatmapInfo) => string.IsNullOrEmpty(beatmapInfo.DifficultyName) ? string.Empty : $"[{beatmapInfo.DifficultyName}]";
|
||||
|
@ -21,18 +21,15 @@ namespace osu.Game.Beatmaps
|
||||
return termsList.ToArray();
|
||||
}
|
||||
|
||||
public static bool Match(IBeatmapMetadataInfo metadataInfo, FilterCriteria.OptionalTextFilter[] filters)
|
||||
public static bool Match(IBeatmapMetadataInfo metadataInfo, FilterCriteria.OptionalTextFilter filter)
|
||||
{
|
||||
foreach (var filter in filters)
|
||||
{
|
||||
if (filter.Matches(metadataInfo.Author.Username)) return true;
|
||||
if (filter.Matches(metadataInfo.Artist)) return true;
|
||||
if (filter.Matches(metadataInfo.ArtistUnicode)) return true;
|
||||
if (filter.Matches(metadataInfo.Title)) return true;
|
||||
if (filter.Matches(metadataInfo.TitleUnicode)) return true;
|
||||
if (filter.Matches(metadataInfo.Source)) return true;
|
||||
if (filter.Matches(metadataInfo.Tags)) return true;
|
||||
}
|
||||
if (filter.Matches(metadataInfo.Author.Username)) return true;
|
||||
if (filter.Matches(metadataInfo.Artist)) return true;
|
||||
if (filter.Matches(metadataInfo.ArtistUnicode)) return true;
|
||||
if (filter.Matches(metadataInfo.Title)) return true;
|
||||
if (filter.Matches(metadataInfo.TitleUnicode)) return true;
|
||||
if (filter.Matches(metadataInfo.Source)) return true;
|
||||
if (filter.Matches(metadataInfo.Tags)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user