mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
cf27ed713d
Koel can now integrate and use the rich information from Last.fm. Now whenever a song is played, its album and artist information will be queried from Last.fm and cached for later use. What's better, if an album has no cover, Koel will try to update its cover if one is found on Last.fm. In order to use this feature, users only need to provide valid Last.fm API credentials (namely LASTFM_API_KEY and LASTFM_API_SECRET) in .env. A npm and gulp rebuild is also required - just like with every update.
40 lines
1.1 KiB
Vue
40 lines
1.1 KiB
Vue
<template>
|
||
<article class="item" v-if="album.songs.length">
|
||
<span class="cover" :style="{ backgroundImage: 'url(' + album.cover + ')' }">
|
||
<a class="control" @click.prevent="play">
|
||
<i class="fa fa-play"></i>
|
||
</a>
|
||
</span>
|
||
<footer>
|
||
<p class="name">{{ album.name }}</p>
|
||
<p class="artist">{{ album.artist.name }}</p>
|
||
<p class="meta">
|
||
{{ album.songs.length }} song{{ album.songs.length == 1 ? '' : 's' }}
|
||
–
|
||
{{ album.fmtLength }}
|
||
</p>
|
||
</footer>
|
||
</article>
|
||
</template>
|
||
|
||
<script>
|
||
import playback from '../../services/playback';
|
||
|
||
export default {
|
||
props: ['album'],
|
||
|
||
methods: {
|
||
/**
|
||
* Play all songs in the current album.
|
||
*/
|
||
play() {
|
||
playback.playAllInAlbum(this.album);
|
||
},
|
||
},
|
||
};
|
||
</script>
|
||
|
||
<style lang="sass">
|
||
@import "resources/assets/sass/partials/_vars.scss";
|
||
@import "resources/assets/sass/partials/_mixins.scss";
|
||
</style>
|