diff --git a/appinfo/routes.php b/appinfo/routes.php
index ec0fc03..89e6a4d 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -13,8 +13,8 @@ declare(strict_types=1);
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
- ['name' => 'fetch#index', 'url' => '/fetch/{uri}', 'verb' => 'GET'],
- ['name' => 'search#index', 'url' => '/search/{value}', 'verb' => 'GET'],
- ['name' => 'toplist#index', 'url' => '/toplist/{count}', 'verb' => 'GET'],
+ ['name' => 'fetch#index', 'url' => '/fetch', 'verb' => 'GET'],
+ ['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'],
+ ['name' => 'toplist#index', 'url' => '/toplist', 'verb' => 'GET'],
],
];
diff --git a/img/fyyd.svg b/img/fyyd.svg
deleted file mode 100644
index fe0be6c..0000000
--- a/img/fyyd.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/img/itunes.svg b/img/itunes.svg
deleted file mode 100644
index 3f06156..0000000
--- a/img/itunes.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/lib/Controller/FetchController.php b/lib/Controller/FetchController.php
index 2a06b47..8448d93 100644
--- a/lib/Controller/FetchController.php
+++ b/lib/Controller/FetchController.php
@@ -24,16 +24,16 @@ class FetchController extends Controller
parent::__construct(Application::APP_ID, $request);
}
- public function index(string $uri): JSONResponse
+ public function index(string $url): JSONResponse
{
- $podcastData = $this->podcastDataReader->getCachedOrFetchPodcastData($uri, $this->userService->getUserUID());
+ $podcastData = $this->podcastDataReader->getCachedOrFetchPodcastData($url, $this->userService->getUserUID());
if ($podcastData) {
- return new JSONResponse($podcastData->toArray());
+ return new JSONResponse(['data' => $podcastData->toArray()]);
}
$client = $this->clientService->newClient();
- $feed = $client->get($uri);
+ $feed = $client->get($url);
$statusCode = $feed->getStatusCode();
if ($statusCode < 200 || $statusCode >= 300) {
@@ -42,6 +42,6 @@ class FetchController extends Controller
$podcastData = PodcastData::parseRssXml((string) $feed->getBody());
- return new JSONResponse($podcastData->toArray());
+ return new JSONResponse(['data' => $podcastData->toArray()]);
}
}
diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php
index 4abdf68..c3b46a5 100644
--- a/lib/Controller/SearchController.php
+++ b/lib/Controller/SearchController.php
@@ -37,7 +37,7 @@ class SearchController extends Controller
}
}
- usort($podcasts, fn (PodcastData $a, PodcastData $b) => $a->getFetchedAtUnix() <=> $b->getFetchedAtUnix());
+ usort($podcasts, fn (PodcastData $a, PodcastData $b) => $b->getFetchedAtUnix() <=> $a->getFetchedAtUnix());
$podcasts = array_intersect_key($podcasts, array_unique(array_map(fn (PodcastData $feed) => $feed->getLink(), $podcasts)));
return new JSONResponse($podcasts);
diff --git a/src/components/Search.vue b/src/components/Search.vue
index c26bd93..5a5e388 100644
--- a/src/components/Search.vue
+++ b/src/components/Search.vue
@@ -1,24 +1,18 @@
@@ -57,7 +51,7 @@ export default {
search: debounce(async function value() {
try {
const currentSearch = this.value
- const feeds = await axios.get(generateUrl('/apps/repod/search/{value}', { value: currentSearch }))
+ const feeds = await axios.get(generateUrl('/apps/repod/search?value={value}', { value: currentSearch }))
if (currentSearch === this.value) {
this.feeds = feeds.data
}
@@ -70,7 +64,6 @@ export default {
return `/${btoa(url)}`
},
formatTimeAgo,
- generateUrl,
},
}
diff --git a/src/components/TopItem.vue b/src/components/TopItem.vue
index ca8beda..38a5082 100644
--- a/src/components/TopItem.vue
+++ b/src/components/TopItem.vue
@@ -1,7 +1,7 @@
@@ -19,7 +19,11 @@ export default {
type: String,
required: true,
},
- logo: {
+ imageUrl: {
+ type: String,
+ required: true,
+ },
+ link: {
type: String,
required: true,
},
@@ -27,15 +31,11 @@ export default {
type: String,
required: true,
},
- url: {
- type: String,
- required: true,
- },
},
methods: {
async addSubscription() {
try {
- await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [this.url], remove: [] })
+ await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [this.link], remove: [] })
} catch (e) {
console.error(e)
showError(t('Error while adding the feed'))
diff --git a/src/components/TopList.vue b/src/components/TopList.vue
index d13c762..71365c5 100644
--- a/src/components/TopList.vue
+++ b/src/components/TopList.vue
@@ -6,11 +6,11 @@