Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/backend/PluginManager/PluginBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def register(self, plugin_name: str = None, github_repo: str = None, plugin_vers
self.plugin_name = plugin_name or manifest.get("name") or None
self.github_repo = github_repo or manifest.get("github") or None
self.plugin_version = plugin_version or manifest.get("version") or None
self.min_app_version = manifest.get("minimum-app-version") or None
self.app_version = app_version or manifest.get("app-version") or None
self.min_app_version = manifest.get("minimum-app-version") or "0.0.0" #TODO: IMPLEMENT BETTER WAY OF VERSION ERROR HANDLING
self.app_version = app_version or manifest.get("app-version") or "0.0.0"

# Verify variables
if self.plugin_name in ["", None]:
Expand Down Expand Up @@ -150,10 +150,12 @@ def is_minimum_version_ok(self) -> bool:

def are_major_versions_matching(self) -> bool:
app_version = version.parse(gl.app_version)
min_app_version = version.parse(self.min_app_version)
# Should use the current app version the plugin uses instead of the minimum app version
current_app_version = version.parse(self.app_version)

return app_version.major == min_app_version.major

return app_version.major == current_app_version.major

#TODO: BETTER ERROR HANDLING FOR are_major_versions_matching and is_minimum_version_ok
def is_app_version_matching(self) -> bool:
return self.are_major_versions_matching() and self.is_minimum_version_ok()

Expand Down
9 changes: 6 additions & 3 deletions src/windows/Store/StoreBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StoreBackend:
STORE_REPO_URL = "https://github.com/StreamController/StreamController-Store" #"https://github.com/StreamController/StreamController-Store"
STORE_CACHE_PATH = "Store/cache"
# STORE_CACHE_PATH = os.path.join(gl.DATA_PATH, STORE_CACHE_PATH)
STORE_BRANCH = "testing"
STORE_BRANCH = "main"


def __init__(self):
Expand Down Expand Up @@ -395,7 +395,7 @@ async def prepare_icon(self, icon):
author=author or None, # Formerly: user_name
official=author in self.official_authors or False,
commit_sha=commit,
local_sha=await self.get_local_sha(os.path.join(gl.DATA_PATH, "icons", manifest.get("id"))),
local_sha=await self.get_local_sha(os.path.join(gl.DATA_PATH, "icons", (manifest.get("id") or ""))),
minimum_app_version=manifest.get("minimum-app-version") or None,
app_version=manifest.get("app-version") or None,
repository_name=self.get_repo_name(url),
Expand Down Expand Up @@ -449,7 +449,7 @@ async def prepare_wallpaper(self, wallpaper):
author=author or None, # Formerly: user_name
official=author in self.official_authors or False,
commit_sha=commit,
local_sha=await self.get_local_sha(os.path.join(gl.DATA_PATH, "plugins", manifest.get("id"))),
local_sha=await self.get_local_sha(os.path.join(gl.DATA_PATH, "plugins", (manifest.get("id") or ""))),
minimum_app_version=manifest.get("minimum-app-version") or None,
app_version=manifest.get("app-version") or None,
repository_name=self.get_repo_name(url),
Expand Down Expand Up @@ -676,6 +676,9 @@ def uninstall_plugin(self, plugin_id:str, remove_from_pages:bool = False, remove
plugin.on_uninstall()

## 3. Remove plugin folder
if os.path.islink(plugin.PATH):
log.error(f"Plugin {plugin.plugin_name} is inside a Symlink! Cant be removed")
return
shutil.rmtree(plugin.PATH)

## 4. Delete plugin base object
Expand Down