Fix freedesktop portal integration

This commit is contained in:
Victor Tran 2022-10-03 22:47:51 +11:00
parent 340e76fd82
commit a27817df98
No known key found for this signature in database
GPG key ID: 1F0729FE016CDC3E

View file

@ -32,14 +32,10 @@ namespace FRESHMusicPlayer.Controls
}; };
// pain // pain
List<(string, (int, string)[])> nativeFilters = new(); List<(string, (uint, string)[])> nativeFilters = new();
foreach (var filter in Filters) foreach (var filter in Filters)
{ {
var nativeExtensions = new List<(int, string)>(); var nativeExtensions = filter.Extensions.Select(extension => new ValueTuple<uint, string>(0, $"*.{extension}")).ToList();
foreach (var extension in filter.Extensions)
{
nativeExtensions.Add(new(0, $"*.{extension}"));
}
if (IncludeOtherOption) nativeExtensions.Add(new(0, "*")); if (IncludeOtherOption) nativeExtensions.Add(new(0, "*"));
nativeFilters.Add((filter.Name, nativeExtensions.ToArray())); nativeFilters.Add((filter.Name, nativeExtensions.ToArray()));
} }