mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-23 15:01:26 +00:00
Compare commits
No commits in common. "eac531c3737bd4e71ef0f90ba15348bfd64b151d" and "5a6135411298668359e5cd8c96475359d439add4" have entirely different histories.
eac531c373
...
5a61354112
|
@ -6,7 +6,6 @@ from src.fw_tracks import list_tracks
|
||||||
from src.fw_channels import list_channels
|
from src.fw_channels import list_channels
|
||||||
from src.fw_playlists import list_playlists
|
from src.fw_playlists import list_playlists
|
||||||
import src.settings as settings
|
import src.settings as settings
|
||||||
import src.mpv_control
|
|
||||||
import json, sys
|
import json, sys
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from pyfzf.pyfzf import FzfPrompt
|
from pyfzf.pyfzf import FzfPrompt
|
||||||
|
@ -25,8 +24,6 @@ def main():
|
||||||
'Switch instance']
|
'Switch instance']
|
||||||
if not s.headers.get('Authorization'):
|
if not s.headers.get('Authorization'):
|
||||||
menu.append('Sign in')
|
menu.append('Sign in')
|
||||||
if not src.mpv_control.player.core_idle:
|
|
||||||
menu.insert(0, 'Player')
|
|
||||||
ids = fzf.prompt(menu)
|
ids = fzf.prompt(menu)
|
||||||
|
|
||||||
selected = ids[0]
|
selected = ids[0]
|
||||||
|
@ -74,8 +71,6 @@ Insert token from "Access token" here''')
|
||||||
del f
|
del f
|
||||||
|
|
||||||
select_instance(instance)
|
select_instance(instance)
|
||||||
if selected == 'Player':
|
|
||||||
src.mpv_control.player_menu(storage=src.mpv_control.player_fw_storage.storage)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import src.fw_artists
|
|
||||||
from src.fw_api import get_artists, get_tracks, get_albums, concatinate_endpoint
|
from src.fw_api import get_artists, get_tracks, get_albums, concatinate_endpoint
|
||||||
from src.settings import get_config
|
import src.fw_artists
|
||||||
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
|
||||||
|
@ -9,7 +8,6 @@ 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
|
||||||
|
@ -34,11 +32,7 @@ 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')
|
||||||
artist_name = i.get('artist').get('name')
|
view.append(f'{index}.{album_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)
|
||||||
|
|
|
@ -12,18 +12,12 @@ player.ytdl = False # Prevent attempts load track with yt-dlp
|
||||||
player.prefetch_playlist = get_config('prefetch_playlist') # Fast loading next track, but high network traffic
|
player.prefetch_playlist = get_config('prefetch_playlist') # Fast loading next track, but high network traffic
|
||||||
show_like_button = get_config('show_like_button')
|
show_like_button = get_config('show_like_button')
|
||||||
|
|
||||||
|
|
||||||
class player_fw_storage:
|
|
||||||
storage = {}
|
|
||||||
|
|
||||||
|
|
||||||
def set_http_header(headers=[]):
|
def set_http_header(headers=[]):
|
||||||
player.http_header_fields = headers
|
player.http_header_fields = headers
|
||||||
|
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def player_menu(header='', storage={}):
|
def player_menu(header=None, storage={}):
|
||||||
player_fw_storage.storage = storage
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
player_items_menu = ['Next', 'Prev', 'Pause',
|
player_items_menu = ['Next', 'Prev', 'Pause',
|
||||||
|
|
|
@ -39,8 +39,7 @@ 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 a new issue