Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit 10a3ca5

Browse files
committed
bumped supported + better eventloop
1 parent 6356c8e commit 10a3ca5

File tree

5 files changed

+91
-82
lines changed

5 files changed

+91
-82
lines changed

Spicetify-Easyinstall.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66

77
import asyncio
88
import sys
9-
import logging
109

1110
# Only start if running as main and not import
1211
if __name__ == "__main__":
13-
14-
# Setup logging preferences
15-
logging.getLogger('aiohttp.server').setLevel(logging.CRITICAL)
16-
1712
# Setup logging console to file output
1813
from modules import logger
1914

@@ -36,13 +31,14 @@
3631
globals.app.setStyleSheet(gui.QSS)
3732

3833
# Configure asyncio loop to work with PyQt5
34+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
3935
loop = QEventLoop(globals.app)
4036
asyncio.set_event_loop(loop)
41-
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
4237

4338
# Setup GUI
4439
globals.gui = gui.MainWindow()
4540
globals.gui.show()
41+
4642
# Set off loop
4743
with loop:
48-
sys.exit(loop.run_forever())
44+
sys.exit(loop.run_until_complete(globals.gui.exit_request.wait()))

modules/core.py

Lines changed: 74 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -349,46 +349,52 @@ async def install(launch=False, latest=False):
349349
# The code below will cache pixmaps of each themes showcase screenshots.
350350

351351
print(f"(11/{steps_count}) Caching pixmaps...")
352-
if os.path.exists('pix_cache.txt'):
353-
os.remove('pix_cache.txt')
354-
open('pix_cache.txt', 'w').close()
355-
globals.pix_cache.clear()
352+
try:
353+
if os.path.exists('pix_cache.txt'):
354+
os.remove('pix_cache.txt')
355+
open('pix_cache.txt', 'w').close()
356+
globals.pix_cache.clear()
356357

357-
themes = utils.list_config_available("themes")
358-
backgrounds = utils.theme_images()
359-
for theme in themes:
360-
background=str(backgrounds[themes.index(theme)])
361-
if background != "None":
362-
Brightness = gui.brightness(background)
363-
pixmapByteArray = gui.buttonPixmap(bg=background, rounded=True, width=284, height=160, typing="ByteArray")
364-
globals.pix_cache[background] = [pixmapByteArray, Brightness]
365-
with open('pix_cache.txt', 'a') as f:
366-
f.write(f'{background}: {str(pixmapByteArray.toBase64())}, {Brightness}\n')
358+
themes = utils.list_config_available("themes")
359+
backgrounds = utils.theme_images()
360+
for theme in themes:
361+
background=str(backgrounds[themes.index(theme)])
362+
if background != "None":
363+
Brightness = gui.brightness(background)
364+
pixmapByteArray = gui.buttonPixmap(bg=background, rounded=True, width=284, height=160, typing="ByteArray")
365+
globals.pix_cache[background] = [pixmapByteArray, Brightness]
366+
with open('pix_cache.txt', 'a') as f:
367+
f.write(f'{background}: {str(pixmapByteArray.toBase64())}, {Brightness}\n')
368+
except:
369+
print("Pixmaps could not be cached, this does not hinder your install.\nHowever customization page might take a second to load.")
367370
print("Finished caching pixmaps!\n")
368371

369372
# >[Section 12]<
370373
# The code below will cache descriptions of each extensions "//description" header.
371374

372375
print(f"(12/{steps_count}) Caching descriptions...")
373-
if os.path.exists('desc_cache.txt'):
374-
os.remove('desc_cache.txt')
375-
else:
376-
open('desc_cache.txt', 'w').close()
377-
globals.desc_cache.clear()
376+
try:
377+
if os.path.exists('desc_cache.txt'):
378+
os.remove('desc_cache.txt')
379+
else:
380+
open('desc_cache.txt', 'w').close()
381+
globals.desc_cache.clear()
378382

379-
extensions=[]
380-
descriptions = utils.extension_descriptions()
381-
for extension in utils.list_config_available("extensions"):
382-
if extension.lower()[:-3] not in [x.lower() for x in utils.list_config_available("themes")]:
383-
extensions.append(extension)
383+
extensions=[]
384+
descriptions = utils.extension_descriptions()
385+
for extension in utils.list_config_available("extensions"):
386+
if extension.lower()[:-3] not in [x.lower() for x in utils.list_config_available("themes")]:
387+
extensions.append(extension)
384388

