Change cache policy (max 25 MB); Pring loading state

This commit is contained in:
localhost_frssoft 2022-12-22 03:23:09 +03:00
parent 4aa1476a81
commit 640242dad5

View File

@ -9,7 +9,7 @@ import sys
fzf = FzfPrompt() fzf = FzfPrompt()
player = mpv.MPV(cache_secs=10) player = mpv.MPV(cache=True, demuxer_max_bytes=25*1024*1024)
player.ytdl = False # Prevent attempts load track with yt-dlp player.ytdl = False # Prevent attempts load track with yt-dlp
player.volume = get_config('mpv_volume') player.volume = get_config('mpv_volume')
player.prefetch_playlist = get_config('prefetch_playlist') player.prefetch_playlist = get_config('prefetch_playlist')
@ -62,6 +62,14 @@ def osd_observer(_name, value):
print_there(0, 0, '\r'+''.join(osd_message)) print_there(0, 0, '\r'+''.join(osd_message))
@player.property_observer('stream-open-filename')
@logger.catch
def waiting_load_observer(_name, value):
'''just show loading state'''
if value and player.core_idle:
print_there(0, 0, '\rLoading track...')
@player.property_observer('percent-pos') @player.property_observer('percent-pos')
@logger.catch @logger.catch
def universal_observer(_name, value): def universal_observer(_name, value):