From a088adb38b88ad18f6c1954c1a1712475731be77 Mon Sep 17 00:00:00 2001 From: Alex Ashmore Date: Mon, 6 Feb 2023 10:13:34 +0000 Subject: [PATCH] Profile Sync portable now works. --- directory/plugins/profilesync.json | 9 +++++---- src/profilesync/modules/profilesync_paths.py | 10 ++++++++-- src/profilesync/profilesync_plugin.py | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/directory/plugins/profilesync.json b/directory/plugins/profilesync.json index efdfd3d..11d64a9 100644 --- a/directory/plugins/profilesync.json +++ b/directory/plugins/profilesync.json @@ -23,16 +23,17 @@ "DataPath": [ "data/profilesync" ] }, { - "Version": "1.1.0a", - "Released": "2023-01-16", + "Version": "1.1.1a", + "Released": "2023-02-06", "MinSupport": "2.4.0", "MaxSupport": "2.5.0", "MinWorking": "2.4.0", "ReleaseNotes": [ "(1.1.0) Potential fix for previously non-supported characters.", - "(1.1.0) Added support for MO 2.5.0" + "(1.1.0) Added support for MO 2.5.0", + "(1.1.1) Portable sync profiles (Requires recreating Sync Profiles on portable instances)." ], - "DownloadUrl": "https://github.com/Kezyma/ModOrganizer-Plugins/releases/download/profilesync/profilesync.1.1.0.zip", + "DownloadUrl": "https://github.com/Kezyma/ModOrganizer-Plugins/releases/download/profilesync/profilesync.1.1.1.zip", "PluginPath": [ "profilesync" ], "LocalePath": [], "DataPath": [ "data/profilesync" ] diff --git a/src/profilesync/modules/profilesync_paths.py b/src/profilesync/modules/profilesync_paths.py index c6aed11..81ea862 100644 --- a/src/profilesync/modules/profilesync_paths.py +++ b/src/profilesync/modules/profilesync_paths.py @@ -11,7 +11,10 @@ def __init__(self, organiser=mobase.IOrganizer): _profileSyncGroupJsonFile = str() def profileSyncGroupJsonFile(self): if self._profileSyncGroupJsonFile == str(): - self._profileSyncGroupJsonFile = self.pluginDataPath() / self.safeGamePathName() / "profile_sync_groups.json" + if self.currentInstanceName() == "": + self._profileSyncGroupJsonFile = self.pluginDataPath() / "Portable" / "profile_sync_groups.json" + else: + self._profileSyncGroupJsonFile = self.pluginDataPath() / self.safeGamePathName() / "profile_sync_groups.json" if not Path(self._profileSyncGroupJsonFile).parent.exists(): os.makedirs(str(Path(self._profileSyncGroupJsonFile).parent)) if not Path(self._profileSyncGroupJsonFile).exists(): @@ -21,7 +24,10 @@ def profileSyncGroupJsonFile(self): _profileSyncModlistFolder = str() def profileSyncGroupModlist(self, groupName=str): if self._profileSyncModlistFolder == str(): - self._profileSyncModlistFolder = self.pluginDataPath() / self.safeGamePathName() / "groups" + if self.currentInstanceName() == "": + self._profileSyncModlistFolder = self.pluginDataPath() / "Portable" / "groups" + else: + self._profileSyncModlistFolder = self.pluginDataPath() / self.safeGamePathName() / "groups" if not Path(self._profileSyncModlistFolder).exists(): os.makedirs(str(self._profileSyncModlistFolder)) return Path(self._profileSyncModlistFolder) / (self.fileSafeName(str(groupName)) + ".txt") diff --git a/src/profilesync/profilesync_plugin.py b/src/profilesync/profilesync_plugin.py index b09df0b..fc47e0e 100644 --- a/src/profilesync/profilesync_plugin.py +++ b/src/profilesync/profilesync_plugin.py @@ -5,7 +5,7 @@ class ProfileSyncPlugin(SharedPlugin): def __init__(self): - super().__init__("ProfileSync", "Profile Sync", mobase.VersionInfo(1,1,0, mobase.ReleaseType.ALPHA)) + super().__init__("ProfileSync", "Profile Sync", mobase.VersionInfo(1,1,1, mobase.ReleaseType.ALPHA)) def init(self, organiser=mobase.IOrganizer): self.profilesync = ProfileSync(organiser)