Merge branch 'main' into enhancement/radio

This commit is contained in:
Core 2022-05-25 03:08:48 +01:00
commit 6a86f78837
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
2 changed files with 579 additions and 557 deletions

View file

@ -52,6 +52,7 @@
"term.navigateForward": "Nyavigate fowwawd", "term.navigateForward": "Nyavigate fowwawd",
"term.play": "Pway", "term.play": "Pway",
"term.pause": "Pause", "term.pause": "Pause",
"term.stop": "Stop",
"term.previous": "Pwevious", "term.previous": "Pwevious",
"term.next": "Nyext", "term.next": "Nyext",
"term.shuffle": "Shuffwe", "term.shuffle": "Shuffwe",
@ -257,6 +258,9 @@
"action.tray.minimize": "Minyimize to Tway", "action.tray.minimize": "Minyimize to Tway",
"action.tray.quit": "Quit", "action.tray.quit": "Quit",
"action.tray.show": "Show Cidew", "action.tray.show": "Show Cidew",
"action.tray.playpause": "Pway/Pause",
"action.tray.next": "Nyext",
"action.tray.previous": "Pwevious",
"action.update": "Update", "action.update": "Update",
"action.install": "Instaww", "action.install": "Instaww",
"action.copy": "Copy", "action.copy": "Copy",

View file

