Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7faec524da | |||
cd7e2e7a0f | |||
c07984c506 | |||
2235372c64 |
@ -10,12 +10,12 @@
|
||||
"http://localhost"
|
||||
],
|
||||
"database": {
|
||||
"host": "localhost",
|
||||
"host": "database",
|
||||
"port": 27017,
|
||||
"name": "webplay"
|
||||
},
|
||||
"redis": {
|
||||
"host": "localhost",
|
||||
"host": "redis",
|
||||
"port": 6379
|
||||
},
|
||||
"album_cover_files": [
|
||||
|
331
package-lock.json
generated
331
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"mongodb": "^6.1.0",
|
||||
"mongodb": "^4.14.0",
|
||||
"music-metadata": "^7.13.3",
|
||||
"node-fdkaac": "^1.4.1",
|
||||
"node-id3": "^0.2.6",
|
||||
|
@ -96,7 +96,7 @@ router.route("/:id/stream")
|
||||
router.route("/:id/stream/:rate/:audioIndex")
|
||||
.get((req, res) => {
|
||||
if (!server.lists.video_quality.includes(req.params.rate)) {
|
||||
req.end();
|
||||
res.end();
|
||||
}
|
||||
|
||||
let video = getFileName(req);
|
||||
|
@ -101,7 +101,7 @@ app.use(fileUpload({
|
||||
}));
|
||||
const corsOptions = {
|
||||
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);
|
||||
} else {
|
||||
database.system.domains((domains) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const MongoClient = require('mongodb').MongoClient;
|
||||
const { MongoClient } = require('mongodb');
|
||||
const server = require("../../server");
|
||||
const config = server.config;
|
||||
|
||||
@ -14,10 +14,7 @@ exports.connect = async function () {
|
||||
else {
|
||||
try {
|
||||
console.log("DB CONNECTING:" + config.database.host + ":" + config.database.port)
|
||||
const client = await MongoClient.connect(url, (err, db)=> {
|
||||
console.log("DB Connected")
|
||||
}
|
||||
);
|
||||
const client = await MongoClient.connect(url);
|
||||
dbo = client.db(database);
|
||||
return dbo;
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user