Compare commits

...

16 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
MathieuG-P d61f59c714 bumb to 1.3.1 2023-10-02 13:36:22 +02:00
MathieuG-P 64e3652b60 Merge pull request #330 from Zagrios/bugfix/steam-vr-restored-before-beatsaber-was-launched
[bugfix] increase timout for restoring SteamVR after launching Beat Saber
2023-10-02 13:35:46 +02:00
MathieuG-P 6f018e6a32 [bugfix] increase timout for restoring SteamVR after launching Beat Saber 2023-10-02 13:30:23 +02:00
MathieuG-P da3b2b13a8 Merge pull request #328 from Zagrios/bugfix/replace-resvg-that-need-dll-by-sharp
[bugfix] Remove resvg lib that need DLL by Sharp that doesnt
2023-09-25 12:52:40 +02:00
MathieuG-P 381daa80a4 [bufix] install node-abi 2023-09-25 12:34:05 +02:00
MathieuG-P bdfe8ce535 [bugfix] Remove resvg lib that need DLL by Sharp that doesnt 2023-09-25 11:55:34 +02:00
11 changed files with 917 additions and 274 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"
+7 -8
View File
@@ -24,6 +24,7 @@
"history": "^5.3.0",
"jszip": "^3.10.1",
"md5-file": "^5.0.0",
"node-abi": "^3.47.0",
"node-fetch": "^2.6.7",
"node-stream-zip": "^1.15.0",
"ps-list": "^7.2.0",
@@ -13509,10 +13510,9 @@
}
},
"node_modules/node-abi": {
"version": "3.28.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.28.0.tgz",
"integrity": "sha512-fRlDb4I0eLcQeUvGq7IY3xHrSb0c9ummdvDSYWfT9+LKP+3jCKw/tKoqaM7r1BAoiAC6GtwyjaGnOz6B3OtF+A==",
"dev": true,
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
"dependencies": {
"semver": "^7.3.5"
},
@@ -29518,10 +29518,9 @@
}
},
"node-abi": {
"version": "3.28.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.28.0.tgz",
"integrity": "sha512-fRlDb4I0eLcQeUvGq7IY3xHrSb0c9ummdvDSYWfT9+LKP+3jCKw/tKoqaM7r1BAoiAC6GtwyjaGnOz6B3OtF+A==",
"dev": true,
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
"requires": {
"semver": "^7.3.5"
}
+1
View File
@@ -244,6 +244,7 @@
"history": "^5.3.0",
"jszip": "^3.10.1",
"md5-file": "^5.0.0",
"node-abi": "^3.47.0",
"node-fetch": "^2.6.7",
"node-stream-zip": "^1.15.0",
"ps-list": "^7.2.0",
+855 -246
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.3.1-alpha.2",
"version": "1.3.2",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
@@ -14,8 +14,8 @@
"postinstall": "npm run electron-rebuild && npm run link-modules"
},
"dependencies": {
"@resvg/resvg-js": "^2.4.1",
"ps-list": "^7.2.0"
"ps-list": "^7.2.0",
"sharp": "^0.32.6"
},
"license": "MIT"
}
+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 });
}
}
}
+14 -11
View File
@@ -11,7 +11,6 @@ import log from "electron-log";
import { Observable, of } from "rxjs";
import { BsmProtocolService } from "./bsm-protocol.service";
import { app, shell} from "electron";
import { Resvg } from "@resvg/resvg-js";
import Color from "color";
import { ensureDir, writeFile } from "fs-extra";
import toIco from "to-ico";
@@ -20,6 +19,7 @@ import { WindowManagerService } from "./window-manager.service";
import { IpcService } from "./ipc.service";
import { BSVersionLibService } from "./bs-version-lib.service";
import { execOnOs } from "../helpers/env.helpers";
import sharp from "sharp";
export class BSLauncherService {
private static instance: BSLauncherService;
@@ -161,7 +161,7 @@ export class BSLauncherService {
bsProcess.removeAllListeners("error");
bsProcess.removeAllListeners("exit");
resolve(-1);
}, 15_000);
}, 30_000);
}).then(exitCode => {
log.info("BS process exit code", exitCode);
@@ -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{
@@ -224,19 +230,16 @@ export class BSLauncherService {
return res;
}
private createShortcutPngBuffer(color: Color): Buffer{
private createShortcutPngBuffer(color: Color): Promise<Buffer>{
const svgIcon = `
const svgBuffer = Buffer.from(`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 406.4 406.4" height="406.4" width="406.4">
<rect rx="69.453" height="406.4" width="406.4" fill="${color.hex()}"/>
<path d="M65.467 60.6H336.4v33.867L200.933 162.2 65.467 94.467z" fill="#fff"/>
</svg>
`;
return new Resvg(svgIcon, {
fitTo: { mode: "width", value: 256 }
}).render().asPng();
`);
return sharp(svgBuffer).resize(256).png().toBuffer();
}
/**
@@ -262,7 +265,7 @@ export class BSLauncherService {
* @returns {Promise<string>} Path of the icon
*/
private async createShortcutIco(color: Color): Promise<string>{
const pngBuffer = this.createShortcutPngBuffer(color);
const pngBuffer = await this.createShortcutPngBuffer(color);
const icoBuffer = await toIco([pngBuffer]);
await ensureDir(IMAGE_CACHE_PATH);