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') menu.append('Donate')
if src.mpv_control.player.playlist_playing_pos != -1: if src.mpv_control.player.playlist_playing_pos != -1:
menu.insert(0, 'Player') menu.insert(0, 'Player')
selected = fzf.prompt(menu, f"--header={main_menu_header}") ids = fzf.prompt(menu, f"--header={main_menu_header}")
if selected == []:
print('bye-bye :3')
break
else:
selected = selected[0]
selected = ids[0]
if selected == 'Radios': if selected == 'Radios':
list_radios() list_radios()
if selected == 'Artists': if selected == 'Artists':
@ -94,12 +90,7 @@ def main():
'public_list_instances') + public_server_list_instances 'public_list_instances') + public_server_list_instances
settings.set_config('public_list_instances', list_instances) settings.set_config('public_list_instances', list_instances)
instance = fzf.prompt(list_instances, instance = fzf.prompt(list_instances,
'--header='+quote(f'Select instance\nServer instances: +{new_ins_count}')) '--header='+quote(f'Select instance\nServer instances: +{new_ins_count}'))[0]
if instance == []:
continue
else:
instance = instance[0]
current_instance.select_instance(instance) current_instance.select_instance(instance)
if selected == 'Sign in': if selected == 'Sign in':
print(f''' 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') artist_name = artist_name.get('name')
option_str += f' | {artist_name}' option_str += f' | {artist_name}'
view.append(f'{option_str}') view.append(f'{option_str}')
select = fzf.prompt(view, '--header=\'map: album | tracks count | opt. artist\'') select = fzf.prompt(view, '--header=\'map: album | tracks count | opt. artist\'')[0].split('.', 1)[0]
if select == []:
return
else:
select = select[0].split('.', 1)[0]
if select == 'Next page': if select == 'Next page':
list_albums(pg=albums_next) list_albums(pg=albums_next)
elif select == 'Prev page': 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_name = i.get('name')
artist_tracks_count = i.get('tracks_count') artist_tracks_count = i.get('tracks_count')
view.append(f'{index}.{artist_name} | {artist_tracks_count}') view.append(f'{index}.{artist_name} | {artist_tracks_count}')
select = fzf.prompt(view, '--header=\'map: artist | tracks count\'') select = fzf.prompt(view, '--header=\'map: artist | tracks count\'')[0].split('.', 1)[0]
if select == []:
return
else:
select = select[0].split('.', 1)[0]
if select == 'Next page': if select == 'Next page':
list_artists(pg=artists_next) list_artists(pg=artists_next)
elif select == 'Prev page': 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']) play_artist(artists_results[int(select)]['id'])
def play_artist(artist_id): def play_artist(artist_id):
tracks = get_tracks(artist=artist_id, include_channels=True, pg=None) tracks = get_tracks(artist=artist_id, include_channels=True, pg=None)
tracks_next = tracks.get('next') tracks_next = tracks.get('next')

View File

@ -22,12 +22,7 @@ def list_channels(pg=None, search=None):
index = channels_results.index(i) index = channels_results.index(i)
channel_name = i.get('artist').get('name') channel_name = i.get('artist').get('name')
view.append(f'{index}.{channel_name}') view.append(f'{index}.{channel_name}')
select = fzf.prompt(view)[0].split('.', 1) select = fzf.prompt(view)[0].split('.', 1)[0]
if select == []:
return
else:
select = select[0]
if select == 'Next page': if select == 'Next page':
list_channels(pg=channels_next) list_channels(pg=channels_next)
elif select == 'Prev page': 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}') libraries_listing.append(f'{index}.{lib_name} | {lib_by} | {lib_tracks_count}')
lib_select = fzf.prompt( lib_select = fzf.prompt(
libraries_listing, libraries_listing,
f'--header=\'found {libs_count} libraries\nmap: library name | owner | tracks count\'') f'--header=\'found {libs_count} libraries\nmap: library name | owner | tracks count\'')[0].split('.', 1)
if lib_select == []:
return
else:
lib_select = lib_select[0].split('.', 1)
if lib_select[0] == 'Next': if lib_select[0] == 'Next':
return libraries(pg=libs_next) return libraries(pg=libs_next)
elif lib_select[0] == 'Prev': elif lib_select[0] == 'Prev':

View File

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

View File

@ -40,12 +40,7 @@ def list_radios(error_given=None):
header += f'\n{error_given}' header += f'\n{error_given}'
header = quote(header) header = quote(header)
selected = fzf.prompt( selected = fzf.prompt(
view, f'--header {header} --read0', delimiter="\0") view, f'--header {header} --read0', delimiter="\0")[0].split('.', 1)
if selected == []:
return
else:
selected = selected[0].split('.', 1)
if 'Favourites' in selected: if 'Favourites' in selected:
radio_load(id_radio, 'favorites', name='your favorites tracks') radio_load(id_radio, 'favorites', name='your favorites tracks')
elif 'Tag' in selected: 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') who_user = i['user'].get('username')
view.append(f'{index}.{track_name} | {who_user}') view.append(f'{index}.{track_name} | {who_user}')
select = fzf.prompt(view, f'--multi --header=\'map: track title | who {action}\'') select = fzf.prompt(view, f'--multi --header=\'map: track title | who {action}\'')
if select == []:
return
if 'Next page' in select: if 'Next page' in select:
list_fav_or_history(pg=tracks_next, is_history_view=is_history_view) list_fav_or_history(pg=tracks_next, is_history_view=is_history_view)
elif 'Prev page' in select: 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) index = tracks_results.index(i)
track_name = i.get('title') track_name = i.get('title')
view.append(f'{index}.{track_name}') view.append(f'{index}.{track_name}')
select = fzf.prompt(view) select = fzf.prompt(view)[0].split('.', 1)[0]
if select == []:
return
else:
select = select[0].split('.', 1)[0]
if select == 'Next page': if select == 'Next page':
list_tracks(pg=tracks_next) list_tracks(pg=tracks_next)
elif select == 'Prev page': elif select == 'Prev page':

View File

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