|
|
@ -804,13 +804,15 @@ class CollectionBuilder:
|
|
|
|
if self.build_collection:
|
|
|
|
if self.build_collection:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.obj = self.library.get_playlist(self.name) if self.playlist else self.library.get_collection(self.name, force_search=True)
|
|
|
|
self.obj = self.library.get_playlist(self.name) if self.playlist else self.library.get_collection(self.name, force_search=True)
|
|
|
|
|
|
|
|
except Failed:
|
|
|
|
|
|
|
|
self.obj = None
|
|
|
|
|
|
|
|
else:
|
|
|
|
if (self.smart and not self.obj.smart) or (not self.smart and self.obj.smart):
|
|
|
|
if (self.smart and not self.obj.smart) or (not self.smart and self.obj.smart):
|
|
|
|
logger.info("")
|
|
|
|
logger.info("")
|
|
|
|
logger.error(f"{self.Type} Error: Converting {self.obj.title} to a {'smart' if self.smart else 'normal'} collection")
|
|
|
|
logger.error(f"{self.Type} Error: Converting {self.obj.title} to a {'smart' if self.smart else 'normal'} collection")
|
|
|
|
self.library.query(self.obj.delete)
|
|
|
|
self.library.delete(self.obj)
|
|
|
|
self.obj = None
|
|
|
|
self.obj = None
|
|
|
|
except Failed:
|
|
|
|
|
|
|
|
self.obj = None
|
|
|
|
|
|
|
|
if self.smart:
|
|
|
|
if self.smart:
|
|
|
|
check_url = self.smart_url if self.smart_url else self.smart_label_url
|
|
|
|
check_url = self.smart_url if self.smart_url else self.smart_label_url
|
|
|
|
if self.obj and check_url != self.library.smart_filter(self.obj):
|
|
|
|
if self.obj and check_url != self.library.smart_filter(self.obj):
|
|
|
@ -2780,14 +2782,14 @@ class CollectionBuilder:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
output = ""
|
|
|
|
output = ""
|
|
|
|
if self.obj:
|
|
|
|
if self.obj:
|
|
|
|
self.library.query(self.obj.delete)
|
|
|
|
self.library.delete(self.obj)
|
|
|
|
|
|
|
|
|
|
|
|
if self.playlist and self.valid_users:
|
|
|
|
if self.playlist and self.valid_users:
|
|
|
|
for user in self.valid_users:
|
|
|
|
for user in self.valid_users:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.library.delete_user_playlist(self.obj.title, user)
|
|
|
|
self.library.delete_user_playlist(self.obj.title, user)
|
|
|
|
output += f"\nPlaylist deleted on User {user}"
|
|
|
|
output += f"\nPlaylist deleted on User {user}"
|
|
|
|
except NotFound:
|
|
|
|
except Failed:
|
|
|
|
output += f"\nPlaylist not found on User {user}"
|
|
|
|
output += f"\nPlaylist not found on User {user}"
|
|
|
|
return output
|
|
|
|
return output
|
|
|
|
|
|
|
|
|
|
|
@ -2799,7 +2801,7 @@ class CollectionBuilder:
|
|
|
|
for user in self.valid_users:
|
|
|
|
for user in self.valid_users:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.library.delete_user_playlist(self.obj.title, user)
|
|
|
|
self.library.delete_user_playlist(self.obj.title, user)
|
|
|
|
except NotFound:
|
|
|
|
except Failed:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
self.obj.copyToUser(user)
|
|
|
|
self.obj.copyToUser(user)
|
|
|
|
logger.info(f"Playlist: {self.name} synced to {user}")
|
|
|
|
logger.info(f"Playlist: {self.name} synced to {user}")
|
|
|
|