def _create_search_playlist( name, search_string, exaile ): '''Create a playlist based on a search string''' tracks = [ x.track for x in search.search_tracks_from_string( exaile.collection, search_string ) ] # create the playlist pl = playlist.Playlist( name, tracks ) main.get_playlist_notebook().create_tab_from_playlist( pl )
def _create_search_playlist(name, search_string, exaile): '''Create a playlist based on a search string''' tracks = [x.track for x in search.search_tracks_from_string(exaile.collection, search_string)] # create the playlist pl = playlist.Playlist(name, tracks) main.get_playlist_notebook().create_tab_from_playlist(pl)
def on_gui_loaded(self): save_on_exit = settings.get_option( 'plugin/history/save_on_exit', history_preferences.save_on_exit_default) shown = settings.get_option('plugin/history/shown', False) # immutable playlist that stores everything we've played self.history_loc = os.path.join(xdg.get_data_dir(), 'history') self.history_playlist = HistoryPlaylist(player.PLAYER) if save_on_exit: self.history_playlist.load_from_location(self.history_loc) self.history_page = HistoryPlaylistPage(self.history_playlist, player.PLAYER) self.history_tab = NotebookTab(main.get_playlist_notebook(), self.history_page) # add menu item to 'view' to display our playlist self.menu = menu.check_menu_item( 'history', '', _('Playback history'), lambda *e: self.is_shown(), self.on_playback_history, ) providers.register('menubar-view-menu', self.menu) # add the history playlist to the primary notebook if save_on_exit and shown: self.show_history(True)
def on_gui_loaded(self): save_on_exit = settings.get_option( 'plugin/history/save_on_exit', history_preferences.save_on_exit_default ) shown = settings.get_option('plugin/history/shown', False) # immutable playlist that stores everything we've played self.history_loc = os.path.join(xdg.get_data_dir(), 'history') self.history_playlist = HistoryPlaylist(player.PLAYER) if save_on_exit: self.history_playlist.load_from_location(self.history_loc) self.history_page = HistoryPlaylistPage(self.history_playlist, player.PLAYER) self.history_tab = NotebookTab(main.get_playlist_notebook(), self.history_page) # add menu item to 'view' to display our playlist self.menu = menu.check_menu_item( 'history', '', _('Playback history'), lambda *e: self.is_shown(), self.on_playback_history, ) providers.register('menubar-view-menu', self.menu) # add the history playlist to the primary notebook if save_on_exit and shown: self.show_history(True)
def show_history(self, show): if show == self.is_shown(): return if show: pn = main.get_playlist_notebook() pn.add_tab(self.history_tab, self.history_page) else: self.history_tab.close()
def show_history(self, show): if show == self.is_shown(): return if show: pn = main.get_playlist_notebook() pn.add_tab( self.history_tab, self.history_page ) else: self.history_tab.close()
def _open_podcast(self, pl, title): new_pl = playlist.Playlist(title) new_pl.extend(pl) main.get_playlist_notebook().create_tab_from_playlist(new_pl)
def is_shown(self): return main.get_playlist_notebook().page_num(self.history_page) != -1
def is_shown(self): return main.get_playlist_notebook().page_num( self.history_page ) != -1