Compare commits

..

4 Commits

Author SHA1 Message Date
7faec524da router/video.js aktualisiert
All checks were successful
continuous-integration/drone Build is passing
fix wrong var name
2024-08-18 22:15:47 +02:00
cd7e2e7a0f server.js aktualisiert
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-21 21:59:12 +01:00
c07984c506 server.js aktualisiert
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-21 21:57:21 +01:00
2235372c64 Merge pull request 'fancy-banner. fix #18' (#21) from fancy-banner into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #21
2023-09-27 21:46:39 +02:00
6 changed files with 88 additions and 262 deletions

View File

@ -10,12 +10,12 @@
"http://localhost" "http://localhost"
], ],
"database": { "database": {
"host": "localhost", "host": "database",
"port": 27017, "port": 27017,
"name": "webplay" "name": "webplay"
}, },
"redis": { "redis": {
"host": "localhost", "host": "redis",
"port": 6379 "port": 6379
}, },
"album_cover_files": [ "album_cover_files": [

333
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
"fluent-ffmpeg": "^2.1.2", "fluent-ffmpeg": "^2.1.2",
"jsonwebtoken": "^9.0.0", "jsonwebtoken": "^9.0.0",
"mime-types": "^2.1.35", "mime-types": "^2.1.35",
"mongodb": "^6.1.0", "mongodb": "^4.14.0",
"music-metadata": "^7.13.3", "music-metadata": "^7.13.3",
"node-fdkaac": "^1.4.1", "node-fdkaac": "^1.4.1",
"node-id3": "^0.2.6", "node-id3": "^0.2.6",

View File

@ -96,7 +96,7 @@ router.route("/:id/stream")
router.route("/:id/stream/:rate/:audioIndex") router.route("/:id/stream/:rate/:audioIndex")
.get((req, res) => { .get((req, res) => {
if (!server.lists.video_quality.includes(req.params.rate)) { if (!server.lists.video_quality.includes(req.params.rate)) {
req.end(); res.end();
} }
let video = getFileName(req); let video = getFileName(req);

View File

@ -101,7 +101,7 @@ app.use(fileUpload({
})); }));
const corsOptions = { const corsOptions = {
origin: (origin, callback) => { origin: (origin, callback) => {
if (!origin || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) { if (!origin || config.domain == origin.replace(/:\d*$/g, "") || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) {
callback(null, true); callback(null, true);
} else { } else {
database.system.domains((domains) => { database.system.domains((domains) => {

View File

@ -1,4 +1,4 @@
const MongoClient = require('mongodb').MongoClient; const { MongoClient } = require('mongodb');
const server = require("../../server"); const server = require("../../server");
const config = server.config; const config = server.config;
@ -14,10 +14,7 @@ exports.connect = async function () {
else { else {
try { try {
console.log("DB CONNECTING:" + config.database.host + ":" + config.database.port) console.log("DB CONNECTING:" + config.database.host + ":" + config.database.port)
const client = await MongoClient.connect(url, (err, db)=> { const client = await MongoClient.connect(url);
console.log("DB Connected")
}
);
dbo = client.db(database); dbo = client.db(database);
return dbo; return dbo;
} catch (error) { } catch (error) {