mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-09 18:51:28 +03:00
Initialization on auth component happens in a separate function, users_db primarily sits in app.js
Fixed bug where current download would set to null, but maincomponent still tried to parse it
This commit is contained in:
@@ -32,9 +32,13 @@ var app = express();
|
||||
|
||||
// database setup
|
||||
const FileSync = require('lowdb/adapters/FileSync')
|
||||
|
||||
const adapter = new FileSync('./appdata/db.json');
|
||||
const db = low(adapter)
|
||||
|
||||
const users_adapter = new FileSync('./appdata/users.json');
|
||||
const users_db = low(users_adapter);
|
||||
|
||||
// check if debug mode
|
||||
let debugMode = process.env.YTDL_MODE === 'debug';
|
||||
|
||||
@@ -62,7 +66,8 @@ const logger = winston.createLogger({
|
||||
});
|
||||
|
||||
config_api.setLogger(logger);
|
||||
subscriptions_api.initialize(db, logger);
|
||||
subscriptions_api.initialize(db, users_db, logger);
|
||||
auth_api.initialize(users_db, logger);
|
||||
|
||||
// var GithubContent = require('github-content');
|
||||
|
||||
@@ -84,6 +89,12 @@ db.defaults(
|
||||
files_to_db_migration_complete: false
|
||||
}).write();
|
||||
|
||||
users_db.defaults(
|
||||
{
|
||||
users: []
|
||||
}
|
||||
).write();
|
||||
|
||||
// config values
|
||||
var frontendUrl = null;
|
||||
var backendUrl = null;
|
||||
|
||||
Reference in New Issue
Block a user