Compare commits

...

10 Commits

Author SHA1 Message Date
MathieuG-P 109d560953 bumb to 1.3.2 2023-10-08 23:03:00 +02:00
MathieuG-P bfc853ee55 Merge pull request #337 from Zagrios/bugfix/one-click-download-playlist-conflict-with-shared-maps
[bugfix] Fix error when downloading playlist with OneClick and having maps linked
2023-10-08 22:53:00 +02:00
MathieuG-P fc2cb676d2 [bugfix] Fix error when downloading playlist with OneClick and having maps linked 2023-10-08 22:38:34 +02:00
MathieuG-P 226468aa00 Merge pull request #336 from Zagrios/bugfix/fix-english-translation-typos
[bugfix] Fix english translation typos
2023-10-08 11:28:24 +02:00
MathieuG-P 767bbf389b [bugfix] Fix english translation typos 2023-10-08 11:24:14 +02:00
MathieuG-P 0de2ea44d3 Merge pull request #335 from Zagrios/bugfix/advanced-launch-arguments-not-work-with-shortcuts
[bugfix] when only one advanced launch arg was set for a shortcut it was mishandled
2023-10-07 21:41:18 +02:00
MathieuG-P 1dde41f4f6 [bugfix] when only one advanced launch arg was set for a shortcut it was mishandled 2023-10-07 21:28:57 +02:00
Iluhadesu 029df85ddb Add v1.32.0 to bs_versions.json 2023-10-05 20:14:17 +02:00
MathieuG-P 139f17d7fc Merge pull request #331 from Zagrios/bugfix/one-click-map-download-may-not-work-with-shared-maps
[bugfix] Fix OneClick map download may not work with multiple maps sharing
2023-10-04 00:21:22 +02:00
MathieuG-P 92fd59be1e [bugfix] Fix OneClick map download may not work with multiple maps sharing 2023-10-04 00:10:05 +02:00
8 changed files with 45 additions and 8 deletions
+8
View File
@@ -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"
}
]
+2 -2
View File
@@ -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 -1
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.3.1",
"version": "1.3.2",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
+2
View File
@@ -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
View File
@@ -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 });
}
}
}
+7 -1
View File
@@ -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{