navigation fixes
This commit is contained in:
parent
a8374dbccb
commit
d6fd99a9b0
2 changed files with 11 additions and 9 deletions
|
@ -372,7 +372,7 @@ const app = new Vue({
|
||||||
let artistId = '';
|
let artistId = '';
|
||||||
try {
|
try {
|
||||||
if (item.relationships.artists && item.relationships.artists.data.length > 0) {
|
if (item.relationships.artists && item.relationships.artists.data.length > 0) {
|
||||||
if (item.relationships.artists.data[0].type === "artists") { artistId = item.relationships.artists.data[0].id }
|
if (item.relationships.artists.data[0].type === "artist" || item.relationships.artists.data[0].type === "artists") { artistId = item.relationships.artists.data[0].id }
|
||||||
} else {
|
} else {
|
||||||
const url = (item.relationships.catalog.data[0].attributes.artistUrl);
|
const url = (item.relationships.catalog.data[0].attributes.artistUrl);
|
||||||
artistId = (url).substring(url.lastIndexOf('/') + 1)
|
artistId = (url).substring(url.lastIndexOf('/') + 1)
|
||||||
|
@ -398,8 +398,8 @@ const app = new Vue({
|
||||||
case "album":
|
case "album":
|
||||||
let albumId = '';
|
let albumId = '';
|
||||||
try {
|
try {
|
||||||
if (item.relationships.albums && item.relationships.artists.albums.length > 0) {
|
if (item.relationships.albums && item.relationships.albums.data.length > 0) {
|
||||||
if (item.relationships.albums.data[0].type === "album") { albumId = item.relationships.albums.data[0].id }
|
if (item.relationships.albums.data[0].type === "album" || item.relationships.albums.data[0].type === "albums") { albumId = item.relationships.albums.data[0].id }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (_) { }
|
catch (_) { }
|
||||||
|
@ -1475,9 +1475,11 @@ document.addEventListener('musickitloaded', function () {
|
||||||
MusicKit.configure({
|
MusicKit.configure({
|
||||||
developerToken: parsedJson.Key,
|
developerToken: parsedJson.Key,
|
||||||
app: {
|
app: {
|
||||||
name: 'My Cool Web App',
|
name: 'Apple Music',
|
||||||
build: '1978.4.1'
|
build: '1978.4.1',
|
||||||
}
|
version: "1.0"
|
||||||
|
},
|
||||||
|
sourceType: 24
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
app.init()
|
app.init()
|
||||||
|
|
|
@ -68,11 +68,11 @@
|
||||||
{{ mk.nowPlayingItem["attributes"]["name"] }}
|
{{ mk.nowPlayingItem["attributes"]["name"] }}
|
||||||
</div>
|
</div>
|
||||||
<div class="song-artist text-overflow-elipsis" style="display: inline-block;-webkit-box-orient: horizontal;">
|
<div class="song-artist text-overflow-elipsis" style="display: inline-block;-webkit-box-orient: horizontal;">
|
||||||
<div class="item-navigate text-overflow-elipsis" style="display: inline-block;" @click="app.getNowPlayingItemDetailed(`artist`)">
|
<div class="item-navigate song-artist text-overflow-elipsis" style="display: inline-block;" @click="app.getNowPlayingItemDetailed(`artist`)">
|
||||||
{{ mk.nowPlayingItem["attributes"]["artistName"] }} -
|
{{ mk.nowPlayingItem["attributes"]["artistName"] }}
|
||||||
</div>
|
</div>
|
||||||
<div class="song-artist item-navigate text-overflow-elipsis" style="display: inline-block;" @click="app.getNowPlayingItemDetailed('album')">
|
<div class="song-artist item-navigate text-overflow-elipsis" style="display: inline-block;" @click="app.getNowPlayingItemDetailed('album')">
|
||||||
{{ mk.nowPlayingItem["attributes"]["albumName"] }}
|
{{ " - " + mk.nowPlayingItem["attributes"]["albumName"] }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue