Merge branch 'main' into feature/albumhero

This commit is contained in:
SoNothing 2022-06-24 16:01:04 +08:00
commit e6ffb2af8c
No known key found for this signature in database
GPG key ID: 89EFF63E1DBC0176
11 changed files with 93 additions and 60 deletions

View file

@ -386,5 +386,13 @@
"term.track": { "term.track": {
"one": "Titel", "one": "Titel",
"other": "Titel" "other": "Titel"
} },
"settings.option.visual.customAccentColor": "Benutzerdefinierte Akzentfarbe",
"settings.option.visual.accentColor": "Akzentfarbe",
"settings.option.visual.purplePodcastPlaybackBar": "Lila Wiedergabeleiste für Podcasts",
"settings.option.visual.windowColor": "Fenstertönung Farbe",
"action.cut": "Ausschneiden",
"action.paste": "Einfügen",
"action.selectAll": "Alles auswählen",
"action.delete": "Löschen"
} }

View file

@ -156,14 +156,14 @@ export class Store {
"dBSPL": false, "dBSPL": false,
"dBSPLcalibration": 90, "dBSPLcalibration": 90,
"maikiwiAudio": { "maikiwiAudio": {
"ciderPPE": false, "ciderPPE": true,
"ciderPPE_value": "MAIKIWI", "ciderPPE_value": "MAIKIWI",
"atmosphereRealizer1": false, "atmosphereRealizer1": false,
"atmosphereRealizer1_value": "NATURAL_STANDARD", "atmosphereRealizer1_value": "NATURAL_STANDARD",
"atmosphereRealizer2": false, "atmosphereRealizer2": false,
"atmosphereRealizer2_value": "NATURAL_STANDARD", "atmosphereRealizer2_value": "NATURAL_STANDARD",
"spatial": false, "spatial": false,
"spatialProfile": "71_420maikiwi", "spatialProfile": "BPLK",
"vibrantBass": { // Hard coded into the app. Don't include any of this config into exporting presets in store.ts "vibrantBass": { // Hard coded into the app. Don't include any of this config into exporting presets in store.ts
'frequencies': [17.182, 42.169, 53.763, 112.69, 119.65, 264.59, 336.57, 400.65, 505.48, 612.7, 838.7, 1155.3, 1175.6, 3406.8, 5158.6, 5968.1, 6999.9, 7468.6, 8862.9, 9666, 10109], 'frequencies': [17.182, 42.169, 53.763, 112.69, 119.65, 264.59, 336.57, 400.65, 505.48, 612.7, 838.7, 1155.3, 1175.6, 3406.8, 5158.6, 5968.1, 6999.9, 7468.6, 8862.9, 9666, 10109],
'Q': [2.5, 0.388, 5, 5, 2.5, 7.071, 14.14, 10, 7.071, 14.14, 8.409, 0.372, 7.071, 10, 16.82, 7.071, 28.28, 20, 8.409, 40, 40], 'Q': [2.5, 0.388, 5, 5, 2.5, 7.071, 14.14, 10, 7.071, 14.14, 8.409, 0.372, 7.071, 10, 16.82, 7.071, 28.28, 20, 8.409, 40, 40],

View file

@ -24,7 +24,7 @@ const Events = {
// CTRL + R // CTRL + R
if (event.keyCode === 82 && event.ctrlKey) { if (event.keyCode === 82 && event.ctrlKey) {
event.preventDefault() event.preventDefault()
bootbox.confirm(app.getLz('term.reload'), (res)=>{ app.confirm(app.getLz('term.reload'), (res)=>{
if (res) { if (res) {
window.location.reload() window.location.reload()
} }

View file

@ -1173,7 +1173,7 @@ const app = new Vue({
} }
}, },
unauthorize() { unauthorize() {
bootbox.confirm(app.getLz('term.confirmLogout'), function (result) { this.confirm(app.getLz('term.confirmLogout'), function (result) {
if (result) { if (result) {
app.mk.unauthorize() app.mk.unauthorize()
document.location.reload() document.location.reload()
@ -1554,7 +1554,8 @@ const app = new Vue({
}, },
deletePlaylist(id) { deletePlaylist(id) {
let self = this let self = this
if (confirm(app.getLz('term.deletePlaylist'))) { this.confirm(app.getLz('term.deletePlaylist'), (ok) => {
if (ok) {
app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, {}, { app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, {}, {
fetchOptions: { fetchOptions: {
method: "DELETE" method: "DELETE"
@ -1570,6 +1571,7 @@ const app = new Vue({
}, 8000); }, 8000);
}) })
} }
});
}, },
/** /**
* @param {string} url, href for the initial request * @param {string} url, href for the initial request
@ -4624,6 +4626,29 @@ const app = new Vue({
app.mk._services.mediaItemPlayback._currentPlayer._playAssetURL(src, false) app.mk._services.mediaItemPlayback._currentPlayer._playAssetURL(src, false)
} }
} }
},
confirm(message, callback) {
bootbox.confirm(this.getBootboxParams(null, message, callback));
},
prompt(title, callback) {
bootbox.prompt(this.getBootboxParams(title, null, callback));
},
getBootboxParams(title, message, callback) {
return {
title: title,
message: message,
buttons: {
confirm: {
label: app.getLz('dialog.ok'),
},
cancel: {
label: app.getLz('dialog.cancel'),
},
},
callback: function (result) {
if (callback) callback(result);
},
}
} }
} }
}) })

View file

@ -280,7 +280,7 @@
}, },
deletePreset() { deletePreset() {
let presets = this.$root.cfg.audio.equalizer.presets let presets = this.$root.cfg.audio.equalizer.presets
bootbox.confirm(app.getLz('term.deletepreset.warn'), (result) => { app.confirm(app.getLz('term.deletepreset.warn'), (result) => {
if (result) { if (result) {
this.changePreset("default") this.changePreset("default")
// find the preset by id (preset) and remove it // find the preset by id (preset) and remove it
@ -351,7 +351,7 @@
}, },
addPreset() { addPreset() {
let self = this let self = this
bootbox.prompt(app.getLz('term.newpreset.name'), (res) => { app.prompt(app.getLz('term.newpreset.name'), (res) => {
if (res) { if (res) {
let eqSettings = Clone(app.cfg.audio.equalizer) let eqSettings = Clone(app.cfg.audio.equalizer)
let newPreset = new self.eqPreset() let newPreset = new self.eqPreset()
@ -386,7 +386,7 @@
}, },
importPreset() { importPreset() {
let self = this let self = this
bootbox.prompt("Enter preset share code", (res) => { app.prompt("Enter preset share code", (res) => {
if (res) { if (res) {
let preset = JSON.parse(atob(res)) let preset = JSON.parse(atob(res))
if (preset.frequencies && preset.gain && preset.Q && preset.mix && preset.vibrantBass) { if (preset.frequencies && preset.gain && preset.Q && preset.mix && preset.vibrantBass) {

View file

@ -542,14 +542,14 @@
let followAction = "follow" let followAction = "follow"
let followActions = { let followActions = {
follow: { follow: {
icon: "./assets/feather/plus-circle.svg", icon: "./assets/star.svg",
name: app.getLz('action.favorite'), name: app.getLz('action.favorite'),
action: () => { action: () => {
self.$root.setArtistFavorite(this.item.id, true) self.$root.setArtistFavorite(this.item.id, true)
} }
}, },
unfollow: { unfollow: {
icon: "./assets/feather/x-circle.svg", icon: "./assets/star.svg",
name: app.getLz('action.removeFavorite'), name: app.getLz('action.removeFavorite'),
action: () => { action: () => {
self.$root.setArtistFavorite(this.item.id, false) self.$root.setArtistFavorite(this.item.id, false)

View file

@ -244,7 +244,7 @@
name: app.getLz("settings.option.visual.theme.uninstall"), name: app.getLz("settings.option.visual.theme.uninstall"),
disabled: true, disabled: true,
action: () => { action: () => {
bootbox.confirm(app.stringTemplateParser(app.getLz("settings.prompt.visual.theme.uninstallTheme"), { app.confirm(app.stringTemplateParser(app.getLz("settings.prompt.visual.theme.uninstallTheme"), {
theme: theme.name ?? theme.file theme: theme.name ?? theme.file
}), (res) => { }), (res) => {
if (res) { if (res) {
@ -317,7 +317,7 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), { let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), {
repo: repo.full_name repo: repo.full_name
}); });
bootbox.confirm(msg, (res) => { app.confirm(msg, (res) => {
if (res) { if (res) {
ipcRenderer.once("theme-installed", (event, arg) => { ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) { if (arg.success) {
@ -334,7 +334,7 @@
}, },
installThemeURL() { installThemeURL() {
let self = this let self = this
bootbox.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => { app.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
if (result) { if (result) {
ipcRenderer.once("theme-installed", (event, arg) => { ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) { if (arg.success) {

View file

@ -265,7 +265,7 @@
document.body.removeChild(blur); document.body.removeChild(blur);
clearTimeout(keyBindTimeout); clearTimeout(keyBindTimeout);
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success')); notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => { app.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
if (ok) ipcRenderer.invoke("relaunchApp") if (ok) ipcRenderer.invoke("relaunchApp")
}) })
} else { } else {
@ -296,7 +296,7 @@
app.cfg.general.keybindings.zoomrst = [app.platform == "darwin" ? "Command" : "Control", "num0"]; app.cfg.general.keybindings.zoomrst = [app.platform == "darwin" ? "Command" : "Control", "num0"];
app.cfg.general.keybindings.openDeveloperTools = [app.platform == "darwin" ? "Command" : "Control", app.platform == "darwin" ? "Option" : "Shift", "I"]; app.cfg.general.keybindings.openDeveloperTools = [app.platform == "darwin" ? "Command" : "Control", app.platform == "darwin" ? "Option" : "Shift", "I"];
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success')); notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => { app.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
if (ok) ipcRenderer.invoke("relaunchApp") if (ok) ipcRenderer.invoke("relaunchApp")
}) })
}, },

View file

@ -125,13 +125,13 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.plugin.github.install.confirm'), { let msg = app.stringTemplateParser(app.getLz('settings.option.visual.plugin.github.install.confirm'), {
repo: repo.full_name repo: repo.full_name
}); });
bootbox.confirm(msg, (res) => { app.confirm(msg, (res) => {
if (res) { if (res) {
ipcRenderer.once("plugin-installed", (event, arg) => { ipcRenderer.once("plugin-installed", (event, arg) => {
if (arg.success) { if (arg.success) {
self.themes = [] self.themes = []
notyf.success(app.getLz('settings.notyf.visual.plugin.install.success')); notyf.success(app.getLz('settings.notyf.visual.plugin.install.success'));
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{ app.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if (ok) { if (ok) {
ipcRenderer.invoke("relaunchApp") ipcRenderer.invoke("relaunchApp")
} else { } else {
@ -148,12 +148,12 @@
}, },
installThemeURL() { installThemeURL() {
let self = this let self = this
bootbox.prompt(app.getLz('settings.prompt.visual.plugin.github.URL'), (result) => { app.prompt(app.getLz('settings.prompt.visual.plugin.github.URL'), (result) => {
if (result) { if (result) {
ipcRenderer.once("plugin-installed", (event, arg) => { ipcRenderer.once("plugin-installed", (event, arg) => {
if (arg.success) { if (arg.success) {
self.themes = ipcRenderer.sendSync("get-themes") self.themes = ipcRenderer.sendSync("get-themes")
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{ app.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if (ok) { if (ok) {
ipcRenderer.invoke("relaunchApp") ipcRenderer.invoke("relaunchApp")
} else { } else {

View file

@ -1407,7 +1407,7 @@
} }
}, },
reinstallWidevineCDM() { reinstallWidevineCDM() {
bootbox.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => { app.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => {
if (ok) { if (ok) {
ipcRenderer.invoke("reinstall-widevine-cdm"); ipcRenderer.invoke("reinstall-widevine-cdm");
} }
@ -1450,7 +1450,7 @@
toggleAudioContext: function () { toggleAudioContext: function () {
if (app.cfg.advanced.AudioContext === true) { if (app.cfg.advanced.AudioContext === true) {
if (navigator.hardwareConcurrency < 6) { if (navigator.hardwareConcurrency < 6) {
bootbox.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) { app.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) {
if (result) { if (result) {
CiderAudio.init(); CiderAudio.init();
if (app.cfg.audio.normalization === true) { if (app.cfg.audio.normalization === true) {
@ -1497,7 +1497,7 @@
}, },
promptForRelaunch() { promptForRelaunch() {
bootbox.confirm(app.getLz('action.relaunch.confirm'), function (result) { app.confirm(app.getLz('action.relaunch.confirm'), function (result) {
if (result) { if (result) {
ipcRenderer.send('relaunchApp', ''); ipcRenderer.send('relaunchApp', '');
} }

View file

@ -146,7 +146,7 @@
let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), { let msg = app.stringTemplateParser(app.getLz('settings.option.visual.theme.github.install.confirm'), {
repo: repo.full_name repo: repo.full_name
}); });
bootbox.confirm(msg, (res) => { app.confirm(msg, (res) => {
if (res) { if (res) {
ipcRenderer.once("theme-installed", (event, arg) => { ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) { if (arg.success) {
@ -163,7 +163,7 @@
}, },
installThemeURL() { installThemeURL() {
let self = this let self = this
bootbox.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => { app.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
if (result) { if (result) {
ipcRenderer.once("theme-installed", (event, arg) => { ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) { if (arg.success) {