Example #1
0
    def __init__(self, parent_id, id):
        BackendItem.__init__(self)
        # the ids as above
        self.parent_id = parent_id
        self.id = id

        # we never have a different name anyway
        self.name = 'LOLCats'

        # but we need to set it to a certain mimetype to explain it, that we
        # contain 'children'.
        self.mimetype = 'directory'

        # As we are updating our data periodically, we increase this value so
        # that our clients can check easier if something has changed since their
        # last request.
        self.update_id = 0

        # that is where we hold the children
        self.children = []

        # and we need to give a DIDLLite again. This time we want to be
        # understood as 'Container'.
        self.item = DIDLLite.Container(id, parent_id, self.name)

        self.item.childCount = None  # will be set as soon as we have images
Example #2
0
	def __init__(self, parent, id, name):
		# the ids as above
		self.parent = parent
		if self.parent != None:
			self.parent_id = parent.id
		else:
			self.parent_id = None
		self.id = id
		self.name = unicode(name,"utf8","ignore")   # the title of the picture. Inside

		# but we need to set it to a certain mimetype to explain it, that we
		# contain 'children'.
		self.mimetype = 'directory'

		# As we are updating our data periodically, we increase this value so
		# that our clients can check easier if something has changed since their
		# last request.
		self.update_id = 0

		# that is where we hold the children
		self.children = []

		# and we need to give a DIDLLite again. This time we want to be
		# understood as 'Container'.
		self.item = DIDLLite.Container(id, self.parent_id, self.name)

		self.item.childCount = None # will be set as soon as we have images
Example #3
0
 def get_item(self):
     if self.item == None:
         self.item = DIDLLite.Container(self.get_id(),
                                        self.parent.get_id(),
                                        self.name,
                                        restricted=True)
         self._set_item_defaults(searchClass="object.item.videoItem")
     return self.item
Example #4
0
 def get_item(self):
     item = DIDLLite.Container(self.id, self.parent_id, self.name)
     item.childCount = self.get_child_count()
     if self.store and self.play_container == True:
         if item.childCount > 0:
             res = DIDLLite.PlayContainerResource(self.store.server.uuid, cid=self.get_id(), fid=self.get_children()[0].get_id())
             item.res.append(res)
     return item
Example #5
0
    def __init__(self, parent_id, id, title):
        BackendItem.__init__(self)
        self.id = id
        self.parent_id = parent_id
        self.name = title
        self.mimetype = 'directory'
        self.item = DIDLLite.Container(self.id, self.parent_id, self.name)

        self.children = []
    def __init__(self, id, parent_id, name, store=None, \
            children_callback=None):
        self.id = id
        self.parent_id = parent_id
        self.name = name
        self.mimetype = 'directory'
        self.update_id = 0
        self.children = []

        self.item = DIDLLite.Container(id, parent_id, self.name)
        self.item.childCount = None  #self.get_child_count()
Example #7
0
    def __init__(self, id, store, parent_id, title):
        self.url = store.urlbase+str(id)
        self.parent_id = parent_id
        self.id = id
        self.name = title
        self.mimetype = 'directory'
        self.update_id = 0
        self.children = []

        self.item = DIDLLite.Container(self.id, self.parent_id, self.name)
        self.item.childCount = 0

        self.sorted = False
Example #8
0
    def get_item(self):
        item = DIDLLite.Container(self.id, self.parent_id, self.name)

        def got_count(count):
            item.childCount = count
            if self.store and self.play_container == True:
                if item.childCount > 0:
                    dfr = self.get_children(request_count=1)
                    dfr.addCallback(got_child, item)
                    return dfr
            return item

        def got_child(children, item):
            res = DIDLLite.PlayContainerResource(self.store.server.uuid,
                                                 cid=self.get_id(),
                                                 fid=children[0].get_id())
            item.res.append(res)
            return item

        dfr = defer.maybeDeferred(self.get_child_count)
        dfr.addCallback(got_count)
        return dfr
Example #9
0
 def get_item(self):
     if self.item is None:
         self.item = DIDLLite.Container(self.storage_id, self.parent_id,
                                        self.name)
     self.item.childCount = len(self.children)
     return self.item