Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
style: happy flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
zdimension committed Nov 8, 2023
1 parent 9fda489 commit b191b45
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions Contents/Code/plex_api_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def update_plex_item(rating_key):
Log.Exception('{}: Error processing youtube url: {}'.format(item.ratingKey, e))
else:
if theme_url:
add_media(item=item, media_type='themes', media_url_id=yt_video_url, media_url=theme_url)

add_media(item=item, media_type='themes',
media_url_id=yt_video_url, media_url=theme_url)


def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
Expand Down Expand Up @@ -242,7 +242,6 @@ def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
"""
uploaded = False


themerr_data = general_helper.get_themerr_json_data(item=item)

if media_file or media_url:
Expand All @@ -254,18 +253,6 @@ def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
media_type_dict[media_type]['name'], item.type, item.title, item.ratingKey
))

try:
if themerr_data['settings_hash'] == settings_hash \
and themerr_data[media_type_dict[media_type]['themerr_data_key']] == media_url_id:
Log.Info('Skipping {} for type: {}, title: {}, rating_key: {}'.format(
media_type_dict[media_type]['name'], item.type, item.title, item.ratingKey
))

# false because we aren't doing anything, and the listener will not see this item again
return False
except KeyError:
pass

# remove existing theme uploads
if Prefs[media_type_dict[media_type]['remove_pref']]:
general_helper.remove_uploaded_media(item=item, media_type=media_type)
Expand Down

0 comments on commit b191b45

Please sign in to comment.