webui: handle playback_pos response with empty contents #13
No reviewers
Labels
No Label
bug
dependencies
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
art
big
blocked
bug
ci-cd
crash report
disputed
documentation
duplicate
feature request
good first issue
packaging
question
security
techdebt spring cleaning
testing
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Projects/grzegorz-clients#13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "handle-empty-playback-pos-response"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Compatibility with changes made in
93366593c7
. Should have no real effect on the original grzegorz API.@ -295,3 +295,3 @@
playback_pos = None
if playback_pos:
if playback_pos and playback_pos["current"] and playback_pos["total"]:
ellers får du KeyError
glemte å godkjenne pending comments...
5d1538b370
to771275cf84
@ -298,0 +298,4 @@
playback_pos,
isinstance(playback_pos, dict),
playback_pos["current"],
playback_pos["total"],
jeg antar at
Option
betyr keyen er optional, og ikke at verdien er nullable?hvis både nullable og optional er kansje dette det du trenger
Option
betyr bare nullable. Det er som en haskellMaybe
. Serialisert til json medNone
s, så eksisterer feltene med verdinull
.👍
denne koden kommer til å brekke hvis
playback_pos = None
, fordiplayback_pos["current"]
blir eagerly evaluated av kallet tilall
, som vil kaste en typefeil. Det er bedre på bruke en rekke avand
i disse tilfellene fordi de blir short-circuited ved førsteFalse
771275cf84
to132cabf434
sjukt. lazy python when