本文整理汇总了Python中library.MediaDB.create_playlist方法的典型用法代码示例。如果您正苦于以下问题:Python MediaDB.create_playlist方法的具体用法?Python MediaDB.create_playlist怎么用?Python MediaDB.create_playlist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类library.MediaDB
的用法示例。
在下文中一共展示了MediaDB.create_playlist方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_to_library
# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import create_playlist [as 别名]
def save_to_library(self):
if self.search_flag:
self.reset_search_entry()
MediaDB.full_erase_playlists()
for item in self.category_list.get_items():
if item.udi is not None:
continue
songs = item.get_songs()
name = item.get_title()
MediaDB.create_playlist("local", name, songs)
示例2: leading_in_list
# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import create_playlist [as 别名]
def leading_in_list(self):
uri = WindowLoadPlaylist().run()
try:
p_name = utils.get_filename(uri)
pl = MediaDB.create_playlist("local", p_name, [])
new_item = ListTreeItem(pl)
self.category_list.add_items([new_item])
new_item.song_view.async_add_uris(uri)
except:
pass
示例3: __on_db_loaded
# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import create_playlist [as 别名]
def __on_db_loaded(self, db):
if not MediaDB.get_playlists():
MediaDB.create_playlist("local", _("Default List"))
# From MediaDB loaded playlists.
init_items = [ListTreeItem(pl) for pl in MediaDB.get_playlists()]
self.category_list.add_items(init_items)
# Init Category_list.
self.category_list.set_highlight_item(self.get_categroy_item_by_index(self.get_save_item_index()))
self.current_item = self.category_list.get_highlight_item()
self.delete_source_id = self.current_item.song_view.connect("delete-select-items", self.parser_delete_items)
self.drag_source_id = self.current_item.song_view.connect("drag-data-received", self.parser_drag_event)
self.menu_source_id = self.current_item.song_view.connect("right-press-items", self.popup_detail_menu)
Player.set_source(self.current_item.song_view)
self.right_box.add(self.current_item.get_list_widget())
self.list_paned.show_all()
示例4: import_list_from_uri
# 需要导入模块: from library import MediaDB [as 别名]
# 或者: from library.MediaDB import create_playlist [as 别名]
def import_list_from_uri(self, uri):
p_name = utils.get_filename(uri)
pl = MediaDB.create_playlist("local", p_name, [])
new_item = ListTreeItem(pl)
self.category_list.add_items([new_item])
new_item.song_view.async_add_uris(uri)