Skip to content

Fix trakt lazy lookup serialization#2596

Merged
gazpachoking merged 3 commits intodevelopfrom
fix_trakt_lazy_lookup_serialization
Feb 11, 2020
Merged

Fix trakt lazy lookup serialization#2596
gazpachoking merged 3 commits intodevelopfrom
fix_trakt_lazy_lookup_serialization

Conversation

@gazpachoking
Copy link
Copy Markdown
Member

Motivation for changes:

This is to fix #2583. Trakt lazy lookups could not be serialized, because they were passing functions in the parameters to the lazy lookups.

This plugin was sorta confusing, I maybe made it slightly better than it was, but there is still room for improvement.

return entry


def add_lazy_fields(entry: entry.Entry, lazy_lookup_name, media_type):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use type hinting for all new / modified code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's a pretty good idea. Definitely for functions that might be called from outside the module.

trakt_ep_id
trakt_ep_tvdb_id

def get_db_data_for(data_type, entry, session):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in ./db.py ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Not sure. Don't think db.py deals with entries at all right now. This is function is sortof about translating the entry into the db calls in db.py

@gazpachoking gazpachoking merged commit 4af1712 into develop Feb 11, 2020
@gazpachoking gazpachoking deleted the fix_trakt_lazy_lookup_serialization branch January 14, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serialization and Trakt (?)

3 participants