INNER CODE UNIT · Python
_process_album
Casvt/Plex-scripts · library_management/first_photo_album_cover.py:42
def _process_album(
ssn: 'Session',
album_key: str
) -> None:
"""Find and set cover for album.
Args:
ssn (Session): The plex requests session to fetch with.
album_key (str): The ratingKey of the album.
"""
album_image = ''
album_output: List[dict] = ssn.get(
f'{base_url}{album_key}'
).json()['MediaContainer']['Metadata']
# If there are sub-albums, do them first
# but also note first picture in album