mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 09:47:49 +01:00
lint code :3
This commit is contained in:
parent
a0cebd409c
commit
bc9643c5e7
1 changed files with 12 additions and 13 deletions
|
@ -109,25 +109,25 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
const poketube_universe_value = "poketube_smart_search";
|
const poketube_universe_value = "poketube_smart_search";
|
||||||
|
|
||||||
if (query) {
|
if (query) {
|
||||||
let redirectTo = null;
|
let redirectTo = null;
|
||||||
|
|
||||||
if (query.includes("youtube.com/watch?v=")) {
|
if (query.includes("youtube.com/watch?v=")) {
|
||||||
redirectTo = "/watch?v=";
|
redirectTo = "/watch?v=";
|
||||||
} else if (query.includes("channel:")) {
|
} else if (query.includes("channel:")) {
|
||||||
redirectTo = "/channel?id=";
|
redirectTo = "/channel?id=";
|
||||||
} else if (query.includes("video:")) {
|
} else if (query.includes("video:")) {
|
||||||
redirectTo = "/watch?v=";
|
redirectTo = "/watch?v=";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redirectTo) {
|
if (redirectTo) {
|
||||||
try {
|
try {
|
||||||
const id = query.split(":")[1];
|
const id = query.split(":")[1];
|
||||||
res.redirect(`${redirectTo}${id}`);
|
res.redirect(`${redirectTo}${id}`);
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (query && query.startsWith("!") && query.length > 2) {
|
if (query && query.startsWith("!") && query.length > 2) {
|
||||||
res.redirect("https://lite.duckduckgo.com/lite/?q=" + query);
|
res.redirect("https://lite.duckduckgo.com/lite/?q=" + query);
|
||||||
|
@ -229,7 +229,6 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
let continuation = req.query.continuation || "";
|
let continuation = req.query.continuation || "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const results = web.web;
|
const results = web.web;
|
||||||
|
|
||||||
renderTemplate(res, req, "search-web.ejs", {
|
renderTemplate(res, req, "search-web.ejs", {
|
||||||
|
|
Loading…
Reference in a new issue