Restructure

This commit is contained in:
Core 2022-06-16 14:01:04 +01:00
parent 2fc4005b6c
commit bbcae012b8
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -2,18 +2,36 @@ import * as fs from "fs";
import * as path from "path";
import {Store} from "./store";
import {BrowserWindow as bw} from "./browserwindow";
import {app, dialog, ipcMain, Notification, shell, BrowserWindow} from "electron";
import {app, BrowserWindow, ipcMain} from "electron";
import fetch from "electron-fetch";
import {AppImageUpdater, NsisUpdater} from "electron-updater";
import * as log from "electron-log";
import ElectronStore from "electron-store";
export class utils {
/**
* Playback Functions
*/
static playback = {
pause: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.pause()")
},
play: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.play()")
},
playPause: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.playPause()")
},
next: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.next()")
},
previous: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.previous()")
}
}
/**
* Paths for the application to use
*/
private static paths: any = {
static paths: any = {
srcPath: path.join(__dirname, "../../src"),
rendererPath: path.join(__dirname, "../../src/renderer"),
mainPath: path.join(__dirname, "../../src/main"),
@ -97,7 +115,6 @@ export class utils {
return Store.cfg.store
}
/**
* Get the store instance
* @returns {Store}
@ -123,10 +140,6 @@ export class utils {
return Store.pushToCloud
}
/**
* Gets the browser window
*/
@ -145,25 +158,4 @@ export class utils {
static loadJSFrontend(path: string): void {
bw.win.webContents.executeJavaScript(fs.readFileSync(path, "utf8"));
}
/**
* Playback Functions
*/
static playback = {
pause: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.pause()")
},
play: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.play()")
},
playPause: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.playPause()")
},
next: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.next()")
},
previous: () => {
bw.win.webContents.executeJavaScript("MusicKitInterop.previous()")
}
}
}