Commit fc9c85b
committed
fix: prevent auto-next double-fire and unblock end-of-queue stop
Two bugs found in auto-next state management:
Bug A - Double-fire: check_auto_next() could fire twice for the same
track end because state.update(TRANSITIONING) is async and hasn't
propagated by the next polling cycle. The _auto_next_in_flight flag
was already set synchronously but check_auto_next never checked it.
Fix: add _auto_next_in_flight guard at the top of check_auto_next().
Bug B - End-of-queue stop blocked: when auto-next fires for the last
track in queue, next() detects end-of-queue and calls stop(), but
stop() was blocked by the _auto_next_in_flight guard (which can't
distinguish stale Plex stops from legitimate internal stops).
Fix: clear _auto_next_in_flight before calling stop() in next()'s
end-of-queue branches (offset<0 and offset>=total_count).1 parent 586e48f commit fc9c85b
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| |||
1072 | 1074 | | |
1073 | 1075 | | |
1074 | 1076 | | |
| 1077 | + | |
1075 | 1078 | | |
1076 | 1079 | | |
1077 | 1080 | | |
1078 | 1081 | | |
| 1082 | + | |
1079 | 1083 | | |
1080 | 1084 | | |
1081 | 1085 | | |
| |||
0 commit comments