Skip to content

Commit

Permalink
Studio/library scan script: make sure scan count is an integer. Re #155.
Browse files Browse the repository at this point in the history
Mypy: in library scan monitor script, make sure scan count is an integer, and return early if None otherwise.
  • Loading branch information
josephsl committed Jan 27, 2021
1 parent df599b6 commit 9134500
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/appModules/splstudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,12 @@ def script_sayTrackPitch(self, gesture):

def script_libraryScanMonitor(self, gesture):
if not self.libraryScanning:
if splbase.studioAPI(1, 32) < 0:
# #155 (21.03): if library scan count is None, then final scan count would also be None.
libScanCount = splbase.studioAPI(1, 32)
# Do nothing if library scan count is indeed None.
if libScanCount is None:
return
if libScanCount < 0:
ui.message(_("{itemCount} items in the library").format(itemCount=splbase.studioAPI(0, 32)))
return
self.libraryScanning = True
Expand Down

0 comments on commit 9134500

Please sign in to comment.