def search_top_albums_task(query): analytics.action("SEARCH_search_top_albums") results = self.lastfm_service.search_top_albums(query) if not results: results = [] self.notetabs.append_tab(query, None) albums_already_inserted = [] for album in results[:15]: all = [] if album.album.lower() in albums_already_inserted: continue album.is_file = False tracks = self.lastfm_service.search_album_tracks( album.artist, album.album) for i, track in enumerate(tracks): track.tracknumber = i + 1 track.album = album.album track.parent(album).add_is_file(True) all.append(track) if len(all) > 0: all = [album] + all albums_already_inserted.append(album.album.lower()) self.notetabs.append_all(all) if not results: all = self.show_google_results(query) self.notetabs.append_all(all)
def search_top_albums_task(query): analytics.action("SEARCH_search_top_albums") results = self.lastfm_service.search_top_albums(query) if not results: results = [] self.notetabs.append_tab(query, None) albums_already_inserted = [] for album in results[:15]: all = [] if album.album.lower() in albums_already_inserted: continue album.is_file = False tracks = self.lastfm_service.search_album_tracks(album.artist, album.album) for i, track in enumerate(tracks): track.tracknumber = i + 1 track.album = album.album track.parent(album).add_is_file(True) all.append(track) if len(all) > 0: all = [album] + all albums_already_inserted.append(album.album.lower()) self.notetabs.append_all(all) if not results: all = self.show_google_results(query) self.notetabs.append_all(all)
def search_top_tracks_task(query): analytics.action("SEARCH_search_top_tracks") results = self.lastfm_service.search_top_tracks(query) if not results: results = [] all = [] parent_bean = FModel(query) all.append(parent_bean) for i, bean in enumerate(results): bean.tracknumber = i + 1 bean.parent(parent_bean).add_is_file(True) all.append(bean) if not results: all = self.show_google_results(query) self.notetabs.append_tab(query, all)
def search_all_tracks_task(): analytics.action("SEARCH_search_all_tracks") results = self.vk_service.find_tracks_by_query(query) if not results: results = [] all = [] p_bean = FModel(query).add_font("bold") all.append(p_bean) for i, bean in enumerate(results): bean.tracknumber = i + 1 bean.parent(p_bean).add_is_file(True) all.append(bean) if not results: all = self.show_google_results(query) self.notetabs.append_tab(query, all)
def activate_perspective(self, perspective_id): if self.is_activated(perspective_id): return perspective = self.get_perspective(perspective_id) assert perspective for _id in self.perspectives.keys(): if self.is_activated(_id): self.get_perspective(_id).emit("deactivated") self.perspectives_container.set_active_by_index(perspective.widget_id) perspective.button.set_active(True) if isinstance(perspective, Filterable): self.filter.show() else: self.filter.hide() perspective.emit("activated") analytics.action("PERSPECTIVE_" + perspective.get_id()) self.check_availability()
def activate_perspective(self, name): for widget in self.perspectivs.values(): widget.hide() FC().left_perspective = name self.perspectivs[name].show() if name in (LEFT_PERSPECTIVE_INFO,LEFT_PERSPECTIVE_LASTFM): self.controls.filter.hide() else: self.controls.filter.show() if name in (LEFT_PERSPECTIVE_RADIO,LEFT_PERSPECTIVE_MY_RADIO): self.switch_radio_button.set_label(self.perspectivs[name] .get_child().switcher_label) self.switch_radio_button.show() else: self.switch_radio_button.hide() analytics.action("PERSPECTIVE_"+name);
def search_top_similar_task(query): analytics.action("SEARCH_search_top_similar") results = self.lastfm_service.search_top_similar_artist(query) if not results: results = [] self.notetabs.append_tab(query, None) for artist in results[:15]: all = [] artist.is_file = False all.append(artist) tracks = self.lastfm_service.search_top_tracks(artist.artist) for i, track in enumerate(tracks): track.tracknumber = i + 1 track.parent(artist).add_is_file(True) all.append(track) self.notetabs.append_all(all) if not results: all = self.show_google_results(query)
def search_top_tags_task(query): analytics.action("SEARCH_search_top_tags") results = self.lastfm_service.search_top_tags(query) if not results: logging.debug("tag result not found") results = [] self.notetabs.append_tab(query, None) for tag in results[:15]: all = [] tag.is_file = False all.append(tag) tracks = self.lastfm_service.search_top_tag_tracks(tag.text) for i, track in enumerate(tracks): track.tracknumber = i + 1 track.parent(tag).add_is_file(True) all.append(track) self.notetabs.append_all(all) if not results: all = self.show_google_results(query) self.notetabs.append_all(all)
def show(self, current=CONFIG_MUSIC_LIBRARY): self.show_all() self.populate_config_category(current) self.on_load() analytics.action("PreferencesWindow")
def show(self): self.show_all() analytics.action("DM")
def on_full_screen(self): self.controls.state_stop(True) self.fullscrean_area.show_window() self.set_output(self.fullscrean_area.get_draw()) self.controls.state_play(under_pointer_icon=True) analytics.action("FullScreanArea")
def show(self): self.eq_view.show_all() analytics.action("EqController")
def show(self): self.eq_view.show_all() analytics.action("EqController");