Skip to content

Refactor: Use TVShow.episodes property for episodes trakt id lookup#716

Merged
glensc merged 11 commits into
Taxel:mainfrom
glensc:pytrakt/show/episodes
Oct 23, 2022
Merged

Refactor: Use TVShow.episodes property for episodes trakt id lookup#716
glensc merged 11 commits into
Taxel:mainfrom
glensc:pytrakt/show/episodes

Conversation

@glensc

@glensc glensc commented Jan 12, 2022

Copy link
Copy Markdown
Collaborator

@glensc glensc self-assigned this Jan 12, 2022
@glensc glensc changed the title Refactor: Use show.episodes property for episodes trakt id lookup Refactor: Use TVShow.episodes property for episodes trakt id lookup Jan 12, 2022
@glensc
glensc force-pushed the pytrakt/show/episodes branch from ef80006 to fba7ae0 Compare October 23, 2022 17:41
@glensc
glensc marked this pull request as ready for review October 23, 2022 18:15
@glensc
glensc force-pushed the pytrakt/show/episodes branch from c3fd002 to f30998e Compare October 23, 2022 20:33
@glensc
glensc merged commit c1c01ff into Taxel:main Oct 23, 2022
@glensc
glensc deleted the pytrakt/show/episodes branch October 23, 2022 20:47
@simonc56

Copy link
Copy Markdown
Collaborator

⚠️ this PR breaks TraktLookup functionnality, do not release as is

@glensc

glensc commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator Author

perhaps explain the problem? steps to reproduce?

@simonc56

simonc56 commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator

Just sync a show (i tested Attack on Titan) and see that find_by_guid is called for each episode.
With 0.23.3 there is no find_by_guid calls needed for each episode because the lookup table works.

@glensc

glensc commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator Author

Unable to reproduce, which season/episode is failing?

I added s01e01 test:

just to be sure:

  1. you installed required dependencies?
  2. you cleared cache so it's not related to cache problem?
  3. python version?
  4. show your plex inspect of the problematic item

@simonc56

simonc56 commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator

I found the problem.

The seasons() from trakt/tv.py uses extract_ids() to flatten the ids dict so the te.ids.get(guid.provider) doesn't work anymore, it always return None.

te.ids.get(guid.provider) needs to be replaced by getattr(te, guid.provider), I'll do it

dependencies installed ✔️
cache cleared ✔️
python 3.9.13
occurs on ALL episodes

Can you confirm the bug on your side ?

@glensc

glensc commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator Author

Found the problem:

@glensc

glensc commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator Author

So, perhaps the PR was incomplete:

should add extract_ids to the seasons() method?

but you seem to claim opposite it does extract_ids while I see it doesn't do extract_ids

EDIT: I see the extract_ids now, perhaps 17abf87 should be the fix

@simonc56

Copy link
Copy Markdown
Collaborator

I think we should use extract_ids() everywhere in pytrakt to be consistent with moogar0880 code.

@glensc

glensc commented Oct 24, 2022

Copy link
Copy Markdown
Collaborator Author

I think we should use extract_ids() everywhere in pytrakt to be consistent with moogar0880 code.

agree, as without that, properties like ids would return None for all providers. extract_ids missing, is bug.

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.

2 participants