fixed custom sort

pull/351/head
meisnate12 3 years ago
parent 91e525e43d
commit ede0325224

@ -1808,15 +1808,9 @@ class CollectionBuilder:
previous = None previous = None
logger.debug(keys) logger.debug(keys)
logger.debug(self.rating_keys) logger.debug(self.rating_keys)
for ki, key in enumerate(self.rating_keys): for key in self.rating_keys:
logger.debug(items)
if key != items[ki].ratingKey:
logger.info(f"Moving {keys[key].title} {'after {}'.format(keys[previous].title) if previous else 'to the beginning'}") logger.info(f"Moving {keys[key].title} {'after {}'.format(keys[previous].title) if previous else 'to the beginning'}")
self.library.moveItem(self.obj, key, after=previous) self.library.move_item(self.obj, key, after=previous)
for ii, item in enumerate(items):
if key == item.ratingKey:
items.insert(ki, items.pop(ii))
break
previous = key previous = key
def run_collections_again(self): def run_collections_again(self):

@ -491,7 +491,7 @@ class Plex:
else: method = None else: method = None
return self.Plex._server.query(key, method=method) return self.Plex._server.query(key, method=method)
def moveItem(self, collection, item, after=None): def move_item(self, collection, item, after=None):
key = f"{collection.key}/items/{item}/move" key = f"{collection.key}/items/{item}/move"
if after: if after:
key += f"?after={after}" key += f"?after={after}"

Loading…
Cancel
Save