Refactor: Get rid of LazyUserList (port functionality to pytrakt)
glensc opened this issue · comments
Feature description
Use case
There's still some code left that's hacking pytrakt internals:
PlexTraktSync/plextraktsync/trakt_list_util.py
Lines 7 to 25 in acd6b43
Plan is to get rid of it, add missing functionality to pytrakt if needed.
@simonc56 as I understand the lazy userlist exists for two purposes:
- not to create Movie, Episode etc objects
- data path is different
data = yield f"lists/{self.trakt}/items"
I think the first point was the original purpose (is that reason still valid?), but second difference came from evolution. should pytrakt be changed to use "lists/{trakt}/items" as well? it seems have changed in 7bde749
or add new entity there just for operating "lists", and operations would be only read methods
LazyUserlist is a kind of hack inspired by LazyEpisode, created to fetch trakt lists faster and avoid hiting rate limit :
About items path, I don't remember anything. Maybe it's changed and needs to be updated.
should pytrakt be changed to use "lists/{trakt}/items" as well? it seems have changed in 7bde749
As explained here, fetching a list with its trakt id is "better" because allows to get user lists AND official lists. Maybe you could create a List
class (for all kind of lists) instead of the current Userlist
(for lists created by trakt users).
List
is reserved word (and UserList
is also from standard library), but yeah new api seems easier
I'll use PublicList
for name:
You must use an integer id, and only public lists will return data.
how to find other list types than
Movies
?
A trakt list can contain movies
, shows
, seasons
, episodes
and people
.
But Plex playlist cannot contain such various content.
Only movies
and episodes
:
And Plex collections can contain movies
or shows
.