Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] emby: multiple providers lookup #3780

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

soloam
Copy link
Contributor

@soloam soloam commented May 26, 2023

Motivation for changes:

The emby api allows to search by providers imdb, tmdb and the movie db. The problem is that it does not handle well searching with multiple providers at the same time. This fix handles this issue, making requests with the providers separated and in the end returns the best selection.

Also, some shows don't provide the "Year" field, this is used when we match more that one show (normally when searched by name). But the field "PremiereDate" is available, so we extract the year from the "PremiereDate"

Also I made a update to the pattern used to decode dates, depending on emby server I found different formats

Detailed changes:

  • Fixed process of searches with providers if search fails
  • Fixed year determination to help filter multiple results
  • Fixed date pattern

date = date.split('.')[0]

# Define the format
format_str = '%Y-%m-%dT%H:%M:%S'
Copy link
Member

Choose a reason for hiding this comment

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

Do we need all this custom date wrangling? Seems like it's probably just an iso date and we can use https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.isoparse

Copy link
Contributor Author

@soloam soloam Jun 19, 2023

Choose a reason for hiding this comment

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

I have found that the api is not very accurate returning the date format, I have found more that one format, and had some errors because of that, so i tried to decode the formats and act accordingly!

https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.isoparse seems to map all the versions! I can try to replace it!

I have other improvements to the lookup! Can I push them in this PR? Since it's related. I've been making some tuning to the lookup, to help getting the matching more accurate.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, feel free to use the same PR. Sorry I haven't merged it already

Copy link

This PR is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 60 days.

@github-actions github-actions bot added the Stale label Nov 17, 2023
@soloam
Copy link
Contributor Author

soloam commented Nov 17, 2023

Delayed but not forgotten!

@github-actions github-actions bot removed the Stale label Nov 17, 2023
Copy link

This PR is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 60 days.

@github-actions github-actions bot added the Stale label Apr 16, 2024
@soloam
Copy link
Contributor Author

soloam commented Apr 16, 2024

Still not forgotten

@github-actions github-actions bot removed the Stale label Apr 16, 2024
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.

None yet

2 participants