385-
for extension in extensions:
386-
if extension[:-3] not in globals.desc_cache:
387-
globals.desc_cache[extension[:-3]] = descriptions[extensions.index(extension)]
388-
with open("desc_cache.txt", "a") as f:
389-
f.write(
390-
f'{extension[:-3]}: {descriptions[extensions.index(extension)]}\n'
389+
for extension in extensions:
390+
if extension[:-3] not in globals.desc_cache:
391+
globals.desc_cache[extension[:-3]] = descriptions[extensions.index(extension)]
392+
with open("desc_cache.txt", "a") as f:
393+
f.write(
394+
f'{extension[:-3]}: {descriptions[extensions.index(extension)]}\n'
391395
)
396+
except:
397+
print("Descriptions could not be cached, this does not hinder your install.\nHowever the extensions page may take a second to load.")
392398
print("Finished caching extension descriptions!\n")
393399

394400
if latest:
@@ -694,47 +700,49 @@ async def update_addons(shipped=False):
694700

695701
else:
696702
utils.verbose_print(f"{unpacked_name} wasnt downloaded successfully...")
697-
print("Finished downloading 'custom' addons!\n")
703+
print("Finished downloading 'custom' addons!\n")
698704

699-
print(f"(4/{steps_count}) Caching pixmaps...")
700-
if os.path.exists('pix_cache.txt'):
701-
os.remove('pix_cache.txt')
702-
open('pix_cache.txt', 'w').close()
703-
globals.pix_cache.clear()
704705

705-
themes = utils.list_config_available("themes")
706-
backgrounds = utils.theme_images()
707-
for theme in themes:
708-
background=str(backgrounds[themes.index(theme)])
709-
if background != "None":
710-
Brightness = gui.brightness(background)
711-
pixmapByteArray = gui.buttonPixmap(bg=background, rounded=True, width=284, height=160, typing="ByteArray")
712-
globals.pix_cache[background] = [pixmapByteArray, Brightness]
713-
with open('pix_cache.txt', 'a') as f:
714-
f.write(f'{background}: {str(pixmapByteArray.toBase64())}, {Brightness}\n')
715-
print("Finished caching pixmaps!\n")
706+
print(f"(4/{steps_count}) Caching pixmaps...")
707+
if os.path.exists('pix_cache.txt'):
708+
os.remove('pix_cache.txt')
709+
open('pix_cache.txt', 'w').close()
710+
globals.pix_cache.clear()
716711

717-
print(f"(5/{steps_count}) Caching descriptions...")
718-
if os.path.exists('desc_cache.txt'):
719-
os.remove('desc_cache.txt')
720-
else:
721-
open('desc_cache.txt', 'w').close()
722-
globals.desc_cache.clear()
712+
themes = utils.list_config_available("themes")
713+
backgrounds = utils.theme_images()
714+
for theme in themes:
715+
background=str(backgrounds[themes.index(theme)])
716+
if background != "None":
717+
Brightness = gui.brightness(background)
718+
pixmapByteArray = gui.buttonPixmap(bg=background, rounded=True, width=284, height=160, typing="ByteArray")
719+
globals.pix_cache[background] = [pixmapByteArray, Brightness]
720+
with open('pix_cache.txt', 'a') as f:
721+
f.write(f'{background}: {str(pixmapByteArray.toBase64())}, {Brightness}\n')
722+
print("Finished caching pixmaps!\n")
723723

724-
extensions=[]
725-
descriptions = utils.extension_descriptions()
726-
for extension in utils.list_config_available("extensions"):
727-
if extension.lower()[:-3] not in [x.lower() for x in utils.list_config_available("themes")]:
728-
extensions.append(extension)
724+
725+
print(f"(5/{steps_count}) Caching descriptions...")
726+
if os.path.exists('desc_cache.txt'):
727+
os.remove('desc_cache.txt')
728+
else:
729+
open('desc_cache.txt', 'w').close()
730+
globals.desc_cache.clear()
729731

730-
for extension in extensions:
731-
if extension[:-3] not in globals.desc_cache:
732-
globals.desc_cache[extension[:-3]] = descriptions[extensions.index(extension)]
733-
with open("desc_cache.txt", "a") as f:
734-
f.write(
735-
f'{extension[:-3]}: {descriptions[extensions.index(extension)]}\n'
736-
)
737-
print("Finished caching extension descriptions!\n")
732+
extensions=[]
733+
descriptions = utils.extension_descriptions()
734+
for extension in utils.list_config_available("extensions"):
735+
if extension.lower()[:-3] not in [x.lower() for x in utils.list_config_available("themes")]:
736+
extensions.append(extension)
737+
738+
for extension in extensions:
739+
if extension[:-3] not in globals.desc_cache:
740+
globals.desc_cache[extension[:-3]] = descriptions[extensions.index(extension)]
741+
with open("desc_cache.txt", "a") as f:
742+
f.write(
743+
f'{extension[:-3]}: {descriptions[extensions.index(extension)]}\n'
744+
)
745+
print("Finished caching extension descriptions!\n")
738746

739747

740748
async def update_app():

modules/globals.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
## All '__xyz__' variables are temporary variables used for re-assigning.
88

99
# Github Variables
10-
RELEASE = "3.1"
10+
RELEASE = "3.2"
1111
HOMEPAGE = "https://github.com/ohitstom/spicetify-easyinstall"
1212
WATERMARK = "Spicetify EasyInstall by OhItsTom and WillyJL"
1313

1414
# Download URLS
15-
SPOTIFY_URL = "https://upgrade.scdn.co/upgrade/client/win32-x86/spotify_installer-1.1.91.824.g07f1e963-9.exe"
16-
THEMES_URL = "https://codeload.github.com/spicetify/spicetify-themes/zip/dcf9a4d805ec6cdc9b6ee70d908b04879aea8207"
17-
ADDONS_URL = "https://codeload.github.com/spicetify/spicetify-cli/zip/5a8a4ae048d1962a2c3663f26a161fec88ebcc49"
15+
SPOTIFY_URL = "https://upgrade.scdn.co/upgrade/client/win32-x86/spotify_installer-1.1.94.864.g540a4cc6-12.exe"
16+
THEMES_URL = "https://codeload.github.com/spicetify/spicetify-themes/zip/0f7a687e76c525e4013a7f82ccb15e11cc30475a"
17+
ADDONS_URL = "https://codeload.github.com/spicetify/spicetify-cli/zip/1bda2cffa39bb71d8bad6ff58c9712d1d60aef0a"
1818
__SPOTIFY_URL__ = SPOTIFY_URL
1919
__THEMES_URL__ = THEMES_URL
2020
__ADDONS_URL__ = ADDONS_URL
2121

2222
# Version Variables
23-
SPICETIFY_VERSION = "2.11.1"
23+
SPICETIFY_VERSION = "2.13.1"
2424
SPOTIFY_VERSION = "/".join(SPOTIFY_URL.split("/")[-1:])
2525
THEMES_VERSION = f"spicetify-themes-{'/'.join(THEMES_URL.split('/')[-1:])}"
2626
ADDONS_VERSION = f"spicetify-cli-{'/'.join(ADDONS_URL.split('/')[-1:])}"
@@ -75,11 +75,11 @@
7575
}
7676

