Skip to content

Commit

Permalink
~ pass the retrieved items in chunks back to Kodi
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed May 17, 2021
1 parent 5346f34 commit f3cf4f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions lib/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f3cf4f4

Please sign in to comment.