internal changes only

- remade config module
- renamed loc to i18n because that's what all developers do
- moved code to src to make repo look cleaner
- fixed some i18n strings
This commit is contained in:
wukko
2022-07-17 17:08:49 +06:00
parent 227dc8436c
commit 67223b3acd
62 changed files with 50 additions and 55 deletions

View File

@@ -0,0 +1,27 @@
import { apiJSON } from "../sub/api-helper.js";
import { verifyStream } from "./manage.js";
import { streamAudioOnly, streamDefault, streamLiveRender } from "./types.js";
export default function(res, ip, id, hmac, exp) {
try {
let streamInfo = verifyStream(ip, id, hmac, exp, process.env.streamSalt);
if (!streamInfo.error) {
if (streamInfo.isAudioOnly) {
streamAudioOnly(streamInfo, res);
} else {
switch (streamInfo.type) {
case "render":
streamLiveRender(streamInfo, res);
break;
default:
streamDefault(streamInfo, res);
break;
}
}
} else {
res.status(streamInfo.status).json(apiJSON(0, { t: streamInfo.error }).body);
}
} catch (e) {
internalError(res)
}
}