feat: configurable addon name per config

closes #74
This commit is contained in:
Viren070
2025-02-10 22:47:12 +00:00
parent 7e3d2024ce
commit 4eca7ae68d
3 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ const manifest = (config?: Config, configPresent?: boolean) => {
addonId += `.${getTextHash(JSON.stringify(config)).substring(0, 12)}`;
}
return {
name: Settings.ADDON_NAME,
name: config?.overrideName || Settings.ADDON_NAME,
id: addonId,
version: version,
description: description,
+23 -1
View File
@@ -193,6 +193,8 @@ export default function Configure() {
const [mediaFlowProxiedServices, setMediaFlowProxiedServices] = useState<
string[] | null
>(null);
const [overrideName, setOverrideName] = useState<string>('');
const [disableButtons, setDisableButtons] = useState<boolean>(false);
const [maxMovieSizeSlider, setMaxMovieSizeSlider] = useState<number>(
Settings.MAX_MOVIE_SIZE
@@ -227,6 +229,7 @@ export default function Configure() {
const createConfig = (): Config => {
const config = {
overrideName,
streamTypes,
resolutions,
qualities,
@@ -629,7 +632,26 @@ export default function Configure() {
style={{ display: 'block', margin: '0 auto' }}
/>
<div style={{ position: 'relative', display: 'inline-block' }}>
<h1 style={{ textAlign: 'center' }}>AIOStreams</h1>
<input
type="text"
value={overrideName || 'AIOStreams'}
onChange={(e) => setOverrideName(e.target.value)}
style={{
border: 'none',
backgroundColor: 'black',
color: 'white',
fontWeight: 'bold',
background: 'black',
height: '30px',
textAlign: 'center',
fontSize: '30px',
padding: '0',
maxWidth: '300px',
width: 'auto',
margin: '0 auto',
}}
size={overrideName?.length < 8 ? 8 : overrideName?.length || 8}
></input>
<span
className={styles.version}
title={`See what's new in v${version}`}
+1
View File
@@ -119,6 +119,7 @@ export type SortBy = { [key: string]: boolean | string | undefined };
export type StreamType = { [key: string]: boolean };
export interface Config {
overrideName?: string;
instanceCache?: any;
requestingIp?: string;
resolutions: Resolution[];