Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #36

Merged
merged 29 commits into from
Mar 1, 2024
Merged

Dev #36

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
41bf475
Bump simple-get from 4.0.0 to 4.0.1 (#9)
dependabot[bot] Nov 16, 2022
953a1b3
Bump follow-redirects from 1.14.6 to 1.14.8 (#10)
dependabot[bot] Nov 16, 2022
dba7851
Bump url-parse from 1.5.3 to 1.5.10 (#12)
dependabot[bot] Nov 16, 2022
bd7caa5
Bump minimist from 1.2.5 to 1.2.6 (#14)
dependabot[bot] Nov 16, 2022
c586269
Bump eventsource from 1.1.0 to 1.1.1 (#15)
dependabot[bot] Nov 16, 2022
6781ef3
Bump ansi-regex from 4.1.0 to 5.0.1 (#19)
dependabot[bot] Nov 16, 2022
97b4a9f
Bump electron from 13.6.3 to 18.3.7 (#18)
dependabot[bot] Nov 16, 2022
2f21437
Bump terser from 4.8.0 to 4.8.1 (#17)
dependabot[bot] Nov 16, 2022
28d2414
Bump nanoid from 3.1.30 to 3.3.4 (#21)
dependabot[bot] Nov 16, 2022
d0eeae7
Bump plist from 3.0.4 to 3.0.6 (#20)
dependabot[bot] Nov 16, 2022
f5eb112
Updating project dependencies and migrating react to vite
iambpn Nov 19, 2022
62b910e
fixing build issues and adding build configuration for linux
iambpn Nov 20, 2022
ec4091e
fixing asets paths
iambpn Nov 20, 2022
e863193
setting up eslint
iambpn Nov 22, 2022
f8464ea
adding serve react buld server for production
iambpn Nov 23, 2022
00297fb
asset added
iambpn Nov 23, 2022
93b077e
adding taskbar icon for linux
iambpn Nov 23, 2022
7e754bd
adding cross platform packages
iambpn Nov 24, 2022
4141c80
Movie player error
iambpn Nov 26, 2022
349e952
upgrading plyr to latest and solving some bugs
iambpn Dec 3, 2022
8af32cc
Adding throttleing torrent and client download/upload speed
iambpn Dec 3, 2022
442596b
improving readme
iambpn Dec 3, 2022
4d93998
icon bug fix
iambpn Dec 3, 2022
4468638
Merge branch 'master' into dev
iambpn Feb 29, 2024
d32324e
Merge branch 'master' into dev
iambpn Feb 29, 2024
44a6318
updating package-lock.json
iambpn Feb 29, 2024
d4c4c11
updating packages
iambpn Feb 29, 2024
8b4dfeb
updating dependencies and updating stream server issues
iambpn Mar 1, 2024
1a8cb5f
updating package.json
iambpn Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions electron/components/DownloaderWindow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserWindow } from 'electron';
import isDev from 'electron-is-dev';
import path from 'path';
import { get__dirname } from '../configs.js';

export default class DownloaderWindow extends BrowserWindow {
constructor(url: string) {
Expand All @@ -12,12 +13,15 @@ export default class DownloaderWindow extends BrowserWindow {
backgroundColor: '#060606',
title: 'Downloader',
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
preload: path.join(get__dirname(import.meta.url), 'preload.js'),
backgroundThrottling: false,
},
icon:
process.platform === 'linux'
? path.join(__dirname, '../assets/icons/256x256.png')
? path.join(
get__dirname(import.meta.url),
'../assets/icons/256x256.png'
)
: undefined,
});
this.setMenuBarVisibility(false);
Expand Down
7 changes: 4 additions & 3 deletions electron/components/MainWindow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserWindow } from 'electron';
import path from 'path';
import windowStateKeeper from 'electron-window-state';
import path from 'path';
import { get__dirname } from '../configs.js';

class MainWindow extends BrowserWindow {
constructor(url: string, state: windowStateKeeper.State) {
Expand All @@ -15,12 +16,12 @@ class MainWindow extends BrowserWindow {
backgroundColor: '#060606',
title: 'YTS-Streaming',
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
preload: path.join(get__dirname(import.meta.url), 'preload.cjs'),
backgroundThrottling: false,
},
icon:
process.platform === 'linux'
? path.join(__dirname, '../assets/icons/256x256.png')
? path.join(get__dirname(import.meta.url), '../assets/icons/256x256.png')
: undefined,
});
this.loadURL(url);
Expand Down
6 changes: 5 additions & 1 deletion electron/components/VideoPlayerWindow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserWindow, Menu, shell } from 'electron';
import path from 'path';
import { get__dirname } from '../configs.js';

class VideoPlayerWindow extends BrowserWindow {
constructor(url: string) {
Expand All @@ -15,7 +16,10 @@ class VideoPlayerWindow extends BrowserWindow {
webPreferences: {},
icon:
process.platform === 'linux'
? path.join(__dirname, '../assets/icons/256x256.png')
? path.join(
get__dirname(import.meta.url),
'../assets/icons/256x256.png'
)
: undefined,
});
this.setMenu(
Expand Down
File renamed without changes.
59 changes: 59 additions & 0 deletions electron/configs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import path from 'path';
import { fileURLToPath } from 'url';

export const ROOT_PATH = process.cwd(); // Current working directory: from where it is called

export const get__dirname = (fileUrl: string) =>
path.dirname(fileURLToPath(fileUrl));

export const ASSETS_PATHs = {
PLYR_JS: path.join(
get__dirname(import.meta.url),
'assets/video_player/plyr3.7.3.polyfilled.min.js'
),
PLYR_CSS: path.join(
get__dirname(import.meta.url),
'assets/video_player/plyr3.7.3.min.css'
),
BOOTSTRAP: path.join(
get__dirname(import.meta.url),
'assets/bootstrap/bootstrap.min.css'
),
VIDEO_HTML_PATH: path.join(
get__dirname(import.meta.url),
'views/html/video.html'
),
REACT_BUILD: path.join(get__dirname(import.meta.url), 'assets'),
};

export const WINDOW_PATHs = {
DOWNLOAD_WINDOW_HTML: path.join(
get__dirname(import.meta.url),
'views/html/download.html'
),
MAIN_WINDOW_HTML: path.join(get__dirname(import.meta.url), 'index.html'),
};

export const DEV_SERVER = {
host: 'localhost',
port: '3000',
};

export const PROD_SERVER = {
host: 'localhost',
port: '18080',
};

export const STREAM_SERVER = {
host: 'localhost',
port: '19000',
};

/* Const Variable */
export const MB = 1e6;

/* Setup caption config */
export const captionConf = path.join(ROOT_PATH, '.CaptionConf');
export const defaultCaptionFont = {
fontSize: { small: 13, medium: 15, large: 21 },
};
Loading