mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 109d560953 | |||
| bfc853ee55 | |||
| fc2cb676d2 | |||
| 226468aa00 | |||
| 767bbf389b | |||
| 0de2ea44d3 | |||
| 1dde41f4f6 | |||
| 029df85ddb | |||
| 139f17d7fc | |||
| 92fd59be1e |
@@ -573,5 +573,13 @@
|
||||
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/58621b3cb8bf42fcfbf3b97fe47aa91b290eea04.png",
|
||||
"ReleaseDate": "1693824747",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.32.0",
|
||||
"BSManifest": "1660149393914874041",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3723971545002767483",
|
||||
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/02284793f06188caf740da66939679afc25415e4.png",
|
||||
"ReleaseDate": "1696517680",
|
||||
"year": "2023"
|
||||
}
|
||||
]
|
||||
@@ -44,7 +44,7 @@
|
||||
"maps": {
|
||||
"title": "Shared maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Search installed maps",
|
||||
"search-placeholder": "Search a map",
|
||||
"filters-btn": "Filters",
|
||||
"dropdown": {
|
||||
"export-maps": "Export maps",
|
||||
@@ -738,7 +738,7 @@
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Search installed models",
|
||||
"search": "Search a model",
|
||||
"drop-down": {
|
||||
"delete": "Delete models",
|
||||
"export": "Export models"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.2",
|
||||
"description": "BSManager",
|
||||
"main": "./dist/main/main.js",
|
||||
"author": {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { from } from "rxjs";
|
||||
import log from "electron-log"
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
@@ -71,6 +72,7 @@ ipc.on("one-click-install-map", async (request: IpcRequest<BsvMapDetail>) => {
|
||||
utils.ipcSend(request.responceChannel, { success: true });
|
||||
})
|
||||
.catch(err => {
|
||||
log.error(err);
|
||||
utils.ipcSend(request.responceChannel, { success: false, error: err });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { LocalPlaylistsManagerService } from "../services/additional-content/local-playlists-manager.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import log from "electron-log";
|
||||
|
||||
ipcMain.on("one-click-install-playlist", async (event, request: IpcRequest<string>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -13,6 +14,7 @@ ipcMain.on("one-click-install-playlist", async (event, request: IpcRequest<strin
|
||||
utils.ipcSend(request.responceChannel, { success: true });
|
||||
})
|
||||
.catch(e => {
|
||||
log.error(e);
|
||||
utils.ipcSend(request.responceChannel, { success: false, error: e });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import { InstallationLocationService } from "../installation-location.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import crypto from "crypto";
|
||||
import { lstatSync } from "fs";
|
||||
import { copy, createReadStream, ensureDir, unlink } from "fs-extra";
|
||||
import { copy, createReadStream, ensureDir, realpath, unlink } from "fs-extra";
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import sanitize from "sanitize-filename";
|
||||
@@ -290,10 +290,16 @@ export class LocalMapsManagerService {
|
||||
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
const downloadedMap = await this.downloadMap(map, versions.pop());
|
||||
const downloadedMapRealFolder = await realpath(path.dirname(downloadedMap.path));
|
||||
|
||||
for (const version of versions) {
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
await ensureDir(versionMapsPath);
|
||||
|
||||
if((await realpath(versionMapsPath)) === downloadedMapRealFolder){
|
||||
continue;
|
||||
}
|
||||
|
||||
await copy(downloadedMap.path, path.join(versionMapsPath, path.basename(downloadedMap.path)), { overwrite: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IpcRequest } from "shared/models/ipc";
|
||||
import { BPList, DownloadPlaylistProgression } from "shared/models/playlists/playlist.interface";
|
||||
import { copyFileSync, readFileSync } from "fs";
|
||||
import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service";
|
||||
import { copySync } from "fs-extra";
|
||||
import { copy, realpath } from "fs-extra";
|
||||
import { ensureFolderExist, pathExist } from "../../helpers/fs.helpers";
|
||||
|
||||
export class LocalPlaylistsManagerService {
|
||||
@@ -180,14 +180,27 @@ export class LocalPlaylistsManagerService {
|
||||
|
||||
const { bpListPath, mapsPath } = await lastValueFrom(this.downloadPlaylist(bpListUrl, versions.pop()));
|
||||
|
||||
if(mapsPath?.length === 0 || !bpListPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
const realSourceMapsFolder = await realpath(path.dirname(mapsPath[0]));
|
||||
|
||||
for (const version of versions) {
|
||||
await this.installBPListFile(bpListPath, version);
|
||||
|
||||
const versionMapsFolder = await this.maps.getMapsFolderPath(version);
|
||||
const realDestMapsFolder = await realpath(versionMapsFolder);
|
||||
|
||||
if(realSourceMapsFolder === realDestMapsFolder) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const mapPath of mapsPath) {
|
||||
const versionMapsFolder = await this.maps.getMapsFolderPath(version);
|
||||
|
||||
const mapDest = path.join(versionMapsFolder, path.basename(mapPath));
|
||||
|
||||
copySync(mapPath, mapDest, { overwrite: true });
|
||||
await copy(mapPath, mapDest, { overwrite: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,13 @@ export class BSLauncherService {
|
||||
shortcutLink = new URL(shortcutLink);
|
||||
}
|
||||
|
||||
return objectFromEntries(shortcutLink.searchParams.entries()) as ShortcutParams;
|
||||
const params = objectFromEntries(shortcutLink.searchParams.entries()) as ShortcutParams;
|
||||
|
||||
if(typeof params.additionalArgs === "string"){
|
||||
params.additionalArgs = [params.additionalArgs];
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
public shortcutLinkToLaunchOptions(shortcutLink: string|URL): LaunchOption{
|
||||
|
||||
Reference in New Issue
Block a user