mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-26 08:09:19 +02:00
Display artist in albums (optional, default disabled)
This commit is contained in:
parent
5a61354112
commit
d5e8342da6
|
@ -1,5 +1,6 @@
|
||||||
from src.fw_api import get_artists, get_tracks, get_albums, concatinate_endpoint
|
|
||||||
import src.fw_artists
|
import src.fw_artists
|
||||||
|
from src.fw_api import get_artists, get_tracks, get_albums, concatinate_endpoint
|
||||||
|
from src.settings import get_config
|
||||||
from src.mpv_control import player, player_menu
|
from src.mpv_control import player, player_menu
|
||||||
from pyfzf.pyfzf import FzfPrompt
|
from pyfzf.pyfzf import FzfPrompt
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
@ -8,6 +9,7 @@ fzf = FzfPrompt()
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def list_albums(albums=None, pg=None, search=None, artist=None, include_channels=None, refresh=False):
|
def list_albums(albums=None, pg=None, search=None, artist=None, include_channels=None, refresh=False):
|
||||||
|
show_artist_name_in_albums = get_config('show_artist_name_in_albums')
|
||||||
albums_next = None
|
albums_next = None
|
||||||
albums_prev = None
|
albums_prev = None
|
||||||
play_artist_albums = False
|
play_artist_albums = False
|
||||||
|
@ -32,7 +34,11 @@ def list_albums(albums=None, pg=None, search=None, artist=None, include_channels
|
||||||
for i in albums_results:
|
for i in albums_results:
|
||||||
index = albums_results.index(i)
|
index = albums_results.index(i)
|
||||||
album_name = i.get('title')
|
album_name = i.get('title')
|
||||||
view.append(f'{index}.{album_name}')
|
artist_name = i.get('artist').get('name')
|
||||||
|
option_str = f'{index}.{album_name}'
|
||||||
|
if show_artist_name_in_albums:
|
||||||
|
option_str += f' | Artist: {artist_name}'
|
||||||
|
view.append(f'{option_str}')
|
||||||
select = fzf.prompt(view)[0].split('.', 1)[0]
|
select = fzf.prompt(view)[0].split('.', 1)[0]
|
||||||
if select == 'Next page':
|
if select == 'Next page':
|
||||||
list_albums(pg=albums_next)
|
list_albums(pg=albums_next)
|
||||||
|
|
|
@ -39,7 +39,8 @@ default_conf = {
|
||||||
"shitnoise.monster"
|
"shitnoise.monster"
|
||||||
],
|
],
|
||||||
'prefetch_playlist': True,
|
'prefetch_playlist': True,
|
||||||
'show_like_button': True
|
'show_like_button': True,
|
||||||
|
'show_artist_name_in_albums': False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue