mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-06 03:16:45 -06:00
Add episode image to Season component with thumbnail support
This commit is contained in:
@@ -6,7 +6,11 @@
|
||||
<b-list-group-item v-for="episode in season.episodes" :key="episode.episode_id">
|
||||
<b-row align-v="start" align-content="start">
|
||||
<b-col cols="5" md="4" lg="4" xl="3">
|
||||
<b-img-lazy fluid-grow class="px-2" src="https://via.placeholder.com/250" />
|
||||
<b-img-lazy
|
||||
fluid-grow class="px-2"
|
||||
:src="getUrl(episode.episodeNumber, episode.seasonNumber)"
|
||||
:blank-src="getUrl(episode.episodeNumber, episode.seasonNumber, true)"
|
||||
/>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<h4>
|
||||
@@ -69,6 +73,13 @@ export default {
|
||||
methods: {
|
||||
getEpisodeRoute(s, e) {
|
||||
return {name: 'Episode', params: {season: s, episode: e}}
|
||||
},
|
||||
getUrl(episode, season, thumbnail = false) {
|
||||
episode = episode.toString().padStart(2, "0")
|
||||
season = season.toString().padStart(2, "0")
|
||||
const filename = thumbnail ? 'thumbnail.jpeg' : 'full.jpeg'
|
||||
|
||||
return `/img/${season}/${episode}/${filename}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user