Skip to content

Commit 6234377

Browse files
committed
improved requirements experiance; Improved login experiance; Minor fixes
1 parent 289b854 commit 6234377

3 files changed

Lines changed: 27 additions & 16 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
**/__pycache__
2+
env/*
3+
venv/*
24
.vscode
35
.cache
46
log.log

main.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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\nThere 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

229229
def 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

252253
if __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()

requirements.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
babel==2.16.0
2-
GPUtil==1.4.0
3-
numpy==2.1.2
2+
numpy~=1.24.4; python_version < "3.9"
3+
numpy~=1.26.4; python_version >= "3.9"
44
pillow==10.4.0
55
psutil==5.9.8
6-
pyadl==0.1
76
pyserial==3.5
8-
pythonnet==3.0.4
9-
pywin32==306; sys_platform='win32'
107
PyYAML==6.0.2
118
spotipy==2.24.0
129
uptime==3.0.1
1310
flask==3.0.3
14-
python-dotenv == 1.0.1
11+
python-dotenv == 1.0.1
12+
13+
# For Nvidia GPU on all platforms
14+
GPUtil~=1.4.0; python_version < "3.12"
15+
# GPUtil is broken for Python 3.12+ and not maintained anymore: fetch it from a fork where it is fixed
16+
GPUtil @ git+https://github.com/mathoudebine/gputil.git@1.4.0-py3.12 ; python_version >= "3.12"
17+
18+
# Windows only
19+
pyadl==0.1; sys_platform=='win32'
20+
pythonnet==3.0.4; sys_platform=='win32'
21+
pywin32==306; sys_platform=='win32'

0 commit comments

Comments
 (0)