Skip to content

Commit

Permalink
[131] Properly batch label removal API calls in Plex
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinHeist committed Oct 30, 2024
1 parent e5a2c24 commit 89d5b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions modules/PlexInterface2.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,9 @@ def load_title_cards(self,

# Prepare batch edits on all these episodes
library.batchMultiEdits([ep[0] for ep in matched_episodes])
if self.integrate_with_kometa:
library.removeLabel(['Overlay'])
log.trace('Removed "Overlay" label')

# Upload card for all matched episodes
loaded: list[tuple['Episode', 'Card']] = []
Expand All @@ -901,12 +904,6 @@ def load_title_cards(self,

# Upload card
self.__retry_upload(plex_episode, image.resolve(), log=log)

# If integrating with Kometa, remove label
if (self.integrate_with_kometa and
any(lbl.tag == 'Overlay' for lbl in plex_episode.labels)):
plex_episode.removeLabel(['Overlay'])
log.trace(f'Removed "Overlay" label from {plex_episode}')
log.debug(f'{series_info} {plex_episode.seasonEpisode} loaded '
f'Card {image.name} into "{library_name}"')
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion modules/ref/version_webui
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0-alpha.12.1-webui130
v2.0-alpha.12.1-webui131

0 comments on commit 89d5b5a

Please sign in to comment.