Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Improved FetchMetadata, Adding Pause state, Fixed "(year)" in title #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Aug 13, 2023

  1. Improving FetchMetadata

    Added:
    - Use trakt if tmdb isn't find
    
    Changed:
    - Now connects to PMS with `ConnectPlexMediaServer()` method.
    - While searching through tmdb results, if we have tmdb id and it is same as `entry["id"]` we correctly found matching content.
    
    Currently for a show It wasn't giving the correct Metadata. Also id should be preferred to identify content than string title or year (those can vary).
    
    Now, we get the guids of the media, if trakt is setup. We get the first database id in the session guids list and do a simple request to trakt, we later use the data returned for the button link. For the poster, trakt documentation says that they use tmdb, so we have to use it. Otherwise, we use the default search method.
    
    **Why don't I have only used TMDB API?**
    TMDB uses id depending of the media type, this makes things a bit harder but not much. True issue is that getting details for TV episode is a pure nightmare. Every database has a way of sorting episodes and seasons. Using id is made to bypass that and directly know which content it is. TMDB however, ask for the tmdb id, but also the season and episode number. Issue is that if you use another database than tmdb on plex you might get an index (episode) and parentIndex (season) that point to a non existing episode for tmdb and so no episode details. Here we at least use trakt to get link to the show.
    
    I have tried to follow the file naming and type hinting convention as closely as possible, even if it doesn't conform to the PEP8 standard.
    TheGeeKing committed Aug 13, 2023
    Configuration menu
    Copy the full SHA
    55bd245 View commit details
    Browse the repository at this point in the history
  2. Added Paused state

    Added:
    - Displays "Paused ⏸︎ | X%/Y min" when session is paused and shows progress (%) and duration of the media -> EthanC#22
    - Added `IsInPause()` and `BuildPausePresence()` methods
    - Logging case clearing status raise an Exception
    
    Changed:
    - trakt apiKey to clientId, forgot to save file
    
    Fixed:
    - `res = res.json()` was at the wrong place causing an error
    - media type was hard coded, changed it to use media_type variable
    
    Removed:
    - Unused function
    - Unused import
    TheGeeKing committed Aug 13, 2023
    Configuration menu
    Copy the full SHA
    87db2d6 View commit details
    Browse the repository at this point in the history
  3. Fixed year in title name

    Added:
    - Use regex to remove any "(XXXX)" in a title -> EthanC#21
    TheGeeKing committed Aug 13, 2023
    Configuration menu
    Copy the full SHA
    abe9cd8 View commit details
    Browse the repository at this point in the history
  4. Improved FetchMetadata

    Added:
    - If using, Trakt, it will use poster of the season (could add a way in the config file to choose between show, season or episode)
    
    Changed:
    - If Trakt is enabled, it will now get the data from TMDB API using Trakt season and episode numbering
    - If trakt is not enabled or it fallbacks to default search, it now use ratingkey to find show tmdb and get accurate data and not title query.
    TheGeeKing committed Aug 13, 2023
    Configuration menu
    Copy the full SHA
    cb29015 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2023

  1. Update README.md

    Added:
    - Trakt setup and configurable values to README.md
    TheGeeKing committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    59cb6ce View commit details
    Browse the repository at this point in the history