themerr_db_helper

Code.themerr_db_helper.item_exists(database_type, database, id)[source]

Check if an item exists in the ThemerrDB.

Parameters:
database_type : str

The type of database to check for the item.

database : str

The database to check for the item.

id : Union[int, str]

The ID of the item to check for.

Returns:
pybool

True if the item exists in the ThemerrDB, otherwise False.

Examples

>>> item_exists(database_type='games', database='igdb', id=1234)
True
>>> item_exists(database_type='movies', database='themoviedb', id=1234)
False
Code.themerr_db_helper.update_cache()[source]

Update the ThemerrDB cache.

The pages.json file is fetched for all database types, then each all_page_N.json file is fetched to form the complete set of available IDs.

Attempting to update the cache while an update is already in progress will wait until the current update is complete.

Updating the cache less than an hour after the last update is a no-op.