Handle AllAnime source assertions

This commit is contained in:
2026-06-20 18:29:02 +02:00
committed by Milas Holsting
parent 0c685e6c09
commit 0acefe636e

View File

@@ -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 {