From 0acefe636e520a7c8d51a3b58a62fd1e2117ec75 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 20 Jun 2026 18:29:02 +0200 Subject: [PATCH] Handle AllAnime source assertions --- integrations/playback/allanime/sources.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integrations/playback/allanime/sources.go b/integrations/playback/allanime/sources.go index c684534..6341e91 100644 --- a/integrations/playback/allanime/sources.go +++ b/integrations/playback/allanime/sources.go @@ -194,8 +194,11 @@ func buildSourceReferences(rawSourceURLs []any) []sourceReference { continue } - sourceURL, _ := item["sourceUrl"].(string) - sourceName, _ := item["sourceName"].(string) + sourceURL, ok := stringMapValue(item, "sourceUrl") + if !ok { + continue + } + sourceName, _ := stringMapValue(item, "sourceName") sourceURL = strings.TrimSpace(sourceURL) sourceName = strings.TrimSpace(sourceName) if sourceURL == "" { @@ -230,6 +233,11 @@ func buildSourceReferences(rawSourceURLs []any) []sourceReference { return ordered } +func stringMapValue(item map[string]any, key string) (string, bool) { + value, ok := item[key].(string) + return value, ok +} + func (c *AllAnimeProvider) graphqlRequestWithHash(ctx context.Context, showID, episode, mode string) (map[string]any, error) { req, err := newEpisodeHashRequest(ctx, showID, episode, mode) if err != nil {