當前位置: 首頁>>代碼示例>>Python>>正文


Python FModel.aritst方法代碼示例

本文整理匯總了Python中foobnix.gui.model.FModel.aritst方法的典型用法代碼示例。如果您正苦於以下問題:Python FModel.aritst方法的具體用法?Python FModel.aritst怎麽用?Python FModel.aritst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在foobnix.gui.model.FModel的用法示例。


在下文中一共展示了FModel.aritst方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: find_tracks_by_url

# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import aritst [as 別名]
    def find_tracks_by_url(self, url):
        logging.debug("Search By URL")

        index = url.rfind("#")
        if index > 0:
            url = url[:index]
        index = url.find("id=")
        if index < 0:
            return None

        id = url[index + 3:]
        id = int(id)
        if id > 0:
            results = self.get_result('audio.get', "uid=" + str(id))
        else:
            results = self.get_result('audio.get', "gid=" + str(abs(id)))

        childs = []
        for line in results:
            bean = FModel(line['artist'] + ' - ' + line['title'])
            bean.aritst = line['artist']
            bean.title = line['title']
            bean.time = convert_seconds_to_text(line['duration'])
            bean.path = line['url'].replace("https://", "http://")
            bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
            childs.append(bean)

        return childs
開發者ID:Cgruppo,項目名稱:foobnix,代碼行數:30,代碼來源:vk_service.py

示例2: find_track_by_id

# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import aritst [as 別名]
 def find_track_by_id(self, id):
     result = self.get_result("audio.get", "audios=" + str(id))
     if not result:
         return None
     line = result[0]
     bean = FModel(line['artist'] + ' - ' + line['title'])
     bean.aritst = line['artist']
     bean.title = line['title']
     bean.time = convert_seconds_to_text(line['duration'])
     bean.path = line['url']
     bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
     return bean
開發者ID:Andresteve07,項目名稱:foobnix,代碼行數:14,代碼來源:vk_service.py

示例3: find_track_by_id

# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import aritst [as 別名]
 def find_track_by_id(self, id):
     if id is not None:
         parts = id.split("_")
         result = self.get_result("audio.get", "owner_id=%s&audio_ids=%s" % (str(parts[0]), str(parts[1])))
         line = result[1]
     else:
         result = self.get_result("audio.get", "audios=" + str(id))
         line = result[0]
     if not result:
         return None
     bean = FModel(line['artist'] + ' - ' + line['title'])
     bean.aritst = line['artist']
     bean.title = line['title']
     bean.time = convert_seconds_to_text(line['duration'])
     bean.path = line['url'].replace("https://", "http://")
     bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
     return bean
開發者ID:Cgruppo,項目名稱:foobnix,代碼行數:19,代碼來源:vk_service.py

示例4: get_user_tracks_as_beans

# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import aritst [as 別名]
 def get_user_tracks_as_beans(self, user_id):
     beans = []
     result = self.controls.vk_service.get_result('audio.get', "uid=" + user_id)
     if not result:
         beans = [FDModel(_("No results found")).add_is_file(True)]
     else:
         for line in result:
             bean = FModel(line['artist'] + ' - ' + line['title'])
             bean.aritst = line['artist']
             bean.title = line['title']
             bean.time = convert_seconds_to_text(line['duration'])
             bean.path = line['url']
             bean.aid = line['aid']
             bean.oid = line['owner_id']
             bean.is_file = True
             bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
             beans.append(bean)
     return beans
開發者ID:foobnix,項目名稱:foobnix,代碼行數:20,代碼來源:vk_integration_tree.py

示例5: find_tracks_by_query

# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import aritst [as 別名]
    def find_tracks_by_query(self, query):
        logging.info("start search songs " + query)
        query = urllib.quote(query.encode("utf-8"))

        list = self.get_result("audio.search", "q=" + query)
        childs = []

        if not list:
            return childs

        for line in list[1:]:
            bean = FModel(line['artist'] + ' - ' + line['title'])
            bean.aritst = line['artist']
            bean.title = line['title']
            bean.time = convert_seconds_to_text(line['duration'])
            bean.path = line['url'].replace("https://", "http://")
            bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
            childs.append(bean)

        return childs
開發者ID:Cgruppo,項目名稱:foobnix,代碼行數:22,代碼來源:vk_service.py


注:本文中的foobnix.gui.model.FModel.aritst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。