-
-
Notifications
You must be signed in to change notification settings - Fork 23
TMDb Attributes
This is an optional YAML section for outlining how the Maker should interact with the public database service TMDb. TMDb is used for many things by the Maker, but notably the following:
- Automatically downloading source image files for use in the title cards
- Automatically downloading series logos for creating Show Summaries
- Automatically adding episode title translations to data files
When a given series uses the Maker's title translation functionality, such as the AnimeTitleCard, the Maker queries TMDb for a translated title of a given episode to add to the series' datafile.
These translations are user submitted, so there is no guarantee a given episode will have a given translation. Blacklisting is used to limit translation queries.
For some reason, many episode titles are "translated" as Episode x
independent of the actual episode title. The Maker will attempt to recognize "translations" of this form and reject them. So for example, if TMDb has a French title as Épisode {number}
or the Japanese title as 第{number}話
; that data will not be added to the datafile.
When these are noticed, I encourage you to contribute to TMDb and translate the title yourself, if possible.
NOTE: I entered a majority of these translations without speaking these languages (duh), so if you see that the Maker is rejecting non-generic titles, or is missing a translation for a given language code, submit an issue.
When summary creation is enabled, the Maker will attempt to download logos from TMDb if they don't already exist. Logos are selected in the following manner:
- Filter out all images whose TMDb-identified languages are not English, or a transparent filetype (
.png
or.svg
) - Select the first
.svg
image if one exists - If no
.svg
image exist, select the image with the largest pixel count - If multiple images have the same pixel count, select the first image in this list (as returned by TMDb)
NOTE:
.svg
images require ImageMagick conversion to.png
tmdb:
api_key: abcdef0123456789
retry_count: 5
mimimum_resolution: 800x400
Name | YAML Attribute | Allowed Values | Default Value | Required |
---|---|---|---|---|
API Key | api_key |
A valid TMDb API Key | - | ✔️ |
Retry Count | retry_count |
A number | 3 |
❌ |
Minimum Resolution | minimum_resolution |
A resolution, specified as WIDTHxHEIGHT
|
0x0 |
❌ |
TMDb requires an API key to validate all API queries. Follow the procedure below to obtain your own unique key.
See the TMDb documentation here.
How many times a request can fail before permanently being 'blacklisted' and immediately skipped. For a variety of reasons, the Maker can fail to successfully find a given resource. This is most commonly one of the following:
- The requested episode not existing in TMDb
- The requested episode might exist in TMDb, but cannot be matched/found
- All source images for a given episode aren't of the minimum resolution
- There are no source images for a given episode
In order to limit unnecessary API queries to TMDb caused by repeatedly asking for a resource that does not exist, a specific episode is "blacklisted" after this specified number of operations. All failed operations are temporarily blacklisted for 24 hours before being tried again; however, if the same operation has failed retry_count
many times, it is permanently skipped.
If some query is blacklisted that shouldn't be, you have a few options:
- Increase the global retry count value
- Delete the blacklist file manually (under
modules/.objects/db_blacklist.pkl
) - Use the fixer to delete the blacklist
NOTE: Despite offering a reliable and useful service, TMDb is free to all users (even through the API). As such, please be mindful in not abusing this service, and of course contribute to TMDb if possible.
Although TMDb has resolution and aspect-ratio restrictions on images users can contribute, the Maker permits enforcing specific resolution restrictions on images that are downloaded from TMDb if you choose to ignore 'low quality' images outright. This value should be specified as WIDTHxHEIGHT
.
Depending on your screen size, there is marginal benefit to using images with a resolution larger than
1920x1080
.
Beyond filtering out images below the specified minimum resolution, the Maker does implement some logic when choosing which image to download for a given entry (if there is more than one option). Source images are selected in the following manner:
- Filter out all images with widths less than the minimum width, or heights less than the minimum height
- Select the image(s) with the largest pixel count
- If multiple images have the same pixel count, select the image(s) with the highest user rating score
- If multiple images have the same pixel count and user rating, select the first image in this list (as returned by TMDb)