🧑💻 feat: Modify some endpoints to match gPodder.net ones
This commit is contained in:
parent
33fee28c02
commit
9a411358ca
@ -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'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user