MrBrax / LiveStreamDVR

An automatic livestream recorder
MIT License
309 stars 24 forks source link

Can't add two Twitch channels #478

Closed JoaoZanetti closed 7 months ago

JoaoZanetti commented 7 months ago

Brand new Docker installation using master image. For some reason after I add one Twitch channel, I can't add more channels.

2023-11-18T20:03:33.870Z | route.channels.add <error> Failed to create channel: Error: Channel phasiot1 already exists in config
2023-11-18T20:03:33.871Z | http.api <error> API error 400 returned: {"status":"ERROR","message":"Channel phasiot1 already exists in config"}

image image

JoaoZanetti commented 7 months ago

I think I found the problem. TwitchChannels.ts is trying to compare ch.login with config.login, but the login field is deprecated, so both are null, which will return a false-true validation.

const exists_config = LiveStreamDVR.getInstance().channels_config.find( (ch) => ch.provider == "twitch" && (ch.login === config.login || ch.internalName === config.login || ch.internalName === config.internalName) ); if (exists_config) throw new Error( 'Channel ${config.internalName} already exists in config' ); image

MrBrax commented 7 months ago

good call, pushed an update with some reworked logic

JoaoZanetti commented 7 months ago

good call, pushed an update with some reworked logic

I just updated to the latest version, It's working now! Thanks.