@ -39,12 +39,20 @@
</div> </div>
</div> </div>
</div> </div>
<div class="info-rect" :class="{'info-rect-card': kind == 'card'}" :style="{'--bgartwork': getArtworkUrl(size, true)}"> <div class="info-rect" :class="{'info-rect-card': kind == 'card'}"
<div class="title" :title="item.attributes?.name ?? (item.relationships?.contents?.data[0]?.attributes?.name ?? (item.attributes?.editorialNotes?.name ?? ''))" v-if="item.attributes.artistNames == null || kind != 'card'" @click='app.routeView(item)'> :style="{'--bgartwork': getArtworkUrl(size, true)}">
<div class="item-navigate text-overflow-elipsis">{{ item.attributes?.name ?? (item.relationships?.contents?.data[0]?.attributes?.name ?? (item.attributes?.editorialNotes?.name ?? '')) }}</div> <div class="title"
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'" style= "background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div> :title="item.attributes?.name ?? (item.relationships?.contents?.data[0]?.attributes?.name ?? (item.attributes?.editorialNotes?.name ?? ''))"
v-if="item.attributes.artistNames == null || kind != 'card'" @click='app.routeView(item)'>
<div class="item-navigate text-overflow-elipsis">{{ item.attributes?.name ??
(item.relationships?.contents?.data[0]?.attributes?.name ??
(item.attributes?.editorialNotes?.name ?? '')) }}
</div> </div>
<div :title="getSubtitle()" class="subtitle item-navigate text-overflow-elipsis" @click="getSubtitleNavigation()" <div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'"
style="background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div>
</div>
<div :title="getSubtitle()" class="subtitle item-navigate text-overflow-elipsis"
@click="getSubtitleNavigation()"
v-if="getSubtitle() != ''"> v-if="getSubtitle() != ''">
{{ getSubtitle() }} {{ getSubtitle() }}
</div> </div>
@ -109,20 +117,21 @@
}, },
methods: { methods: {
getBgColor() { getBgColor() {
let color = `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : ``}` return `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : ``}`
return color
}, },
getContextMenu(event) { getContextMenu(event) {
if (this.item.type == "artists") { if (this.item.type === "artists") {
return this.artistMenu(event) return this.artistMenu(event)
} else { } else {
return this.contextMenu(event) return this.contextMenu(event)
} }
}, },
getSubtitle() { getSubtitle() {
if (this.kind == 'card') { if (this.kind === 'card' || this.item.type === "playlists") {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.description.standard != "undefined") {
return this.item.attributes.description.standard
} else if (typeof this.item.attributes.artistNames != "undefined") {
return this.item.attributes.artistNames return this.item.attributes.artistNames
} else if (typeof this.item.attributes.editorialNotes != "undefined") { } else if (typeof this.item.attributes.editorialNotes != "undefined") {
return this.item?.attributes?.editorialNotes?.short ?? (this.item.attributes?.editorialNotes?.name ?? '') return this.item?.attributes?.editorialNotes?.short ?? (this.item.attributes?.editorialNotes?.name ?? '')
@ -143,13 +152,9 @@
} }
}, },
getSubtitleNavigation() { getSubtitleNavigation() {
if (this.kind == 'card') { if (this.kind === 'card' || this.item.type === "playlists") {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.artistName != "undefined") {
return app.routeView(this.item)
} else if (typeof this.item.attributes.editorialNotes != "undefined") {
return app.routeView(this.item)
} else if (typeof this.item.attributes.artistName != "undefined") {
return app.searchAndNavigate(this.item, 'artist') return app.searchAndNavigate(this.item, 'artist')
} else { } else {
return app.routeView(this.item) return app.routeView(this.item)
@ -191,7 +196,9 @@
} }
let kind = this.item.type ?? this.item.attributes.playParams.kind let kind = this.item.type ?? this.item.attributes.playParams.kind
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind; let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
if (truekind == "musicVideos") {truekind = "music-videos"} if (truekind === "musicVideos") {
truekind = "music-videos"
}
let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`, params); let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`, params);
res = res.data.data[0] res = res.data.data[0]
this.addedToLibrary = (res && res.attributes && res.attributes.inLibrary) ? res.attributes.inLibrary : false this.addedToLibrary = (res && res.attributes && res.attributes.inLibrary) ? res.attributes.inLibrary : false
@ -207,7 +214,9 @@
} }
let kind = this.item.type ?? this.item.attributes.playParams.kind let kind = this.item.type ?? this.item.attributes.playParams.kind
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind; let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
if (truekind == "musicVideos") {truekind = "music-videos"} if (truekind == "musicVideos") {
truekind = "music-videos"
}
let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`, params); let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`, params);
res = res.data.data[0] res = res.data.data[0]
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) {
@ -218,7 +227,8 @@
{ {
fetchOptions: { fetchOptions: {
method: "DELETE" method: "DELETE"
}}) }
})
this.addedToLibrary = true this.addedToLibrary = true
}, },
uuidv4() { uuidv4() {
@ -247,9 +257,11 @@
try { try {
type = this.item.type type = this.item.type
}catch(e) {console.log('sd',this.item)} } catch (e) {
console.log('sd', this.item)
}
if (this.kind != "") { if (this.kind !== "") {
type = this.kind type = this.kind
} }
switch (type) { switch (type) {
@ -444,10 +456,13 @@
"action": function () { "action": function () {
if (!self.item.attributes.url && self.item.relationships) { if (!self.item.attributes.url && self.item.relationships) {
if (self.item.relationships.catalog) { if (self.item.relationships.catalog) {
app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.copyToClipboard((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)}) app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {
self.app.copyToClipboard((u.data.data.length && u.data.data.length > 0) ? u.data.data[0].attributes.url : u.data.data.attributes.url)
})
} }
} else { } else {
self.app.copyToClipboard(self.item.attributes.url)} self.app.copyToClipboard(self.item.attributes.url)
}
} }
}, },
{ {
@ -456,10 +471,13 @@
"action": function () { "action": function () {
if (!self.item.attributes.url && self.item.relationships) { if (!self.item.attributes.url && self.item.relationships) {
if (self.item.relationships.catalog) { if (self.item.relationships.catalog) {
app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.songLinkShare((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)}) app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {
self.app.songLinkShare((u.data.data.length && u.data.data.length > 0) ? u.data.data[0].attributes.url : u.data.data.attributes.url)
})
} }
} else { } else {
self.app.songLinkShare(self.item.attributes.url)} self.app.songLinkShare(self.item.attributes.url)
}
} }
} }
] ]