mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-21 04:00:57 +03:00
Old database files are now backed up prior to migration to simplified structure
This commit is contained in:
@@ -260,6 +260,13 @@ async function runFilesToDBMigration() {
|
||||
}
|
||||
|
||||
async function simplifyDBFileStructure() {
|
||||
// back up db files
|
||||
const old_db_file = fs.readJSONSync('./appdata/db.json');
|
||||
const old_users_db_file = fs.readJSONSync('./appdata/users.json');
|
||||
fs.writeJSONSync('appdata/db.old.json', old_db_file);
|
||||
fs.writeJSONSync('appdata/users.old.json', old_users_db_file);
|
||||
|
||||
// simplify
|
||||
let users = users_db.get('users').value();
|
||||
for (let i = 0; i < users.length; i++) {
|
||||
const user = users[i];
|
||||
|
||||
Reference in New Issue
Block a user