Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
085081afc3
3 changed files with 8 additions and 9 deletions
|
@ -116,9 +116,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build": {
|
"build": {
|
||||||
"electronVersion": "20.1.1",
|
"electronVersion": "20.1.3",
|
||||||
"electronDownload": {
|
"electronDownload": {
|
||||||
"version": "20.1.1+wvcus",
|
"version": "20.1.3+wvcus",
|
||||||
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
|
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
|
||||||
},
|
},
|
||||||
"appId": "cider",
|
"appId": "cider",
|
||||||
|
|
|
@ -83,7 +83,7 @@ const MusicKitInterop = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetchSongRelationships({id = app.mk.nowPlayingItem.attributes.playParams.catalogId || app.mk.nowPlayingItem.attributes.playParams.id, relationship = "primaryName"}={}) {
|
async fetchSongRelationships({ id = app.mk.nowPlayingItem.attributes.playParams.catalogId || app.mk.nowPlayingItem.attributes.playParams.id, relationship = "primaryName" } = {}) {
|
||||||
const res = await MusicKit.getInstance().api.v3.music("/v1/catalog/" + MusicKit.getInstance().storefrontId + `/songs/${id}`, {
|
const res = await MusicKit.getInstance().api.v3.music("/v1/catalog/" + MusicKit.getInstance().storefrontId + `/songs/${id}`, {
|
||||||
include: {
|
include: {
|
||||||
songs: ["artists"],
|
songs: ["artists"],
|
||||||
|
@ -108,7 +108,7 @@ const MusicKitInterop = {
|
||||||
const albumData = songData.relationships.albums.data;
|
const albumData = songData.relationships.albums.data;
|
||||||
const primaryArtist = artistData[0];
|
const primaryArtist = artistData[0];
|
||||||
|
|
||||||
switch(relationship) {
|
switch (relationship) {
|
||||||
default:
|
default:
|
||||||
case "primaryName":
|
case "primaryName":
|
||||||
if (artistData.length < 1) {
|
if (artistData.length < 1) {
|
||||||
|
@ -121,7 +121,7 @@ const MusicKitInterop = {
|
||||||
return primaryArtist;
|
return primaryArtist;
|
||||||
|
|
||||||
case "album":
|
case "album":
|
||||||
return albumData[0]
|
return albumData[0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2147,7 +2147,7 @@ const app = new Vue({
|
||||||
// app.getTypeFromID((kind), (id), (isLibrary), params);
|
// app.getTypeFromID((kind), (id), (isLibrary), params);
|
||||||
} else if (kind.toString().includes("song")) {
|
} else if (kind.toString().includes("song")) {
|
||||||
const albumUrl = new Promise(async (resolve, reject) => {
|
const albumUrl = new Promise(async (resolve, reject) => {
|
||||||
resolve(await MusicKitInterop.fetchSongRelationships({id: id, relationship: "album"}));
|
resolve(await MusicKitInterop.fetchSongRelationships({ id: id, relationship: "album" }));
|
||||||
});
|
});
|
||||||
albumUrl.then((data) => {
|
albumUrl.then((data) => {
|
||||||
if (data && data.type === "albums" && data.id) {
|
if (data && data.type === "albums" && data.id) {
|
||||||
|
@ -2155,8 +2155,7 @@ const app = new Vue({
|
||||||
} else {
|
} else {
|
||||||
app.playMediaItemById(id, kind, isLibrary, item.attributes.url ?? "");
|
app.playMediaItemById(id, kind, isLibrary, item.attributes.url ?? "");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
app.playMediaItemById(id, kind, isLibrary, item.attributes.url ?? "");
|
app.playMediaItemById(id, kind, isLibrary, item.attributes.url ?? "");
|
||||||
}
|
}
|
||||||
|
@ -4554,7 +4553,7 @@ const app = new Vue({
|
||||||
if (app.mk.nowPlayingItem.relationships.artists.data[0].id) {
|
if (app.mk.nowPlayingItem.relationships.artists.data[0].id) {
|
||||||
app.appRoute(`artist/${app.mk.nowPlayingItem.relationships.artists.data[0].id}`);
|
app.appRoute(`artist/${app.mk.nowPlayingItem.relationships.artists.data[0].id}`);
|
||||||
} else {
|
} else {
|
||||||
const primaryArtist = await MusicKitInterop.fetchSongRelationships({ relationship: "primaryArtist"})
|
const primaryArtist = await MusicKitInterop.fetchSongRelationships({ relationship: "primaryArtist" });
|
||||||
app.appRoute(`artist/${primaryArtist.id}`);
|
app.appRoute(`artist/${primaryArtist.id}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue