Browse Source

fix files... turns out we do need the checkUpdate on items, just not

containers.. so put it back in so that the res element reappears and
things work again...

[git-p4: depot-paths = "//depot/": change = 857]
v0.3
John-Mark Gurney 18 years ago
parent
commit
7a52990bca
2 changed files with 8 additions and 1 deletions
  1. +5
    -1
      ContentDirectory.py
  2. +3
    -0
      DIDLLite.py

+ 5
- 1
ContentDirectory.py View File

@@ -215,7 +215,11 @@ class ContentDirectoryControl(UPnPPublisher, dict):


if BrowseFlag == 'BrowseDirectChildren': if BrowseFlag == 'BrowseDirectChildren':
ch = self.getchildren(ObjectID)[StartingIndex: StartingIndex + RequestedCount] ch = self.getchildren(ObjectID)[StartingIndex: StartingIndex + RequestedCount]
filter(lambda x, d = didl: d.addItem(x) and None, ch)
for i in ch:
log.msg('i:', `i`, i.needupdate)
if i.needupdate:
i.checkUpdate()
didl.addItem(i)
total = len(self.getchildren(ObjectID)) total = len(self.getchildren(ObjectID))
else: else:
didl.addItem(self[ObjectID]) didl.addItem(self[ObjectID])


+ 3
- 0
DIDLLite.py View File

@@ -40,6 +40,7 @@ class Object(object):
res = None res = None
writeStatus = None writeStatus = None
content = property(lambda x: x._content) content = property(lambda x: x._content)
needupdate = None # do we update before sending? (for res)


def __init__(self, cd, id, parentID, title, restricted = False, def __init__(self, cd, id, parentID, title, restricted = False,
creator = None, **kwargs): creator = None, **kwargs):
@@ -103,6 +104,7 @@ class Item(Object):
klass = Object.klass + '.item' klass = Object.klass + '.item'
elementName = 'item' elementName = 'item'
refID = None refID = None
needupdate = True


def doUpdate(self): def doUpdate(self):
# Update parent container # Update parent container
@@ -240,6 +242,7 @@ class Container(Object, list):
searchClass = None searchClass = None
searchable = None searchable = None
updateID = 0 updateID = 0
needupdate = False


def __init__(self, cd, id, parentID, title, restricted = 0, creator = None): def __init__(self, cd, id, parentID, title, restricted = 0, creator = None):
Object.__init__(self, cd, id, parentID, title, restricted, creator) Object.__init__(self, cd, id, parentID, title, restricted, creator)


Loading…
Cancel
Save