Skip to content

Commit

Permalink
Metadata streaming: metadata list can include None. Re #155.
Browse files Browse the repository at this point in the history
Mypy: not ideal, but some metadata stream list items can be None, possibly because Studio dies in the middle of retrieving metadata streaming values. Therefore metadata list function will return a list of None and integers.
  • Loading branch information
josephsl committed Jan 26, 2021
1 parent 92b8f18 commit 710232c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/appModules/splstudio/splmisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def cartExplorerRefresh(studioTitle: str, currentCarts: dict[str, Any]) -> dict[
# Gather streaming flags into a list.
# 18.04: raise runtime error if list is nothing
# (thankfully the splbase's StudioAPI will return None if Studio handle is not found).
def metadataList() -> list[int]:
def metadataList() -> list[Optional[int]]:
metadata = [splbase.studioAPI(pos, 36) for pos in range(5)]
if metadata == [None, None, None, None, None]:
raise RuntimeError("Studio handle not found, no metadata list to return")
Expand Down

0 comments on commit 710232c

Please sign in to comment.