diff --git a/music_graph/src/components/AlbumCarousel.vue b/music_graph/src/components/AlbumCarousel.vue index fe7ab54..210fea4 100644 --- a/music_graph/src/components/AlbumCarousel.vue +++ b/music_graph/src/components/AlbumCarousel.vue @@ -1,20 +1,23 @@ - - + {{release.name}} ({{release.year}}) - + @@ -23,7 +26,7 @@ import {MusicGraphApi} from '../MusicGraphApi' export default { name: 'AlbumCarousel', - props: ['releases', 'interval'], + props: ['releases', 'interval', 'alone'], data() { return { api: new MusicGraphApi(), @@ -37,18 +40,23 @@ export default { }, Number(this.interval)) }, watch: { - releases: () => { + releases: function () { this.index = 0 + this.tick() } }, methods: { tick() { - if (this.index === this.releases.length - 1) { + if (this.releases.length === 0) { + return + } + + if (this.index >= this.releases.length) { this.index = 0 } - this.index += 1 this.current = this.releases[this.index].mbid + this.index += 1 } } } @@ -58,7 +66,8 @@ export default { figure { text-align: center; - margin: 0 0 10px 0; - max-width: 300px; + width: 128px; + height: 180px; + margin: 0 20px 3em 20px; } diff --git a/music_graph/src/components/ArtistInfo.vue b/music_graph/src/components/ArtistInfo.vue index b36e279..3c4891b 100644 --- a/music_graph/src/components/ArtistInfo.vue +++ b/music_graph/src/components/ArtistInfo.vue @@ -1,14 +1,27 @@ - {{artist.name}} + {{artist.name}}[{{artistInfo.year}}] - Listeners: {{artist.listeners}} + style="float: right" + :releases="artistInfo.releases" + interval="1250"/> + + {{artistInfo.comment}} + + + Tags + {{tag.name}} + + @@ -39,7 +52,9 @@ export default { this.api.getArtistDetails(artist.mbid) .then(info => { this.artistInfo = info - this.artistInfo.releases = this.artistInfo.releases.slice(0, 2) + this.artistInfo.releases = this.artistInfo.releases.filter(r => + r.labels.indexOf('Album') !== -1 || r.labels.indexOf('EP') !== -1) + this.artistInfo.tags = info.tags.sort((a, b) => b.weight - a.weight).splice(0, 6) }) } } @@ -48,7 +63,33 @@ export default { diff --git a/music_graph/static/album.png b/music_graph/static/album.png new file mode 100644 index 0000000..80eed43 Binary files /dev/null and b/music_graph/static/album.png differ
{{artistInfo.comment}}