7777
CUSTOM_APPS = {
78-
"https://codeload.github.com/spicetify/spicetify-marketplace/zip/cdc3e1dde8acc89237c65dc752c5f65ec7d422ed": f"{spice_config}\\CustomApps\\marketplace.zip",
78+
"https://codeload.github.com/spicetify/spicetify-marketplace/zip/160209c0527c8785784f67199fbe5b91732d1436": f"{spice_config}\\CustomApps\\marketplace.zip",
7979
}
8080

8181
CUSTOM_THEMES = {
82-
"https://codeload.github.com/Comfy-Themes/Spicetify/zip/0d5bc648da0bc3e746dab47a4762039eda72d1fc": f"{spice_config}\\Themes\\Comfy-Collection.zip",
82+
"https://codeload.github.com/Comfy-Themes/Spicetify/zip/b80a46f012d2e3b9f49b42d76d3f4df634f367c1": f"{spice_config}\\Themes\\Comfy-Collection.zip",
8383
}
8484

8585
# Text Pages For GUI

modules/gui.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
TEXT_COLOR = "#EDEDED"
3535
DISABLED_TEXT_COLOR = "#222222"
3636

37-
ANIM_TYPE = QtCore.QEasingCurve.InBack
37+
ANIM_TYPE = QtCore.QEasingCurve.InOutQuart
3838
ANIM_DURATION = 300
3939

4040
QSS = f"""
@@ -281,6 +281,8 @@ def __init__(self):
281281
spacing=0,
282282
)
283283

284+
self.exit_request = asyncio.Event()
285+
284286
self.setWindowTitle("Spicetify EasyInstall")
285287
self.setWindowIcon(QtGui.QIcon("resources/icons/icon.png"))
286288

@@ -296,6 +298,9 @@ def __init__(self):
296298

297299
self.bottom_bar = BottomBar(parent=self)
298300
self.layout().addWidget(self.bottom_bar)
301+
302+
def closeEvent(self, *args):
303+
self.exit_request.set()
299304

300305

301306
class SlidingFrame(QuickWidget):

resources/notes/to_do.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ Optional:
1111
-Better image scanning for backgrounds to make text pop
1212
-Future dropdown for patchnotes.
1313
-Custom Titlebar
14-
-Benign Socket Errors
1514
-Crossplatform?
15+
-Smoother screen slide
1616

0 commit comments

Comments
 (0)