1
0
forked from w0bm/f0bm

show dest & srchost

This commit is contained in:
Flummi
2019-05-11 09:20:01 +00:00
parent a3a195b26b
commit 1058d313a1
2 changed files with 3 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import router from "../router";
import sql from "../sql";
import { parse } from "url";
import cfg from "../../../config.json";
import { mimes, queries } from "./inc/api";
@@ -77,6 +78,7 @@ router.get(/^\/api\/item\/[0-9]+$/, async (req, res) => {
const data = rows[0].length > 0 ? {
...rows[0][0], ...{
thumb: `${cfg.main.url}/t/${rows[0][0].id}.png`,
srchost: parse(rows[0][0].src).hostname,
next: rows[1].length ? rows[1][0].id : null,
prev: rows[2].length ? rows[2][0].id : null,
}