[1] update details of synced playlists

pull/943/head
meisnate12 3 years ago
parent 6524b7b274
commit d7c99be137

@ -1 +1 @@
1.17.1 1.17.1-develop1

@ -183,6 +183,7 @@ class CollectionBuilder:
self.library = library self.library = library
self.libraries = [] self.libraries = []
self.playlist = library is None self.playlist = library is None
self.playlist_summary = None
self.overlay = overlay self.overlay = overlay
methods = {m.lower(): m for m in self.data} methods = {m.lower(): m for m in self.data}
if self.playlist: if self.playlist:
@ -2436,15 +2437,17 @@ class CollectionBuilder:
else: summary = None else: summary = None
if self.playlist: if self.playlist:
if summary and str(summary[1]) != str(self.obj.summary): if summary:
try: self.playlist_summary = summary
self.obj.edit(summary=str(summary[1])) if str(summary[1]) != str(self.obj.summary):
logger.info(f"Summary ({summary[0]}) | {summary[1]:<25}") try:
logger.info("Details: have been updated") self.obj.edit(summary=str(summary[1]))
updated_details.append("Metadata") logger.info(f"Summary ({summary[0]}) | {summary[1]:<25}")
except NotFound: logger.info("Details: have been updated")
logger.error("Details: Failed to Update Please delete the collection and run again") updated_details.append("Metadata")
logger.info("") except NotFound:
logger.error("Details: Failed to Update Please delete the collection and run again")
logger.info("")
else: else:
self.obj.batchEdits() self.obj.batchEdits()
@ -2634,7 +2637,14 @@ class CollectionBuilder:
self.library.delete_user_playlist(self.obj.title, user) self.library.delete_user_playlist(self.obj.title, user)
except NotFound: except NotFound:
pass pass
self.obj.copyToUser(user) new_playlist = self.obj.copyToUser(user)
if self.collection_poster:
self.library._upload_image(new_playlist, self.collection_poster)
if self.collection_background:
self.library._upload_image(new_playlist, self.collection_background)
if self.playlist_summary:
new_playlist.edit(summary=self.playlist_summary)
logger.info(f"Playlist: {self.name} synced to {user}") logger.info(f"Playlist: {self.name} synced to {user}")
def send_notifications(self, playlist=False): def send_notifications(self, playlist=False):

Loading…
Cancel
Save