From 9a411358cafd763dde9dd4f37e00815e11a2c3d9 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 20 Feb 2024 21:31:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20feat:=20Mod?= =?UTF-8?q?ify=20some=20endpoints=20to=20match=20gPodder.net=20ones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appinfo/routes.php | 4 ++-- lib/Controller/SearchController.php | 4 ++-- .../{TopsController.php => ToplistController.php} | 2 +- src/components/Discover/Search.vue | 2 +- src/components/Discover/{Tops.vue => Toplist.vue} | 4 ++-- src/views/Discover.vue | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) rename lib/Controller/{TopsController.php => ToplistController.php} (93%) rename src/components/Discover/{Tops.vue => Toplist.vue} (93%) diff --git a/appinfo/routes.php b/appinfo/routes.php index eb63e71..5235527 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -19,7 +19,7 @@ return [ ['name' => 'opml#import', 'url' => '/opml/import', 'verb' => 'POST'], ['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'], ['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'], - ['name' => 'tops#hot', 'url' => '/tops/hot', 'verb' => 'GET'], - ['name' => 'tops#new', 'url' => '/tops/new', 'verb' => 'GET'], + ['name' => 'toplist#hot', 'url' => '/toplist/hot', 'verb' => 'GET'], + ['name' => 'toplist#new', 'url' => '/toplist/new', 'verb' => 'GET'], ], ]; diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php index 17d5685..1b42821 100644 --- a/lib/Controller/SearchController.php +++ b/lib/Controller/SearchController.php @@ -19,7 +19,7 @@ class SearchController extends Controller parent::__construct(Application::APP_ID, $request); } - public function index(string $value): JSONResponse { - return new JSONResponse($this->multiPodService->search($value)); + public function index(string $q): JSONResponse { + return new JSONResponse($this->multiPodService->search($q)); } } diff --git a/lib/Controller/TopsController.php b/lib/Controller/ToplistController.php similarity index 93% rename from lib/Controller/TopsController.php rename to lib/Controller/ToplistController.php index 6c5285d..28bef13 100644 --- a/lib/Controller/TopsController.php +++ b/lib/Controller/ToplistController.php @@ -10,7 +10,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; -class TopsController extends Controller +class ToplistController extends Controller { public function __construct( IRequest $request, diff --git a/src/components/Discover/Search.vue b/src/components/Discover/Search.vue index 1483c2f..0c3234b 100644 --- a/src/components/Discover/Search.vue +++ b/src/components/Discover/Search.vue @@ -61,7 +61,7 @@ export default { try { this.loading = true const currentSearch = this.value - const feeds = await axios.get(generateUrl('/apps/repod/search?value={value}', { value: currentSearch })) + const feeds = await axios.get(generateUrl('/apps/repod/search?q={value}', { value: currentSearch })) if (currentSearch === this.value) { this.feeds = [...feeds.data].sort((a, b) => b.fetchedAtUnix - a.fetchedAtUnix) } diff --git a/src/components/Discover/Tops.vue b/src/components/Discover/Toplist.vue similarity index 93% rename from src/components/Discover/Tops.vue rename to src/components/Discover/Toplist.vue index ff649db..408e180 100644 --- a/src/components/Discover/Tops.vue +++ b/src/components/Discover/Toplist.vue @@ -20,7 +20,7 @@ import { showError } from '@nextcloud/dialogs' import { toUrl } from '../../utils/url.js' export default { - name: 'Tops', + name: 'Toplist', components: { Loading, }, @@ -51,7 +51,7 @@ export default { async mounted() { try { this.loading = true - const tops = await axios.get(generateUrl(`/apps/repod/tops/${this.type}`)) + const tops = await axios.get(generateUrl(`/apps/repod/toplist/${this.type}`)) this.tops = tops.data } catch (e) { console.error(e) diff --git a/src/views/Discover.vue b/src/views/Discover.vue index 47d229a..4cef5fa 100644 --- a/src/views/Discover.vue +++ b/src/views/Discover.vue @@ -4,8 +4,8 @@ - - + + @@ -16,7 +16,7 @@ import AppContent from '../components/Atoms/AppContent.vue' import Magnify from 'vue-material-design-icons/Magnify.vue' import { NcTextField } from '@nextcloud/vue' import Search from '../components/Discover/Search.vue' -import Tops from '../components/Discover/Tops.vue' +import Toplist from '../components/Discover/Toplist.vue' export default { name: 'Discover', @@ -26,7 +26,7 @@ export default { Magnify, NcTextField, Search, - Tops, + Toplist, }, data() { return {