mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] rework link unlink modals
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user