-
Notifications
You must be signed in to change notification settings - Fork 41
Added season search for TmdbAPI #220
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
base: master
Are you sure you want to change the base?
Conversation
Refactored TMDBSeasonAPI to improve API calls and data handling. I also added metadata from the main series that is missing in the season details (actors, writers, genre,...) this might be inaccurate for some seasons however but there's no other option
You can now search for a series, select it and it'll list all the seasons for that series. With the new modal you can then select the seasons you want to add.
mProjectsCode
left a comment
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.
It would also be nice if you could add types for the API responses, similar to the other APIs.
| (await this.modalHelper.openSelectModal({ elements: apiSearchResults }, async selectModalData => { | ||
| return await this.queryDetails(selectModalData.selected); | ||
| })) ?? []; | ||
| if (types.length === 1 && types[0] === 'season') { |
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 am not sure I like this check here and the one in handleSeasonSelectModal. Maybe it's better to move the season import to its own thing (own command and ui, I mean). I am open to other suggestions, though.
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.
That would keep the code more readable for the future but won't making it a separate command and ui make it confusing for users?
It's definitely something to think about but I'm not sure yet how I'd go about it
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.
If I understand it correctly I'd have to make a new function like createEntryWithSeasonSearchModal that skips type selection and defaults to tmdbseasonapi and therefore also create a new modal like MediaDBSeasonSearchModal in /src/modals? I feel like that would lead to a lot of duplicate code
Switched dynamic import to a static one Changed tmdbSeasonAPI variables to lowercase
|
Heads up: since implementing TMDB's OpenAPI specs, auth in my PR was changed from |
* Using types from open api schema * Changed api key to api read access token
|
Thanks for the heads up, I've updated it for the seasons search |
The last modal now says "create entry" instead of "Ok"
When searching for seasons the modal specifies that you must select only one series to proceed to the season selection screen



This is separate from the series search so users can choose which to use or use both if they want to. It only works with tmdbAPI and here is how it looks

Step 1:
Step 2:

Step 3:

Note that if you try to add multiple series it won't work, only choose one series in the series modal and then as many seasons as you want in the season modal.
I used @ZackBoe's tmdb PR as a base.