@@ -17,7 +17,6 @@ from functools import partial
1717from pathlib import Path
1818
1919import gi
20- import numpy as np
2120import requests
2221import syncedlyrics
2322from PIL import Image
@@ -290,7 +289,6 @@ def update_metadata(player, metadata, manager):
290289def get_new_lyrics (artist , title ):
291290 def finalize ():
292291 global lyrics
293- lyrics ["secs" ] = np .array (lyrics ["secs" ])
294292 lyrics ["max_len" ] = max ([len (x ) for x in lyrics ["text" ]])
295293 global lyrics
296294 lyrics = {"secs" : [0 ], "text" : ["[INTRO]" ], "last_ix" : - 1 }
@@ -410,7 +408,7 @@ def update_progressbar(manager, player):
410408 if lyrics :
411409 # pos is in microseconds
412410 lyr_pos = float (pos / (10 ** 6 ))
413- lyrics_ix = np . sum (lyr_pos >= lyrics ["secs" ]) - 1
411+ lyrics_ix = sum (lyr_pos >= x for x in lyrics ["secs" ]) - 1
414412 lyrics_same = lyrics_ix == lyrics ["last_ix" ]
415413 else :
416414 lyrics_same = True
@@ -453,7 +451,7 @@ def update_progressbar(manager, player):
453451 span_before += max (lyrics_ix + span_after - len (lyrics ["text" ]) + 1 , 0 )
454452 span_after += max (span_before - lyrics_ix , 0 )
455453 # Loop over lyrics window
456- to_put = np . arange (
454+ to_put = range (
457455 max (lyrics_ix - span_before , 0 ),
458456 min (lyrics_ix + span_after , len (lyrics ["text" ]) - 1 ) + 1 ,
459457 )
0 commit comments