mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Create central compare
This commit is contained in:
parent
36491c47d8
commit
db0e84f786
1 changed files with 23 additions and 1 deletions
|
@ -134,7 +134,29 @@ class Items(object):
|
|||
if update:
|
||||
self.count += 1
|
||||
|
||||
def compare_checksum(self, items, compare_to):
|
||||
def compare(self, item_type, items, compare_to, view=None):
|
||||
|
||||
view_name = view['name'] if view else item_type
|
||||
|
||||
update_list = self._compare_checksum(items, compare_to)
|
||||
log.info("Update for %s: %s", view_name, update_list)
|
||||
|
||||
emby_items = self.emby.getFullItems(update_list)
|
||||
total = len(update_list)
|
||||
|
||||
if self.pdialog:
|
||||
self.pdialog.update(heading="Processing %s / %s items" % (view_name, total))
|
||||
|
||||
# Process additions and updates
|
||||
if emby_items:
|
||||
self.added(emby_items, total, view)
|
||||
# Process deletes
|
||||
if compare_to:
|
||||
self.remove_all(item_type, compare_to.items())
|
||||
|
||||
return True
|
||||
|
||||
def _compare_checksum(self, items, compare_to):
|
||||
|
||||
update_list = list()
|
||||
|
||||
|
|
Loading…
Reference in a new issue