diff --git a/client/src/components/SeasonList.vue b/client/src/components/SeasonList.vue
index ebe7f8e..3d3646d 100644
--- a/client/src/components/SeasonList.vue
+++ b/client/src/components/SeasonList.vue
@@ -23,33 +23,33 @@
>
-
-
- Episode {{ episode.episode_id }} - "{{ episode.title }}"
+
+
+
+ Episode {{ episode.episode_id }} - "{{ episode.title }}"
+
+
+
+ episode.title
+
+ episode.description
+
+
+
+
-
- {{ episode.title }}
- {{ episode.description }}
-
@@ -59,31 +59,20 @@
diff --git a/client/src/store.js b/client/src/store.js
index 6c04efd..1d7802d 100644
--- a/client/src/store.js
+++ b/client/src/store.js
@@ -18,7 +18,7 @@ export default new Vuex.Store({
state: {
seasonCount: 9,
episodeCount: episodeCount,
- quoteData: baseData
+ quoteData: baseData,
},
mutations: {
[types.SET_EPISODE](state, payload) {
@@ -44,18 +44,22 @@ export default new Vuex.Store({
getters: {
// Check whether a episode has been fetched yet
isFetched(season, episode) {
- return this.state.quoteData[season - 1].episodes[episode] !== null;
+ return this.$store.state.quoteData[season - 1].episodes[episode] !== null;
},
// Get the number of episodes present for a given season
getEpisodeCount(season) {
- return this.state.episodeCount[season - 1];
+ return this.$store.state.episodeCount[season - 1];
},
// return Episode data if present
getEpisode(season, episode) {
if (this.getters.isFetched(season, episode))
- return this.state.quoteData[season]
+ return this.$store.state.quoteData[season]
else
return null
+ },
+ // return true if a specific episode is valid
+ isValidEpisode(season, episode = 1) {
+ return season >= 1 && season <= 9 && episode >= 1 && episode <= this.$store.getters.getEpisodeCount(season)
}
}
});