Skip to content

feat(connect): re-enable Spotify Connect hooks with version guard and prefs defaults#220

Closed
stiefenm wants to merge 2 commits into
michaelherger:masterfrom
stiefenm:pr/b1-connect-prefs
Closed

feat(connect): re-enable Spotify Connect hooks with version guard and prefs defaults#220
stiefenm wants to merge 2 commits into
michaelherger:masterfrom
stiefenm:pr/b1-connect-prefs

Conversation

@stiefenm

@stiefenm stiefenm commented May 21, 2026

Copy link
Copy Markdown

Summary

Re-enable the Spotify Connect hooks in Plugin.pm with a version guard, and set
default 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 canSpotifyConnect
check, adds a version guard (CONNECT_VERSION), and establishes the preference keys
that the daemon lifecycle (#221) and event dispatch (#222) depend on.

This PR is intentionally minimal — it only touches Plugin.pm and sets the foundation
for #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

  • Restore canSpotifyConnect check (previously commented out)
  • Add CONNECT_VERSION constant for binary compatibility checks
  • Set default preference values: connectEnabled, connectPlayerName, connectPort

Dependency Notes

This PR is part of the Spotify Connect re-implementation series (#220#221#222).

Submitted as draft pending merge of the A-series. Ready to mark as "ready for review"
once #215-#219 are merged.

Tested On

  • Lyrion Music Server 9.2.0 (build 1778040950) on Debian Linux x86_64
  • Perl 5.38.2 (x86_64-linux-gnu-thread-multi)
  • spotty binary v2.1.0 / librespot 0.8.0
  • Verified: LMS starts without errors with this PR applied; canSpotifyConnect returns true
    on compatible binary version; Connect preference keys are present in spotty.prefs

stiefenm added 2 commits May 21, 2026 09:14
- 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
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3b0b8ea-1b5b-48a4-996b-dfd136537ab7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@stiefenm

Copy link
Copy Markdown
Author

Closing in favor of consolidated PRs as discussed — will resubmit as focused issues + PRs.

@stiefenm stiefenm closed this May 22, 2026
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