From 7a52990bca7d43f9da44590b44521714419d4655 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 9 Jul 2006 01:51:15 -0800 Subject: [PATCH] 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] --- ContentDirectory.py | 6 +++++- DIDLLite.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ContentDirectory.py b/ContentDirectory.py index 54e687f..621ab88 100644 --- a/ContentDirectory.py +++ b/ContentDirectory.py @@ -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]) diff --git a/DIDLLite.py b/DIDLLite.py index f9994dd..6907f34 100644 --- a/DIDLLite.py +++ b/DIDLLite.py @@ -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)