1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 15:53:23 +00:00

Fixed: (FileList) Prevent double query escaping and category IDs correction

This commit is contained in:
Bogdan 2023-07-31 17:31:33 +03:00
parent 3ec6a73656
commit 27518a27fb
2 changed files with 14 additions and 9 deletions

View file

@ -23,7 +23,10 @@ public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchC
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetRequest("search-torrents", Settings.Categories, string.Format("&type=name&query={0}+{1}", Uri.EscapeDataString(searchCriteria.CleanArtistQuery.Trim()), Uri.EscapeDataString(searchCriteria.CleanAlbumQuery.Trim()))));
var artistQuery = searchCriteria.CleanArtistQuery.Replace("+", " ").Trim();
var albumQuery = searchCriteria.CleanAlbumQuery.Replace("+", " ").Trim();
pageableRequests.Add(GetRequest("search-torrents", Settings.Categories, string.Format("&type=name&query={0}+{1}", Uri.EscapeDataString(artistQuery), Uri.EscapeDataString(albumQuery))));
return pageableRequests;
}
@ -32,7 +35,9 @@ public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria search
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetRequest("search-torrents", Settings.Categories, string.Format("&type=name&query={0}", Uri.EscapeDataString(searchCriteria.CleanArtistQuery.Trim()))));
var artistQuery = searchCriteria.CleanArtistQuery.Replace("+", " ").Trim();
pageableRequests.Add(GetRequest("search-torrents", Settings.Categories, string.Format("&type=name&query={0}", Uri.EscapeDataString(artistQuery))));
return pageableRequests;
}

View file

@ -26,10 +26,10 @@ public FileListSettings()
BaseUrl = "https://filelist.io";
MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS;
Categories = new int[]
Categories = new[]
{
(int)FileListCategories.AUDIO,
(int)FileListCategories.FLAC
(int)FileListCategories.Audio,
(int)FileListCategories.Flac
};
}
@ -62,9 +62,9 @@ public NzbDroneValidationResult Validate()
public enum FileListCategories
{
[FieldOption]
AUDIO = 5,
[FieldOption]
FLAC = 11
[FieldOption(Label = "FLAC")]
Flac = 5,
[FieldOption(Label = "Audio")]
Audio = 11
}
}