MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.35k stars 397 forks source link

🐛 | RFID: place_not_swipe: Buttons may resume audio without a card present #2324

Open hoffie opened 5 months ago

hoffie commented 5 months ago

Version

v3.5.2

Branch

future3/main

OS

Raspberry Pi OS 32bit bookworm

Pi model

3B

Hardware

RFID Reader: RC522

What happened?

When using place_not_swipe, removing the card pauses the current song. I would have expected that the only way to resume the song would be placing the card again. Yet, when using physical buttons (e.g. for next/prev), those buttons will also resume playing.

This is unintuitive to me. Also, if there is no physical stop/pause button, the only way to pause is playing the card again and removing it again, which is even more unintuitive.

There should be some mechanism to prevent that.

Logs

No response

Configuration

No response

More info

Not sure, if/how this was solved in v2?

I guess this could be fixed by preventing all player functions (except for play() itself), which somehow call mpd_client.play(), from performing any action when the player is in paused state. It would still have to be decided (a) if this is a sane thing to do for all environments, (b) if this is only useful for place_not_swipe=true setups or (c) if this should be configurable in an independent way. I guess I'd argue for (c).

Basis for a fix: https://github.com/hoffie/RPi-Jukebox-RFID/commit/2f0d4a16c3f1889647e2061b53485ab2f705c6cf