refactor: Import version, bugs URL and repo URL directly from package.json (#1004)

This commit is contained in:
absidue
2025-09-11 20:49:48 +02:00
committed by GitHub
parent 95976de115
commit 46c2f6c6c1
14 changed files with 18 additions and 68 deletions

View File

@@ -1,8 +1,9 @@
import type { StoryboardData } from '../parser/classes/PlayerStoryboardSpec.js';
import PlayerStoryboardSpec from '../parser/classes/PlayerStoryboardSpec.js';
import { getStringBetweenStrings, InnertubeError, Platform } from './Utils.js';
import { getStringBetweenStrings, InnertubeError } from './Utils.js';
import * as Constants from './Constants.js';
import * as Log from './Log.js';
import packageInfo from '../../package.json' with { type: 'json' };
import type Actions from '../core/Actions.js';
import type Player from '../core/Player.js';
@@ -543,7 +544,7 @@ function getColorInfo(format: Format) {
anonymisedFormat.cipher = 'REDACTED';
Log.warn(TAG_, `Unknown matrix coefficients "${color_info.matrix_coefficients}". The DASH manifest is still usable without this.\n`
+ `Please report it at ${Platform.shim.info.bugs_url} so we can add support for it.\n`
+ `Please report it at ${packageInfo.bugs.url} so we can add support for it.\n`
+ `InnerTube client: ${url.searchParams.get('c')}\nformat:`, anonymisedFormat);
}
}

View File

@@ -9,6 +9,7 @@ import { Memo } from '../parser/helpers.js';
import { Text } from '../parser/misc.js';
import * as Log from './Log.js';
import userAgents from './user-agents.js';
import packageInfo from '../../package.json' with { type: 'json' };
const TAG_ = 'Utils';
@@ -40,7 +41,7 @@ export class InnertubeError extends Error {
}
this.date = new Date();
this.version = Platform.shim.info.version;
this.version = packageInfo.version;
}
}