fix some conflicts, updated routes to settings

This commit is contained in:
booploops 2022-06-28 01:49:30 -07:00
parent f71ca88298
commit 9320b7f412
6 changed files with 55 additions and 30 deletions

View file

@ -37,7 +37,7 @@ export default class Thumbar {
{ {
label: utils.getLocale(utils.getStoreValue('general.language'), 'term.settings'), label: utils.getLocale(utils.getStoreValue('general.language'), 'term.settings'),
accelerator: utils.getStoreValue("general.keybindings.settings").join('+'), accelerator: utils.getStoreValue("general.keybindings.settings").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('settings')`) click: () => utils.getWindow().webContents.executeJavaScript(`app.openSettingsPage()`)
}, },
...(this.isMac ? [ ...(this.isMac ? [
{type: 'separator'}, {type: 'separator'},

View file

@ -928,10 +928,10 @@ const app = new Vue({
app.mk.nowPlayingItem.attributes.name = e.title app.mk.nowPlayingItem.attributes.name = e.title
app.mk.nowPlayingItem.attributes.artistName = e.performer app.mk.nowPlayingItem.attributes.artistName = e.performer
app.mk.nowPlayingItem.attributes.albumName = e.album app.mk.nowPlayingItem.attributes.albumName = e.album
if(e.links[1]) { if (e.links[1]) {
app.currentArtUrl = e.links[1].url app.currentArtUrl = e.links[1].url
app.currentArtUrlRaw = e.links[1].url app.currentArtUrlRaw = e.links[1].url
}else{ } else {
app.currentArtUrl = e.links[0].url app.currentArtUrl = e.links[0].url
app.currentArtUrlRaw = e.links[0].url app.currentArtUrlRaw = e.links[0].url
} }
@ -944,7 +944,7 @@ const app = new Vue({
self.$refs.queue.updateQueue(); self.$refs.queue.updateQueue();
} }
this.currentSongInfo = a this.currentSongInfo = a
if (this.currentSongInfo === null || this.currentSongInfo === undefined) {return;} // EVIL EMPTY OBJECTS BE GONE if (this.currentSongInfo === null || this.currentSongInfo === undefined) { return; } // EVIL EMPTY OBJECTS BE GONE
console.debug("songinfo: " + JSON.stringify(a)) console.debug("songinfo: " + JSON.stringify(a))
if (app.cfg.advanced.AudioContext) { if (app.cfg.advanced.AudioContext) {
@ -959,7 +959,7 @@ const app = new Vue({
} catch (e) { } catch (e) {
localStorage.setItem("playingBitrate", "256") localStorage.setItem("playingBitrate", "256")
} }
if (!app.cfg.audio.normalization) {CiderAudio.hierarchical_loading();} if (!app.cfg.audio.normalization) { CiderAudio.hierarchical_loading(); }
} }
@ -976,16 +976,16 @@ const app = new Vue({
previewURL = response.data.data[0].attributes.previews[0].url previewURL = response.data.data[0].attributes.previews[0].url
if (previewURL) if (previewURL)
console.debug("[Cider][MaikiwiSoundCheck] previewURL response.data.data[0].attributes.previews[0].url: " + previewURL) console.debug("[Cider][MaikiwiSoundCheck] previewURL response.data.data[0].attributes.previews[0].url: " + previewURL)
ipcRenderer.send('getPreviewURL', previewURL) ipcRenderer.send('getPreviewURL', previewURL)
}) })
} else { } else {
if (previewURL) if (previewURL)
console.debug("[Cider][MaikiwiSoundCheck] previewURL in app.mk.nowPlayingItem.previewURL: " + previewURL) console.debug("[Cider][MaikiwiSoundCheck] previewURL in app.mk.nowPlayingItem.previewURL: " + previewURL)
ipcRenderer.send('getPreviewURL', previewURL) ipcRenderer.send('getPreviewURL', previewURL)
} }
} catch (e) { } catch (e) {
if (e instanceof TypeError === false) {console.debug("[Cider][MaikiwiSoundCheck] normalizer function err: " + e)} if (e instanceof TypeError === false) { console.debug("[Cider][MaikiwiSoundCheck] normalizer function err: " + e) }
} }
} }
@ -1300,7 +1300,7 @@ const app = new Vue({
results.forEach(result => { results.forEach(result => {
try { try {
if (result.relationships?.catalog?.data[0]?.attributes?.inFavorites) { if (result.relationships?.catalog?.data[0]?.attributes?.inFavorites) {
if(!favs.includes(result.relationships?.catalog?.data[0].id)) { if (!favs.includes(result.relationships?.catalog?.data[0].id)) {
favs.push(result.relationships?.catalog?.data[0].id) favs.push(result.relationships?.catalog?.data[0].id)
} }
} }
@ -1313,8 +1313,8 @@ const app = new Vue({
return favs return favs
}, },
async setArtistFavorite(id, val = true) { async setArtistFavorite(id, val = true) {
if(val) { if (val) {
if(!app.cfg.home.followedArtists.includes(id)) { if (!app.cfg.home.followedArtists.includes(id)) {
app.cfg.home.followedArtists.push(id) app.cfg.home.followedArtists.push(id)
} }
await app.mk.api.v3.music(`/v1/me/favorites`, { await app.mk.api.v3.music(`/v1/me/favorites`, {
@ -1327,8 +1327,8 @@ const app = new Vue({
method: "POST" method: "POST"
} }
}) })
}else{ } else {
if(app.cfg.home.followedArtists.includes(id)) { if (app.cfg.home.followedArtists.includes(id)) {
app.cfg.home.followedArtists.splice(app.cfg.home.followedArtists.indexOf(id), 1) app.cfg.home.followedArtists.splice(app.cfg.home.followedArtists.indexOf(id), 1)
} }
await app.mk.api.v3.music(`/v1/me/favorites`, { await app.mk.api.v3.music(`/v1/me/favorites`, {
@ -1460,7 +1460,7 @@ const app = new Vue({
}, },
{ {
name: app.getLz("action.refresh"), name: app.getLz("action.refresh"),
action: ()=>{ action: () => {
this.refreshPlaylists() this.refreshPlaylists()
} }
} }
@ -2018,8 +2018,8 @@ const app = new Vue({
async getNowPlayingItemDetailed(target) { async getNowPlayingItemDetailed(target) {
let nowPlayingItem = JSON.parse(JSON.stringify(this.mk.nowPlayingItem)) let nowPlayingItem = JSON.parse(JSON.stringify(this.mk.nowPlayingItem))
if(nowPlayingItem.type === "radioStation" && app.mk.nowPlayingItem.id !== -1) { if (nowPlayingItem.type === "radioStation" && app.mk.nowPlayingItem.id !== -1) {
nowPlayingItem.playParams = {kind: "songs"} nowPlayingItem.playParams = { kind: "songs" }
nowPlayingItem.attributes.playParams.catalogId = app.mk.nowPlayingItem.id nowPlayingItem.attributes.playParams.catalogId = app.mk.nowPlayingItem.id
nowPlayingItem.attributes.playParams.id = app.mk.nowPlayingItem.id nowPlayingItem.attributes.playParams.id = app.mk.nowPlayingItem.id
nowPlayingItem.id = app.mk.nowPlayingItem.id nowPlayingItem.id = app.mk.nowPlayingItem.id
@ -4331,8 +4331,7 @@ const app = new Vue({
"name": app.getLz('settings.option.audio.audioLab'), "name": app.getLz('settings.option.audio.audioLab'),
"hidden": true, "hidden": true,
"action": function () { "action": function () {
app.$store.state.pageState.settings.currentTabIndex = 2 app.openSettingsPage('audiolabs')
app.modals.settings = true
} }
}, },
] ]
@ -4358,7 +4357,7 @@ const app = new Vue({
try { try {
// if its a radio station, then change the attributes to match a song // if its a radio station, then change the attributes to match a song
const nowPlayingItem = JSON.parse(JSON.stringify(this.mk.nowPlayingItem)) const nowPlayingItem = JSON.parse(JSON.stringify(this.mk.nowPlayingItem))
if(nowPlayingItem.type == "radioStation" && app.mk.nowPlayingItem.id != -1) { if (nowPlayingItem.type == "radioStation" && app.mk.nowPlayingItem.id != -1) {
nowPlayingItem.type = "song" nowPlayingItem.type = "song"
nowPlayingItem.attributes.playParams.catalogId = app.mk.nowPlayingItem.id nowPlayingItem.attributes.playParams.catalogId = app.mk.nowPlayingItem.id
nowPlayingItem.attributes.playParams.id = app.mk.nowPlayingItem.id nowPlayingItem.attributes.playParams.id = app.mk.nowPlayingItem.id
@ -4391,6 +4390,32 @@ const app = new Vue({
} }
}, },
openSettingsPage(page) {
switch (page) {
case "general":
this.$store.state.pageState.settings.currentTabIndex = 0
break;
case "audio":
this.$store.state.pageState.settings.currentTabIndex = 1
break;
case "audiolabs":
this.$store.state.pageState.settings.currentTabIndex = 2
break;
case "visual":
this.$store.state.pageState.settings.currentTabIndex = 3
break;
case "lyrics":
this.$store.state.pageState.settings.currentTabIndex = 4
break;
case "connectivity":
this.$store.state.pageState.settings.currentTabIndex = 5
break;
case "advanced":
this.$store.state.pageState.settings.currentTabIndex = 6
break;
}
app.modals.settings = true
},
LastFMDeauthorize() { LastFMDeauthorize() {
ipcRenderer.invoke('setStoreValue', 'lastfm.enabled', false).catch((e) => console.error(e)); ipcRenderer.invoke('setStoreValue', 'lastfm.enabled', false).catch((e) => console.error(e));
ipcRenderer.invoke('setStoreValue', 'lastfm.auth_token', '').catch((e) => console.error(e)); ipcRenderer.invoke('setStoreValue', 'lastfm.auth_token', '').catch((e) => console.error(e));
@ -4649,7 +4674,7 @@ const app = new Vue({
label: app.getLz('dialog.ok'), label: app.getLz('dialog.ok'),
}, },
cancel: { cancel: {
label: app.getLz('dialog.cancel'), label: app.getLz('dialog.cancel'),
}, },
}, },
callback: function (result) { callback: function (result) {

View file

@ -1,10 +1,10 @@
<script type="text/x-template" id="audio-controls"> <script type="text/x-template" id="audio-controls">
<div class="modal-fullscreen addtoplaylist-panel" @click.self="app.resetState()" <div class="modal-fullscreen addtoplaylist-panel" @click.self="app.modals.audioControls = false"
@contextmenu.self="app.resetState()"> @contextmenu.self="app.modals.audioControls = false">
<div class="modal-window"> <div class="modal-window">
<div class="modal-header"> <div class="modal-header">
<div class="modal-title">{{app.getLz('term.audioControls')}}</div> <div class="modal-title">{{app.getLz('term.audioControls')}}</div>
<button class="close-btn" @click="app.resetState()" :aria-label="app.getLz('action.close')"></button> <button class="close-btn" @click="app.modals.audioControls = false" :aria-label="app.getLz('action.close')"></button>
</div> </div>
<div class="modal-content"> <div class="modal-content">
<div class="md-option-line"> <div class="md-option-line">

View file

@ -1,10 +1,10 @@
<script type="text/x-template" id="audio-playbackrate"> <script type="text/x-template" id="audio-playbackrate">
<div class="modal-fullscreen addtoplaylist-panel" @click.self="app.resetState()" <div class="modal-fullscreen addtoplaylist-panel" @click.self="app.modals.audioPlaybackRate = false"
@contextmenu.self="app.resetState()"> @contextmenu.self="app.modals.audioPlaybackRate = false">
<div class="modal-window"> <div class="modal-window">
<div class="modal-header"> <div class="modal-header">
<div class="modal-title">{{app.getLz('settings.option.audio.changePlaybackRate')}}</div> <div class="modal-title">{{app.getLz('settings.option.audio.changePlaybackRate')}}</div>
<button class="close-btn" @click="app.resetState()" :aria-label="app.getLz('action.close')"></button> <button class="close-btn" @click="app.modals.audioPlaybackRate = false" :aria-label="app.getLz('action.close')"></button>
</div> </div>
<div class="modal-content"> <div class="modal-content">
<div class="md-option-line"> <div class="md-option-line">

View file

@ -1,10 +1,10 @@
<script type="text/x-template" id="audio-settings"> <script type="text/x-template" id="audio-settings">
<template> <template>
<div class="modal-fullscreen addtoplaylist-panel" @click.self="app.resetState()" @contextmenu.self="app.resetState()"> <div class="modal-fullscreen addtoplaylist-panel" @click.self="app.modals.audioSettings = false" @contextmenu.self="app.modals.audioSettings = false">
<div class="modal-window"> <div class="modal-window">
<div class="modal-header"> <div class="modal-header">
<div class="modal-title">{{app.getLz('term.audioSettings')}}</div> <div class="modal-title">{{app.getLz('term.audioSettings')}}</div>
<button class="close-btn" @click="app.resetState()" :aria-label="app.getLz('action.close')"></button> <button class="close-btn" @click="app.modals.audioSettings = false" :aria-label="app.getLz('action.close')"></button>
</div> </div>
<div class="modal-content"> <div class="modal-content">
<button class="playlist-item" <button class="playlist-item"
@ -23,7 +23,7 @@
<div class="name">{{app.getLz('settings.option.audio.changePlaybackRate')}}</div> <div class="name">{{app.getLz('settings.option.audio.changePlaybackRate')}}</div>
</button> </button>
<button class="playlist-item" <button class="playlist-item"
@click="$root.appRoute('audiolabs')" style="width:100%;"> @click="$root.openSettingsPage('audiolabs')" style="width:100%;">
<div class="icon"><%- include("../svg/speaker.svg") %></div> <div class="icon"><%- include("../svg/speaker.svg") %></div>
<div class="name">{{app.getLz('settings.option.audio.audioLab')}}</div> <div class="name">{{app.getLz('settings.option.audio.audioLab')}}</div>
</button> </button>

View file

@ -291,7 +291,7 @@
}) })
}, },
close() { close() {
app.resetState() app.modals.equalizer = false
}, },
changeVibrantBass() { changeVibrantBass() {
if (app.cfg.audio.equalizer.vibrantBass !== '0') { if (app.cfg.audio.equalizer.vibrantBass !== '0') {