Optimize zero-length array handling
@@ -51,6 +51,9 @@ def plex_items_sorted(self):
https://github.com/Taxel/PlexTraktSync/pull/58
"""
+ if len(self.plex_items) == 0:
+ return []
+
_, items = zip(*sorted(dict(reversed(self.plex_items)).items()))
return items
