From a350a16668ed4e0ceac7a7130c9e2896f0fc0354 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 30 Oct 2022 11:52:15 +0530 Subject: [PATCH] Use server-provided search result typing --- src/routes/SearchResults.vue | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/routes/SearchResults.vue b/src/routes/SearchResults.vue index 5276dff..b04e831 100644 --- a/src/routes/SearchResults.vue +++ b/src/routes/SearchResults.vue @@ -15,7 +15,7 @@
- + @@ -89,22 +89,8 @@ export default { methods: { rationalizeSearchResult (sr) { - let type - // This seriously can't be the best solution - if (sr.url.startsWith('/watch')) { - type = 'VIDEO' - } else if (sr.url.startsWith('/playlist')) { - type = 'PLAYLIST' - } else if (sr.url.startsWith('/channel')) { - type = 'CHANNEL' - } else { - console.warn('WARNING: UNKNOWN VIDEO URL TYPE FOUND:', sr.url) - type = 'VIDEO' - } - return { title: sr.name, - type, uploaderName: sr.uploader, uploadedDate: sr.uploadDate, ...sr