mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2025-07-10 19:54:14 +00:00
Libraries filter now avalaible in artists, albums, tracks
This commit is contained in:
parent
8fa1773807
commit
dae0516052
6 changed files with 81 additions and 17 deletions
|
@ -1,5 +1,6 @@
|
|||
from src.fw_api import get_artists, get_tracks, get_audio_file
|
||||
from src.fw_albums import list_albums
|
||||
from src.fw_libraries import libraries
|
||||
from src.mpv_control import player, player_menu, track_url_to_uuid
|
||||
from pyfzf.pyfzf import FzfPrompt
|
||||
from loguru import logger
|
||||
|
@ -8,12 +9,12 @@ fzf = FzfPrompt()
|
|||
|
||||
|
||||
@logger.catch
|
||||
def list_artists(pg=None, search=None):
|
||||
artists = get_artists(q=search, pg=pg)
|
||||
def list_artists(pg=None, search=None, library=None):
|
||||
artists = get_artists(q=search, library=library, pg=pg)
|
||||
artists_next = artists.get('next')
|
||||
artists_prev = artists.get('previous')
|
||||
artists_results = artists.get('results')
|
||||
view = ['Search']
|
||||
view = ['Search', 'Library']
|
||||
if artists_next:
|
||||
view.append('Next page')
|
||||
if artists_prev:
|
||||
|
@ -31,6 +32,9 @@ def list_artists(pg=None, search=None):
|
|||
elif select == 'Search':
|
||||
print('Search by artist:')
|
||||
list_artists(search=input())
|
||||
elif select == 'Library':
|
||||
select_lib = libraries()
|
||||
list_artists(library=select_lib)
|
||||
else:
|
||||
albums = artists_results[int(select)].get('albums')
|
||||
if albums:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue