general_helper¶
-
Code.general_helper.agent_enabled(item_agent, item_type)[source]¶ Check if the specified agent is enabled.
Parameters: Returns: pyboolTrue if the agent is enabled, False otherwise.
Examples
>>> agent_enabled(item_agent='com.plexapp.agents.imdb', item_type='movie') True >>> agent_enabled(item_agent='com.plexapp.agents.themoviedb', item_type='movie') True >>> agent_enabled(item_agent='com.plexapp.agents.themoviedb', item_type='show') True >>> agent_enabled(item_agent='com.plexapp.agents.thetvdb', item_type='show') True >>> agent_enabled(item_agent='dev.lizardbyte.retroarcher-plex', item_type='movie') True
-
Code.general_helper.continue_update(item_agent, item_type)[source]¶ Check if the specified agent should continue updating.
Parameters: Returns: pyboolTrue if the agent should continue updating, False otherwise.
Examples
>>> continue_update(item_agent='tv.plex.agents.movie', item_type='movie') True >>> continue_update(item_agent='com.plexapp.agents.imdb', item_type='movie') True >>> continue_update(item_agent='com.plexapp.agents.themoviedb', item_type='movie') True >>> continue_update(item_agent='com.plexapp.agents.themoviedb', item_type='show') True >>> continue_update(item_agent='com.plexapp.agents.thetvdb', item_type='show') True >>> continue_update(item_agent='dev.lizardbyte.retroarcher-plex', item_type='movie') True
-
Code.general_helper.get_media_upload_path(item, media_type)[source]¶ Get the path to the theme upload directory.
Get the hashed path of the theme upload directory for the item specified by the
item.Parameters: Returns: strThe path to the theme upload directory.
Raises: ValueErrorIf the
media_typeis not one of ‘art’, ‘posters’, or ‘themes’.
Examples
>>> get_media_upload_path(item=..., media_type='art') "...bundle/Uploads/art..." >>> get_media_upload_path(item=..., media_type='posters') "...bundle/Uploads/posters..." >>> get_media_upload_path(item=..., media_type='themes') "...bundle/Uploads/themes..."
-
Code.general_helper.get_themerr_json_data(item)[source]¶ Get the Themerr data for the specified item.
Themerr data is stored as a JSON file in the Themerr data directory, and is used to ensure that we don’t unnecessarily re-upload media to the Plex server.
Parameters: - item :
any The item to get the Themerr data for.
Returns: dictThe Themerr data for the specified item, or empty dict if no Themerr data exists.
- item :
-
Code.general_helper.get_themerr_json_path(item)[source]¶ Get the path to the Themerr data file.
Get the path to the Themerr data file for the item specified by the
item.Parameters: - item :
any The item to get the Themerr data file path for.
Returns: strThe path to the Themerr data file.
Examples
>>> get_themerr_json_path(item=...) '.../Plex Media Server/Plug-in Support/Data/dev.lizardbyte.themerr-plex/DataItems/...'
- item :
-
Code.general_helper.get_themerr_settings_hash()[source]¶ Get a hash of the current Themerr settings.
Returns: strHash of the current Themerr settings.
Examples
>>> get_themerr_settings_hash() '...'
-
Code.general_helper.remove_uploaded_media(item, media_type)[source]¶ Remove themes for the specified item.
Deletes the themes upload directory for the item specified by the
item.Parameters: Returns: pyboolTrue if the themes were removed successfully, False otherwise.
Examples
>>> remove_uploaded_media(item=..., media_type='themes') ...
-
Code.general_helper.remove_uploaded_media_error_handler(func, path, exc_info)[source]¶ Error handler for removing themes.
Handles errors that occur when removing themes using
shutil.Parameters: