mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-24 01:39:20 +02:00
Compare commits
No commits in common. "96ce0dfb500f7daabe927b7ffaadf12a4bfc4324" and "35879ac63e6a1cdac1ec7e9de94848b2c978750e" have entirely different histories.
96ce0dfb50
...
35879ac63e
|
@ -70,7 +70,7 @@ def list_albums(albums=None, pg=None, search=None, artist=None, library=None, in
|
||||||
|
|
||||||
|
|
||||||
def play_album(album_id):
|
def play_album(album_id):
|
||||||
tracks = get_tracks(album=album_id, ordering='disc_number,position', include_channels=True)
|
tracks = get_tracks(album=album_id, include_channels=True)
|
||||||
tracks_results = tracks.get('results')
|
tracks_results = tracks.get('results')
|
||||||
storage = {}
|
storage = {}
|
||||||
for i in tracks_results:
|
for i in tracks_results:
|
||||||
|
|
|
@ -100,13 +100,11 @@ def get_audio_file(track_uuid, listen_url=False, download=False,
|
||||||
|
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def get_tracks(page=None, ordering=None, q=None,
|
def get_tracks(page=None, q=None, artist=None, album=None, library=None,
|
||||||
artist=None, album=None, library=None,
|
|
||||||
tag=None, favourites=None, include_channels=None, pg=None):
|
tag=None, favourites=None, include_channels=None, pg=None):
|
||||||
'''This function get tracks by params'''
|
'''This function get tracks by params'''
|
||||||
params = {
|
params = {
|
||||||
'page': page,
|
'page': page,
|
||||||
'ordering': ordering,
|
|
||||||
'q': q,
|
'q': q,
|
||||||
'artist': artist,
|
'artist': artist,
|
||||||
'album': album,
|
'album': album,
|
||||||
|
@ -180,12 +178,10 @@ def get_artists(page=None, q=None, artist=None, album=None,
|
||||||
|
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def get_albums(page=None, q=None, ordering=None,
|
def get_albums(page=None, q=None, artist=None, library=None, include_channels=None, refresh=False, pg=None):
|
||||||
artist=None, library=None, include_channels=None, refresh=False, pg=None):
|
|
||||||
'''This function get artists by params'''
|
'''This function get artists by params'''
|
||||||
params = {
|
params = {
|
||||||
'page': page,
|
'page': page,
|
||||||
'ordering': ordering,
|
|
||||||
'q': q,
|
'q': q,
|
||||||
'artist': artist,
|
'artist': artist,
|
||||||
'library': library,
|
'library': library,
|
||||||
|
|
|
@ -55,8 +55,7 @@ def list_artists(pg=None, search=None, library=None, scope=None):
|
||||||
|
|
||||||
|
|
||||||
def play_artist(artist_id):
|
def play_artist(artist_id):
|
||||||
tracks = get_tracks(artist=artist_id, ordering='disc_number,position',
|
tracks = get_tracks(artist=artist_id, include_channels=True, pg=None)
|
||||||
include_channels=True, pg=None)
|
|
||||||
tracks_next = tracks.get('next')
|
tracks_next = tracks.get('next')
|
||||||
tracks_count = tracks.get('count')
|
tracks_count = tracks.get('count')
|
||||||
storage = {}
|
storage = {}
|
||||||
|
|
|
@ -9,6 +9,7 @@ from loguru import logger
|
||||||
from shlex import quote
|
from shlex import quote
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
fzf = FzfPrompt()
|
fzf = FzfPrompt()
|
||||||
|
|
||||||
|
@ -93,7 +94,8 @@ def radio_generator(radio_session_id):
|
||||||
player.playlist_current_pos
|
player.playlist_current_pos
|
||||||
if playlist_remaining <= 2:
|
if playlist_remaining <= 2:
|
||||||
radio_get_track(radio_session_id)
|
radio_get_track(radio_session_id)
|
||||||
print('\rRadio generator stopped', flush=True)
|
sys.stdout.write('\rRadio generator stopped')
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
radio_event_gen = threading.Event()
|
radio_event_gen = threading.Event()
|
||||||
|
|
|
@ -23,7 +23,6 @@ player.volume = get_config('mpv_volume')
|
||||||
player.prefetch_playlist = get_config('prefetch_playlist')
|
player.prefetch_playlist = get_config('prefetch_playlist')
|
||||||
show_like_button = get_config('show_like_button')
|
show_like_button = get_config('show_like_button')
|
||||||
track_activity_history = get_config('track_activity_history')
|
track_activity_history = get_config('track_activity_history')
|
||||||
shuffle = False
|
|
||||||
|
|
||||||
|
|
||||||
class player_fw_storage:
|
class player_fw_storage:
|
||||||
|
@ -127,19 +126,14 @@ def soft_volume_reduce():
|
||||||
def player_menu(header='', storage={}):
|
def player_menu(header='', storage={}):
|
||||||
player_fw_storage.storage.update(storage)
|
player_fw_storage.storage.update(storage)
|
||||||
player.volume = get_config("mpv_volume")
|
player.volume = get_config("mpv_volume")
|
||||||
global shuffle
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
player_items_menu = ['Next', 'Prev', 'Pause',
|
player_items_menu = ['Next', 'Prev', 'Pause',
|
||||||
'Shuffle', 'Download', 'Info']
|
'Download', 'Info']
|
||||||
if player.pause:
|
if player.pause:
|
||||||
player_items_menu[2] = 'Play'
|
player_items_menu[2] = 'Play'
|
||||||
else:
|
else:
|
||||||
player_items_menu[2] = 'Pause'
|
player_items_menu[2] = 'Pause'
|
||||||
if shuffle:
|
|
||||||
player_items_menu[3] = 'Unshuffle'
|
|
||||||
else:
|
|
||||||
player_items_menu[3] = 'Shuffle'
|
|
||||||
if show_like_button:
|
if show_like_button:
|
||||||
player_items_menu.append('Like')
|
player_items_menu.append('Like')
|
||||||
player_items_menu.extend(['Hide artist', 'Exit'])
|
player_items_menu.extend(['Hide artist', 'Exit'])
|
||||||
|
@ -158,14 +152,10 @@ def player_menu(header='', storage={}):
|
||||||
elif select == 'Prev':
|
elif select == 'Prev':
|
||||||
player.playlist_prev()
|
player.playlist_prev()
|
||||||
elif select in ('Pause', 'Play'):
|
elif select in ('Pause', 'Play'):
|
||||||
player.cycle('pause')
|
if player.pause:
|
||||||
elif select in ('Shuffle', 'Unshuffle'):
|
player.pause = False
|
||||||
if shuffle:
|
|
||||||
shuffle = False
|
|
||||||
player.playlist_unshuffle()
|
|
||||||
else:
|
else:
|
||||||
shuffle = True
|
player.pause = True
|
||||||
player.playlist_shuffle()
|
|
||||||
elif select == 'Download':
|
elif select == 'Download':
|
||||||
name_downloaded = download_track(player.stream_open_filename)
|
name_downloaded = download_track(player.stream_open_filename)
|
||||||
elif select == 'Info':
|
elif select == 'Info':
|
||||||
|
|
Loading…
Reference in New Issue