diff --git a/changelog.txt b/changelog.txt index 84838f0..07cf031 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ - show hint after using force full synchronization - support actor thumbnails - add advanced option to change the URL of a media provider +- pass the retrieved items in chunks back to Kodi [B]Version 0.0.8[/B] - properly handle empty movie collections (fixes #25) diff --git a/lib/importer.py b/lib/importer.py index 7e7e4a0..b018a72 100644 --- a/lib/importer.py +++ b/lib/importer.py @@ -994,6 +994,7 @@ def execImport(handle: int, options: dict): log(f"importing {mediaType} items from {mediaProvider2str(mediaProvider)}", xbmc.LOGINFO) # handle library sections + itemsTotal = 0 itemsToImport = [] sectionsProgressTotal = len(librarySections) for sectionsProgress, librarySection in enumerate(librarySections): @@ -1092,9 +1093,12 @@ def execImport(handle: int, options: dict): xbmc.LOGWARNING) continue - if itemsToImport: - log(f"{len(itemsToImport)} {mediaType} items imported from {mediaProvider2str(mediaProvider)}", xbmc.LOGINFO) - xbmcmediaimport.addImportItems(handle, itemsToImport, mediaType) + itemsTotal += len(itemsToImport) + xbmcmediaimport.addImportItems(handle, itemsToImport, mediaType) + itemsToImport.clear() + + if itemsTotal: + log(f"{itemsTotal} {mediaType} items imported from {mediaProvider2str(mediaProvider)}", xbmc.LOGINFO) xbmcmediaimport.finishImport(handle, fastSync)