Kometa-Team/Kometa

imdb_list sorting doesn't work

d3mystified opened this issue · 5 comments

Version Number

2.0.2

What branch are you on?

master

Describe the Bug

rating.desc is a valid sort_by attribute. And the format seems to be consistent with https://kometa.wiki/en/latest/files/builders/imdb/#imdb-list but it still doesn't work:

| Collection Warning: imdb_list {'list_id': 'list_id', 'sort_by': 'sort_by', 'limit': 'limit'} attribute {'list_id': 'ls000054939', 'sort_by': 'rating.desc', 'limit': 50} must be in [popularity.asc, popularity.desc, title.asc, title.desc, rating.asc, rating.desc, votes.asc, votes.desc, box_office.asc, box_office.desc, runtime.asc, runtime.desc, year.asc, year.desc, release.asc, release.desc] using custom.asc as default |

Relevant Collection/Overlay/Playlist Definition

Config:


  Dance Flicks:
    sort_title: "!03-03-Dance Flicks"
    collection_order: random
    visible_home: false
    visible_shared: false
    visible_library: false
    imdb_list:
      - list_id: ls000054939
        sort_by: rating.desc
        limit: 50
      - list_id: ls023979601
        sort_by: rating.desc
        limit: 50

Mr. Carrot on Discord said:

This looks like a plain old bug in the parsing here.

Basically it appears to be looking for this entire string:

{'list_id': 'ls000054939', 'sort_by': 'rating.desc', 'limit': 50} 


in this list:

[popularity.asc, popularity.desc, title.asc, title.desc, rating.asc, rating.desc, votes.asc, votes.desc, box_office.asc, box_office.desc, runtime.asc, runtime.desc, year.asc, year.desc, release.asc, release.desc]


rather than just rating.desc, and of course it isn't there.


### Logs

_No response_

Does this happen in the current 2.1.0 release?

Yes, it does:

| Collection Warning: imdb_list {'list_id': 'list_id', 'sort_by': 'sort_by', 'limit': 'limit'} attribute {'list_id': 'ls000054939', 'sort_by': 'rating.desc', 'limit': 50} must be in [popu
larity.asc, popularity.desc, title.asc, title.desc, rating.asc, rating.desc, votes.asc, votes.desc, box_office.asc, box_office.desc, runtime.asc, runtime.desc, year.asc, year.desc, releas
e.asc, release.desc] using custom.asc as default |

I was able to reproduce this error, if it helps here is a workaround using imdb_search:

collections:
  Dance Flicks:
    sort_title: "!03-03-Dance Flicks"
    collection_order: random
    visible_home: false
    visible_shared: false
    visible_library: false
    imdb_search:
      - list: ls000054939
        sort_by: rating.desc
        limit: 50
      - list: ls023979601
        sort_by: rating.desc
        limit: 50

I have re-tested and can confirm this is fixed in nightly.

Can confirm that nightly fixed this! Thanks @YozoraXCII