feat(connect): re-enable Spotify Connect hooks with version guard and prefs defaults#220
feat(connect): re-enable Spotify Connect hooks with version guard and prefs defaults#220stiefenm wants to merge 2 commits into
Conversation
- use constant CONNECT_HELPER_VERSION => '2.1.0' (verified against spotty-custom --check) - $prefs->init: add disableDiscovery => 0 (Discovery ON per D-01) - $prefs->init: add checkDaemonConnected => 0 (explicitly disabled per REQUIREMENTS.md)
- add canSpotifyConnect(): checks CONNECT_HELPER_VERSION via Slim::Utils::Versions->checkVersion, requires Plugins::Spotty::Connect and calls Connect->init() unless dontInit is set - add isSpotifyConnect(): delegates to canSpotifyConnect(1) + Connect->isSpotifyConnect() - postinitPlugin: call $class->canSpotifyConnect() after OPML->init() to initialize Connect - shutdownPlugin: call Connect->shutdown() guarded by canSpotifyConnect(1) before process cleanup - killHangingProcesses REG-01 guard: collect DaemonManager->helperInstances PIDs before kill, switch from blind pkill to pgrep + PID-filtered kill to preserve Connect daemon process
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Closing in favor of consolidated PRs as discussed — will resubmit as focused issues + PRs. |
Summary
Re-enable the Spotify Connect hooks in
Plugin.pmwith a version guard, and setdefault preference values for Connect so the plugin can discover and register as a
Connect endpoint after enabling the feature.
Background
Spotify Connect support in the Spotty plugin was disabled (commented out) in a previous
version. This PR is the first step in re-enabling it: it restores the
canSpotifyConnectcheck, adds a version guard (
CONNECT_VERSION), and establishes the preference keysthat the daemon lifecycle (#221) and event dispatch (#222) depend on.
This PR is intentionally minimal — it only touches
Plugin.pmand sets the foundationfor #221/#222 to build on. No daemon is started; no Connect events are dispatched.
Note on PR #210: PR #210 (by hansherlighed) is an alternative Connect implementation
that is currently open. Our B-series is a more complete re-implementation of the Connect
stack from the ground up (three layered PRs), while PR #210 takes an incremental
patching approach. We leave it to the maintainer to decide which direction to pursue;
the two approaches are not merge-compatible due to overlapping file changes.
Changes
Plugin.pm
canSpotifyConnectcheck (previously commented out)CONNECT_VERSIONconstant for binary compatibility checksconnectEnabled,connectPlayerName,connectPortDependency Notes
This PR is part of the Spotify Connect re-implementation series (#220 → #221 → #222).
depends on feat(token): flavor-aware token cache keys and removeRefreshToken for account cleanup #217 for the
keymaster-tokenrefresh path used by feat(connect): full Spotify Connect event dispatch, API control methods, and settings UI #222's Connect daemon.Submitted as draft pending merge of the A-series. Ready to mark as "ready for review"
once #215-#219 are merged.
Tested On
canSpotifyConnectreturns trueon compatible binary version; Connect preference keys are present in spotty.prefs