limiting artist breakdown visibility

This commit is contained in:
andy 2022-06-28 07:25:24 +01:00
parent 3e04935897
commit fb88da4337
2 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,7 @@
<info-card v-for="card in cards" :html="card.content"></info-card> <info-card v-for="card in cards" :html="card.content"></info-card>
<artist-breakdown :play_count="playCount" <artist-breakdown :play_count="playCount"
v-if="playCount !== null && playCount !== undefined"></artist-breakdown> v-if="showArtistBreakdown"></artist-breakdown>
<play-count-chart-card-comb :data_points="combinedData" <play-count-chart-card-comb :data_points="combinedData"
:chart_id="'combined'" :chart_id="'combined'"

View File

@ -7,7 +7,6 @@ import { PlayCountChartCard, CombinedPlayCountChartCard } from "./Now/PlayCountG
import { ArtistBreakdownChartCard } from "./Now/ArtistBreakdownGraph"; import { ArtistBreakdownChartCard } from "./Now/ArtistBreakdownGraph";
import { PlayCountCard, LastFmLogoLink } from "./Now/LastFm"; import { PlayCountCard, LastFmLogoLink } from "./Now/LastFm";
import BaseInfoCard from "./Now/BaseInfoCard"; import BaseInfoCard from "./Now/BaseInfoCard";
import { DateTime } from "luxon";
const connection = new signalR.HubConnectionBuilder() const connection = new signalR.HubConnectionBuilder()
.withUrl("/hub") .withUrl("/hub")
@ -63,6 +62,9 @@ const app = Vue.createApp({
showTrackChart(){ showTrackChart(){
return this.playCount !== null && this.playCount !== undefined && this.playCount.trackCountData.length > 3; return this.playCount !== null && this.playCount !== undefined && this.playCount.trackCountData.length > 3;
}, },
showArtistBreakdown(){
return this.playCount !== null && this.playCount !== undefined && this.playCount.artist > 0;
},
earliestDate(){ earliestDate(){
return this.playCount.artistCountData[0].timeStamp; return this.playCount.artistCountData[0].timeStamp;
}, },