Skip to content

Commit

Permalink
move the db to the data folder as well
Browse files Browse the repository at this point in the history
  • Loading branch information
anshuman852 committed May 28, 2023
1 parent 1a941fd commit d622ac6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -19,11 +19,11 @@ const __dirname = path.dirname(__filename);


if (!fs.existsSync(process.cwd()+"/data/channel.db")) {
fs["writeFileSync"]("./channel.db", '{"channel": {}}');
fs["writeFileSync"](process.cwd()+"/data/channel.db", '{"channel": {}}');
}

if (!fs.existsSync(process.cwd()+"/data/channel-catchup.db")) {
fs["writeFileSync"]("./channel-catchup.db", '{"channel": {}}');
fs["writeFileSync"](process.cwd()+"/data/channel-catchup.db", '{"channel": {}}');
}

app.get("/login.html", (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion utils/catchup/cookieManager.mjs
Expand Up @@ -2,7 +2,7 @@ import { JsonDB }from "node-json-db";
import { Config }from "node-json-db/dist/lib/JsonDBConfig.js";
import fs from 'fs';

const db = new JsonDB(new Config("channel-catchup.db", true, false, "/"));
const db = new JsonDB(new Config(process.cwd()+"/data/channel-catchup.db", true, false, "/"));

// function init() {
// if (condition) {
Expand Down
2 changes: 1 addition & 1 deletion utils/cookieManager.mjs
Expand Up @@ -2,7 +2,7 @@ import { JsonDB } from "node-json-db";
import { Config } from "node-json-db/dist/lib/JsonDBConfig.js";
import fs from 'fs';

const db = new JsonDB(new Config("channel.db", true, false, "/"));
const db = new JsonDB(new Config(process.cwd()+"/data/channel.db", true, false, "/"));

export async function setCookie(id, cookie, masterUrl, masterM3u8) {
let uri = masterUrl.split("?");
Expand Down

0 comments on commit d622ac6

Please sign in to comment.