we can now enable deep links for playlists

This commit is contained in:
MathieuG-P
2022-12-23 21:52:34 +01:00
parent e18caca70f
commit 698eab012f
4 changed files with 103 additions and 4 deletions
@@ -15,7 +15,6 @@ import { BPList, DownloadPlaylistProgression } from "shared/models/playlists/pla
import { copyFileSync, readFileSync } from "fs";
import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service";
import { copySync } from "fs-extra";
import { timer } from "rxjs";
export class LocalPlaylistsManagerService {
@@ -116,8 +115,7 @@ export class LocalPlaylistsManagerService {
private openOneClickDownloadPlaylistWindow(downloadUrl: string): void{
// TODO make once
ipcMain.on("one-click-playlist-info", async (event, req: IpcRequest<void>) => {
ipcMain.once("one-click-playlist-info", async (event, req: IpcRequest<void>) => {
this.utils.ipcSend(req.responceChannel, {success: true, data: {bpListUrl: downloadUrl, id: this.getPlaylistIdFromDownloadUrl(downloadUrl)}});
});
@@ -213,4 +211,16 @@ export class LocalPlaylistsManagerService {
}
public enableDeepLinks(): boolean{
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.registerDeepLink(link));
}
public disableDeepLinks(): boolean{
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.unRegisterDeepLink(link));
}
public isDeepLinksEnabled(): boolean{
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
}
}