Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Keep collecting podcast data when a feed was removed from PodcastIndex#413

Merged
andygrunwald merged 1 commit into
mainEngineeringKiosk/GermanTechPodcasts:mainfrom
andygrunwald/tolerate-removed-podcastindex-feedsEngineeringKiosk/GermanTechPodcasts:andygrunwald/tolerate-removed-podcastindex-feedsCopy head branch name to clipboard
Jul 19, 2026
Merged

Keep collecting podcast data when a feed was removed from PodcastIndex#413
andygrunwald merged 1 commit into
mainEngineeringKiosk/GermanTechPodcasts:mainfrom
andygrunwald/tolerate-removed-podcastindex-feedsEngineeringKiosk/GermanTechPodcasts:andygrunwald/tolerate-removed-podcastindex-feedsCopy head branch name to clipboard

Conversation

@andygrunwald

Copy link
Copy Markdown
Contributor

Problem

The scheduled Podcast data workflow fails. Run 29679381516 aborted while processing generated/it-at-db.json (feed id 685245):

Error: json: cannot unmarshal array into Go struct field Podcast.feed of type podcastindex.PodcastFeed:
{"status":"true","query":{"id":"685245"},"feed":[],"description":"No feeds match this id."}

Once a feed is removed from the PodcastIndex, the API answers with an empty JSON array as feed instead of a feed object. Podcast.Feed is typed as a struct, so decoding fails, and cmdCollectPodcastData returns that error immediately. A single delisted podcast therefore stopped the remaining ~50 of 112 files from being refreshed.

IT@DB has been archive: true with no new episode since Aug 2025, so it having disappeared from the index is expected — it just shouldn't take the whole run down with it.

Change

  • app/podcastindex/podcasts.go: decode feed through a custom UnmarshalJSON that treats a leading [ as "no feed found", and expose the outcome via a new Podcast.Found field.
  • app/cmd/collectPodcastData.go: when !p.Found, log it and continue. Image download, episode retrieval and the write-back are skipped, so the existing generated JSON stays byte-identical. This follows the tolerance we already apply when a cover image download fails but an older image is on disk.

Every other error path in the loop keeps its current fail-fast behaviour.

Verification

go build ./..., go vet ./... and go test ./... pass. Added app/podcastindex/podcasts_test.go, which decodes the exact failing payload from the run log (expects no error, Found == false) and a normal feed response (expects the fields populated). These are the first test files in the repo.

Not verified locally: the end-to-end run against the live API, which needs the real key/secret. Worth watching the next scheduled run — it should finish, log PodcastIndex has no feed for id 685245 anymore, and leave generated/it-at-db.json unchanged.

Noticed, not fixed

collectPodcastData.go:150-162: when an image download fails but an old file exists, DoesImageExistsOnDisk(path, true) returns an absolute path while the sibling branch returns a bare filename. The following filepath.Join(imageFolder, podcastImageName) then writes a broken images//home/runner/.../images/wp-sofa.png into podcastInfo.Image. That branch was hit in this same run (wp-sofa, HTTP 423). Unrelated to this crash, left alone.

🤖 Generated with Claude Code

The scheduled "Podcast data" workflow aborted while processing
it-at-db.json (feed id 685245):

    json: cannot unmarshal array into Go struct field Podcast.feed
    of type podcastindex.PodcastFeed:
    {"status":"true","query":{"id":"685245"},"feed":[],
     "description":"No feeds match this id."}

Once a feed is removed from the PodcastIndex, the API answers with an
empty JSON array as "feed" instead of a feed object. Podcast.Feed is
typed as a struct, so decoding failed and the error aborted the run.
A single dead podcast therefore stopped the remaining ~50 of 112 files
from being refreshed.

Decode "feed" through a custom UnmarshalJSON that treats an array as
"no feed found" and expose that via Podcast.Found. The collector skips
such a podcast and keeps the data collected in the past, following the
same tolerance we already apply to failing cover image downloads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@andygrunwald
andygrunwald merged commit 714ed26 into main Jul 19, 2026
5 checks passed
@andygrunwald
andygrunwald deleted the andygrunwald/tolerate-removed-podcastindex-feeds branch July 19, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.