mmmmmtasty / SportScanner

Scanner and Metadata Agent for Plex that uses sportdb
109 stars 31 forks source link

Provide ability to use Personal API Key at TheSportsDB.com + small fixes #34

Closed jbalcorn closed 2 years ago

jbalcorn commented 2 years ago

If the user has a personal API key at TheSportsDB.com, a file (not created by default) can be placed in the agent data directory (on Linux, "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.sportscanner/SportsScanner.ini"

The contents of the file can be:

[thesportsdb.com]
apikey=2

With your personal API key (2 is the test key), Code will still use the SportsScanner API key by default if the file does not exist. In this way, the code supports using a personal key without having to edit the code base.

Other changes: use the localmedia agent as a fallback with SportsScanner as primary (ef0e264) avoid uninitialized errors on the potential_leagues variable on failures (fdc11d7)