Skip to content

IoEvent::Repeat from a plugin changes Spotify's repeat while internet radio plays #376

Description

@LargeModGames

Describe the bug

A plugin can dispatch IoEvent::Repeat. The decoded routers intercept it through set_decoded_repeat_from_state, which returns false for internet radio because radio has no queue to repeat. False means "not handled", so the runtime forwards the event to the Spotify network handler and repeat changes on your real Spotify device while you are listening to radio.

To Reproduce

  1. Build with --features all-sources.
  2. Play an internet radio station.
  3. From a plugin, call the scripting API that dispatches IoEvent::Repeat (src/infra/scripting/api.rs:453).
  4. Open the Spotify client. Repeat changed there, on a track you are not playing.

Expected behavior

The request should be rejected while a source that cannot honour repeat owns playback, the same way the keyboard and MPRIS paths do after #373.

Root cause

The IoEvent::Repeat arm in route_local_event (src/infra/local/dispatch.rs:131) and its Subsonic and YouTube twins return whatever set_decoded_repeat_from_state gives back, and radio has no router arm for it at all. So for radio nothing consumes the event and it reaches handle_network_event.

Additional context

Found while reviewing #373. Narrow, since the keyboard and MPRIS paths are both guarded now and a plugin is the only remaining way in. Worth fixing anyway so the "a source that has no repeat does not touch Spotify's repeat" rule holds on every path rather than most of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrustRust programming language related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions