Skip to content

Commit

Permalink
Use more apropriate album cover resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTeaCat committed Jan 11, 2021
1 parent 84c450a commit 7d78658
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ export default {
},
mounted() {
this.album.album.images.sort((a,b)=>{return b.width*b.height - a.width*a.height})[0]
//Pick the image with the closest resolution to 300x300.
this.album.album.images.sort(
(a,b) => {
return Math.abs(a.width*a.height - 300*300)
- Math.abs(b.width*b.height - 300*300)
}
)
this.albumCover = this.album.album.images[0].url
}
}
Expand Down

0 comments on commit 7d78658

Please sign in to comment.