Merge branch 'main' into Volume-Persistence-Across-Restarts

This commit is contained in:
Omar Amin authored and GitHub committed 2026-02-22 05:34:57 +02:00
commit 15b87942c5
1 file changed
+5 -4
+5 -4
View File
@@ -3,6 +3,7 @@ import logging
from typing import Union, List, Callable, Optional
from .player.libmpv import LibMpvPlayer
from .player.state import PlayerState
class MpvMediaPlayer:
@@ -39,12 +40,12 @@ class MpvMediaPlayer:
self._log.debug("Received URL list, using first entry")
url = url[0]
# Track is changing
# Track is changing - only stop for replacement if actually playing
if self._done_callback is not None:
if self._player.state() != PlayerState.IDLE:
self._log.debug(
"Stopping active playback before starting new media"
)
# Not self.stop() → this would call done_callback
self._player.stop(for_replacement=True)
self._done_callback = None
@@ -87,7 +88,7 @@ class MpvMediaPlayer:
Set playback volume.
Args:
volume: Volume in percent (0.0–100.0).
volume: Volume in percent (0.0-100.0).
"""
self._log.debug("set_volume(volume=%.2f)", volume)
self._player.set_volume(volume)
@@ -97,7 +98,7 @@ class MpvMediaPlayer:
Temporarily reduce volume.
Args:
factor: Volume multiplier (0.0–1.0).
factor: Volume multiplier (0.0-1.0).
"""
self._log.debug("duck(factor=%.2f)", factor)
self._player.duck(factor)