Action Item #470
Refactor to better support Movies vs TV episodes
Status: | Closed | Start date: | 30 Oct 2015 | |
---|---|---|---|---|
Priority: | Immediate | Due date: | ||
Assignee: | % Done: | 100% | ||
Category: | TMDB API | |||
Target version: | PiBox - 0.12.0 | |||
Severity: | 01 - Critical |
Description
Adding TV episodes worked fairly well but the code is ugly and is not bug free (alternatives doesn't work right, for example).
I need to refactor this code to separate the movie vs tv code, including allowing better TV support in UI.
Associated revisions
RM #470: Added TVDB class and extended UI class to support TV episode data from TVDB.com. This basically works but
load/save and alternatives are not yet implemented.
RM #470: Added TVDB class and extended UI class to support TV episode data from TVDB.com. This basically works but
load/save and alternatives are not yet implemented.
RM #470: Add TVDB.com logo at the bottom of the details frame. If the episode name is provided in the JSON, use it as the "TMDB name". Change "TMDB Name" label to "Video Title" Use the episode overview if available, otherwise use the series overview.
RM #470: Add TVDB.com logo at the bottom of the details frame. If the episode name is provided in the JSON, use it as the "TMDB name". Change "TMDB Name" label to "Video Title" Use the episode overview if available, otherwise use the series overview.
RM #470: Moved common code to updateEntry and let queryDB and setID call it as appropriate.
RM #470: Moved common code to updateEntry and let queryDB and setID call it as appropriate.
RM #470: Provide separate fields for file title and real title for use with TV episodes. Scan the correct DB type when
clicking on alternatives.
RM #470: Provide separate fields for file title and real title for use with TV episodes. Scan the correct DB type when
clicking on alternatives.
RM #470: Fix setting alternative to actually update the entry to the alternative series and matching season/episode numbers.
RM #470: Fix setting alternative to actually update the entry to the alternative series and matching season/episode numbers.
RM #470: Implemented load/save for tv episodes.
RM #470: Implemented load/save for tv episodes.
RM #470: Add title bar text to shell.
RM #470: Add title bar text to shell.
RM #470: Added simple about dialog.
RM #470: Added simple about dialog.
RM #470: Clean up old db files before saving. Add some missing fields that make it easier for the front end to
know what to display. Clean up properly when rescanning all video entries.
RM #470: Clean up old db files before saving. Add some missing fields that make it easier for the front end to
know what to display. Clean up properly when rescanning all video entries.
RM #470: Add overview to top level JSON output so front ends can get to it easily.
RM #470: Add overview to top level JSON output so front ends can get to it easily.
History
#1
Updated by Hammel over 4 years ago
This work should include requiring a directory and file naming structure that matches the Plex requirements (title/season/title - s01e01 - episode name.mkv for tv episodies). And use the TheTVDB.com.
#2
Updated by Hammel over 4 years ago
- Status changed from New to In Progress
- Priority changed from High to Immediate
- % Done changed from 0 to 10
- Severity changed from 02 - High to 01 - Critical
Refactoring should use TheTVDB.com for TV episode lookups instead of TheMovieDB.org. This is what Plex uses and I will enforce a file structure of the same format as Plex, so it should work must better than the old way.
This requires:- Add a configuration dialog for setting
- TheMovieDB.org API key
- TheTVDB.com API key
- File extensions to scan
- Poster sizes
- New class: TVDB.java
- Migrate TV specifics to TVDB.java from MovieDB.java
- Refactor directory scans to require Plex directory layout depending on which type is selected (Movie or TV).
The Database UI box sets which base URL to use and which class (MovieDB or TVDB) to use for scans.
#3
Updated by Hammel over 4 years ago
MovieDB is refactored. Now I need to write TVDB.java. Here are some notes:
- To get a TOKEN, required to make additional queries:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"apikey":"xxx"}' 'https://api.thetvdb.com/login'
- This returns a token that is then used in subsequent queries:
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer <token>' 'https://api.thetvdb.com/search/series?name=The%20West%20Wing'
This java API shows how series episodes can be queries given you have the token.
It is also possible to reset the token within 24 hours. So the time stamp for the token should be saved in configuration data and a new token requested only if the old one has expired.
#4
Updated by Hammel over 4 years ago
- % Done changed from 10 to 60
Support for both Movies (TheMovieDB.org) and TV Episodes (TVDB.com) is now implemented. I can scan a directory of episodes that use the following naming scheme:
Series-Name - s<xx>e<yy> - Episode-Name
As long as the series name and season (xx) and episode (yy) numbers are provided then it works perfectly. I can also show both series and episode images.
There is still a bit of work to do for TV episodes.Load/Save of json dataSeparate TV from Movie json data when saving. VideoFE will eventually offer browsing of either at the start.Add support for alternatives for TV episodesAdd TVDB.com logo at the bottom of videolib, like TheMovieDB.org. Not sure if it's required but give credit where due.If the episode name is provided in the JSON, use it as the TMDB name.Change "TMDB Name" lable to "Video Title"Use the episode overview if available, otherwise use the series overview.
I also noticed that VideoLib doesn't display it's program name in the window manager title bar. I should fix that too.
#5
Updated by Hammel over 4 years ago
- % Done changed from 60 to 90
Everything's working now. All fixes are applied, tested, committed and pushed.
The changes are in the mjhammel/tvdbcom branch for now. I'll merge with master when videofe is updated to support the new db formats.
Issue will be closed when the merge with master occurs.
#6
Updated by Hammel over 4 years ago
- I needed more data stored as videolib_ names in the main JSON entry to make it easier for the front end to find what it needs quickly.
- VideoLib had problems with rescan all where it didn't actually get new instances of the video classes.
- VideoLib generated new file IDs but didn't clean out old entries, leaving cruft behind. The cruft had to be deleted before saves were performed.
These are all fixed and both videolib and videofe appear to be working fine now.
Now videofe needs to be tested on hardware. Once that's shown to be working with the new db I can close both issues.
#7
Updated by Hammel over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
Videofe tested on hardware. Fixed a few minor bugs and added support for overviews and series posters that were missing.
Everything is working fine now. In fact, much better than before refactoring.
Committed and pushed.
Merged with master.
Closing issue.