helpers¶
-
Code.helpers.
get_game_name
(media, media_filename)[source]¶ Get the game name from the given media object or media_filename.
Parameters: - media : Media.Movie
Media object provided by plex framework.
- media_filename : str
The filename of the media object representing the game.
Returns: - str
The game name.
Examples
>>> get_game_name(media=media, media_filename='007 - GoldenEye (USA).mp4') '007 - GoldenEye'
-
Code.helpers.
get_game_platform
(path)[source]¶ Get the game platform from the given path.
Parameters: - path : str
The path of the media object representing the game.
Returns: - str
The platform of the game.
Examples
>>> get_game_platform(path='.../media/Nintendo 64/007 - GoldenEye (USA).mp4') 'Nintendo 64'
-
Code.helpers.
get_game_version
(media_filename)[source]¶ Get the game version from the given media_filename.
Parameters: - media_filename : str
The filename of the media object representing the game.
Returns: - str
The version of the game.
Examples
>>> get_game_version(media_filename='007 - GoldenEye (USA).mp4') '(USA)'
-
Code.helpers.
get_list_of_substrings
(string_subject, string1, string2)[source]¶ Get list of strings between two strings.
Parameters: - string_subject : str
The string to search.
- string1 : str
Search start string.
- string2 : str
Search end string.
Returns: - List
List of strings.
Examples
>>> get_list_of_substrings(string_subject='{test1}{test2}{test3}', string1='{', string2='}') ['test1', 'test2', 'test3']