kinda works

This commit is contained in:
Amaru8 2022-04-30 16:45:55 +02:00
parent dfac4c5f2b
commit 6be02711a0

View file

@ -67,7 +67,7 @@
</div>
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'"></div>
<template v-if="showMetaData == true" @dblclick="route()">
<div class="metainfo" style="min-width: 70px;" v-if="getHeartStatus()">
<div class="metainfo" style="min-width: 70px;" v-if="isLoved">
<div class="svg-icon" :style="{'--url': 'url(./assets/feather/heart-fill.svg)'}"></div>
</div>
<div class="metainfo">
@ -101,7 +101,8 @@
displayDuration: true,
addClasses: {},
itemId: 0,
isLibrary: false
isLibrary: false,
isLoved: null
}
},
props: {
@ -124,6 +125,9 @@
} else {
this.itemId = this.item.id;
}
if (this.item.attributes.playParams) {
this.getHeartStatus();
}
let duration = this.item.attributes.durationInMillis ?? 0
if (duration == 0 || !this.showDuration) {
this.displayDuration = false
@ -504,14 +508,13 @@
},
async getHeartStatus() {
try {
let rating = await app.getRating(this.item)
if (rating == 1) {
console.log(this.item.attributes.name + " checked for heart status! Response: true")
return true;
await app.getRating(this.item).then(res => {
if (res == 1) {
this.isLoved = true
} else {
console.log(this.item.attributes.name + " checked for heart status! Response: false")
return false;
this.isLoved = false
}
})
} catch (err) {
console.log(err)
}