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':
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))
else:
didl.addItem(self[ObjectID])


+ 3
- 0
DIDLLite.py View File

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

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

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

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


Loading…
Cancel
Save