Skip to content

Commit

Permalink
fix: define path to userData folder as db store
Browse files Browse the repository at this point in the history
  • Loading branch information
4gray committed Sep 6, 2020
1 parent 817884c commit 8e8c107
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<Playlist>({ filename: 'data.db', autoload: true });
const userData = app.getPath('userData');
const db = new Nedb<Playlist>({
filename: `${userData}/db/data.db`,
autoload: true,
});

export class Api {
constructor() {
Expand Down

0 comments on commit 8e8c107

Please sign in to comment.