From 36cafbbbb043ca168f8b5be9aa2c807b49b0ef1d Mon Sep 17 00:00:00 2001
From: Jonas Heinrich <onny@project-insanity.org>
Date: Wed, 16 Dec 2020 14:07:51 +0100
Subject: [PATCH] fix styling episode list thumb size

---
 lib/Service/ShowNotFound.php | 27 +++++++++++++++++++++++++++
 src/components/Table.vue     |  9 +++++++--
 src/views/Show.vue           | 28 ++++++++++++++++++++--------
 3 files changed, 54 insertions(+), 10 deletions(-)
 create mode 100644 lib/Service/ShowNotFound.php

diff --git a/lib/Service/ShowNotFound.php b/lib/Service/ShowNotFound.php
new file mode 100644
index 0000000..e62707f
--- /dev/null
+++ b/lib/Service/ShowNotFound.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Podcast App
+ *
+ * @author Jonas Heinrich
+ * @copyright 2020 Jonas Heinrich <onny@project-insanity.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Podcast\Service;
+
+class ShowNotFound extends \Exception {
+}
diff --git a/src/components/Table.vue b/src/components/Table.vue
index d4a4ddf..f5bc9fb 100644
--- a/src/components/Table.vue
+++ b/src/components/Table.vue
@@ -43,7 +43,7 @@
 				:key="idx"
 				:class="{ selected: idx === activeItem}">
 				<td class="iconColumn">
-					<div style="width: 64px; height: 64px;">
+					<div>
 						<blur-hash-image
 							hash="L1TSUA?bj[?b~qfQfQj[ayfQfQfQ"
 							:src="episode.imgURL" />
@@ -226,7 +226,12 @@ table {
 
 		td.iconColumn {
 			padding-right: 0px;
-			padding-left: 40px;
+			padding-left: 35px;
+
+			div {
+				width: 74px;
+				height: 74px;
+			}
 		}
 
 		td.nameColumn {
diff --git a/src/views/Show.vue b/src/views/Show.vue
index 0216629..6e96d8b 100644
--- a/src/views/Show.vue
+++ b/src/views/Show.vue
@@ -87,7 +87,7 @@ export default {
 			episodes: [],
 		},
 		pageLoading: false,
-		queryParams: {},
+		nextPage: 0,
 	}),
 	computed: {
 		player() {
@@ -124,6 +124,7 @@ export default {
 		onResize({ width, height }) {
 			const contentHeight = document.getElementById('app-content-vue').scrollHeight
 			const tableHeight = height
+			console.log(tableHeight, contentHeight)
 			if (tableHeight < contentHeight) {
 				this.preFill()
 			}
@@ -135,6 +136,7 @@ export default {
 
 		preFill() {
 			const route = this.$route
+			console.log('lol')
 			console.log(route)
 			// this.queryPodcast(route.name)
 		},
@@ -148,11 +150,18 @@ export default {
 
 			const vm = this
 
-			const queryURI = 'https://api.fyyd.de/0.2/podcast/episodes?podcast_id=' + podcastId
+			const queryURI = 'https://api.fyyd.de/0.2/podcast/episodes'
 			try {
 				delete axios.defaults.headers.requesttoken
-				await axios.get(queryURI)
+				await axios.get(queryURI, {
+					params: {
+						podcast_id: podcastId,
+						count: 20,
+						page: vm.nextPage,
+					},
+				})
 					.then(function(response) {
+						vm.nextPage = response.data.meta.paging.next_page
 						vm.processPodcast(response.data)
 					})
 			} catch (error) {
@@ -161,7 +170,11 @@ export default {
 		},
 
 		processPodcast(podcast) {
-			this.podcast = podcast.data
+			if (this.nextPage > 1) {
+				this.podcast.episodes = this.podcast.episodes.concat(podcast.data.episodes)
+			} else {
+				this.podcast = podcast.data
+			}
 			this.pageLoading = false
 		},
 
@@ -171,10 +184,9 @@ export default {
 		scroll() {
 			window.onscroll = () => {
 				if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
-					const route = this.$route
-					console.log(route)
-					// this.queryPodcast(route.name)
-				    }
+					const podcastId = this.$route.params.id
+					this.queryPodcast(podcastId)
+				}
 			}
 		},
 	},
-- 
GitLab