Merge pull request #1667 from croneter/typeerror
Direct Paths: Fix TypeError: "element indices must be integers" on playback startup [backport]
This commit is contained in:
commit
24c1ada5b1
1 changed files with 10 additions and 2 deletions
|
@ -254,13 +254,21 @@ class Base(object):
|
|||
Returns the media streams directly from the PMS xml.
|
||||
Mind to set self.mediastream and self.part before calling this method!
|
||||
"""
|
||||
try:
|
||||
return self.xml[self.mediastream][self.part]
|
||||
except TypeError:
|
||||
# Direct Paths when we don't set mediastream and part
|
||||
return self.xml[0][0]
|
||||
|
||||
def part_id(self):
|
||||
"""
|
||||
Returns the unique id of the currently active part [int]
|
||||
"""
|
||||
try:
|
||||
return int(self.xml[self.mediastream][self.part].attrib['id'])
|
||||
except TypeError:
|
||||
# Direct Paths when we don't set mediastream and part
|
||||
return int(self.xml[0][0].attrib['id'])
|
||||
|
||||
def plot(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue