commit
dfac4c5f2b
7 changed files with 382 additions and 353 deletions
|
@ -73,7 +73,6 @@
|
||||||
"term.viewAs": "Megjelenítés",
|
"term.viewAs": "Megjelenítés",
|
||||||
"term.viewAs.coverArt": "Borító",
|
"term.viewAs.coverArt": "Borító",
|
||||||
"term.viewAs.list": "Lista",
|
"term.viewAs.list": "Lista",
|
||||||
"term.dynamic": "Dinamikus",
|
|
||||||
"term.size": "Méret",
|
"term.size": "Méret",
|
||||||
"term.size.normal": "Normál",
|
"term.size.normal": "Normál",
|
||||||
"term.size.compact": "Kompakt",
|
"term.size.compact": "Kompakt",
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
"term.contributors": "貢獻者",
|
"term.contributors": "貢獻者",
|
||||||
"term.equalizer": "均衡器",
|
"term.equalizer": "均衡器",
|
||||||
"term.reset": "重設",
|
"term.reset": "重設",
|
||||||
"term.tracks": "首歌曲",
|
"term.tracks": "歌曲",
|
||||||
"term.videos": "MV",
|
"term.videos": "MV",
|
||||||
"term.menu": "選項",
|
"term.menu": "選項",
|
||||||
"term.check": "檢查",
|
"term.check": "檢查",
|
||||||
|
@ -225,6 +225,10 @@
|
||||||
"settings.option.general.resumebehavior.locally.description": "Cider 將還原你在這台電腦上的最後一次操作。",
|
"settings.option.general.resumebehavior.locally.description": "Cider 將還原你在這台電腦上的最後一次操作。",
|
||||||
"settings.option.general.resumebehavior.history": "歷史",
|
"settings.option.general.resumebehavior.history": "歷史",
|
||||||
"settings.option.general.resumebehavior.history.description": "Cider 將跨裝置將你的整個 Apple Music 歷史記錄中的最後一首歌曲排隊入列。",
|
"settings.option.general.resumebehavior.history.description": "Cider 將跨裝置將你的整個 Apple Music 歷史記錄中的最後一首歌曲排隊入列。",
|
||||||
|
"settings.option.general.resumetabs" : "啟動時打開的選項",
|
||||||
|
"settings.option.general.resumetabs.description" : "你可以選擇啟動 Cider 時要打開的選項。",
|
||||||
|
"settings.option.general.resumetabs.dynamic" : "動態",
|
||||||
|
"settings.option.general.resumetabs.dynamic.description" : "Cider 將打開你上次停留的選項。",
|
||||||
"settings.option.general.language": "語言",
|
"settings.option.general.language": "語言",
|
||||||
"settings.option.general.language.main": "語言",
|
"settings.option.general.language.main": "語言",
|
||||||
"settings.option.general.language.fun": "惡搞語言",
|
"settings.option.general.language.fun": "惡搞語言",
|
||||||
|
@ -236,6 +240,8 @@
|
||||||
"settings.option.general.updateCider.branch.develop": "測試",
|
"settings.option.general.updateCider.branch.develop": "測試",
|
||||||
"settings.option.general.customizeSidebar": "自訂側邊欄的功能",
|
"settings.option.general.customizeSidebar": "自訂側邊欄的功能",
|
||||||
"settings.option.general.customizeSidebar.customize": "自訂",
|
"settings.option.general.customizeSidebar.customize": "自訂",
|
||||||
|
"settings.option.general.keybindings": "快捷操作鍵",
|
||||||
|
"settings.option.general.keybindings.open": "開啟",
|
||||||
"settings.notyf.updateCider.update-not-available": "沒有可用的更新",
|
"settings.notyf.updateCider.update-not-available": "沒有可用的更新",
|
||||||
"settings.notyf.updateCider.update-downloaded": "更新已成功下載,重啟後進行更新",
|
"settings.notyf.updateCider.update-downloaded": "更新已成功下載,重啟後進行更新",
|
||||||
"settings.notyf.updateCider.update-error": "更新時,發生錯誤",
|
"settings.notyf.updateCider.update-error": "更新時,發生錯誤",
|
||||||
|
@ -281,6 +287,7 @@
|
||||||
"settings.option.audio.enableAdvancedFunctionality.tunedAudioSpatialization.profile.standard": "標準",
|
"settings.option.audio.enableAdvancedFunctionality.tunedAudioSpatialization.profile.standard": "標準",
|
||||||
"settings.option.audio.enableAdvancedFunctionality.tunedAudioSpatialization.profile.audiophile": "發燒友",
|
"settings.option.audio.enableAdvancedFunctionality.tunedAudioSpatialization.profile.audiophile": "發燒友",
|
||||||
"settings.warn.audio.enableAdvancedFunctionality.audioSpatialization.compatibility": "空間音訊無法與 CAP 相容,請關閉 CAP 再進行操作。",
|
"settings.warn.audio.enableAdvancedFunctionality.audioSpatialization.compatibility": "空間音訊無法與 CAP 相容,請關閉 CAP 再進行操作。",
|
||||||
|
"settings.option.visual.uiscale": "介面顯示大小",
|
||||||
"settings.header.visual": "外觀",
|
"settings.header.visual": "外觀",
|
||||||
"settings.header.visual.description": "調整 Cider 的外觀",
|
"settings.header.visual.description": "調整 Cider 的外觀",
|
||||||
"settings.option.visual.windowBackgroundStyle": "視窗背景樣式",
|
"settings.option.visual.windowBackgroundStyle": "視窗背景樣式",
|
||||||
|
@ -335,14 +342,18 @@
|
||||||
"settings.option.lyrics.enableMusixmatchKaraoke": "開啟卡拉OK模式(僅限Musixmatch)",
|
"settings.option.lyrics.enableMusixmatchKaraoke": "開啟卡拉OK模式(僅限Musixmatch)",
|
||||||
"settings.option.lyrics.musixmatchPreferredLanguage": "Musixmatch 歌詞語言偏好",
|
"settings.option.lyrics.musixmatchPreferredLanguage": "Musixmatch 歌詞語言偏好",
|
||||||
"settings.option.lyrics.enableYoutubeLyrics": "播放 MV 時,使用 YouTube 歌詞",
|
"settings.option.lyrics.enableYoutubeLyrics": "播放 MV 時,使用 YouTube 歌詞",
|
||||||
|
"settings.option.lyrics.enableQQLyrics": "開啟 QQ 音樂的歌詞",
|
||||||
"settings.header.connectivity": "外部連結",
|
"settings.header.connectivity": "外部連結",
|
||||||
"settings.header.connectivity.description": "調整 Cider 與外部的連結",
|
"settings.header.connectivity.description": "調整 Cider 與外部的連結",
|
||||||
"settings.option.connectivity.discordRPC": "Discord 狀態",
|
"settings.option.connectivity.discordRPC": "Discord 狀態",
|
||||||
"settings.option.connectivity.playbackNotifications": "播放通知",
|
"settings.option.connectivity.playbackNotifications": "播放通知",
|
||||||
|
"settings.option.connectivity.discordRPC.clientName": "應用程式名稱",
|
||||||
"settings.header.connectivity.discordRPC.cider": "顯示為'Cider'",
|
"settings.header.connectivity.discordRPC.cider": "顯示為'Cider'",
|
||||||
"settings.header.connectivity.discordRPC.appleMusic": "顯示為'Apple Music'",
|
"settings.header.connectivity.discordRPC.appleMusic": "顯示為'Apple Music'",
|
||||||
"settings.option.connectivity.discordRPC.clearOnPause": "暫停時清除 Discord 狀態",
|
"settings.option.connectivity.discordRPC.clearOnPause": "暫停時清除 Discord 狀態",
|
||||||
"settings.option.connectivity.discordRPC.hideButtons": "隱藏 Discord 狀態上的按鈕",
|
"settings.option.connectivity.discordRPC.hideButtons": "隱藏 Discord 狀態上的按鈕",
|
||||||
|
"settings.option.connectivity.discordRPC.detailsFormat": "詳細資訊格式",
|
||||||
|
"settings.option.connectivity.discordRPC.stateFormat": "狀態格式",
|
||||||
"settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling 記錄",
|
"settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling 記錄",
|
||||||
"settings.option.connectivity.lastfmScrobble.delay": "Last.fm Scrobble 延遲 (%)",
|
"settings.option.connectivity.lastfmScrobble.delay": "Last.fm Scrobble 延遲 (%)",
|
||||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "開啟 Last.fm 正在播放",
|
"settings.option.connectivity.lastfmScrobble.nowPlaying": "開啟 Last.fm 正在播放",
|
||||||
|
@ -366,6 +377,9 @@
|
||||||
"settings.option.visual.transparent": "透明視窗框架",
|
"settings.option.visual.transparent": "透明視窗框架",
|
||||||
"settings.option.visual.transparent.description": "需主題有支援透明框架,且須重新啟動才會套用。",
|
"settings.option.visual.transparent.description": "需主題有支援透明框架,且須重新啟動才會套用。",
|
||||||
"settings.header.advanced": "進階",
|
"settings.header.advanced": "進階",
|
||||||
|
"settings.header.connect": "同步",
|
||||||
|
"settings.option.connect.link_account": "開啟與 Cider Connect 同步",
|
||||||
|
"settings.option.connect.link_account.description": "將您的 Discord 帳戶與 Cider Connect 連接後,你可以儲存使用者資料,包括設定、等化器,並最終在完成後儲存更多資料。(正在進行中)",
|
||||||
"spatial.notTurnedOn": "請先在設定中開啟空間音訊。",
|
"spatial.notTurnedOn": "請先在設定中開啟空間音訊。",
|
||||||
"spatial.spatialProperties": "空間音訊屬性",
|
"spatial.spatialProperties": "空間音訊屬性",
|
||||||
"spatial.width": "闊度",
|
"spatial.width": "闊度",
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
height: var(--chromeHeight1);
|
height: var(--chromeHeight1);
|
||||||
|
|
||||||
&.chrome-bottom {
|
&.chrome-bottom {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
height : var(--chromeHeight2);
|
height : var(--chromeHeight2);
|
||||||
box-shadow: 0px -1px 0px rgba(0, 0, 0, 0.25);
|
box-shadow: 0px -1px 0px rgba(0, 0, 0, 0.25);
|
||||||
z-index : 1;
|
z-index : 1;
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
.app-playback-controls .actions {
|
.app-playback-controls .actions {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
|
||||||
.playback-button.play,
|
.playback-button.play,
|
||||||
.playback-button.pause {
|
.playback-button.pause {
|
||||||
|
@ -120,8 +122,9 @@
|
||||||
width : 30%;
|
width : 30%;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items : flex-start;
|
align-items : flex-start;
|
||||||
|
-webkit-app-region: no-drag!important;
|
||||||
.playback-controls {
|
.playback-controls {
|
||||||
|
-webkit-app-region: no-drag!important;
|
||||||
.artwork {
|
.artwork {
|
||||||
width : var(--chromeHeight2);
|
width : var(--chromeHeight2);
|
||||||
height : var(--chromeHeight2);
|
height : var(--chromeHeight2);
|
||||||
|
|
|
@ -234,7 +234,7 @@ const app = new Vue({
|
||||||
watch: {
|
watch: {
|
||||||
cfg: {
|
cfg: {
|
||||||
handler: function (val, oldVal) {
|
handler: function (val, oldVal) {
|
||||||
console.log(`cfg changed from ${oldVal} to ${val}`);
|
console.debug(`cfg changed from ${oldVal} to ${val}`);
|
||||||
ipcRenderer.send("setStore", val);
|
ipcRenderer.send("setStore", val);
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
|
@ -254,6 +254,12 @@ const app = new Vue({
|
||||||
app.resetState()
|
app.resetState()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
window.addEventListener("hashchange", function (event) {
|
||||||
|
let currentPath = window.location.hash.slice(1);
|
||||||
|
console.debug("hashchange", currentPath);
|
||||||
|
}, false)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setTimeout(func, time) {
|
setTimeout(func, time) {
|
||||||
return setTimeout(func, time);
|
return setTimeout(func, time);
|
||||||
|
@ -268,10 +274,10 @@ const app = new Vue({
|
||||||
if (httpRequest.readyState === 4) {
|
if (httpRequest.readyState === 4) {
|
||||||
if (httpRequest.status === 200) {
|
if (httpRequest.status === 200) {
|
||||||
let response = JSON.parse(httpRequest.responseText);
|
let response = JSON.parse(httpRequest.responseText);
|
||||||
console.log(response);
|
console.debug(response);
|
||||||
self.copyToClipboard(response.pageUrl)
|
self.copyToClipboard(response.pageUrl)
|
||||||
} else {
|
} else {
|
||||||
console.log('There was a problem with the request.');
|
console.warn('There was a problem with the request.');
|
||||||
notyf.error(app.getLz('term.requestError'))
|
notyf.error(app.getLz('term.requestError'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -940,7 +946,7 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async setTheme(theme = "", onlyPrefs = false) {
|
async setTheme(theme = "", onlyPrefs = false) {
|
||||||
console.log(theme)
|
console.debug(theme)
|
||||||
if (this.cfg.visual.theme == "") {
|
if (this.cfg.visual.theme == "") {
|
||||||
this.cfg.visual.theme = "default.less"
|
this.cfg.visual.theme = "default.less"
|
||||||
}
|
}
|
||||||
|
@ -1121,15 +1127,15 @@ const app = new Vue({
|
||||||
const cachedTrackMapping = await CiderCache.getCache("library-playlists-tracks")
|
const cachedTrackMapping = await CiderCache.getCache("library-playlists-tracks")
|
||||||
|
|
||||||
if (cachedPlaylist) {
|
if (cachedPlaylist) {
|
||||||
console.log("using cached playlists")
|
console.debug("using cached playlists")
|
||||||
this.playlists.listing = cachedPlaylist
|
this.playlists.listing = cachedPlaylist
|
||||||
self.sortPlaylists()
|
self.sortPlaylists()
|
||||||
} else {
|
} else {
|
||||||
console.log("playlist has no cache")
|
console.debug("playlist has no cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachedTrackMapping) {
|
if (cachedTrackMapping) {
|
||||||
console.log("using cached track mapping")
|
console.debug("using cached track mapping")
|
||||||
this.playlists.trackMapping = cachedTrackMapping
|
this.playlists.trackMapping = cachedTrackMapping
|
||||||
}
|
}
|
||||||
if (localOnly) {
|
if (localOnly) {
|
||||||
|
@ -1140,7 +1146,7 @@ const app = new Vue({
|
||||||
this.library.backgroundNotification.show = true
|
this.library.backgroundNotification.show = true
|
||||||
|
|
||||||
async function deepScan(parent = "p.playlistsroot") {
|
async function deepScan(parent = "p.playlistsroot") {
|
||||||
console.log(`scanning ${parent}`)
|
console.debug(`scanning ${parent}`)
|
||||||
const playlistData = await app.mk.api.v3.music(`/v1/me/library/playlist-folders/${parent}/children/`)
|
const playlistData = await app.mk.api.v3.music(`/v1/me/library/playlist-folders/${parent}/children/`)
|
||||||
await asyncForEach(playlistData.data.data, async (playlist) => {
|
await asyncForEach(playlistData.data.data, async (playlist) => {
|
||||||
playlist.parent = parent
|
playlist.parent = parent
|
||||||
|
@ -1259,7 +1265,7 @@ const app = new Vue({
|
||||||
// this.darwinShare(str)
|
// this.darwinShare(str)
|
||||||
// } else {
|
// } else {
|
||||||
notyf.success(app.getLz('term.share.success'))
|
notyf.success(app.getLz('term.share.success'))
|
||||||
navigator.clipboard.writeText(str).then(r => console.log("Copied to clipboard."))
|
navigator.clipboard.writeText(str).then(r => console.debug("Copied to clipboard."))
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
newPlaylist(name = app.getLz('term.newPlaylist'), tracks = []) {
|
newPlaylist(name = app.getLz('term.newPlaylist'), tracks = []) {
|
||||||
|
@ -1282,7 +1288,7 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
res = res.data.data[0]
|
res = res.data.data[0]
|
||||||
console.log(res)
|
console.debug(res)
|
||||||
self.appRoute(`playlist_` + res.id);
|
self.appRoute(`playlist_` + res.id);
|
||||||
self.showingPlaylist = [];
|
self.showingPlaylist = [];
|
||||||
self.getPlaylistFromID(app.page.substring(9), true)
|
self.getPlaylistFromID(app.page.substring(9), true)
|
||||||
|
@ -1317,7 +1323,7 @@ const app = new Vue({
|
||||||
},
|
},
|
||||||
async showCollection(response, title, type, requestBody = {}) {
|
async showCollection(response, title, type, requestBody = {}) {
|
||||||
let self = this
|
let self = this
|
||||||
console.log(response)
|
console.debug(response)
|
||||||
this.collectionList.requestBody = {}
|
this.collectionList.requestBody = {}
|
||||||
this.collectionList.response = response
|
this.collectionList.response = response
|
||||||
this.collectionList.title = title
|
this.collectionList.title = title
|
||||||
|
@ -1327,7 +1333,7 @@ const app = new Vue({
|
||||||
},
|
},
|
||||||
async showArtistView(artist, title, view) {
|
async showArtistView(artist, title, view) {
|
||||||
let response = (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artist}/view/${view}?l=${this.mklang}`, {}, { includeResponseMeta: !0 })).data
|
let response = (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artist}/view/${view}?l=${this.mklang}`, {}, { includeResponseMeta: !0 })).data
|
||||||
console.log(response)
|
console.debug(response)
|
||||||
await this.showCollection(response, title, "artists")
|
await this.showCollection(response, title, "artists")
|
||||||
},
|
},
|
||||||
async showRecordLabelView(label, title, view) {
|
async showRecordLabelView(label, title, view) {
|
||||||
|
@ -1367,7 +1373,7 @@ const app = new Vue({
|
||||||
includeResponseMeta: !0
|
includeResponseMeta: !0
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('searchres', response)
|
console.debug('searchres', response)
|
||||||
let responseFormat = {
|
let responseFormat = {
|
||||||
data: response.data.results[group].data,
|
data: response.data.results[group].data,
|
||||||
next: response.data.results[group].next,
|
next: response.data.results[group].next,
|
||||||
|
@ -1421,13 +1427,13 @@ const app = new Vue({
|
||||||
app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, params).then(res => {
|
app.mk.api.v3.music(`/v1/me/library/playlists/${id}`, params).then(res => {
|
||||||
self.getPlaylistContinuous(res, transient)
|
self.getPlaylistContinuous(res, transient)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.debug(e);
|
||||||
try {
|
try {
|
||||||
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${id}`, params).then(res => {
|
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${id}`, params).then(res => {
|
||||||
self.getPlaylistContinuous(res, transient)
|
self.getPlaylistContinuous(res, transient)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.debug(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1444,7 +1450,7 @@ const app = new Vue({
|
||||||
"art[url]": "f",
|
"art[url]": "f",
|
||||||
l: this.mklang
|
l: this.mklang
|
||||||
}, { includeResponseMeta: !0 })
|
}, { includeResponseMeta: !0 })
|
||||||
console.log(artistData.data.data[0])
|
console.debug(artistData.data.data[0])
|
||||||
this.artistPage.data = artistData.data.data[0]
|
this.artistPage.data = artistData.data.data[0]
|
||||||
this.page = "artist-page"
|
this.page = "artist-page"
|
||||||
},
|
},
|
||||||
|
@ -1479,12 +1485,12 @@ const app = new Vue({
|
||||||
"meta": {}
|
"meta": {}
|
||||||
}
|
}
|
||||||
if (response.next) {
|
if (response.next) {
|
||||||
console.log("has next")
|
console.debug("has next")
|
||||||
returnData.data.concat(response.data)
|
returnData.data.concat(response.data)
|
||||||
returnData.meta = response.meta
|
returnData.meta = response.meta
|
||||||
return await this.getRecursive(await response.next())
|
return await this.getRecursive(await response.next())
|
||||||
} else {
|
} else {
|
||||||
console.log("no next")
|
console.debug("no next")
|
||||||
returnData.data.concat(response.data)
|
returnData.data.concat(response.data)
|
||||||
return returnData
|
return returnData
|
||||||
}
|
}
|
||||||
|
@ -1573,7 +1579,7 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
route = route.replace(/#/g, "")
|
route = route.replace(/#/g, "")
|
||||||
if (app.cfg.general.resumeTabs.tab == "dynamic") {
|
if (app.cfg.general.resumeTabs.tab == "dynamic") {
|
||||||
if (route == "home" || route == "library-songs" || route == "library-albums" || route == "library-artists" || route == "library-videos" || route == "podcasts") {
|
if (route == "home" || route == "listen_now" || route == "browse" || route == "radio" || route == "library-songs" || route == "library-albums" || route == "library-artists" || route == "library-videos" || route == "podcasts") {
|
||||||
app.cfg.general.resumeTabs.dynamicData = route
|
app.cfg.general.resumeTabs.dynamicData = route
|
||||||
} else {
|
} else {
|
||||||
app.cfg.general.resumeTabs.dynamicData = "home"
|
app.cfg.general.resumeTabs.dynamicData = "home"
|
||||||
|
@ -1624,7 +1630,7 @@ const app = new Vue({
|
||||||
window.location.hash = `${kind}/${id}`
|
window.location.hash = `${kind}/${id}`
|
||||||
document.querySelector("#app-content").scrollTop = 0
|
document.querySelector("#app-content").scrollTop = 0
|
||||||
} else if (kind == "editorial-elements") {
|
} else if (kind == "editorial-elements") {
|
||||||
console.log(item)
|
console.debug(item)
|
||||||
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
|
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
|
||||||
this.routeView(item.relationships.contents.data[0])
|
this.routeView(item.relationships.contents.data[0])
|
||||||
} else if (item.attributes?.link?.url != null) {
|
} else if (item.attributes?.link?.url != null) {
|
||||||
|
@ -1665,28 +1671,16 @@ const app = new Vue({
|
||||||
params["meta[albums:tracks]"] = 'popularity'
|
params["meta[albums:tracks]"] = 'popularity'
|
||||||
params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialNotes,editorialVideo,name,playParams,releaseDate,url,copyright"
|
params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialNotes,editorialVideo,name,playParams,releaseDate,url,copyright"
|
||||||
}
|
}
|
||||||
|
if(kind.includes("playlist") || kind.includes("album")){
|
||||||
// if (this.cfg.advanced.experiments.includes('inline-playlists')) {
|
|
||||||
if (false) {
|
|
||||||
let showModal = kind.toString().includes("album") || kind.toString().includes("playlist")
|
|
||||||
if (app.page.includes("playlist") || app.page.includes("album")) {
|
|
||||||
showModal = false
|
|
||||||
}
|
|
||||||
if (showModal) {
|
|
||||||
app.modals.showPlaylist = true
|
|
||||||
app.chrome.contentAreaScrolling = false
|
|
||||||
} else {
|
|
||||||
app.page = (kind) + "_" + (id);
|
|
||||||
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
app.page = (kind) + "_" + (id);
|
app.page = (kind) + "_" + (id);
|
||||||
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
||||||
|
app.getTypeFromID((kind), (id), (isLibrary), params);
|
||||||
|
}else{
|
||||||
|
app.page = (kind)
|
||||||
|
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// app.getTypeFromID((kind), (id), (isLibrary), params);
|
||||||
app.getTypeFromID((kind), (id), (isLibrary), params);
|
|
||||||
// document.querySelector("#app-content").scrollTop = 0
|
|
||||||
} else {
|
} else {
|
||||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
||||||
}
|
}
|
||||||
|
@ -1752,12 +1746,12 @@ const app = new Vue({
|
||||||
try {
|
try {
|
||||||
if (artistQuery.artists.data.length > 0) {
|
if (artistQuery.artists.data.length > 0) {
|
||||||
artistId = artistQuery.artists.data[0].id;
|
artistId = artistQuery.artists.data[0].id;
|
||||||
console.log(artistId)
|
console.debug(artistId)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(artistId);
|
console.debug(artistId);
|
||||||
if (artistId != "")
|
if (artistId != "")
|
||||||
self.appRoute(`artist/${artistId}`)
|
self.appRoute(`artist/${artistId}`)
|
||||||
break;
|
break;
|
||||||
|
@ -1789,7 +1783,7 @@ const app = new Vue({
|
||||||
})).data.results;
|
})).data.results;
|
||||||
if (albumQuery.albums.data.length > 0) {
|
if (albumQuery.albums.data.length > 0) {
|
||||||
albumId = albumQuery.albums.data[0].id;
|
albumId = albumQuery.albums.data[0].id;
|
||||||
console.log(albumId)
|
console.debug(albumId)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
@ -1813,7 +1807,7 @@ const app = new Vue({
|
||||||
})).data.results;
|
})).data.results;
|
||||||
if (labelQuery["record-labels"].data.length > 0) {
|
if (labelQuery["record-labels"].data.length > 0) {
|
||||||
labelId = labelQuery["record-labels"].data[0].id;
|
labelId = labelQuery["record-labels"].data[0].id;
|
||||||
console.log(labelId)
|
console.debug(labelId)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
@ -1846,7 +1840,7 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
followingArtist(id) {
|
followingArtist(id) {
|
||||||
console.log(`check for ${id}`)
|
console.debug(`check for ${id}`)
|
||||||
return this.cfg.home.followedArtists.includes(id)
|
return this.cfg.home.followedArtists.includes(id)
|
||||||
},
|
},
|
||||||
playMediaItem(item) {
|
playMediaItem(item) {
|
||||||
|
@ -1876,7 +1870,7 @@ const app = new Vue({
|
||||||
try {
|
try {
|
||||||
a = await this.mkapi(kind.toString(), isLibrary, id.toString(), params, params2);
|
a = await this.mkapi(kind.toString(), isLibrary, id.toString(), params, params2);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.debug(e);
|
||||||
try {
|
try {
|
||||||
a = await this.mkapi(kind.toString(), !isLibrary, id.toString(), params, params2);
|
a = await this.mkapi(kind.toString(), !isLibrary, id.toString(), params, params2);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -2131,7 +2125,7 @@ const app = new Vue({
|
||||||
return await this.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/${truemethod}/${term.toString()}`, params, params2)
|
return await this.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/${truemethod}/${term.toString()}`, params, params2)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.debug(e)
|
||||||
return await this.mkapi(method, library, term, params, params2, attempts + 1)
|
return await this.mkapi(method, library, term, params, params2, attempts + 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2183,7 +2177,7 @@ const app = new Vue({
|
||||||
l: app.mklang,
|
l: app.mklang,
|
||||||
},
|
},
|
||||||
onProgress: (data) => {
|
onProgress: (data) => {
|
||||||
console.log(`${data.total}/${data.response.data.meta.total}`)
|
console.debug(`${data.total}/${data.response.data.meta.total}`)
|
||||||
self.library.backgroundNotification.show = true
|
self.library.backgroundNotification.show = true
|
||||||
self.library.backgroundNotification.message = app.getLz('notification.updatingLibrarySongs')
|
self.library.backgroundNotification.message = app.getLz('notification.updatingLibrarySongs')
|
||||||
self.library.backgroundNotification.total = data.response.data.meta.total
|
self.library.backgroundNotification.total = data.response.data.meta.total
|
||||||
|
@ -2199,7 +2193,7 @@ const app = new Vue({
|
||||||
self.library.backgroundNotification.show = false
|
self.library.backgroundNotification.show = false
|
||||||
self.searchLibrarySongs()
|
self.searchLibrarySongs()
|
||||||
CiderCache.putCache(cacheId, library)
|
CiderCache.putCache(cacheId, library)
|
||||||
console.log("Done!")
|
console.debug("Done!")
|
||||||
|
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
|
@ -2250,7 +2244,7 @@ const app = new Vue({
|
||||||
app.mk.api.v3.music(`/v1/me/library/albums/`, params).then((response) => {
|
app.mk.api.v3.music(`/v1/me/library/albums/`, params).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('safe loading');
|
console.debug('safe loading');
|
||||||
app.mk.api.v3.music(`/v1/me/library/albums/`, safeparams).then((response) => {
|
app.mk.api.v3.music(`/v1/me/library/albums/`, safeparams).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
@ -2264,7 +2258,7 @@ const app = new Vue({
|
||||||
app.mk.api.v3.music(downloaded.next, params).then((response) => {
|
app.mk.api.v3.music(downloaded.next, params).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('safe loading');
|
console.debug('safe loading');
|
||||||
app.mk.api.v3.music(downloaded.next, safeparams).then((response) => {
|
app.mk.api.v3.music(downloaded.next, safeparams).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
@ -2274,7 +2268,7 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log("Download next", downloaded.next)
|
console.debug("Download next", downloaded.next)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2291,7 +2285,7 @@ const app = new Vue({
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (typeof downloaded.next == "undefined") {
|
if (typeof downloaded.next == "undefined") {
|
||||||
console.log("downloaded.next is undefined")
|
console.debug("downloaded.next is undefined")
|
||||||
self.library.albums.listing = library
|
self.library.albums.listing = library
|
||||||
self.library.albums.downloadState = 2
|
self.library.albums.downloadState = 2
|
||||||
self.library.backgroundNotification.show = false
|
self.library.backgroundNotification.show = false
|
||||||
|
@ -2299,7 +2293,7 @@ const app = new Vue({
|
||||||
self.searchLibraryAlbums(index)
|
self.searchLibraryAlbums(index)
|
||||||
}
|
}
|
||||||
if (downloaded.meta.total > library.length || typeof downloaded.meta.next != "undefined") {
|
if (downloaded.meta.total > library.length || typeof downloaded.meta.next != "undefined") {
|
||||||
console.log(`downloading next chunk - ${library.length
|
console.debug(`downloading next chunk - ${library.length
|
||||||
} albums so far`)
|
} albums so far`)
|
||||||
downloadChunk()
|
downloadChunk()
|
||||||
} else {
|
} else {
|
||||||
|
@ -2357,7 +2351,7 @@ const app = new Vue({
|
||||||
app.mk.api.v3.music(`/v1/me/library/artists/`, params).then((response) => {
|
app.mk.api.v3.music(`/v1/me/library/artists/`, params).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('safe loading');
|
console.debug('safe loading');
|
||||||
app.mk.api.v3.music(`/v1/me/library/artists/`, safeparams).then((response) => {
|
app.mk.api.v3.music(`/v1/me/library/artists/`, safeparams).then((response) => {
|
||||||
processChunk(response.data)
|
processChunk(response.data)
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
@ -2485,7 +2479,7 @@ const app = new Vue({
|
||||||
reload: !0
|
reload: !0
|
||||||
})).data;
|
})).data;
|
||||||
this.listennow.timestamp = Date.now()
|
this.listennow.timestamp = Date.now()
|
||||||
console.log(this.listennow)
|
console.debug(this.listennow)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.getListenNow(attempt + 1)
|
this.getListenNow(attempt + 1)
|
||||||
|
@ -2513,7 +2507,7 @@ const app = new Vue({
|
||||||
});
|
});
|
||||||
this.browsepage = browse.data.data[0];
|
this.browsepage = browse.data.data[0];
|
||||||
this.browsepage.timestamp = Date.now()
|
this.browsepage.timestamp = Date.now()
|
||||||
console.log(this.browsepage)
|
console.debug(this.browsepage)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.getBrowsePage(attempt + 1)
|
this.getBrowsePage(attempt + 1)
|
||||||
|
@ -2714,7 +2708,7 @@ const app = new Vue({
|
||||||
if (status2 == 200) {
|
if (status2 == 200) {
|
||||||
let token = jsonResponse["message"]["body"]["user_token"] ?? '';
|
let token = jsonResponse["message"]["body"]["user_token"] ?? '';
|
||||||
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
||||||
console.log('200 token', mode);
|
console.debug('200 token', mode);
|
||||||
// token good
|
// token good
|
||||||
app.mxmtoken = token;
|
app.mxmtoken = token;
|
||||||
|
|
||||||
|
@ -2724,7 +2718,7 @@ const app = new Vue({
|
||||||
getMXMTrans(songid, lang, app.mxmtoken);
|
getMXMTrans(songid, lang, app.mxmtoken);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('fake 200 token');
|
console.debug('fake 200 token');
|
||||||
getToken(mode, track, artist, songid, lang, time)
|
getToken(mode, track, artist, songid, lang, time)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2759,7 +2753,7 @@ const app = new Vue({
|
||||||
req.onload = function () {
|
req.onload = function () {
|
||||||
try {
|
try {
|
||||||
let jsonResponse = JSON.parse(this.responseText);
|
let jsonResponse = JSON.parse(this.responseText);
|
||||||
console.log(jsonResponse);
|
console.debug(jsonResponse);
|
||||||
let status1 = jsonResponse["message"]["header"]["status_code"];
|
let status1 = jsonResponse["message"]["header"]["status_code"];
|
||||||
|
|
||||||
if (status1 == 200) {
|
if (status1 == 200) {
|
||||||
|
@ -2823,7 +2817,7 @@ const app = new Vue({
|
||||||
});
|
});
|
||||||
app.lyrics = preLrc;
|
app.lyrics = preLrc;
|
||||||
}
|
}
|
||||||
if (lrcfile != null && lrcfile != '' && lang != "disabled") {
|
if (lrcfile != null && lrcfile != '') {
|
||||||
// load translation
|
// load translation
|
||||||
getMXMTrans(id, lang, token);
|
getMXMTrans(id, lang, token);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3145,7 +3139,7 @@ const app = new Vue({
|
||||||
},
|
},
|
||||||
playMediaItemById(id, kind, isLibrary, raurl = "") {
|
playMediaItemById(id, kind, isLibrary, raurl = "") {
|
||||||
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
console.log(id, truekind, isLibrary)
|
console.debug(id, truekind, isLibrary)
|
||||||
try {
|
try {
|
||||||
if (truekind.includes("artist")) {
|
if (truekind.includes("artist")) {
|
||||||
app.mk.setStationQueue({ artist: 'a-' + id }).then(() => {
|
app.mk.setStationQueue({ artist: 'a-' + id }).then(() => {
|
||||||
|
@ -3770,7 +3764,7 @@ const app = new Vue({
|
||||||
volumeUp() {
|
volumeUp() {
|
||||||
if ((app.mk.volume + app.cfg.audio.volumeStep) > app.cfg.audio.maxVolume) {
|
if ((app.mk.volume + app.cfg.audio.volumeStep) > app.cfg.audio.maxVolume) {
|
||||||
app.mk.volume = app.cfg.audio.maxVolume;
|
app.mk.volume = app.cfg.audio.maxVolume;
|
||||||
console.log('setting max volume')
|
console.debug('setting max volume')
|
||||||
} else {
|
} else {
|
||||||
console.log('volume up')
|
console.log('volume up')
|
||||||
app.mk.volume = ((app.mk.volume * 100) + (app.cfg.audio.volumeStep * 100)) / 100
|
app.mk.volume = ((app.mk.volume * 100) + (app.cfg.audio.volumeStep * 100)) / 100
|
||||||
|
@ -3779,7 +3773,7 @@ const app = new Vue({
|
||||||
volumeDown() {
|
volumeDown() {
|
||||||
if ((app.mk.volume - app.cfg.audio.volumeStep) < 0) {
|
if ((app.mk.volume - app.cfg.audio.volumeStep) < 0) {
|
||||||
app.mk.volume = 0;
|
app.mk.volume = 0;
|
||||||
console.log('setting volume to 0')
|
console.debug('setting volume to 0')
|
||||||
} else {
|
} else {
|
||||||
console.log('volume down')
|
console.log('volume down')
|
||||||
app.mk.volume = ((app.mk.volume * 100) - (app.cfg.audio.volumeStep * 100)) / 100
|
app.mk.volume = ((app.mk.volume * 100) - (app.cfg.audio.volumeStep * 100)) / 100
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
this.itemPages = app.arrayToChunk(this.items, 4);
|
this.itemPages = app.arrayToChunk(this.items, 4);
|
||||||
try{
|
try{
|
||||||
this.simplifiedParent = JSON.stringify(this.items.map ( function(x){return x.attributes.playParams}));
|
this.simplifiedParent = JSON.stringify(this.items.map ( function(x){return x.attributes.playParams}));
|
||||||
console.log("simplifiedParent: " + this.simplifiedParent);
|
console.debug("simplifiedParent: " + this.simplifiedParent);
|
||||||
}
|
}
|
||||||
catch (e){}
|
catch (e){}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log("MOUNTED")
|
|
||||||
if (this.event) {
|
if (this.event) {
|
||||||
this.position = [this.event.clientX, this.event.clientY];
|
this.position = [this.event.clientX, this.event.clientY];
|
||||||
}
|
}
|
||||||
|
@ -81,7 +80,6 @@
|
||||||
},
|
},
|
||||||
getStyle() {
|
getStyle() {
|
||||||
let style = {}
|
let style = {}
|
||||||
console.debug(this.$refs.menubody)
|
|
||||||
this.size = [this.$refs.menubody.offsetWidth, this.$refs.menubody.offsetHeight];
|
this.size = [this.$refs.menubody.offsetWidth, this.$refs.menubody.offsetHeight];
|
||||||
if (this.event) {
|
if (this.event) {
|
||||||
style["position"] = "absolute";
|
style["position"] = "absolute";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script type="text/x-template" id="cider-settings">
|
<script type="text/x-template" id="cider-settings">
|
||||||
<div class="content-inner settings-page">
|
<div class="content-inner settings-page">
|
||||||
<b-tabs pills fill content-class="mt-3">
|
<b-tabs pills fill content-class="mt-3" v-model="tabIndex">
|
||||||
<b-tab :title="$root.getLz('settings.header.general')" active>
|
<b-tab :title="$root.getLz('settings.header.general')" active>
|
||||||
<div class="md-option-container">
|
<div class="md-option-container">
|
||||||
<!-- General Settings -->
|
<!-- General Settings -->
|
||||||
|
@ -90,6 +90,9 @@
|
||||||
<select class="md-select" style="width:180px;"
|
<select class="md-select" style="width:180px;"
|
||||||
v-model="$root.cfg.general.resumeTabs.tab">
|
v-model="$root.cfg.general.resumeTabs.tab">
|
||||||
<option value="home">{{$root.getLz('home.title')}}</option>
|
<option value="home">{{$root.getLz('home.title')}}</option>
|
||||||
|
<option value="listen_now">{{$root.getLz('term.listenNow')}}</option>
|
||||||
|
<option value="browse">{{$root.getLz('term.browse')}}</option>
|
||||||
|
<option value="radio">{{$root.getLz('term.radio')}}</option>
|
||||||
<option value="library-recentlyadded">{{$root.getLz('term.recentlyAdded')}}</option>
|
<option value="library-recentlyadded">{{$root.getLz('term.recentlyAdded')}}</option>
|
||||||
<option value="library-songs">{{$root.getLz('term.songs')}}</option>
|
<option value="library-songs">{{$root.getLz('term.songs')}}</option>
|
||||||
<option value="library-albums">{{$root.getLz('term.albums')}}</option>
|
<option value="library-albums">{{$root.getLz('term.albums')}}</option>
|
||||||
|
@ -1410,10 +1413,10 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// do not translate
|
// do not translate
|
||||||
Vue.component('stylestack-editor', {
|
Vue.component('stylestack-editor', {
|
||||||
/*html*/
|
/*html*/
|
||||||
template: `
|
template: `
|
||||||
<div class="stylestack-editor">
|
<div class="stylestack-editor">
|
||||||
<draggable class="list-group" v-model="$root.cfg.visual.styles" @end="$root.reloadStyles()">
|
<draggable class="list-group" v-model="$root.cfg.visual.styles" @end="$root.reloadStyles()">
|
||||||
<b-list-group-item variant="dark" v-for="theme in $root.cfg.visual.styles" :key="theme">
|
<b-list-group-item variant="dark" v-for="theme in $root.cfg.visual.styles" :key="theme">
|
||||||
|
@ -1439,290 +1442,308 @@
|
||||||
</draggable>
|
</draggable>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
props: {
|
props: {
|
||||||
themes: {
|
themes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
selected: null,
|
selected: null,
|
||||||
newTheme: null,
|
newTheme: null,
|
||||||
themeList: []
|
themeList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.themeList = [...this.themes]
|
this.themeList = [...this.themes]
|
||||||
this.themeList.unshift({
|
this.themeList.unshift({
|
||||||
name: "Acrylic Grain",
|
name: "Acrylic Grain",
|
||||||
file: "grain.less"
|
file: "grain.less"
|
||||||
})
|
})
|
||||||
this.themeList.unshift({
|
this.themeList.unshift({
|
||||||
name: "Sweetener",
|
name: "Sweetener",
|
||||||
file: "sweetener.less"
|
file: "sweetener.less"
|
||||||
})
|
})
|
||||||
this.themeList.unshift({
|
this.themeList.unshift({
|
||||||
name: "Reduce Visuals",
|
name: "Reduce Visuals",
|
||||||
file: "reduce_visuals.less"
|
file: "reduce_visuals.less"
|
||||||
})
|
})
|
||||||
this.themeList.unshift({
|
this.themeList.unshift({
|
||||||
name: "Inline Drawer",
|
name: "Inline Drawer",
|
||||||
file: "inline_drawer.less"
|
file: "inline_drawer.less"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gitHubExplore() {
|
gitHubExplore() {
|
||||||
this.$root.appRoute("themes-github")
|
this.$root.appRoute("themes-github")
|
||||||
},
|
},
|
||||||
getThemeName(filename) {
|
getThemeName(filename) {
|
||||||
try {
|
try {
|
||||||
return this.themeList.find(theme => theme.file === filename).name;
|
return this.themeList.find(theme => theme.file === filename).name;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
moveUp() {
|
moveUp() {
|
||||||
const styles = this.$root.cfg.visual.styles
|
const styles = this.$root.cfg.visual.styles
|
||||||
const index = styles.indexOf(this.selected)
|
const index = styles.indexOf(this.selected)
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
styles.splice(index, 1)
|
styles.splice(index, 1)
|
||||||
styles.splice(index - 1, 0, this.selected)
|
styles.splice(index - 1, 0, this.selected)
|
||||||
}
|
}
|
||||||
this.$root.reloadStyles()
|
this.$root.reloadStyles()
|
||||||
},
|
},
|
||||||
moveDown() {
|
moveDown() {
|
||||||
const styles = this.$root.cfg.visual.styles
|
const styles = this.$root.cfg.visual.styles
|
||||||
const index = styles.indexOf(this.selected)
|
const index = styles.indexOf(this.selected)
|
||||||
if (index < styles.length - 1) {
|
if (index < styles.length - 1) {
|
||||||
styles.splice(index, 1)
|
styles.splice(index, 1)
|
||||||
styles.splice(index + 1, 0, this.selected)
|
styles.splice(index + 1, 0, this.selected)
|
||||||
}
|
}
|
||||||
this.$root.reloadStyles()
|
this.$root.reloadStyles()
|
||||||
},
|
},
|
||||||
remove(style) {
|
remove(style) {
|
||||||
const styles = this.$root.cfg.visual.styles
|
const styles = this.$root.cfg.visual.styles
|
||||||
const index = styles.indexOf(style)
|
const index = styles.indexOf(style)
|
||||||
styles.splice(index, 1)
|
styles.splice(index, 1)
|
||||||
this.$root.reloadStyles()
|
this.$root.reloadStyles()
|
||||||
},
|
},
|
||||||
addStyle(style) {
|
addStyle(style) {
|
||||||
const styles = this.$root.cfg.visual.styles
|
const styles = this.$root.cfg.visual.styles
|
||||||
styles.push(style)
|
styles.push(style)
|
||||||
this.$root.reloadStyles()
|
this.$root.reloadStyles()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
Vue.component('cider-settings', {
|
Vue.component('cider-settings', {
|
||||||
template: "#cider-settings",
|
template: "#cider-settings",
|
||||||
props: [],
|
props: [],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
themes: ipcRenderer.sendSync("get-themes")
|
themes: ipcRenderer.sendSync("get-themes"),
|
||||||
}
|
tabIndex: 0,
|
||||||
},
|
canChangeHash: false
|
||||||
mounted: function () {
|
}
|
||||||
if (app.cfg.lastfm.enabled) {
|
}, watch: {
|
||||||
const element = document.getElementById('lfmConnect');
|
tabIndex: function (val) {
|
||||||
if (element) {
|
if (this.canChangeHash) {
|
||||||
element.innerHTML = `Disconnect\n<p style="font-size: 8px"><i>(Authed: ${app.cfg.lastfm.auth_token})</i></p>`;
|
window.location.hash = `#settings/${val}`
|
||||||
element.onclick = app.LastFMDeauthorize;
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
mounted: function () {
|
||||||
methods: {
|
this.$nextTick(function () {
|
||||||
windowBgStyleChange() {
|
if (window.location.hash.split("/").length > 1) {
|
||||||
this.$root.getNowPlayingArtworkBG(undefined, true)
|
this.tabIndex = parseInt(window.location.hash.split("/")[1])
|
||||||
if (this.$root.cfg.visual.window_background_style === "mica") {
|
console.debug("tabIndex", this.tabIndex)
|
||||||
this.$root.spawnMica()
|
this.canChangeHash = true
|
||||||
}
|
}else{
|
||||||
},
|
this.canChangeHash = true
|
||||||
reinstallWidevineCDM() {
|
}
|
||||||
bootbox.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => {
|
})
|
||||||
if (ok) {
|
|
||||||
ipcRenderer.invoke("reinstall-widevine-cdm");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
keyBindUpdate: function (action) {
|
|
||||||
const blur = document.createElement('div');
|
|
||||||
blur.className = 'blur';
|
|
||||||
blur.style.backgroundColor = 'rgba(0,0,0,0.25)';
|
|
||||||
blur.style.position = 'fixed';
|
|
||||||
blur.style.top = '0';
|
|
||||||
blur.style.left = '0';
|
|
||||||
blur.style.width = '100%';
|
|
||||||
blur.style.height = '100%';
|
|
||||||
blur.style.zIndex = '9999';
|
|
||||||
blur.style.display = 'flex';
|
|
||||||
blur.style.alignItems = 'center';
|
|
||||||
blur.style.justifyContent = 'center';
|
|
||||||
blur.style.fontSize = '2em';
|
|
||||||
blur.style.color = 'white';
|
|
||||||
blur.innerHTML = 'Press a combination of two keys to update keybinding. Press Escape key to go back.'
|
|
||||||
document.body.appendChild(blur);
|
|
||||||
|
|
||||||
let keyBind = [];
|
if (app.cfg.lastfm.enabled) {
|
||||||
const keyBindTimeout = setTimeout(function () {
|
const element = document.getElementById('lfmConnect');
|
||||||
keyBind = [];
|
if (element) {
|
||||||
document.body.removeChild(blur);
|
element.innerHTML = `Disconnect\n<p style="font-size: 8px"><i>(Authed: ${app.cfg.lastfm.auth_token})</i></p>`;
|
||||||
}, 30000);
|
element.onclick = app.LastFMDeauthorize;
|
||||||
const keyBindUpdate = function (e) {
|
}
|
||||||
if (document.body.contains(blur)) {
|
}
|
||||||
if (e.key == 'Escape') {
|
},
|
||||||
document.body.removeChild(blur);
|
methods: {
|
||||||
clearTimeout(keyBindTimeout);
|
windowBgStyleChange() {
|
||||||
return;
|
this.$root.getNowPlayingArtworkBG(undefined, true)
|
||||||
} else {
|
if (this.$root.cfg.visual.window_background_style === "mica") {
|
||||||
if (e.keyCode >= 65 && e.keyCode <= 90 && e.keyCode <= 97 && e.keyCode <= 122) {
|
this.$root.spawnMica()
|
||||||
keyBind.push(e.key.toUpperCase());
|
}
|
||||||
} else {
|
},
|
||||||
keyBind.push(e.key);
|
reinstallWidevineCDM() {
|
||||||
}
|
bootbox.confirm(app.getLz("settings.option.experimental.reinstallwidevine.confirm"), (ok) => {
|
||||||
if (keyBind.length === 2) {
|
if (ok) {
|
||||||
if (keyBind[0] !== keyBind[1]) {
|
ipcRenderer.invoke("reinstall-widevine-cdm");
|
||||||
app.cfg.general.keybindings[action] = keyBind
|
}
|
||||||
document.body.removeChild(blur);
|
})
|
||||||
clearTimeout(keyBindTimeout);
|
},
|
||||||
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
|
keyBindUpdate: function (action) {
|
||||||
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
|
const blur = document.createElement('div');
|
||||||
if (ok) ipcRenderer.invoke("relaunchApp")
|
blur.className = 'blur';
|
||||||
})
|
blur.style.backgroundColor = 'rgba(0,0,0,0.25)';
|
||||||
} else {
|
blur.style.position = 'fixed';
|
||||||
keyBind = [];
|
blur.style.top = '0';
|
||||||
}
|
blur.style.left = '0';
|
||||||
}
|
blur.style.width = '100%';
|
||||||
}
|
blur.style.height = '100%';
|
||||||
}
|
blur.style.zIndex = '9999';
|
||||||
};
|
blur.style.display = 'flex';
|
||||||
document.addEventListener('keydown', keyBindUpdate);
|
blur.style.alignItems = 'center';
|
||||||
},
|
blur.style.justifyContent = 'center';
|
||||||
keyBindReset: function () {
|
blur.style.fontSize = '2em';
|
||||||
app.cfg.general.keybindings.search = [app.platform == "darwin" ? "Command" : "Control", "S"];
|
blur.style.color = 'white';
|
||||||
app.cfg.general.keybindings.albums = [app.platform == "darwin" ? "Command" : "Control", "F"];
|
blur.innerHTML = 'Press a combination of two keys to update keybinding. Press Escape key to go back.'
|
||||||
app.cfg.general.keybindings.artists = [app.platform == "darwin" ? "Command" : "Control", "D"];
|
document.body.appendChild(blur);
|
||||||
app.cfg.general.keybindings.browse = [app.platform == "darwin" ? "Command" : "Control", "B"];
|
|
||||||
app.cfg.general.keybindings.togglePrivateSession = [app.platform == "darwin" ? "Command" : "Control", "P"];
|
|
||||||
app.cfg.general.keybindings.webRemote = [app.platform == "darwin" ? "Command" : "Control", "W"];
|
|
||||||
app.cfg.general.keybindings.audioSettings = [app.platform == "darwin" ? "Option" : "Shift", "A"];
|
|
||||||
app.cfg.general.keybindings.pluginMenu = [app.platform == "darwin" ? "Option" : "Shift", "P"];
|
|
||||||
app.cfg.general.keybindings.castToDevices = [app.platform == "darwin" ? "Option" : "Shift", "C"];
|
|
||||||
app.cfg.general.keybindings.settings = [app.platform == "darwin" ? "Option" : "Shift", "S"];
|
|
||||||
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'));
|
|
||||||
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
|
|
||||||
if (ok) ipcRenderer.invoke("relaunchApp")
|
|
||||||
})
|
|
||||||
},
|
|
||||||
gitHubExplore() {
|
|
||||||
app.appRoute("themes-github")
|
|
||||||
},
|
|
||||||
copyLogs() {
|
|
||||||
ipcRenderer.send('fetch-log')
|
|
||||||
notyf.success(app.getLz('term.share.success'));
|
|
||||||
},
|
|
||||||
openAppData() {
|
|
||||||
ipcRenderer.send('open-appdata')
|
|
||||||
},
|
|
||||||
getLanguages: function () {
|
|
||||||
let langs = this.$root.lzListing
|
|
||||||
let categories = {
|
|
||||||
"main": [],
|
|
||||||
"fun": [],
|
|
||||||
"unsorted": []
|
|
||||||
}
|
|
||||||
// sort by category if category is undefined or empty put it in "unsorted"
|
|
||||||
for (let i = 0; i < langs.length; i++) {
|
|
||||||
if (langs[i].category === undefined || langs[i].category === "") {
|
|
||||||
categories.unsorted.push(langs[i])
|
|
||||||
} else {
|
|
||||||
categories[langs[i].category].push(langs[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// return
|
|
||||||
return categories
|
|
||||||
},
|
|
||||||
addExperiment(flag) {
|
|
||||||
app.cfg.advanced.experiments.push(flag);
|
|
||||||
},
|
|
||||||
removeExperiment(flag) {
|
|
||||||
app.cfg.advanced.experiments.splice(app.cfg.advanced.experiments.indexOf(flag), 1);
|
|
||||||
},
|
|
||||||
toggleAudioContext: function () {
|
|
||||||
if (app.cfg.advanced.AudioContext === true) {
|
|
||||||
if (navigator.hardwareConcurrency < 6) {
|
|
||||||
bootbox.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) {
|
|
||||||
if (result) {
|
|
||||||
CiderAudio.init();
|
|
||||||
if (app.cfg.audio.normalization === true) {
|
|
||||||
CiderAudio.normalizerOn()
|
|
||||||
}
|
|
||||||
if (app.cfg.audio.spatial === true) {
|
|
||||||
CiderAudio.spatialOn()
|
|
||||||
CiderAudio.hierarchical_loading();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
CiderAudio.init();
|
|
||||||
if (app.cfg.audio.normalization === true) {
|
|
||||||
CiderAudio.normalizerOn()
|
|
||||||
}
|
|
||||||
if (app.cfg.audio.spatial === true) {
|
|
||||||
CiderAudio.spatialOn()
|
|
||||||
CiderAudio.hierarchical_loading();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
CiderAudio.off();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toggleNormalization: function () {
|
|
||||||
if (app.cfg.audio.normalization) {
|
|
||||||
CiderAudio.normalizerOn()
|
|
||||||
} else {
|
|
||||||
CiderAudio.normalizerOff()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeAudioQuality: function () {
|
|
||||||
1
|
|
||||||
app.mk.bitrate = MusicKit.PlaybackBitrate[app.cfg.audio.quality];
|
|
||||||
},
|
|
||||||
toggleUserInfo: function () {
|
|
||||||
app.chrome.hideUserInfo = !app.cfg.visual.showuserinfo
|
|
||||||
},
|
|
||||||
sendDataToMTT: function () {
|
|
||||||
ipcRenderer.invoke('setStoreValue', 'general.close_behavior', app.cfg.general.close_behavior);
|
|
||||||
// setStoreValue does not change plugin store values somehow
|
|
||||||
ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior);
|
|
||||||
},
|
|
||||||
checkIfUpdateDisabled() {
|
|
||||||
if (app.cfg.main.UPDATABLE) return;
|
|
||||||
|
|
||||||
let updateFields = document.getElementsByClassName('update-check');
|
let keyBind = [];
|
||||||
for (let i = 0; i < updateFields.length; i++) {
|
const keyBindTimeout = setTimeout(function () {
|
||||||
updateFields[i].style = "opacity: 0.5; pointer-events: none;";
|
keyBind = [];
|
||||||
updateFields[i].title = "Not available on this type of build";
|
document.body.removeChild(blur);
|
||||||
}
|
}, 30000);
|
||||||
|
const keyBindUpdate = function (e) {
|
||||||
|
if (document.body.contains(blur)) {
|
||||||
|
if (e.key == 'Escape') {
|
||||||
|
document.body.removeChild(blur);
|
||||||
|
clearTimeout(keyBindTimeout);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
if (e.keyCode >= 65 && e.keyCode <= 90 && e.keyCode <= 97 && e.keyCode <= 122) {
|
||||||
|
keyBind.push(e.key.toUpperCase());
|
||||||
|
} else {
|
||||||
|
keyBind.push(e.key);
|
||||||
|
}
|
||||||
|
if (keyBind.length === 2) {
|
||||||
|
if (keyBind[0] !== keyBind[1]) {
|
||||||
|
app.cfg.general.keybindings[action] = keyBind
|
||||||
|
document.body.removeChild(blur);
|
||||||
|
clearTimeout(keyBindTimeout);
|
||||||
|
notyf.success(app.getLz('settings.notyf.general.keybindings.update.success'));
|
||||||
|
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
|
||||||
|
if (ok) ipcRenderer.invoke("relaunchApp")
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
keyBind = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener('keydown', keyBindUpdate);
|
||||||
|
},
|
||||||
|
keyBindReset: function () {
|
||||||
|
app.cfg.general.keybindings.search = [app.platform == "darwin" ? "Command" : "Control", "S"];
|
||||||
|
app.cfg.general.keybindings.albums = [app.platform == "darwin" ? "Command" : "Control", "F"];
|
||||||
|
app.cfg.general.keybindings.artists = [app.platform == "darwin" ? "Command" : "Control", "D"];
|
||||||
|
app.cfg.general.keybindings.browse = [app.platform == "darwin" ? "Command" : "Control", "B"];
|
||||||
|
app.cfg.general.keybindings.togglePrivateSession = [app.platform == "darwin" ? "Command" : "Control", "P"];
|
||||||
|
app.cfg.general.keybindings.webRemote = [app.platform == "darwin" ? "Command" : "Control", "W"];
|
||||||
|
app.cfg.general.keybindings.audioSettings = [app.platform == "darwin" ? "Option" : "Shift", "A"];
|
||||||
|
app.cfg.general.keybindings.pluginMenu = [app.platform == "darwin" ? "Option" : "Shift", "P"];
|
||||||
|
app.cfg.general.keybindings.castToDevices = [app.platform == "darwin" ? "Option" : "Shift", "C"];
|
||||||
|
app.cfg.general.keybindings.settings = [app.platform == "darwin" ? "Option" : "Shift", "S"];
|
||||||
|
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'));
|
||||||
|
bootbox.confirm(app.getLz("settings.prompt.general.keybindings.update.success"), (ok) => {
|
||||||
|
if (ok) ipcRenderer.invoke("relaunchApp")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
gitHubExplore() {
|
||||||
|
app.appRoute("themes-github")
|
||||||
|
},
|
||||||
|
copyLogs() {
|
||||||
|
ipcRenderer.send('fetch-log')
|
||||||
|
notyf.success(app.getLz('term.share.success'));
|
||||||
|
},
|
||||||
|
openAppData() {
|
||||||
|
ipcRenderer.send('open-appdata')
|
||||||
|
},
|
||||||
|
getLanguages: function () {
|
||||||
|
let langs = this.$root.lzListing
|
||||||
|
let categories = {
|
||||||
|
"main": [],
|
||||||
|
"fun": [],
|
||||||
|
"unsorted": []
|
||||||
|
}
|
||||||
|
// sort by category if category is undefined or empty put it in "unsorted"
|
||||||
|
for (let i = 0; i < langs.length; i++) {
|
||||||
|
if (langs[i].category === undefined || langs[i].category === "") {
|
||||||
|
categories.unsorted.push(langs[i])
|
||||||
|
} else {
|
||||||
|
categories[langs[i].category].push(langs[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// return
|
||||||
|
return categories
|
||||||
|
},
|
||||||
|
addExperiment(flag) {
|
||||||
|
app.cfg.advanced.experiments.push(flag);
|
||||||
|
},
|
||||||
|
removeExperiment(flag) {
|
||||||
|
app.cfg.advanced.experiments.splice(app.cfg.advanced.experiments.indexOf(flag), 1);
|
||||||
|
},
|
||||||
|
toggleAudioContext: function () {
|
||||||
|
if (app.cfg.advanced.AudioContext === true) {
|
||||||
|
if (navigator.hardwareConcurrency < 6) {
|
||||||
|
bootbox.confirm(app.getLz("settings.warn.audio.enableAdvancedFunctionality.lowcores"), function (result) {
|
||||||
|
if (result) {
|
||||||
|
CiderAudio.init();
|
||||||
|
if (app.cfg.audio.normalization === true) {
|
||||||
|
CiderAudio.normalizerOn()
|
||||||
|
}
|
||||||
|
if (app.cfg.audio.spatial === true) {
|
||||||
|
CiderAudio.spatialOn()
|
||||||
|
CiderAudio.hierarchical_loading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
CiderAudio.init();
|
||||||
|
if (app.cfg.audio.normalization === true) {
|
||||||
|
CiderAudio.normalizerOn()
|
||||||
|
}
|
||||||
|
if (app.cfg.audio.spatial === true) {
|
||||||
|
CiderAudio.spatialOn()
|
||||||
|
CiderAudio.hierarchical_loading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CiderAudio.off();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggleNormalization: function () {
|
||||||
|
if (app.cfg.audio.normalization) {
|
||||||
|
CiderAudio.normalizerOn()
|
||||||
|
} else {
|
||||||
|
CiderAudio.normalizerOff()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeAudioQuality: function () {
|
||||||
|
1
|
||||||
|
app.mk.bitrate = MusicKit.PlaybackBitrate[app.cfg.audio.quality];
|
||||||
|
},
|
||||||
|
toggleUserInfo: function () {
|
||||||
|
app.chrome.hideUserInfo = !app.cfg.visual.showuserinfo
|
||||||
|
},
|
||||||
|
sendDataToMTT: function () {
|
||||||
|
ipcRenderer.invoke('setStoreValue', 'general.close_behavior', app.cfg.general.close_behavior);
|
||||||
|
// setStoreValue does not change plugin store values somehow
|
||||||
|
ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior);
|
||||||
|
},
|
||||||
|
checkIfUpdateDisabled() {
|
||||||
|
if (app.cfg.main.UPDATABLE) return;
|
||||||
|
|
||||||
},
|
let updateFields = document.getElementsByClassName('update-check');
|
||||||
promptForRelaunch() {
|
for (let i = 0; i < updateFields.length; i++) {
|
||||||
bootbox.confirm(app.getLz('action.relaunch.confirm'), function (result) {
|
updateFields[i].style = "opacity: 0.5; pointer-events: none;";
|
||||||
if (result) {
|
updateFields[i].title = "Not available on this type of build";
|
||||||
ipcRenderer.send('relaunchApp', '');
|
}
|
||||||
}
|
|
||||||
});
|
},
|
||||||
},
|
promptForRelaunch() {
|
||||||
authCC() {
|
bootbox.confirm(app.getLz('action.relaunch.confirm'), function (result) {
|
||||||
ipcRenderer.send('cc-auth')
|
if (result) {
|
||||||
},
|
ipcRenderer.send('relaunchApp', '');
|
||||||
logoutCC() {
|
}
|
||||||
ipcRenderer.send('cc-logout')
|
});
|
||||||
},
|
},
|
||||||
}
|
authCC() {
|
||||||
})
|
ipcRenderer.send('cc-auth')
|
||||||
|
},
|
||||||
|
logoutCC() {
|
||||||
|
ipcRenderer.send('cc-logout')
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue