From 8e8c107ca78d30bc6e90c6894fc021b1ee83d5ea Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 6 Sep 2020 13:19:11 +0200 Subject: [PATCH] fix: define path to userData folder as db store --- api.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api.ts b/api.ts index bc3881e4f..78b1c1ebf 100644 --- a/api.ts +++ b/api.ts @@ -1,4 +1,4 @@ -import { ipcMain } from 'electron'; +import { app, ipcMain } from 'electron'; import { parse } from 'iptv-playlist-parser'; import axios from 'axios'; import { guid } from '@datorama/akita'; @@ -7,7 +7,11 @@ import Nedb from 'nedb-promises-ts'; const join = require('path').join; const openAboutWindow = require('about-window').default; -const db = new Nedb({ filename: 'data.db', autoload: true }); +const userData = app.getPath('userData'); +const db = new Nedb({ + filename: `${userData}/db/data.db`, + autoload: true, +}); export class Api { constructor() {