fix: handle empty addon name in stream results and update description for addon name field

This commit is contained in:
Viren070
2025-06-20 18:05:04 +01:00
parent abf99c1768
commit 5612140ffe
+6 -2
View File
@@ -23,11 +23,14 @@ class AIOStreamsStreamParser extends StreamParser {
);
throw new Error('Invalid stream');
}
const addonName = this.addon?.name?.trim();
return {
id: this.getRandomId(),
addon: {
...this.addon,
name: `${this.addon.name} | ${aioStream.streamData?.addon ?? ''}`,
name: addonName
? `${addonName} | ${aioStream.streamData?.addon ?? ''}`
: (aioStream.streamData?.addon ?? ''),
},
error: aioStream.streamData?.error,
type: aioStream.streamData?.type ?? 'http',
@@ -68,7 +71,8 @@ export class AIOStreamsPreset extends Preset {
{
id: 'name',
name: 'Name',
description: 'What to call this addon',
description:
"What to call this addon. Leave empty if you don't want to include the name of this addon in the stream results.",
type: 'string',
required: true,
default: 'AIOStreams',