refactor(baseball): use background_data_service via data_manager#19
refactor(baseball): use background_data_service via data_manager#19ChuckBuilds merged 1 commit intomainfrom
Conversation
Wire manager.py to delegate data fetching to the existing data_manager.py, which already has full background_data_service integration (submit_fetch_request with callbacks, request tracking, and sync fallback). This brings baseball in line with the basketball, football, hockey, and soccer scoreboard plugins. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughVersion 1.0.5 release of the baseball-scoreboard plugin introduces optional background data fetching via a new data_manager module. Metadata updated across plugins.json and manifest.json, while manager.py adds data_manager initialization with fallback to synchronous ESPN API calls when unavailable. Changes
Sequence DiagramsequenceDiagram
participant Plugin as BaseballScoreboardPlugin
participant DataMgr as BaseballDataManager
participant ESPN as ESPN API
Plugin->>DataMgr: Initialize (attempt)
alt data_manager available
DataMgr-->>Plugin: Instance created
Note over Plugin: Ready for async fetching
else Initialization fails
Plugin-->>Plugin: Set data_manager to None
Note over Plugin: Will use sync fallback
end
Plugin->>Plugin: fetch_league_data()
alt data_manager exists
Plugin->>DataMgr: _fetch_via_data_manager()
DataMgr-->>Plugin: Return game data
Plugin->>Plugin: _convert_milb_game() (if needed)
else no data_manager
Plugin->>ESPN: Direct API call (sync)
ESPN-->>Plugin: Return game data
end
Plugin-->>Plugin: Cleanup & reset data_manager
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
Summary
manager.pyto delegate data fetching to the existingdata_manager.py, which already has fullbackground_data_serviceintegration (submit_fetch_requestwith callbacks, request tracking, and sync fallback)background_data_servicefor async background fetching_fetch_league_data_sync()fallback ifdata_managerimport failsChanges
manager.py: ImportBaseballDataManager, initialize in__init__(), delegate_fetch_league_data()to data manager, add MiLB format converter, updatecleanup()manifest.json: Bump to v1.0.5, add monorepo fields (repo,branch,plugin_path)plugins.json: Synclast_updatedto2026-02-12to match manifestTest plan
data_manager.pyimports resolve when running as a plugindata_managerimport fails, sync fetch still works🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores