🧑‍💻 feat: Modify some endpoints to match gPodder.net ones
All checks were successful
repod / xml (push) Successful in 18s
repod / php (push) Successful in 1m25s
repod / nodejs (push) Successful in 2m12s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-02-20 21:31:38 +01:00
parent 33fee28c02
commit 9a411358ca
6 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,7 @@ return [
['name' => 'opml#import', 'url' => '/opml/import', 'verb' => 'POST'], ['name' => 'opml#import', 'url' => '/opml/import', 'verb' => 'POST'],
['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'], ['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'],
['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'], ['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'],
['name' => 'tops#hot', 'url' => '/tops/hot', 'verb' => 'GET'], ['name' => 'toplist#hot', 'url' => '/toplist/hot', 'verb' => 'GET'],
['name' => 'tops#new', 'url' => '/tops/new', 'verb' => 'GET'], ['name' => 'toplist#new', 'url' => '/toplist/new', 'verb' => 'GET'],
], ],
]; ];

View File

@ -19,7 +19,7 @@ class SearchController extends Controller
parent::__construct(Application::APP_ID, $request); parent::__construct(Application::APP_ID, $request);
} }
public function index(string $value): JSONResponse { public function index(string $q): JSONResponse {
return new JSONResponse($this->multiPodService->search($value)); return new JSONResponse($this->multiPodService->search($q));
} }
} }

View File

@ -10,7 +10,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest; use OCP\IRequest;
class TopsController extends Controller class ToplistController extends Controller
{ {
public function __construct( public function __construct(
IRequest $request, IRequest $request,

View File

@ -61,7 +61,7 @@ export default {
try { try {
this.loading = true this.loading = true
const currentSearch = this.value 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) { if (currentSearch === this.value) {
this.feeds = [...feeds.data].sort((a, b) => b.fetchedAtUnix - a.fetchedAtUnix) this.feeds = [...feeds.data].sort((a, b) => b.fetchedAtUnix - a.fetchedAtUnix)
} }

View File

@ -20,7 +20,7 @@ import { showError } from '@nextcloud/dialogs'
import { toUrl } from '../../utils/url.js' import { toUrl } from '../../utils/url.js'
export default { export default {
name: 'Tops', name: 'Toplist',
components: { components: {
Loading, Loading,
}, },
@ -51,7 +51,7 @@ export default {
async mounted() { async mounted() {
try { try {
this.loading = true 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 this.tops = tops.data
} catch (e) { } catch (e) {
console.error(e) console.error(e)

View File

@ -4,8 +4,8 @@
<Magnify :size="20" /> <Magnify :size="20" />
</NcTextField> </NcTextField>
<Search v-if="search" :value="search" /> <Search v-if="search" :value="search" />
<Tops v-if="!search" type="hot" /> <Toplist v-if="!search" type="hot" />
<Tops v-if="!search" type="new" /> <Toplist v-if="!search" type="new" />
<AddRss v-if="!search" /> <AddRss v-if="!search" />
</AppContent> </AppContent>
</template> </template>
@ -16,7 +16,7 @@ import AppContent from '../components/Atoms/AppContent.vue'
import Magnify from 'vue-material-design-icons/Magnify.vue' import Magnify from 'vue-material-design-icons/Magnify.vue'
import { NcTextField } from '@nextcloud/vue' import { NcTextField } from '@nextcloud/vue'
import Search from '../components/Discover/Search.vue' import Search from '../components/Discover/Search.vue'
import Tops from '../components/Discover/Tops.vue' import Toplist from '../components/Discover/Toplist.vue'
export default { export default {
name: 'Discover', name: 'Discover',
@ -26,7 +26,7 @@ export default {
Magnify, Magnify,
NcTextField, NcTextField,
Search, Search,
Tops, Toplist,
}, },
data() { data() {
return { return {