Browse Source

add new attribute updateID which is the system update id.. currently

maps to object 0's id, but we need to fix that...

when an object doesn't have an updateID, use the system's ID... this
means music presets work w/ the DSM-520 now...

[git-p4: depot-paths = "//depot/": change = 863]
v0.3
John-Mark Gurney 19 years ago
parent
commit
cffd2f474b
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      ContentDirectory.py

+ 9
- 6
ContentDirectory.py View File

@@ -83,6 +83,7 @@ def doRecallgen(defer, fun, *args, **kwargs):
class ContentDirectoryControl(UPnPPublisher, dict):
"""This class implements the CDS actions over SOAP."""

updateID = property(lambda x: x['0'].updateID)
urlbase = property(lambda x: x._urlbase)

def getnextID(self):
@@ -172,7 +173,7 @@ class ContentDirectoryControl(UPnPPublisher, dict):
"""Required: Return the current value of state variable SystemUpdateID."""

log.msg('GetSystemUpdateID()')
return { 'SystemUpdateIdResponse': { 'Id': self['0'].updateID }}
return { 'SystemUpdateIdResponse': { 'Id': self.updateID }}

BrowseFlags = ('BrowseMetaData', 'BrowseDirectChildren')

@@ -224,12 +225,14 @@ class ContentDirectoryControl(UPnPPublisher, dict):
didl.addItem(self[ObjectID])
total = 1

result = {'BrowseResponse': {'Result': didl.toString() ,
'NumberReturned': didl.numItems(),
'TotalMatches': total,
'UpdateID': self[ObjectID].updateID }}
r = { 'Result': didl.toString(), 'TotalMatches': total,
'NumberReturned': didl.numItems(), }
result = { 'BrowseResponse': r }

#log.msg('Returning: %s' % result)
if hasattr(self[ObjectID], 'updateID'):
r['UpdateID'] = self[ObjectID].updateID
else:
r['UpdateID'] = self.updateID

return result



Loading…
Cancel
Save