feat(feeds): torznab parse category and freeleech (#492)

* feat(feeds): torznab parse freeleech

* feat(feeds): torznab parse categories
This commit is contained in:
ze0s 2022-10-14 18:01:04 +02:00 committed by GitHub
parent 924899d9f3
commit b7d2161fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 478 additions and 57 deletions

View file

@ -160,23 +160,23 @@ func TestClient_GetCaps(t *testing.T) {
SupportedParams: "q",
},
},
Categories: Categories{Category: []Category{
Categories: CapCategories{Categories: []Category{
{
ID: "2000",
ID: 2000,
Name: "Movies",
Subcat: []SubCategory{
SubCategories: []Category{
{
ID: "2010",
ID: 2010,
Name: "Foreign",
},
},
},
{
ID: "5000",
ID: 5000,
Name: "TV",
Subcat: []SubCategory{
SubCategories: []Category{
{
ID: "5040",
ID: 5040,
Name: "HD",
},
{
@ -232,7 +232,7 @@ func TestClient_GetCaps(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
c := NewClient(Config{Host: tt.fields.Host, ApiKey: tt.fields.ApiKey})
got, err := c.GetCaps()
got, err := c.FetchCaps()
if tt.wantErr && assert.Error(t, err) {
assert.EqualErrorf(t, err, tt.expectedErr, "Error should be: %v, got: %v", tt.wantErr, err)
}