Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit e1aca8e

Browse files
committed
Added update supression check and implemented manager checkpoints
1 parent 5992895 commit e1aca8e

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

components/shellbridge.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,10 @@ def blockSpotifyUpdate(active):
133133
return e.returncode
134134

135135
# Checks if spotify updates are blocked !WIP!
136-
def checkSpotifyBlockedUpdate():
137-
138-
directory_path = r'C:\path\to\directory'
139-
permission_to_check = 'D'
140-
141-
command = f'icacls "{directory_path}"'
136+
def checkUpdateSupression():
137+
if not os.path.exists(os.path.join(os.environ['LOCALAPPDATA'], "Spotify", "Update")):
138+
return False
139+
else:
140+
return True
142141

143-
try:
144-
result = subprocess.check_output(command, shell=True, text=True)
145-
146-
if f'"{permission_to_check}":(R)' in result:
147-
print(f'Permission {permission_to_check} is active on {directory_path}')
148-
else:
149-
print(f'Permission {permission_to_check} is not active on {directory_path}')
150-
except subprocess.CalledProcessError as e:
151-
print(f'Error: {e.returncode}. Failed to check permissions.')
152142

components/tools.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import configparser
22
import requests
3+
import os
34

45
#Reads config files
56
def readConfig(file_path,section,key):
@@ -20,4 +21,9 @@ def getLatestRelease():
2021
else:
2122
return '0.0.0'
2223
except:
23-
return '0.0.0'
24+
return '0.0.0'
25+
26+
#Writes a short info about the installation status to a text file in spicetifys folder
27+
def writeManagerPoint(data):
28+
with open(os.path.join(os.path.join( os.path.expanduser('~'), 'AppData','Local'), 'spicetify', 'protonosmanager.txt'), 'w') as f:
29+
f.write(data)

manager_window.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from PyQt6.uic import loadUi
1010
from PyQt6.QtGui import QDesktopServices
1111
from components.popups import errorDialog, infoDialog, windowsNotification
12-
from components.shellbridge import InstallSpicetify, UpdateSpicetify, ApplySpicetify, UninstallSpicetify, CustomCommand,checkApplied,blockSpotifyUpdate
13-
from components.tools import getLatestRelease
12+
from components.shellbridge import InstallSpicetify, UpdateSpicetify, ApplySpicetify, UninstallSpicetify, CustomCommand,checkApplied,blockSpotifyUpdate,checkUpdateSupression
13+
from components.tools import getLatestRelease, writeManagerPoint
1414
from components.afterinstall_popup import Popup
1515

1616

@@ -47,7 +47,10 @@ def __init__(self):
4747
# Execute once window is loaded before listeners are enabled
4848
def InitWindow(self):
4949
self.SystemSoftStatusCheck()
50-
print('Made by Protonos')
50+
if(checkUpdateSupression()):
51+
self.check_noupdate.setChecked(True)
52+
else:
53+
self.check_noupdate.setChecked(False)
5154

5255
# Master trigger for all requests
5356
def masterButton(self):
@@ -98,10 +101,12 @@ def masterButton(self):
98101
#Update user about progress while installing spicetify
99102
def installProgress(self, action):
100103
if (action == "fail"):
104+
writeManagerPoint('nok')
101105
self.l_status.setStyleSheet("color: red")
102106
self.l_status.setText("⚠️ Installer has crashed ⚠️")
103107
errorDialog("The installation of Spicetify has failed due to an unrecoverable error! Check logs or ask for help.")
104108
elif (action == "done"):
109+
writeManagerPoint('ok')
105110
self.SystemSoftStatusCheck()
106111
windowsNotification("Spicetify Manager", "Spicetify has successfully been installed!")
107112
dialog = Popup(self)
@@ -139,10 +144,10 @@ def Custom(self):
139144

140145
# Disables Spotify self update function using permissions
141146
def DisableUpdate(self):
142-
if not (blockSpotifyUpdate(self.check_noupdate.isChecked())):
143-
windowsNotification("Spicetify Manager", "Update supression failed!")
147+
if (blockSpotifyUpdate(self.check_noupdate.isChecked())):
148+
windowsNotification("Spicetify Manager", "Update supression change failed!")
144149
else:
145-
windowsNotification("Spicetify Manager", "Update supression activated!")
150+
windowsNotification("Spicetify Manager", "Update supression updated")
146151

147152

148153
#Called when spicetify is installed or not?

0 commit comments

Comments
 (0)