@@ -153,10 +153,10 @@ def screenOFFProcedure(self: App):
153153 }
154154 self .drawNewSong (songinfo = song_info )
155155
156- def _secondIncrease (self ):
157- while RUN :
158- sleep (1 )
159- self .time_done = (datetime .datetime .combine (datetime .date .today (), self .time_done ) + datetime .timedelta (seconds = 1 )).time ()
156+ # def _secondIncrease(self):
157+ # while RUN:
158+ # sleep(1.1) # To the human eye looks fine but doesnt roll back all the time with API updates
159+ # self.time_done = (datetime.datetime.combine(datetime.date.today(), self.time_done) + datetime.timedelta(seconds=1)).time()
160160
161161 def _updateSongBar (self ):
162162 i = 0
@@ -214,16 +214,16 @@ def drawNewSong(self, songinfo: dict):
214214
215215 def drawLoginPage (self ):
216216 self .ClearWithBG ()
217- logo = Image .open ("res/imgs/spoti-logo.png" )
218- logo .thumbnail ((219 ,219 ))
217+ # logo = Image.open("res/imgs/spoti-logo.png")
218+ # logo.thumbnail((219,219))
219219 self .lock .acquire ()
220220 self .comm .DisplayText ("Please authorize this application to access your spotify data\n There should be a new tab in your default browser" , x = 2 , y = 219 + 5 ,
221221 font = "Roboto-Italic.ttf" ,
222222 font_size = 18 ,
223223 font_color = (255 , 255 , 255 ),
224224 background_color = BGCOL ,
225225 align = 'left' )
226- self .comm .DisplayPILImage (logo )
226+ # self.comm.DisplayPILImage(logo)
227227 self .lock .release ()
228228
229229def seconds_to_time (seconds ):
@@ -246,7 +246,8 @@ def HandleAuth() -> spotipy.Spotify:
246246 # BRUH, I implemented a whole flask web server and it just had this builtin
247247 sp = spotipy .Spotify (oauth_manager = SpotifyPKCE (scope = OAUTH2_SCOPES ))
248248 oauth : SpotifyPKCE = sp .oauth_manager
249- oauth .get_access_token ()
249+ print ("If your browser did not open please navigate to:\n " + oauth .get_authorize_url ())
250+ oauth .get_access_token ()
250251 return sp
251252
252253if __name__ == "__main__" :
@@ -276,8 +277,9 @@ def stopall(signum, frame):
276277 app .sp = SP
277278 app .ClearWithBG ()
278279 threading .Thread (target = app ._updateSongBar , daemon = True ).start ()
279- threading .Thread (target = app ._secondIncrease ).start () # keeping up with progress between API updates
280+ # threading.Thread(target=app._secondIncrease).start() # keeping up with progress between API updates
280281 while RUN :
281282 pass
282-
283+
284+ lcd_comm .ScreenOff ()
283285 lcd_comm .closeSerial ()
0 commit comments