Exemplo n.º 1
0
 def populate(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     result = False
     if options.lvl != -1:
         self.add_child(getNode(Flag.FRIENDS, parameters=self.parameters))
     for playlist in self.data['playlists']['items']:
         node = getNode(Flag.PLAYLIST, data=playlist)
         if node.get_owner() == self.label:
             self.nid = node.get_owner_id()
         self.add_child(node)
         result = True
     return result
Exemplo n.º 2
0
 def populate(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     result = False
     if options.lvl != -1:
         self.add_child(getNode(Flag.FRIENDS, parameters=self.parameters))
     for playlist in self.data['playlists']['items']:
         node = getNode(Flag.PLAYLIST, data=playlist)
         if node.get_owner() == self.label:
             self.nid = node.get_owner_id()
         self.add_child(node)
         result = True
     return result
Exemplo n.º 3
0
 def populate(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     if self.nid is None:
         for item in self.data['labels']['items']:
             self.add_child(getNode(Flag.LABEL, data=item))
     else:
         options.xdir.add_node(self)
         supplier_id = self.get_property('supplier_id', default=None)
         if supplier_id is not None:
             options.xdir.add_node(
                 getNode(Flag.LABEL,
                         parameters={'nid': supplier_id},
                         data={'name': '[Supplier]'}))
     return True
Exemplo n.º 4
0
 def populate(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     if self.nid is None:
         for item in self.data['labels']['items']:
             self.add_child(getNode(Flag.LABEL, data=item))
     else:
         options.xdir.add_node(self)
         supplier_id = self.get_property('supplier_id', default=None)
         if supplier_id is not None:
             options.xdir.add_node(
                 getNode(
                     Flag.LABEL,
                     parameters={'nid': supplier_id},
                     data={'name': '[Supplier]'}))
     return True
Exemplo n.º 5
0
 def _populate_albums(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     for album in self.data['albums']['items']:
         node = helper.get_node_album(album)
         self.add_child(node)
     return populate_return_helper(self.data['albums']['items'])
Exemplo n.º 6
0
 def fetch(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     return api.get('/album/get',
                    album_id=self.nid,
                    noRemote=options.noRemote)
Exemplo n.º 7
0
def populate_node(node, options):
    options = helper.get_tree_traverse_opts(options)
    return node.populating(options)
Exemplo n.º 8
0
 def _populate_albums(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     for album in self.data['albums']['items']:
         node = helper.get_node_album(album)
         self.add_child(node)
     return populate_return_helper(self.data['albums']['items'])
Exemplo n.º 9
0
def populate_node(node, options):
    options = helper.get_tree_traverse_opts(options)
    return node.populating(options)
Exemplo n.º 10
0
 def fetch(self, options=None):
     options = helper.get_tree_traverse_opts(options)
     if (options.blackFlag is not None) and (
             options.blackFlag & Flag.STOPBUILD == Flag.STOPBUILD):
         return None
     return api.get('/track/get', track_id=self.nid)