本文整理匯總了Python中Playlist.Playlist.update_filelist方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.update_filelist方法的具體用法?Python Playlist.update_filelist怎麽用?Python Playlist.update_filelist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.update_filelist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run_command
# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import update_filelist [as 別名]
def run_command(self,*args) :
# args[0] is command
if args[0] == "play_pause" :
return self.remote.play_pause()
elif args[0] == "next":
return self.remote.next()
elif args[0] == "previous":
return self.remote.previous()
elif args[0] == "add_playlist":
playlist_name = args[1]
player_id = args[2]
playlist_repo = GetPlaylist()
playlist_repo.add_playlist(playlist_name,player_id)
elif args[0] == "delete_file_pl":
playlist_name = args[1]
file_repo = FileRepo()
file_repo.delete_from_playlist(self.player_ip,playlist_name)
elif args[0] == "add_file_to_pl":
file_name = args[1]
playlist_name = args[2]
file_repo = FileRepo()
file_repo.add(file_name,self.player_ip,playlist_name)
elif args[0] == "get_playlist_songs":
playlist_name = args[1]
player_id = args[2]
pl = Playlist(playlist_name,player_id)
pl.update_filelist(self.player_ip)
file_list = pl.get_filelist()
return_list = []
for song in file_list:
return_list.append(song.get_file_name())
return return_list
elif args[0] == "remove":
file_management = FileManagment()
file_name = args[1]
file_management.remove(file_name,self.player_ip)
file_repo = FileRepo()
file_repo.delete_file(file_name,self.player_ip)
else:
#Play Song
file_queue = []
check = 1
file_list = args[2]
file_name = args[1]
for file_ in file_list:
if check and file_.get_file_name() != file_name:
pass
else:
check = 0
file_queue.append(file_.get_file_name())
return self.remote.play_song(file_queue)