From 6cd6721ed80823593ee6eda1ac614e9369386f28 Mon Sep 17 00:00:00 2001 From: 4gray Date: Mon, 24 May 2021 22:49:54 +0200 Subject: [PATCH] refactor: workaround to resolve an issue with playlist interface dependency --- .gitignore | 1 + api.ts | 5 +---- playlist.interface.ts | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 playlist.interface.ts diff --git a/.gitignore b/.gitignore index e68cdd744..d44333f9b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ epg-worker.js ipc-commands.js main.js menu.js +playlist.interface.js src/**/*.js !src/karma.conf.js *.js.map diff --git a/api.ts b/api.ts index b8586e776..83719d6f9 100644 --- a/api.ts +++ b/api.ts @@ -3,10 +3,7 @@ import { app, BrowserWindow, ipcMain } from 'electron'; import { parse } from 'iptv-playlist-parser'; import axios from 'axios'; import { guid } from '@datorama/akita'; -import { - Playlist, - PlaylistUpdateState, -} from './src/app/home/playlist.interface'; +import { Playlist, PlaylistUpdateState } from './playlist.interface'; import Nedb, { Cursor } from 'nedb-promises-ts'; import { EPG_ERROR, diff --git a/playlist.interface.ts b/playlist.interface.ts new file mode 100644 index 000000000..98ede0f9d --- /dev/null +++ b/playlist.interface.ts @@ -0,0 +1,31 @@ +import { ID } from '@datorama/akita'; + +/** + * An interface that describe the possible states of the playlist update/refresh process + */ +export enum PlaylistUpdateState { + UPDATED, + IN_PROGRESS, + NOT_UPDATED, +} + +/** + * Describes playlist interface + */ +export interface Playlist { + id: ID; + _id: string; + title: string; + filename: string; + playlist: any; + importDate: string; + lastUsage: string; + favorites: string[]; + count: number; + url?: string; + userAgent?: string; + filePath?: string; + autoRefresh: boolean; + updateDate?: number; + updateState?: PlaylistUpdateState; +}