diff --git a/src/hooks/useSetlistData.ts b/src/hooks/useSetlistData.ts index 7ba6904..4027225 100644 --- a/src/hooks/useSetlistData.ts +++ b/src/hooks/useSetlistData.ts @@ -25,9 +25,10 @@ export const useSetlistData = (setlistData: SetlistData) => { async () => { if (state || !setlistData) return; - const exists = await invoke("version_exists_setlist", { - id: setlistData.id, - version: setlistData.version + const exists = await invoke("exists", { + appName: "official_setlist", + version: setlistData.version, + profile: setlistData.id }); setState(exists ? SetlistStates.AVAILABLE : SetlistStates.NEW_UPDATE); diff --git a/src/hooks/useYARGVersion.ts b/src/hooks/useYARGVersion.ts index 80b789b..f0bc3de 100644 --- a/src/hooks/useYARGVersion.ts +++ b/src/hooks/useYARGVersion.ts @@ -37,8 +37,9 @@ export const useYARGVersion = (releaseData: ExtendedReleaseData | undefined, pro async () => { if (state || !releaseData) return; - const exists = await invoke("version_exists_yarg", { - versionId: releaseData.tag_name, + const exists = await invoke("exists", { + appName: "yarg", + version: releaseData.tag_name, profile: profileName }); @@ -54,7 +55,7 @@ export const useYARGVersion = (releaseData: ExtendedReleaseData | undefined, pro play: async () => {}, download: async () => {}, }; - } + } const play = async () => { if (!releaseData) return; @@ -62,14 +63,15 @@ export const useYARGVersion = (releaseData: ExtendedReleaseData | undefined, pro setState(YARGStates.LOADING); try { - await invoke("play_yarg", { - versionId: releaseData.tag_name, + await invoke("launch", { + appName: "yarg", + version: releaseData.tag_name, profile: profileName }); setState(YARGStates.PLAYING); - // As we don't have a way to check if the YARG game process is closed, we set a timer to avoid locking the state to PLAYING + // As we don't have a way to check if the YARG game process is closed, we set a timer to avoid locking the state to PLAYING setTimeout(() => { setState(YARGStates.AVAILABLE); }, 10 * 1000); diff --git a/src/utils/Download/Processors/Setlist.tsx b/src/utils/Download/Processors/Setlist.tsx index 3b7fe9a..2d3d381 100644 --- a/src/utils/Download/Processors/Setlist.tsx +++ b/src/utils/Download/Processors/Setlist.tsx @@ -17,10 +17,12 @@ export class SetlistDownload extends BaseDownload implements IBaseDownload { } async start(): Promise { - return await invoke("download_setlist", { - zipUrls: this.zipUrls, - id: this.id, + return await invoke("download_and_install", { + appName: "official_setlist", version: this.version, + profile: this.id, + zipUrls: this.zipUrls, + sigUrls: [], }); } diff --git a/src/utils/Download/Processors/YARG.tsx b/src/utils/Download/Processors/YARG.tsx index d6cd5ba..9b8293c 100644 --- a/src/utils/Download/Processors/YARG.tsx +++ b/src/utils/Download/Processors/YARG.tsx @@ -22,11 +22,17 @@ export class YARGDownload extends BaseDownload implements IBaseDownload { } async start(): Promise { - return await invoke("download_yarg", { - zipUrl: this.zipUrl, - sigUrl: this.sigUrl, - versionId: this.version, - profile: this.profile + let sigUrls: string[] = []; + if (this.sigUrl != null) { + sigUrls = [ this.sigUrl ]; + } + + return await invoke("download_and_install", { + appName: "yarg", + version: this.version, + profile: this.profile, + zipUrls: [ this.zipUrl ], + sigUrls: sigUrls, }); }