Compare commits
3 Commits
d9bdf744fd
...
f9a0fdcf3d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9a0fdcf3d | ||
|
|
da1d14d458 | ||
|
|
18940d0640 |
25
eslint.config.mjs
Normal file
25
eslint.config.mjs
Normal file
@ -0,0 +1,25 @@
|
||||
import js from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import security from 'eslint-plugin-security';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
security.configs.recommended,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
rules: {
|
||||
// Tune down noisy rules for existing codebase
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'no-console': 'off',
|
||||
'security/detect-object-injection': 'off', // Too many false positives with Record types
|
||||
'security/detect-non-literal-fs-filename': 'off', // All paths come from controlled sources
|
||||
'no-async-promise-executor': 'warn',
|
||||
'no-empty': ['warn', { allowEmptyCatch: true }],
|
||||
}
|
||||
},
|
||||
{
|
||||
ignores: ['dist/**', 'release/**', 'node_modules/**', 'scripts/**', 'tmp_*/**']
|
||||
}
|
||||
];
|
||||
1145
package-lock.json
generated
1145
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "4.5.5",
|
||||
"version": "4.5.6",
|
||||
"description": "Twitch VOD Manager - Download Twitch VODs easily",
|
||||
"main": "dist/main.js",
|
||||
"author": "xRangerDE",
|
||||
@ -25,10 +25,14 @@
|
||||
"electron-updater": "^6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/node": "^20.10.0",
|
||||
"electron": "^28.0.0",
|
||||
"electron-builder": "^24.9.0",
|
||||
"typescript": "^5.3.0"
|
||||
"eslint": "^10.1.0",
|
||||
"eslint-plugin-security": "^4.0.0",
|
||||
"typescript": "^5.3.0",
|
||||
"typescript-eslint": "^8.57.1"
|
||||
},
|
||||
"build": {
|
||||
"appId": "de.24-music.twitch-vod-manager",
|
||||
|
||||
12
src/main.ts
12
src/main.ts
@ -688,6 +688,7 @@ function parseDuration(duration: string): number {
|
||||
}
|
||||
|
||||
function formatDuration(seconds: number): string {
|
||||
if (!isFinite(seconds) || seconds < 0) return '00:00:00';
|
||||
const h = Math.floor(seconds / 3600);
|
||||
const m = Math.floor((seconds % 3600) / 60);
|
||||
const s = Math.floor(seconds % 60);
|
||||
@ -695,6 +696,7 @@ function formatDuration(seconds: number): string {
|
||||
}
|
||||
|
||||
function formatDurationDashed(seconds: number): string {
|
||||
if (!isFinite(seconds) || seconds < 0) return '00-00-00';
|
||||
const h = Math.floor(seconds / 3600);
|
||||
const m = Math.floor((seconds % 3600) / 60);
|
||||
const s = Math.floor(seconds % 60);
|
||||
@ -1095,8 +1097,7 @@ function withInFlightDedup<T>(
|
||||
return existing;
|
||||
}
|
||||
|
||||
let requestPromise: Promise<T>;
|
||||
requestPromise = factory().finally(() => {
|
||||
const requestPromise: Promise<T> = factory().finally(() => {
|
||||
if (store.get(key) === requestPromise) {
|
||||
store.delete(key);
|
||||
}
|
||||
@ -1412,8 +1413,7 @@ function requestTwitchLogin(): Promise<boolean> {
|
||||
return twitchLoginInFlight;
|
||||
}
|
||||
|
||||
let loginPromise: Promise<boolean>;
|
||||
loginPromise = twitchLogin().finally(() => {
|
||||
const loginPromise: Promise<boolean> = twitchLogin().finally(() => {
|
||||
if (twitchLoginInFlight === loginPromise) {
|
||||
twitchLoginInFlight = null;
|
||||
}
|
||||
@ -1883,9 +1883,7 @@ async function cutVideo(
|
||||
let inputBytes = 0;
|
||||
try {
|
||||
inputBytes = fs.statSync(inputFile).size;
|
||||
} catch {
|
||||
inputBytes = 0;
|
||||
}
|
||||
} catch { }
|
||||
|
||||
const cutRequiredBytes = Math.max(96 * 1024 * 1024, Math.ceil(inputBytes * 0.75));
|
||||
const cutDiskCheck = ensureDiskSpace(path.dirname(outputFile), cutRequiredBytes, 'Video-Cut');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user