Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A list of 0 first party or third party emotes prevents the other list to load anyway #342

Open
Entrivax opened this issue Jan 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Entrivax
Copy link
Contributor

Entrivax commented Jan 5, 2024

Having an empty array of thirdParty or firstParty embed emotes causes to not load the other list.
For example, I have a chat dump containing a list of 0 elements in the third party emotes, preventing the first party ones to not load either.
In my case, I try to convert a chat dump from YouTube to fit the current chat format used by Ganymede, without support of third party emotes. So it falls in the default case and not loading the embedded emotes.

case len(chatData.Emotes.FirstParty) > 0 && len(chatData.Emotes.ThirdParty) > 0:
log.Debug().Msgf("VOD %s chat playback embedded emotes found in 'emotes'", vodID)
for _, emote := range chatData.Emotes.FirstParty {
var ganymedeEmote chat.GanymedeEmote
ganymedeEmote.Name = fmt.Sprint(emote.Name)
ganymedeEmote.ID = emote.ID
ganymedeEmote.URL = emote.Data
ganymedeEmote.Type = "embed"
ganymedeEmote.Width = emote.Width
ganymedeEmote.Height = emote.Height
ganymedeEmotes.Emotes = append(ganymedeEmotes.Emotes, ganymedeEmote)
}
// Loop through third party emotes
for _, emote := range chatData.Emotes.ThirdParty {
var ganymedeEmote chat.GanymedeEmote
ganymedeEmote.Name = fmt.Sprint(emote.Name)
ganymedeEmote.ID = emote.ID
ganymedeEmote.URL = emote.Data
ganymedeEmote.Type = "embed"
ganymedeEmote.Width = emote.Width
ganymedeEmote.Height = emote.Height
ganymedeEmotes.Emotes = append(ganymedeEmotes.Emotes, ganymedeEmote)
}
case len(chatData.EmbeddedData.FirstParty) > 0 && len(chatData.EmbeddedData.ThirdParty) > 0:
log.Debug().Msgf("VOD %s chat playback embedded emotes found in 'emebeddedData'", vodID)
for _, emote := range chatData.EmbeddedData.FirstParty {
var ganymedeEmote chat.GanymedeEmote
ganymedeEmote.Name = fmt.Sprint(emote.Name)
ganymedeEmote.ID = emote.ID
ganymedeEmote.URL = emote.Data
ganymedeEmote.Type = "embed"
ganymedeEmote.Width = emote.Width
ganymedeEmote.Height = emote.Height
ganymedeEmotes.Emotes = append(ganymedeEmotes.Emotes, ganymedeEmote)
}
// Loop through third party emotes
for _, emote := range chatData.EmbeddedData.ThirdParty {
var ganymedeEmote chat.GanymedeEmote
ganymedeEmote.Name = fmt.Sprint(emote.Name)
ganymedeEmote.ID = emote.ID
ganymedeEmote.URL = emote.Data
ganymedeEmote.Type = "embed"
ganymedeEmote.Width = emote.Width
ganymedeEmote.Height = emote.Height
ganymedeEmotes.Emotes = append(ganymedeEmotes.Emotes, ganymedeEmote)
}

image

image

My current workaround for this is to add one fake emote in the thirdParty array like this:

"thirdParty":[{"id":"NOEMOTE","imageScale":1,"data":"","name":"NOEMOTE","url":null,"width":0,"height":0}]
@Entrivax Entrivax changed the title A list of 0 first party or third party emotes prevent the other list to load anyway A list of 0 first party or third party emotes prevents the other list to load anyway Jan 5, 2024
@Zibbp Zibbp added the bug Something isn't working label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants