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
base: develop
Are you sure you want to change the base?
Conversation
date = date.split('.')[0] | ||
|
||
# Define the format | ||
format_str = '%Y-%m-%dT%H:%M:%S' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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. |
Delayed but not forgotten! |
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. |
Still not forgotten |
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: