[chore] rework link unlink modals

This commit is contained in:
MathieuG-P
2024-12-11 20:30:35 +01:00
parent 0f5ea88a27
commit be5cc9c645
25 changed files with 238 additions and 1186 deletions
+7 -1
View File
@@ -2,10 +2,11 @@ import { shell } from "electron";
import { BSVersionLibService } from "../services/bs-version-lib.service";
import { BSLocalVersionService } from "../services/bs-local-version.service";
import { IpcService } from "../services/ipc.service";
import { from } from "rxjs";
import { from, of } from "rxjs";
import path from "path";
import { pathExists } from "fs-extra";
import { VersionFolderLinkerService } from "../services/version-folder-linker.service";
import { FolderLinkerService } from "main/services/folder-linker.service";
const ipc = IpcService.getInstance();
@@ -67,3 +68,8 @@ ipc.on("relink-all-versions-folders", (_, reply) => {
const versionLinker = VersionFolderLinkerService.getInstance();
reply(from(versionLinker.relinkAllVersionsFolders()));
});
ipc.on("get-shared-folder", (_, reply) => {
const versionLinker = FolderLinkerService.getInstance();
reply(of(versionLinker.sharedFolder()));
});
@@ -104,6 +104,7 @@ export class BSLocalVersionService {
const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers');
const folderVersion = await this.getVersionFromGlobalGameManagerFile(versionFilePath);
folderVersion.path = bsPath;
if(!folderVersion){ return null; }
+2 -2
View File
@@ -36,12 +36,12 @@ export class FolderLinkerService {
});
}
private async sharedFolder(): Promise<string> {
public sharedFolder(): string {
return this.installLocationService.sharedContentPath();
}
private async getSharedFolder(folderPath: string, intermediateFolder?: string): Promise<string> {
return path.join(await this.sharedFolder(), intermediateFolder ?? "", path.basename(folderPath));
return path.join(this.sharedFolder(), intermediateFolder ?? "", path.basename(folderPath));
}
private getBackupFolder(folderPath: string): string {