auto format my ass
This commit is contained in:
parent
e6567d5f62
commit
ac9c537c3c
2 changed files with 3311 additions and 3413 deletions
5
src/renderer/.jsbeautifyrc
Normal file
5
src/renderer/.jsbeautifyrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"js": {
|
||||||
|
"beautify.ignore": "src/renderer/index.js"
|
||||||
|
}
|
||||||
|
}
|
|
@ -646,12 +646,8 @@ const app = new Vue({
|
||||||
|
|
||||||
try {
|
try {
|
||||||
a = a.item.attributes;
|
a = a.item.attributes;
|
||||||
} catch (_) {} <<
|
} catch (_) {}
|
||||||
<< << < HEAD
|
let type = (self.mk.nowPlayingItem != null) ? self.mk.nowPlayingItem["type"] ?? '' : '';
|
||||||
let type = (self.mk.nowPlayingItem != null) ? self.mk.nowPlayingItem["type"] || '' : ''; ===
|
|
||||||
=== =
|
|
||||||
let type = (self.mk.nowPlayingItem != null) ? self.mk.nowPlayingItem["type"] ? ? '' : ''; >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
|
|
||||||
if (type.includes("musicVideo") || type.includes("uploadedVideo") || type.includes("music-movie")) {
|
if (type.includes("musicVideo") || type.includes("uploadedVideo") || type.includes("music-movie")) {
|
||||||
document.getElementById("apple-music-video-container").style.display = "block";
|
document.getElementById("apple-music-video-container").style.display = "block";
|
||||||
|
@ -1087,12 +1083,8 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
let hash = route.split("/")
|
let hash = route.split("/")
|
||||||
let page = hash[0]
|
let page = hash[0]
|
||||||
let id = hash[1] <<
|
let id = hash[1]
|
||||||
<< << < HEAD
|
let isLibrary = hash[2] ?? false
|
||||||
let isLibrary = hash[2] || false ===
|
|
||||||
=== =
|
|
||||||
let isLibrary = hash[2] ? ? false >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
console.log(`page: ${page} id: ${id} isLibrary: ${isLibrary}`)
|
console.log(`page: ${page} id: ${id} isLibrary: ${isLibrary}`)
|
||||||
this.routeView({
|
this.routeView({
|
||||||
kind: page,
|
kind: page,
|
||||||
|
@ -1102,16 +1094,10 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
routeView(item) { <<
|
routeView(item) {
|
||||||
<< << < HEAD
|
|
||||||
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind || (item.type || '')) : (item.type || ''));
|
|
||||||
let id = (item.attributes.playParams ? (item.attributes.playParams.id || (item.id || '')) : (item.id || ''));;
|
|
||||||
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary || false) : false; ===
|
|
||||||
=== =
|
|
||||||
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
|
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
|
||||||
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));;
|
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));;
|
||||||
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ? ? false) : false; >>>
|
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false;
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
console.log(kind, id, isLibrary)
|
console.log(kind, id, isLibrary)
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
|
@ -1153,12 +1139,8 @@ const app = new Vue({
|
||||||
app.getTypeFromID((kind), (id), (isLibrary), params);
|
app.getTypeFromID((kind), (id), (isLibrary), params);
|
||||||
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
||||||
document.querySelector("#app-content").scrollTop = 0
|
document.querySelector("#app-content").scrollTop = 0
|
||||||
} else { <<
|
} else {
|
||||||
<< << < HEAD
|
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
||||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url || '') ===
|
|
||||||
=== =
|
|
||||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ? ? '') >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1282,16 +1264,10 @@ const app = new Vue({
|
||||||
this.getArtistFromID(id)
|
this.getArtistFromID(id)
|
||||||
//this.getTypeFromID("artist",id,isLibrary,query)
|
//this.getTypeFromID("artist",id,isLibrary,query)
|
||||||
},
|
},
|
||||||
playMediaItem(item) { <<
|
playMediaItem(item) {
|
||||||
<< << < HEAD
|
|
||||||
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind || (item.type || '')) : (item.type || ''));
|
|
||||||
let id = (item.attributes.playParams ? (item.attributes.playParams.id || (item.id || '')) : (item.id || ''));;
|
|
||||||
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary || false) : false; ===
|
|
||||||
=== =
|
|
||||||
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
|
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
|
||||||
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));;
|
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));;
|
||||||
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ? ? false) : false; >>>
|
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false;
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
console.log(kind, id, isLibrary)
|
console.log(kind, id, isLibrary)
|
||||||
app.mk.stop().then(() => {
|
app.mk.stop().then(() => {
|
||||||
|
@ -1366,12 +1342,8 @@ const app = new Vue({
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
else { <<
|
else {
|
||||||
<< << < HEAD
|
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
||||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url || '') ===
|
|
||||||
=== =
|
|
||||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ? ? '') >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -2023,12 +1995,8 @@ const app = new Vue({
|
||||||
showSearch() {
|
showSearch() {
|
||||||
this.page = "search"
|
this.page = "search"
|
||||||
},
|
},
|
||||||
loadLyrics() { <<
|
loadLyrics() {
|
||||||
<< << < HEAD
|
const musicType = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["type"] ?? '' : '';
|
||||||
const musicType = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["type"] || '' : ''; ===
|
|
||||||
=== =
|
|
||||||
const musicType = (MusicKit.getInstance().nowPlayingItem != null) ? MusicKit.getInstance().nowPlayingItem["type"] ? ? '' : ''; >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
console.log("mt", musicType)
|
console.log("mt", musicType)
|
||||||
if (musicType === "musicVideo") {
|
if (musicType === "musicVideo") {
|
||||||
this.loadYTLyrics();
|
this.loadYTLyrics();
|
||||||
|
@ -2040,12 +2008,8 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadAMLyrics() { <<
|
loadAMLyrics() {
|
||||||
<< << < HEAD
|
const songID = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem["_songId"] ?? -1 : -1;
|
||||||
const songID = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem["_songId"] || -1 : -1; ===
|
|
||||||
=== =
|
|
||||||
const songID = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem["_songId"] ? ? -1 : -1; >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
// this.getMXM( trackName, artistName, 'en', duration);
|
// this.getMXM( trackName, artistName, 'en', duration);
|
||||||
if (songID != -1) {
|
if (songID != -1) {
|
||||||
MusicKit.getInstance().api.lyric(songID)
|
MusicKit.getInstance().api.lyric(songID)
|
||||||
|
@ -2072,25 +2036,15 @@ const app = new Vue({
|
||||||
self.getLibrarySongsFull(true)
|
self.getLibrarySongsFull(true)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async loadYTLyrics() { <<
|
async loadYTLyrics() {
|
||||||
<< << < HEAD
|
|
||||||
const track = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title || '' : '';
|
|
||||||
const artist = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName || '' : '';
|
|
||||||
const time = (this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] || -1000) / 1000) || -1) : -1; ===
|
|
||||||
=== =
|
|
||||||
const track = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title ?? '' : '';
|
const track = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title ?? '' : '';
|
||||||
const artist = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName ?? '' : '';
|
const artist = (this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName ?? '' : '';
|
||||||
const time = (this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] ? ? -1000) / 1000) ? ? -1) : -1; >>>
|
const time = (this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] ?? -1000) / 1000) ?? -1) : -1;
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
ipcRenderer.invoke('getYTLyrics', track, artist).then((result) => {
|
ipcRenderer.invoke('getYTLyrics', track, artist).then((result) => {
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
let ytid = result[0]['id']['videoId'];
|
let ytid = result[0]['id']['videoId'];
|
||||||
if (app.cfg.lyrics.enable_yt) { <<
|
if (app.cfg.lyrics.enable_yt) {
|
||||||
<< << < HEAD
|
loadYT(ytid, app.cfg.lyrics.mxm_language ?? "en")
|
||||||
loadYT(ytid, app.cfg.lyrics.mxm_language || "en") ===
|
|
||||||
=== =
|
|
||||||
loadYT(ytid, app.cfg.lyrics.mxm_language ? ? "en") >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
} else {
|
} else {
|
||||||
app.loadMXM()
|
app.loadMXM()
|
||||||
}
|
}
|
||||||
|
@ -2146,18 +2100,11 @@ const app = new Vue({
|
||||||
|
|
||||||
},
|
},
|
||||||
loadMXM() {
|
loadMXM() {
|
||||||
let attempt = 0; <<
|
let attempt = 0;
|
||||||
<< << < HEAD
|
|
||||||
const track = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title || '' : '');
|
|
||||||
const artist = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName || '' : '');
|
|
||||||
const time = encodeURIComponent((this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] || -1000) / 1000) || -1) : -1);
|
|
||||||
const id = encodeURIComponent((this.mk.nowPlayingItem != null) ? app.mk.nowPlayingItem._songId || '' : ''); ===
|
|
||||||
=== =
|
|
||||||
const track = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title ?? '' : '');
|
const track = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title ?? '' : '');
|
||||||
const artist = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName ?? '' : '');
|
const artist = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName ?? '' : '');
|
||||||
const time = encodeURIComponent((this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] ?? -1000) / 1000) ?? -1) : -1);
|
const time = encodeURIComponent((this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] ?? -1000) / 1000) ?? -1) : -1);
|
||||||
const id = encodeURIComponent((this.mk.nowPlayingItem != null) ? app.mk.nowPlayingItem._songId ? ? '' : ''); >>>
|
const id = encodeURIComponent((this.mk.nowPlayingItem != null) ? app.mk.nowPlayingItem._songId ?? '' : '');
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
let lrcfile = "";
|
let lrcfile = "";
|
||||||
let richsync = [];
|
let richsync = [];
|
||||||
const lang = app.cfg.lyrics.mxm_language // translation language
|
const lang = app.cfg.lyrics.mxm_language // translation language
|
||||||
|
@ -2179,12 +2126,8 @@ const app = new Vue({
|
||||||
req.onload = function() {
|
req.onload = function() {
|
||||||
let jsonResponse = JSON.parse(this.responseText);
|
let jsonResponse = JSON.parse(this.responseText);
|
||||||
let status2 = jsonResponse["message"]["header"]["status_code"];
|
let status2 = jsonResponse["message"]["header"]["status_code"];
|
||||||
if (status2 == 200) { <<
|
if (status2 == 200) {
|
||||||
<< << < HEAD
|
let token = jsonResponse["message"]["body"]["user_token"] ?? '';
|
||||||
let token = jsonResponse["message"]["body"]["user_token"] || ''; ===
|
|
||||||
=== =
|
|
||||||
let token = jsonResponse["message"]["body"]["user_token"] ? ? ''; >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
||||||
console.log('200 token', mode);
|
console.log('200 token', mode);
|
||||||
// token good
|
// token good
|
||||||
|
@ -2231,12 +2174,8 @@ const app = new Vue({
|
||||||
if (status1 == 200) {
|
if (status1 == 200) {
|
||||||
let id = '';
|
let id = '';
|
||||||
try {
|
try {
|
||||||
if (jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 && jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200) { <<
|
if (jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 && jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200) {
|
||||||
<< << < HEAD
|
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] ?? '';
|
||||||
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] || ''; ===
|
|
||||||
=== =
|
|
||||||
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] ? ? ''; >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
lrcfile = jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["body"]["subtitle_list"][0]["subtitle"]["subtitle_body"];
|
lrcfile = jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["body"]["subtitle_list"][0]["subtitle"]["subtitle_body"];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2256,18 +2195,10 @@ const app = new Vue({
|
||||||
let u = app.lyricsMediaItem.split(/[\r\n]/);
|
let u = app.lyricsMediaItem.split(/[\r\n]/);
|
||||||
let preLrc = []
|
let preLrc = []
|
||||||
for (var i = u.length - 1; i >= 0; i--) {
|
for (var i = u.length - 1; i >= 0; i--) {
|
||||||
let xline = (/(\[[0-9.:\[\]]*\])+(.*)/).exec(u[i]) <<
|
let xline = (/(\[[0-9.:\[\]]*\])+(.*)/).exec(u[i])
|
||||||
<< << < HEAD
|
|
||||||
let end = (preLrc.length > 0) ? ((preLrc[preLrc.length - 1].startTime) || 99999) : 99999
|
|
||||||
preLrc.push({
|
|
||||||
startTime: app.toMS(xline[1].substring(1, xline[1].length - 2)) || 0,
|
|
||||||
===
|
|
||||||
=== =
|
|
||||||
let end = (preLrc.length > 0) ? ((preLrc[preLrc.length - 1].startTime) ?? 99999) : 99999
|
let end = (preLrc.length > 0) ? ((preLrc[preLrc.length - 1].startTime) ?? 99999) : 99999
|
||||||
preLrc.push({
|
preLrc.push({
|
||||||
startTime: app.toMS(xline[1].substring(1, xline[1].length - 2)) ?? 0,
|
startTime: app.toMS(xline[1].substring(1, xline[1].length - 2)) ?? 0,
|
||||||
>>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
endTime: end,
|
endTime: end,
|
||||||
line: xline[2],
|
line: xline[2],
|
||||||
translation: ''
|
translation: ''
|
||||||
|
@ -2279,9 +2210,9 @@ const app = new Vue({
|
||||||
endTime: preLrc[preLrc.length - 1].startTime,
|
endTime: preLrc[preLrc.length - 1].startTime,
|
||||||
line: "lrcInstrumental",
|
line: "lrcInstrumental",
|
||||||
translation: ''
|
translation: ''
|
||||||
}); app.lyrics = preLrc.reverse();
|
});
|
||||||
}
|
app.lyrics = preLrc.reverse();
|
||||||
else {
|
} else {
|
||||||
preLrc = richsync.map(function(item) {
|
preLrc = richsync.map(function(item) {
|
||||||
return {
|
return {
|
||||||
startTime: item.ts,
|
startTime: item.ts,
|
||||||
|
@ -2527,14 +2458,10 @@ const app = new Vue({
|
||||||
if (childIndex != -1) {
|
if (childIndex != -1) {
|
||||||
app.mk.changeToMediaAtIndex(childIndex)
|
app.mk.changeToMediaAtIndex(childIndex)
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
app.mk.playNext({ <<
|
app.mk.playNext({
|
||||||
<< << < HEAD[item.attributes.playParams.kind || item.type]: item.attributes.playParams.id || item.id
|
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) || 1) ===
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1)
|
||||||
=== = [item.attributes.playParams.kind ? ? item.type]: item.attributes.playParams.id ? ? item.id
|
|
||||||
}).then(function() {
|
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ? ? 1) >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -2545,14 +2472,10 @@ const app = new Vue({
|
||||||
} else {
|
} else {
|
||||||
app.mk.stop().then(() => {
|
app.mk.stop().then(() => {
|
||||||
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))) {
|
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))) {
|
||||||
app.mk.setQueue({ <<
|
app.mk.setQueue({
|
||||||
<< << < HEAD[item.attributes.playParams.kind || item.type]: item.attributes.playParams.id || item.id
|
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) || 1).then(function() { ===
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1).then(function() {
|
||||||
=== = [item.attributes.playParams.kind ? ? item.type]: item.attributes.playParams.id ? ? item.id
|
|
||||||
}).then(function() {
|
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ? ? 1).then(function() { >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
|
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
|
||||||
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
let u = query;
|
let u = query;
|
||||||
|
@ -2583,14 +2506,10 @@ const app = new Vue({
|
||||||
if (childIndex != -1) {
|
if (childIndex != -1) {
|
||||||
app.mk.changeToMediaAtIndex(childIndex)
|
app.mk.changeToMediaAtIndex(childIndex)
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
app.mk.playNext({ <<
|
app.mk.playNext({
|
||||||
<< << < HEAD[item.attributes.playParams.kind || item.type]: item.attributes.playParams.id || item.id
|
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) || 1) ===
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1)
|
||||||
=== = [item.attributes.playParams.kind ? ? item.type]: item.attributes.playParams.id ? ? item.id
|
|
||||||
}).then(function() {
|
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ? ? 1) >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -2600,17 +2519,12 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
console.log(err)
|
console.log(err)
|
||||||
try {
|
try {
|
||||||
app.mk.stop()
|
app.mk.stop()
|
||||||
} catch (e) {} <<
|
} catch (e) {}
|
||||||
<< << < HEAD
|
this.playMediaItemById(item.attributes.playParams.id ?? item.id, item.attributes.playParams.kind ?? item.type, item.attributes.playParams.isLibrary ?? false, item.attributes.url)
|
||||||
this.playMediaItemById(item.attributes.playParams.id || item.id, item.attributes.playParams.kind || item.type, item.attributes.playParams.isLibrary || false, item.attributes.url) ===
|
|
||||||
=== =
|
|
||||||
this.playMediaItemById(item.attributes.playParams.id ? ? item.id, item.attributes.playParams.kind ? ? item.type, item.attributes.playParams.isLibrary ? ? false, item.attributes.url) >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -2707,12 +2621,8 @@ const app = new Vue({
|
||||||
if (type.slice(-1) != "s") {
|
if (type.slice(-1) != "s") {
|
||||||
type += "s"
|
type += "s"
|
||||||
}
|
}
|
||||||
type = type.replace("library-", "") <<
|
type = type.replace("library-", "")
|
||||||
<< << < HEAD
|
let id = item.attributes.playParams.catalogId ?? item.id
|
||||||
let id = item.attributes.playParams.catalogId || item.id ===
|
|
||||||
=== =
|
|
||||||
let id = item.attributes.playParams.catalogId ? ? item.id >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
|
|
||||||
let index = types.findIndex(function(type) {
|
let index = types.findIndex(function(type) {
|
||||||
return type.type == this
|
return type.type == this
|
||||||
|
@ -2894,24 +2804,16 @@ const app = new Vue({
|
||||||
async getCurrentArtURL() {
|
async getCurrentArtURL() {
|
||||||
try {
|
try {
|
||||||
this.currentArtUrl = '';
|
this.currentArtUrl = '';
|
||||||
if (app.mk.nowPlayingItem != null && app.mk.nowPlayingItem.attributes != null && app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url != '') { <<
|
if (app.mk.nowPlayingItem != null && app.mk.nowPlayingItem.attributes != null && app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url != '') {
|
||||||
<< << < HEAD
|
this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50);
|
||||||
this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] || '').replace('{w}', 50).replace('{h}', 50); ===
|
|
||||||
=== =
|
|
||||||
this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ? ? '').replace('{w}', 50).replace('{h}', 50); >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
try {
|
try {
|
||||||
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
} else {
|
} else {
|
||||||
let data = await this.mk.api.v3.music(`/v1/me/library/songs/${this.mk.nowPlayingItem.id}`);
|
let data = await this.mk.api.v3.music(`/v1/me/library/songs/${this.mk.nowPlayingItem.id}`);
|
||||||
data = data.data.data[0];
|
data = data.data.data[0];
|
||||||
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) { <<
|
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) {
|
||||||
<< << < HEAD
|
this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50);
|
||||||
this.currentArtUrl = (data["attributes"]["artwork"]["url"] || '').replace('{w}', 50).replace('{h}', 50); ===
|
|
||||||
=== =
|
|
||||||
this.currentArtUrl = (data["attributes"]["artwork"]["url"] ? ? '').replace('{w}', 50).replace('{h}', 50); >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
try {
|
try {
|
||||||
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
@ -3111,14 +3013,9 @@ const app = new Vue({
|
||||||
// return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
// return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||||
// }
|
// }
|
||||||
let self = this
|
let self = this
|
||||||
let data_type = this.mk.nowPlayingItem.playParams.kind <<
|
let data_type = this.mk.nowPlayingItem.playParams.kind
|
||||||
<< << < HEAD
|
|
||||||
let item_id = this.mk.nowPlayingItem.attributes.playParams.id || this.mk.nowPlayingItem.id
|
|
||||||
let isLibrary = this.mk.nowPlayingItem.attributes.playParams.isLibrary || false ===
|
|
||||||
=== =
|
|
||||||
let item_id = this.mk.nowPlayingItem.attributes.playParams.id ?? this.mk.nowPlayingItem.id
|
let item_id = this.mk.nowPlayingItem.attributes.playParams.id ?? this.mk.nowPlayingItem.id
|
||||||
let isLibrary = this.mk.nowPlayingItem.attributes.playParams.isLibrary ? ? false >>>
|
let isLibrary = this.mk.nowPlayingItem.attributes.playParams.isLibrary ?? false
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
let params = { "fields[songs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library", "t": "1" }
|
let params = { "fields[songs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library", "t": "1" }
|
||||||
// let res = await app.mkapi(data_type, isLibrary , item_id, params);
|
// let res = await app.mkapi(data_type, isLibrary , item_id, params);
|
||||||
// if (res && res.relationships && res.relationships.library && res.relationships.library.data && res.relationships.library.data.length > 0) {
|
// if (res && res.relationships && res.relationships.library && res.relationships.library.data && res.relationships.library.data.length > 0) {
|
||||||
|
@ -3275,12 +3172,8 @@ const app = new Vue({
|
||||||
numbers.push(parseInt(item, 16))
|
numbers.push(parseInt(item, 16))
|
||||||
|
|
||||||
}
|
}
|
||||||
numbers.shift() <<
|
numbers.shift()
|
||||||
<< << < HEAD
|
let gain = Math.log10((Math.max(numbers[0], numbers[1]) ?? 1000) / 1000.0) * -10
|
||||||
let gain = Math.log10((Math.max(numbers[0], numbers[1]) || 1000) / 1000.0) * -10 ===
|
|
||||||
=== =
|
|
||||||
let gain = Math.log10((Math.max(numbers[0], numbers[1]) ? ? 1000) / 1000.0) * -10 >>>
|
|
||||||
>>> > c7f180daf8cf1b2cdc35e1afde3b6c3ae98b7916
|
|
||||||
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
|
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
|
||||||
return {
|
return {
|
||||||
gain: gain,
|
gain: gain,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue