Handle AllAnime source assertions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user