Merge pull request #1735 from ciderapp/crowdin-api
janky ass implementation of crowdin api
This commit is contained in:
commit
27a3a73124
10 changed files with 279 additions and 259 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
||||||
[submodule "src/cider-i18n"]
|
|
||||||
path = src/cider-i18n
|
|
||||||
url = https://github.com/ciderapp/cider-i18n
|
|
|
@ -1,3 +0,0 @@
|
||||||
files:
|
|
||||||
- source: /src/i18n/source/en_US.json
|
|
||||||
translation: /src/i18n/%locale_with_underscore%.json
|
|
|
@ -30,6 +30,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@achingbrain/ssdp": "^4.0.4",
|
"@achingbrain/ssdp": "^4.0.4",
|
||||||
|
"@crowdin/ota-client": "^1.0.0",
|
||||||
"@sentry/electron": "^4.6.0",
|
"@sentry/electron": "^4.6.0",
|
||||||
"@sentry/integrations": "^7.54.0",
|
"@sentry/integrations": "^7.54.0",
|
||||||
"adm-zip": "^0.5.10",
|
"adm-zip": "^0.5.10",
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 1a427976edb6c19bf16620c15cba75f5052f7313
|
|
|
@ -1048,22 +1048,19 @@ export class BrowserWindow {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on("get-i18n-listing", (event) => {
|
ipcMain.on("get-i18n-listing", (event) => {
|
||||||
console.debug("[i18n] Getting i18n listing from " + utils.getPath("i18nPath"));
|
const translations = utils.i18n
|
||||||
const i18nFiles = readdirSync(utils.getPath("i18nPath")).filter((file) => file.endsWith(".json")),
|
const i18nListing: any = [];
|
||||||
i18nListing = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < i18nFiles.length; i++) {
|
for (const lang in translations) {
|
||||||
if (i18nFiles[i] == "index.json") continue;
|
|
||||||
console.debug("[i18n] Processing file: " + join(utils.getPath("i18nPath"), i18nFiles[i]));
|
|
||||||
const i18n: { [index: string]: Object } = JSON.parse(readFileSync(join(utils.getPath("i18nPath"), i18nFiles[i]), "utf8"));
|
|
||||||
i18nListing.push({
|
i18nListing.push({
|
||||||
code: i18nFiles[i].replace(".json", ""),
|
code: lang,
|
||||||
nameNative: i18n["i18n.languageName"] ?? i18nFiles[i].replace(".json", ""),
|
nameNative: translations[lang][0].content["i18n.languageName"] ?? lang,
|
||||||
nameEnglish: i18n["i18n.languageNameEnglish"] ?? i18nFiles[i].replace(".json", ""),
|
nameEnglish: translations[lang][0].content["i18n.languageNameEnglish"] ?? lang,
|
||||||
category: i18n["i18n.category"] ?? "",
|
category: translations[lang][0].content["i18n.category"] ?? "",
|
||||||
authors: i18n["i18n.authors"] ?? "",
|
authors: translations[lang][0].content["i18n.authors"] ?? "",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
event.returnValue = i18nListing;
|
event.returnValue = i18nListing;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,14 @@ import * as path from "path";
|
||||||
import { Store } from "./store";
|
import { Store } from "./store";
|
||||||
import { BrowserWindow as bw } from "./browserwindow";
|
import { BrowserWindow as bw } from "./browserwindow";
|
||||||
import { app, BrowserWindow, ipcMain } from "electron";
|
import { app, BrowserWindow, ipcMain } from "electron";
|
||||||
|
import OtaClient from "@crowdin/ota-client";
|
||||||
import fetch from "electron-fetch";
|
import fetch from "electron-fetch";
|
||||||
import ElectronStore from "electron-store";
|
import ElectronStore from "electron-store";
|
||||||
|
|
||||||
export class utils {
|
export class utils {
|
||||||
|
static crowdinClient: OtaClient = new OtaClient('fda9a6528649ea90dee35390wog')
|
||||||
|
static i18n: any = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Playback Functions
|
* Playback Functions
|
||||||
*/
|
*/
|
||||||
|
@ -38,8 +42,6 @@ export class utils {
|
||||||
rendererPath: path.join(__dirname, "../../src/renderer"),
|
rendererPath: path.join(__dirname, "../../src/renderer"),
|
||||||
mainPath: path.join(__dirname, "../../src/main"),
|
mainPath: path.join(__dirname, "../../src/main"),
|
||||||
resourcePath: path.join(__dirname, "../../resources"),
|
resourcePath: path.join(__dirname, "../../resources"),
|
||||||
i18nPath: path.join(__dirname, "../../src/cider-i18n"),
|
|
||||||
i18nPathSrc: path.join(__dirname, "../../src/il8n/source"),
|
|
||||||
ciderCache: path.resolve(app.getPath("userData"), "CiderCache"),
|
ciderCache: path.resolve(app.getPath("userData"), "CiderCache"),
|
||||||
themes: path.resolve(app.getPath("userData"), "Themes"),
|
themes: path.resolve(app.getPath("userData"), "Themes"),
|
||||||
plugins: path.resolve(app.getPath("userData"), "Plugins"),
|
plugins: path.resolve(app.getPath("userData"), "Plugins"),
|
||||||
|
@ -102,6 +104,11 @@ export class utils {
|
||||||
return await fetch(url, opts);
|
return await fetch(url, opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async initializeTranslations() {
|
||||||
|
this.i18n = await this.crowdinClient.getTranslations()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the i18n locale for the given language.
|
* Fetches the i18n locale for the given language.
|
||||||
* @param language {string} The language to fetch the locale for.
|
* @param language {string} The language to fetch the locale for.
|
||||||
|
@ -109,23 +116,12 @@ export class utils {
|
||||||
* @returns {string | Object} The locale value.
|
* @returns {string | Object} The locale value.
|
||||||
*/
|
*/
|
||||||
static getLocale(language: string, key?: string): string | object {
|
static getLocale(language: string, key?: string): string | object {
|
||||||
let i18n: { [index: string]: Object } = JSON.parse(fs.readFileSync(path.join(this.paths.i18nPath, "en_US.json"), "utf8"));
|
let i18n: any = {}
|
||||||
|
if (!this.i18n[language]) {
|
||||||
if (language !== "en_US" && fs.existsSync(path.join(this.paths.i18nPath, `${language}.json`))) {
|
i18n = this.i18n["en"][0].content;
|
||||||
i18n = Object.assign(i18n, JSON.parse(fs.readFileSync(path.join(this.paths.i18nPath, `${language}.json`), "utf8")));
|
} else {
|
||||||
|
i18n = this.i18n[language ?? "en"][0].content;
|
||||||
}
|
}
|
||||||
/* else if (!fs.existsSync(path.join(this.paths.i18nPath, `${language}.json`))) {
|
|
||||||
fetch(`https://raw.githubusercontent.com/ciderapp/Cider/main/src/i18n/${language}.json`)
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(res => {
|
|
||||||
if (res) {
|
|
||||||
i18n = Object.assign(i18n, res);
|
|
||||||
fs.writeFileSync(path.join(this.paths.i18nPath, `${language}.json`), JSON.stringify(res));
|
|
||||||
} else {
|
|
||||||
i18n = Object.assign(i18n, JSON.parse(fs.readFileSync(path.join(this.paths.i18nPath, `en_US.json`), "utf8")));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} */
|
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
return i18n[key];
|
return i18n[key];
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { Plugins } from "./base/plugins";
|
||||||
import { BrowserWindow } from "./base/browserwindow";
|
import { BrowserWindow } from "./base/browserwindow";
|
||||||
import { init as Sentry } from "@sentry/electron";
|
import { init as Sentry } from "@sentry/electron";
|
||||||
import { RewriteFrames } from "@sentry/integrations";
|
import { RewriteFrames } from "@sentry/integrations";
|
||||||
|
import { utils } from "./base/utils";
|
||||||
|
|
||||||
if (!app.isPackaged) {
|
if (!app.isPackaged) {
|
||||||
app.setPath("userData", join(app.getPath("appData"), "Cider"));
|
app.setPath("userData", join(app.getPath("appData"), "Cider"));
|
||||||
|
@ -30,8 +31,8 @@ const CiderPlug = new Plugins();
|
||||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
* App Event Handlers
|
* App Event Handlers
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||||
|
app.on("ready", async () => {
|
||||||
app.on("ready", () => {
|
await utils.initializeTranslations()
|
||||||
Cider.ready(CiderPlug);
|
Cider.ready(CiderPlug);
|
||||||
|
|
||||||
console.log("[Cider] Application is Ready. Creating Window.");
|
console.log("[Cider] Application is Ready. Creating Window.");
|
||||||
|
@ -39,9 +40,10 @@ app.on("ready", () => {
|
||||||
console.info("[Cider] Running in development mode.");
|
console.info("[Cider] Running in development mode.");
|
||||||
require("vue-devtools").install();
|
require("vue-devtools").install();
|
||||||
}
|
}
|
||||||
|
console.log("aa")
|
||||||
components.whenReady().then(async () => {
|
components.whenReady().then(async () => {
|
||||||
const bw = new BrowserWindow();
|
const bw = new BrowserWindow();
|
||||||
|
console.log("[Cider] Creating Window.")
|
||||||
const win = await bw.createWindow();
|
const win = await bw.createWindow();
|
||||||
|
|
||||||
app.getGPUInfo("complete").then((gpuInfo) => {
|
app.getGPUInfo("complete").then((gpuInfo) => {
|
||||||
|
@ -110,3 +112,4 @@ app.on("widevine-error", (error) => {
|
||||||
console.log("[Cider][Widevine] Widevine installation encountered an error: " + error);
|
console.log("[Cider][Widevine] Widevine installation encountered an error: " + error);
|
||||||
app.exit();
|
app.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -18,28 +18,45 @@ export default class Thumbar {
|
||||||
|
|
||||||
private isNotMac: boolean = process.platform !== "darwin";
|
private isNotMac: boolean = process.platform !== "darwin";
|
||||||
private isMac: boolean = process.platform === "darwin";
|
private isMac: boolean = process.platform === "darwin";
|
||||||
private _menuTemplate: any = [
|
private _menuTemplate: any = []
|
||||||
{
|
|
||||||
label: app.getName(),
|
/*******************************************************************************************
|
||||||
submenu: [
|
* Public Methods
|
||||||
{
|
* ****************************************************************************************/
|
||||||
label: `${utils.getLocale(utils.getStoreValue("general.language"), "term.about")} ${app.getName()}`,
|
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('about')`),
|
/**
|
||||||
},
|
* Runs on plugin load (Currently run on application start)
|
||||||
{ type: "separator" },
|
*/
|
||||||
{
|
constructor(_utils: utils) {
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.toggleprivate"),
|
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
||||||
accelerator: utils.getStoreValue("general.keybindings.togglePrivateSession").join("+"),
|
}
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`),
|
|
||||||
},
|
/**
|
||||||
{
|
* Runs on app ready
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.settings"),
|
*/
|
||||||
accelerator: utils.getStoreValue("general.keybindings.settings").join("+"),
|
onReady(_win: Electron.BrowserWindow): void {
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.openSettingsPage()`),
|
this._menuTemplate = [
|
||||||
},
|
{
|
||||||
...(this.isMac ? [{ type: "separator" }, { role: "services" }, { type: "separator" }, { role: "hide" }, { role: "hideOthers" }, { role: "unhide" }, { type: "separator" }, { role: "quit" }] : []),
|
label: app.getName(),
|
||||||
...(this.isNotMac
|
submenu: [
|
||||||
? [
|
{
|
||||||
|
label: `${utils.getLocale(utils.getStoreValue("general.language"), "term.about")} ${app.getName()}`,
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('about')`),
|
||||||
|
},
|
||||||
|
{ type: "separator" },
|
||||||
|
{
|
||||||
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.toggleprivate"),
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.togglePrivateSession").join("+"),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.settings"),
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.settings").join("+"),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.openSettingsPage()`),
|
||||||
|
},
|
||||||
|
...(this.isMac ? [{ type: "separator" }, { role: "services" }, { type: "separator" }, { role: "hide" }, { role: "hideOthers" }, { role: "unhide" }, { type: "separator" }, { role: "quit" }] : []),
|
||||||
|
...(this.isNotMac
|
||||||
|
? [
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.quit"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.quit"),
|
||||||
|
@ -47,62 +64,62 @@ export default class Thumbar {
|
||||||
click: () => app.quit(),
|
click: () => app.quit(),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.view"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.view"),
|
||||||
submenu: [
|
submenu: [
|
||||||
...(this.isMac ? [{ role: "reload" }, { role: "forceReload" }, { role: "toggleDevTools" }, { type: "separator" }, { role: "resetZoom" }, { role: "zoomIn" }, { role: "zoomOut" }, { type: "separator" }, { role: "togglefullscreen" }, { type: "separator" }] : []),
|
...(this.isMac ? [{ role: "reload" }, { role: "forceReload" }, { role: "toggleDevTools" }, { type: "separator" }, { role: "resetZoom" }, { role: "zoomIn" }, { role: "zoomOut" }, { type: "separator" }, { role: "togglefullscreen" }, { type: "separator" }] : []),
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.search"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.search"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.search").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.search").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript("app.focusSearch()"),
|
click: () => utils.getWindow().webContents.executeJavaScript("app.focusSearch()"),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.listenNow"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.listenNow"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.listnow").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.listnow").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('listen_now')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('listen_now')`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.browse"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.browse"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.browse").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.browse").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('browse')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('browse')`),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.recentlyAdded"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.recentlyAdded"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.recentAdd").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.recentAdd").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-recentlyadded')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-recentlyadded')`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.songs"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.songs"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.songs").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.songs").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-songs')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-songs')`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.albums"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.albums"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.albums").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.albums").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-albums')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-albums')`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.artists"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.artists"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.artists").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.artists").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-artists')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-artists')`),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.window"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.window"),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
role: "minimize",
|
role: "minimize",
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.minimize"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.minimize"),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
...(this.isMac
|
...(this.isMac
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: "Show",
|
label: "Show",
|
||||||
click: () => utils.getWindow().show(),
|
click: () => utils.getWindow().show(),
|
||||||
|
@ -117,9 +134,9 @@ export default class Thumbar {
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
...(this.isNotMac
|
...(this.isNotMac
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.zoom"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.zoom"),
|
||||||
submenu: [
|
submenu: [
|
||||||
|
@ -164,142 +181,127 @@ export default class Thumbar {
|
||||||
role: "forceReload",
|
role: "forceReload",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.controls"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.controls"),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.playpause"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.playpause"),
|
||||||
accelerator: "Space",
|
accelerator: "Space",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.SpacePause()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.SpacePause()`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.next"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.next"),
|
||||||
accelerator: "CommandOrControl+Right",
|
accelerator: "CommandOrControl+Right",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.next()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.next()`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.previous"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.previous"),
|
||||||
accelerator: "CommandOrControl+Left",
|
accelerator: "CommandOrControl+Left",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.previous()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.previous()`),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.volumeup"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.volumeup"),
|
||||||
accelerator: "CommandOrControl+Up",
|
accelerator: "CommandOrControl+Up",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeUp()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeUp()`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.volumedown"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.volumedown"),
|
||||||
accelerator: "CommandOrControl+Down",
|
accelerator: "CommandOrControl+Down",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeDown()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeDown()`),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.cast2"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.cast2"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.castToDevices").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.castToDevices").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.castMenu = true`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.castMenu = true`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.webremote"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.webremote"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.webRemote").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.webRemote").join("+"),
|
||||||
sublabel: "Opens in external window",
|
sublabel: "Opens in external window",
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('remote-pair')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('remote-pair')`),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.audioSettings"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.audioSettings"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.audioSettings").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.audioSettings").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.audioSettings = true`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.audioSettings = true`),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.plugins"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.plugins"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.pluginMenu").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.pluginMenu").join("+"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.pluginMenu = true`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.pluginMenu = true`),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.account"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.account"),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.accountSettings"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.accountSettings"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('apple-account-settings')`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('apple-account-settings')`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.signout"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.signout"),
|
||||||
click: () => utils.getWindow().webContents.executeJavaScript(`app.unauthorize()`),
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.unauthorize()`),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.support"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.support"),
|
||||||
role: "help",
|
role: "help",
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.discord"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.discord"),
|
||||||
click: () => shell.openExternal("https://discord.gg/AppleMusic").catch(console.error),
|
click: () => shell.openExternal("https://discord.gg/AppleMusic").catch(console.error),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.github"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.github"),
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/wiki/Troubleshooting").catch(console.error),
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/wiki/Troubleshooting").catch(console.error),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.report"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.report"),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.bug"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.bug"),
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=bug%2Ctriage&template=bug_report.yaml&title=%5BBug%5D%3A+").catch(console.error),
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=bug%2Ctriage&template=bug_report.yaml&title=%5BBug%5D%3A+").catch(console.error),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.feature"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.feature"),
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/discussions/new?category=feature-request").catch(console.error),
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/discussions/new?category=feature-request").catch(console.error),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.trans"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.trans"),
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=%F0%9F%8C%90+Translations&template=translation.yaml&title=%5BTranslation%5D%3A+").catch(console.error),
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=%F0%9F%8C%90+Translations&template=translation.yaml&title=%5BTranslation%5D%3A+").catch(console.error),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.license"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.license"),
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/blob/main/LICENSE").catch(console.error),
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/blob/main/LICENSE").catch(console.error),
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.toggledevtools"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.toggledevtools"),
|
||||||
accelerator: utils.getStoreValue("general.keybindings.openDeveloperTools").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.openDeveloperTools").join("+"),
|
||||||
click: () => utils.getWindow().webContents.openDevTools(),
|
click: () => utils.getWindow().webContents.openDevTools(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.conf"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.conf"),
|
||||||
click: () => utils.getStoreInstance().openInEditor(),
|
click: () => utils.getStoreInstance().openInEditor(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/*******************************************************************************************
|
|
||||||
* Public Methods
|
|
||||||
* ****************************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs on plugin load (Currently run on application start)
|
|
||||||
*/
|
|
||||||
constructor(_utils: utils) {
|
|
||||||
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs on app ready
|
|
||||||
*/
|
|
||||||
onReady(_win: Electron.BrowserWindow): void {
|
|
||||||
const menu = Menu.buildFromTemplate(this._menuTemplate);
|
const menu = Menu.buildFromTemplate(this._menuTemplate);
|
||||||
Menu.setApplicationMenu(menu);
|
Menu.setApplicationMenu(menu);
|
||||||
}
|
}
|
||||||
|
@ -315,11 +317,11 @@ export default class Thumbar {
|
||||||
* Runs on playback State Change
|
* Runs on playback State Change
|
||||||
* @param attributes Music Attributes (attributes.status = current state)
|
* @param attributes Music Attributes (attributes.status = current state)
|
||||||
*/
|
*/
|
||||||
onPlaybackStateDidChange(attributes: object): void {}
|
onPlaybackStateDidChange(attributes: object): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs on song change
|
* Runs on song change
|
||||||
* @param attributes Music Attributes
|
* @param attributes Music Attributes
|
||||||
*/
|
*/
|
||||||
onNowPlayingItemDidChange(attributes: object): void {}
|
onNowPlayingItemDidChange(attributes: object): void { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ const app = new Vue({
|
||||||
pluginInstalled: false,
|
pluginInstalled: false,
|
||||||
pluginMenuEntries: [],
|
pluginMenuEntries: [],
|
||||||
pluginMenuTopEntries: [],
|
pluginMenuTopEntries: [],
|
||||||
lz: ipcRenderer.sendSync("get-i18n", "en_US"),
|
lz: ipcRenderer.sendSync("get-i18n", "en"),
|
||||||
lzListing: ipcRenderer.sendSync("get-i18n-listing"),
|
lzListing: ipcRenderer.sendSync("get-i18n-listing"),
|
||||||
radiohls: null,
|
radiohls: null,
|
||||||
search: {
|
search: {
|
||||||
|
|
30
yarn.lock
30
yarn.lock
|
@ -1347,6 +1347,15 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@crowdin/ota-client@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "@crowdin/ota-client@npm:1.0.0"
|
||||||
|
dependencies:
|
||||||
|
axios: ^1
|
||||||
|
checksum: b416632208cccf87235bd2ce7817c6b61c5069d626130f11e1034681ba9ff2ed6771f8b39e8a6afbde94f0274521cf1b2f5c02cc4dada31efe8881e5c9379952
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@develar/schema-utils@npm:~2.6.5":
|
"@develar/schema-utils@npm:~2.6.5":
|
||||||
version: 2.6.5
|
version: 2.6.5
|
||||||
resolution: "@develar/schema-utils@npm:2.6.5"
|
resolution: "@develar/schema-utils@npm:2.6.5"
|
||||||
|
@ -3286,6 +3295,17 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"axios@npm:^1":
|
||||||
|
version: 1.4.0
|
||||||
|
resolution: "axios@npm:1.4.0"
|
||||||
|
dependencies:
|
||||||
|
follow-redirects: ^1.15.0
|
||||||
|
form-data: ^4.0.0
|
||||||
|
proxy-from-env: ^1.1.0
|
||||||
|
checksum: 7fb6a4313bae7f45e89d62c70a800913c303df653f19eafec88e56cea2e3821066b8409bc68be1930ecca80e861c52aa787659df0ffec6ad4d451c7816b9386b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"axlsign@git+https://github.com/ciderapp/curve25519-js.git":
|
"axlsign@git+https://github.com/ciderapp/curve25519-js.git":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "axlsign@https://github.com/ciderapp/curve25519-js.git#commit=cae68782564b83ffa1c7c757e40a3944cb140290"
|
resolution: "axlsign@https://github.com/ciderapp/curve25519-js.git#commit=cae68782564b83ffa1c7c757e40a3944cb140290"
|
||||||
|
@ -3999,6 +4019,7 @@ __metadata:
|
||||||
resolution: "cider@workspace:."
|
resolution: "cider@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@achingbrain/ssdp": ^4.0.4
|
"@achingbrain/ssdp": ^4.0.4
|
||||||
|
"@crowdin/ota-client": ^1.0.0
|
||||||
"@sentry/electron": ^4.6.0
|
"@sentry/electron": ^4.6.0
|
||||||
"@sentry/integrations": ^7.54.0
|
"@sentry/integrations": ^7.54.0
|
||||||
"@types/adm-zip": ^0.5.0
|
"@types/adm-zip": ^0.5.0
|
||||||
|
@ -6062,7 +6083,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"follow-redirects@npm:^1.0.0":
|
"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.15.0":
|
||||||
version: 1.15.2
|
version: 1.15.2
|
||||||
resolution: "follow-redirects@npm:1.15.2"
|
resolution: "follow-redirects@npm:1.15.2"
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
|
@ -10080,6 +10101,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"proxy-from-env@npm:^1.1.0":
|
||||||
|
version: 1.1.0
|
||||||
|
resolution: "proxy-from-env@npm:1.1.0"
|
||||||
|
checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"prr@npm:~1.0.1":
|
"prr@npm:~1.0.1":
|
||||||
version: 1.0.1
|
version: 1.0.1
|
||||||
resolution: "prr@npm:1.0.1"
|
resolution: "prr@npm:1.0.1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue