Skip to content

Discover and process all US TV shows dynamically via TVMaze schedule API#66

Merged
DisabledAbel merged 1 commit into
mainfrom
discover-us-tv-schedules-1232259988698646920
Jul 16, 2026
Merged

Discover and process all US TV shows dynamically via TVMaze schedule API#66
DisabledAbel merged 1 commit into
mainfrom
discover-us-tv-schedules-1232259988698646920

Conversation

@DisabledAbel

@DisabledAbel DisabledAbel commented Jul 16, 2026

Copy link
Copy Markdown
Owner

The Google verification and Rotten Tomatoes fetch scripts are updated to dynamically fetch and process all US TV shows from the TVMaze schedule API over an 8-day window (today + 7 days) rather than being limited to the single hardcoded show "Sofia the First: Royal Magic". This ensures full and up-to-date schedule verification and pre-caching for all active US television shows.


PR created automatically by Jules for task 1232259988698646920 started by @DisabledAbel

Summary by CodeRabbit

  • New Features
    • Expanded TV show discovery using upcoming US TV schedules for the next seven days, helping identify more shows automatically.
  • Bug Fixes
    • Added request timeouts to TV data lookups, preventing stalled updates when external services are slow or unavailable.
    • Improved handling of incomplete schedule entries so invalid or missing show names are ignored.
  • Tests
    • Added coverage to verify schedule-based show discovery returns valid, distinct titles.

…e API 📺

- Modified `scripts/fetch-rt.js` and `scripts/google-verify.js` to dynamically fetch US TV show names from the TVMaze schedule API for today and the next 7 days.
- Introduced `fetchWithTimeout` helper function with 15-second network timeout in both scripts.
- Added unit test in `test/googleVerify.test.js` to verify TVMaze schedule show name extraction.
- Verified that all unit/integration tests pass.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
make-ics Ready Ready Preview, Comment Jul 16, 2026 8:37pm

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Both TV show processing scripts add timeout-controlled TVMaze requests and discover additional US shows from upcoming schedules. A unit test validates extraction of distinct, non-empty schedule show names.

Changes

TVMaze network discovery

Layer / File(s) Summary
Timeout-enabled TVMaze requests
scripts/fetch-rt.js, scripts/google-verify.js
Adds abortable fetch helpers with configurable timeouts and timer cleanup.
Schedule-based show discovery
scripts/fetch-rt.js, scripts/google-verify.js, test/googleVerify.test.js
Queries upcoming US TVMaze schedules, merges valid show names into showSet, handles request failures, and tests distinct-name extraction.
Per-show metadata and episode lookups
scripts/fetch-rt.js, scripts/google-verify.js
Uses timeout-controlled requests for TVMaze single-search and episode retrieval.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Script as TV show processing script
  participant Schedule as TVMaze US schedule API
  participant ShowSet as showSet
  participant TVMaze as TVMaze show and episode APIs
  Script->>Schedule: Fetch upcoming schedules
  Schedule-->>Script: Return schedule items
  Script->>ShowSet: Add valid show names
  Script->>TVMaze: Fetch show metadata and episodes with timeouts
  TVMaze-->>Script: Return show and episode data
Loading

Possibly related PRs

  • DisabledAbel/MakeICS#63: Both modify TVMaze schedule discovery and per-show lookup logic in scripts/google-verify.js.
  • DisabledAbel/MakeICS#65: Both extend TV-show discovery and TVMaze verification behavior in scripts/google-verify.js.

Suggested labels: codex

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: dynamic discovery and processing of US TV shows from the TVMaze schedule API.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch discover-us-tv-schedules-1232259988698646920

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DisabledAbel

Copy link
Copy Markdown
Owner Author

@coderabbitai review the code

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@DisabledAbel, I’ll review the changes in #66, with particular attention to API pagination, date/timezone boundaries, deduplication, and failure handling across the expanded show set.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/googleVerify.test.js (1)

68-95: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test exercises duplicated inline logic rather than the production implementation.

This test validates a standalone copy of the scheduling logic, meaning it will continue to pass even if the actual implementation in the scripts is broken or modified. Consider extracting the schedule parsing block into a shared utility function so that both the scripts and the test exercise the exact same code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/googleVerify.test.js` around lines 68 - 95, The test currently
duplicates the schedule parsing logic instead of invoking production code.
Extract the parsing block into a shared utility, update the relevant scheduling
script to use it, and change the “TVMaze schedule discovery parses show names
correctly” test to call that utility while preserving the existing filtering and
deduplication behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/fetch-rt.js`:
- Around line 113-115: Replace the UTC-based date formatting after local date
mutation in scripts/fetch-rt.js lines 113-115 and scripts/google-verify.js lines
212-214 with local year, month, and day formatting, preserving the existing date
iteration so each query matches the intended local calendar date.

---

Nitpick comments:
In `@test/googleVerify.test.js`:
- Around line 68-95: The test currently duplicates the schedule parsing logic
instead of invoking production code. Extract the parsing block into a shared
utility, update the relevant scheduling script to use it, and change the “TVMaze
schedule discovery parses show names correctly” test to call that utility while
preserving the existing filtering and deduplication behavior.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c3bdf8b-d6d2-4431-bf79-81309d3db3e2

📥 Commits

Reviewing files that changed from the base of the PR and between 7a0950b and 9116c73.

📒 Files selected for processing (3)
  • scripts/fetch-rt.js
  • scripts/google-verify.js
  • test/googleVerify.test.js

Comment thread scripts/fetch-rt.js
Comment on lines +113 to +115
const d = new Date();
d.setDate(d.getDate() + i);
const dateStr = d.toISOString().slice(0, 10);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Timezone misalignment skips the current local day during schedule discovery.

Both scripts mix local date mutation (getDate(), setDate()) with UTC string formatting (toISOString()). If the script runs in a timezone where the local date lags behind UTC (e.g., US evenings), toISOString() evaluates to the next calendar day. This mismatch causes the discovery loop to completely skip the current local day's schedule.

  • scripts/fetch-rt.js#L113-L115: Format local year, month, and day to ensure the query date strictly matches the local date iteration.
  • scripts/google-verify.js#L212-L214: Apply the exact same local date formatting fix to ensure consistent date boundaries here.
🛠️ Proposed fix for both files
-        const d = new Date();
-        d.setDate(d.getDate() + i);
-        const dateStr = d.toISOString().slice(0, 10);
+        const d = new Date();
+        d.setDate(d.getDate() + i);
+        const dateStr = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const d = new Date();
d.setDate(d.getDate() + i);
const dateStr = d.toISOString().slice(0, 10);
const d = new Date();
d.setDate(d.getDate() + i);
const dateStr = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
📍 Affects 2 files
  • scripts/fetch-rt.js#L113-L115 (this comment)
  • scripts/google-verify.js#L212-L214
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/fetch-rt.js` around lines 113 - 115, Replace the UTC-based date
formatting after local date mutation in scripts/fetch-rt.js lines 113-115 and
scripts/google-verify.js lines 212-214 with local year, month, and day
formatting, preserving the existing date iteration so each query matches the
intended local calendar date.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

❌ Failed to clone repository into sandbox. Please try again.

@DisabledAbel
DisabledAbel merged commit 24533a4 into main Jul 16, 2026
4 checks passed
@DisabledAbel
DisabledAbel deleted the discover-us-tv-schedules-1232259988698646920 branch July 16, 2026 23:21
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