mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: extract electron related files
This commit is contained in:
1 parent
4e39f15393
commit
e3a6e1269d
8 files changed
+39
-43
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { app, BrowserWindow, ipcMain, session } from 'electron';
|
||||
import { parse } from 'iptv-playlist-parser';
|
||||
import { GLOBAL_FAVORITES_PLAYLIST_ID } from './shared/constants';
|
||||
import { GLOBAL_FAVORITES_PLAYLIST_ID } from '../shared/constants';
|
||||
import {
|
||||
CHANNEL_SET_USER_AGENT,
|
||||
EPG_ERROR,
|
||||
@@ -26,13 +26,13 @@ import {
|
||||
PLAYLIST_UPDATE_FAVORITES,
|
||||
PLAYLIST_UPDATE_POSITIONS,
|
||||
PLAYLIST_UPDATE_RESPONSE,
|
||||
} from './shared/ipc-commands';
|
||||
import { Playlist, PlaylistUpdateState } from './shared/playlist.interface';
|
||||
} from '../shared/ipc-commands';
|
||||
import { Playlist, PlaylistUpdateState } from '../shared/playlist.interface';
|
||||
import {
|
||||
aggregateFavoriteChannels,
|
||||
createFavoritesPlaylist,
|
||||
} from './shared/playlist.utils';
|
||||
import { ParsedPlaylist } from './src/typings.d';
|
||||
} from '../shared/playlist.utils';
|
||||
import { ParsedPlaylist } from '../src/typings.d';
|
||||
|
||||
const Nedb = require('nedb-promises');
|
||||
|
||||
File renamed without changes.
@@ -11,9 +11,9 @@ import {
|
||||
EPG_GET_CHANNELS_DONE,
|
||||
EPG_GET_PROGRAM,
|
||||
EPG_GET_PROGRAM_DONE,
|
||||
} from './shared/ipc-commands';
|
||||
import { EpgChannel } from './src/app/player/models/epg-channel.model';
|
||||
import { EpgProgram } from './src/app/player/models/epg-program.model';
|
||||
} from '../shared/ipc-commands';
|
||||
import { EpgChannel } from '../src/app/player/models/epg-channel.model';
|
||||
import { EpgProgram } from '../src/app/player/models/epg-program.model';
|
||||
|
||||
// EPG data store
|
||||
let EPG_DATA: { channels: EpgChannel[]; programs: EpgProgram[] };
|
||||
@@ -2,8 +2,8 @@
|
||||
import { app, BrowserWindow, Menu } from 'electron';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
import { Api } from './api';
|
||||
import { AppMenu } from './menu';
|
||||
import { Api } from '../api';
|
||||
import { AppMenu } from '../menu';
|
||||
const contextMenu = require('electron-context-menu');
|
||||
|
||||
let win: BrowserWindow = null;
|
||||
@@ -28,7 +28,7 @@ function createWindow(): BrowserWindow {
|
||||
},
|
||||
resizable: true,
|
||||
darkTheme: true,
|
||||
icon: path.join(__dirname, 'dist/assets/icons/icon.png'),
|
||||
icon: path.join(__dirname, '../build/assets/icons/icon.png'),
|
||||
titleBarStyle: 'hidden',
|
||||
frame: false,
|
||||
minWidth: 900,
|
||||
@@ -44,7 +44,7 @@ function createWindow(): BrowserWindow {
|
||||
} else {
|
||||
win.loadURL(
|
||||
url.format({
|
||||
pathname: path.join(__dirname, 'dist/index.html'),
|
||||
pathname: path.join(__dirname, '../build/index.html'),
|
||||
protocol: 'file:',
|
||||
slashes: true,
|
||||
})
|
||||
@@ -80,10 +80,10 @@ function createEpgWorkerWindow() {
|
||||
});
|
||||
|
||||
if (serve) {
|
||||
window.loadFile('epg-worker.html');
|
||||
window.loadFile(path.join(__dirname, '../electron/index.html'));
|
||||
window.webContents.openDevTools();
|
||||
} else {
|
||||
window.loadFile('epg-worker.html');
|
||||
window.loadFile('./epg-worker.html');
|
||||
}
|
||||
|
||||
window.once('ready-to-show', () => {
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
SHOW_WHATS_NEW,
|
||||
VIEW_ADD_PLAYLIST,
|
||||
VIEW_SETTINGS,
|
||||
} from './shared/ipc-commands';
|
||||
} from '../shared/ipc-commands';
|
||||
const openAboutWindow = require('about-window').default;
|
||||
|
||||
export class AppMenu {
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "iptvnator-electron",
|
||||
"version": "0.10.0",
|
||||
"main": "main.js",
|
||||
"private": true,
|
||||
"dependencies": {}
|
||||
}
|
||||
File renamed without changes.
+17
-28
@@ -1,31 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"node"
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"types": ["node"],
|
||||
"lib": ["es2017", "es2016", "es2015", "dom"]
|
||||
},
|
||||
"files": [
|
||||
"electron/api.ts",
|
||||
"electron/epg-worker.ts",
|
||||
"electron/main.ts",
|
||||
"electron/menu.ts",
|
||||
"electron/preload.ts"
|
||||
],
|
||||
"lib": [
|
||||
"es2017",
|
||||
"es2016",
|
||||
"es2015",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"api.ts",
|
||||
"epg-worker.ts",
|
||||
"main.ts",
|
||||
"menu.ts",
|
||||
"preload.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.spec.ts",
|
||||
"**/*.stub.ts"
|
||||
]
|
||||
"exclude": ["node_modules", "**/*.spec.ts", "**/*.stub.ts"]
|
||||
}
|
||||
Reference in new issue
Block a user