Compare commits

..

No commits in common. "27e697b9c1e8097666f47064d8d857dde6ae7705" and "a76f36bafdd95ef7f42c06b8c0ad5bc3eadd3417" have entirely different histories.

10 changed files with 12 additions and 62 deletions

View File

@ -62,13 +62,9 @@ def main():
menu.append('Donate')
if src.mpv_control.player.playlist_playing_pos != -1:
menu.insert(0, 'Player')
selected = fzf.prompt(menu, f"--header={main_menu_header}")
if selected == []:
print('bye-bye :3')
break
else:
selected = selected[0]
ids = fzf.prompt(menu, f"--header={main_menu_header}")
selected = ids[0]
if selected == 'Radios':
list_radios()
if selected == 'Artists':
@ -94,12 +90,7 @@ def main():
'public_list_instances') + public_server_list_instances
settings.set_config('public_list_instances', list_instances)
instance = fzf.prompt(list_instances,
'--header='+quote(f'Select instance\nServer instances: +{new_ins_count}'))
if instance == []:
continue
else:
instance = instance[0]
'--header='+quote(f'Select instance\nServer instances: +{new_ins_count}'))[0]
current_instance.select_instance(instance)
if selected == 'Sign in':
print(f'''

View File

@ -44,12 +44,7 @@ def list_albums(albums=None, pg=None, search=None, artist=None, library=None, in
artist_name = artist_name.get('name')
option_str += f' | {artist_name}'
view.append(f'{option_str}')
select = fzf.prompt(view, '--header=\'map: album | tracks count | opt. artist\'')
if select == []:
return
else:
select = select[0].split('.', 1)[0]
select = fzf.prompt(view, '--header=\'map: album | tracks count | opt. artist\'')[0].split('.', 1)[0]
if select == 'Next page':
list_albums(pg=albums_next)
elif select == 'Prev page':

View File

@ -26,12 +26,7 @@ def list_artists(pg=None, search=None, library=None, scope=None):
artist_name = i.get('name')
artist_tracks_count = i.get('tracks_count')
view.append(f'{index}.{artist_name} | {artist_tracks_count}')
select = fzf.prompt(view, '--header=\'map: artist | tracks count\'')
if select == []:
return
else:
select = select[0].split('.', 1)[0]
select = fzf.prompt(view, '--header=\'map: artist | tracks count\'')[0].split('.', 1)[0]
if select == 'Next page':
list_artists(pg=artists_next)
elif select == 'Prev page':
@ -54,6 +49,7 @@ def list_artists(pg=None, search=None, library=None, scope=None):
play_artist(artists_results[int(select)]['id'])
def play_artist(artist_id):
tracks = get_tracks(artist=artist_id, include_channels=True, pg=None)
tracks_next = tracks.get('next')

View File

@ -22,12 +22,7 @@ def list_channels(pg=None, search=None):
index = channels_results.index(i)
channel_name = i.get('artist').get('name')
view.append(f'{index}.{channel_name}')
select = fzf.prompt(view)[0].split('.', 1)
if select == []:
return
else:
select = select[0]
select = fzf.prompt(view)[0].split('.', 1)[0]
if select == 'Next page':
list_channels(pg=channels_next)
elif select == 'Prev page':

View File

@ -29,12 +29,7 @@ def libraries(pg=None, radio=False):
libraries_listing.append(f'{index}.{lib_name} | {lib_by} | {lib_tracks_count}')
lib_select = fzf.prompt(
libraries_listing,
f'--header=\'found {libs_count} libraries\nmap: library name | owner | tracks count\'')
if lib_select == []:
return
else:
lib_select = lib_select[0].split('.', 1)
f'--header=\'found {libs_count} libraries\nmap: library name | owner | tracks count\'')[0].split('.', 1)
if lib_select[0] == 'Next':
return libraries(pg=libs_next)
elif lib_select[0] == 'Prev':

View File

@ -22,12 +22,7 @@ def list_playlists(pg=None, search=None):
index = playlists_results.index(i)
playlist_name = i.get('name')
view.append(f'{index}.{playlist_name}')
select = fzf.prompt(view)
if select == []:
return
else:
select = select[0].split('.', 1)[0]
select = fzf.prompt(view)[0].split('.', 1)[0]
if select == 'Next page':
list_playlists(pg=playlists_next)
elif select == 'Prev page':

View File

@ -40,12 +40,7 @@ def list_radios(error_given=None):
header += f'\n{error_given}'
header = quote(header)
selected = fzf.prompt(
view, f'--header {header} --read0', delimiter="\0")
if selected == []:
return
else:
selected = selected[0].split('.', 1)
view, f'--header {header} --read0', delimiter="\0")[0].split('.', 1)
if 'Favourites' in selected:
radio_load(id_radio, 'favorites', name='your favorites tracks')
elif 'Tag' in selected:

View File

@ -30,9 +30,6 @@ def list_fav_or_history(pg=None, search=None, scope=None, is_history_view=False)
who_user = i['user'].get('username')
view.append(f'{index}.{track_name} | {who_user}')
select = fzf.prompt(view, f'--multi --header=\'map: track title | who {action}\'')
if select == []:
return
if 'Next page' in select:
list_fav_or_history(pg=tracks_next, is_history_view=is_history_view)
elif 'Prev page' in select:

View File

@ -24,11 +24,7 @@ def list_tracks(pg=None, search=None, tag=None, library=None):
index = tracks_results.index(i)
track_name = i.get('title')
view.append(f'{index}.{track_name}')
select = fzf.prompt(view)
if select == []:
return
else:
select = select[0].split('.', 1)[0]
select = fzf.prompt(view)[0].split('.', 1)[0]
if select == 'Next page':
list_tracks(pg=tracks_next)
elif select == 'Prev page':

View File

@ -138,12 +138,7 @@ def player_menu(header='', storage={}):
player_items_menu.append('Like')
player_items_menu.extend(['Hide artist', 'Exit'])
select = fzf.prompt(player_items_menu, quote(f"--header=\'{header}\'"))
if select == []:
break
else:
select = select[0]
select = fzf.prompt(player_items_menu, quote(f"--header=\'{header}\'"))[0]
if select == 'Next':
try:
player.playlist_next()