self._signal_update()
for path in [f.full_path for f in self._files]:
- self._mpv.playlist_append(path)
- self._mpv.playlist_play_index(self._idx)
+ self._mpv.command('loadfile', path, 'append')
+ self._mpv.command('playlist-play-index', self._idx)
@_if_mpv_available
def _kill_mpv(self) -> None:
"""Move player to previous item in playlist."""
assert self._mpv is not None
if self._mpv.playlist_pos > 0:
- self._mpv.playlist_prev()
+ self._mpv.command('playlist-prev')
else:
- self._mpv.playlist_play_index(0)
+ self._mpv.command('playlist-play-index', 0)
@_if_mpv_available
def next(self) -> None:
"""Move player to next item in playlist."""
assert self._mpv is not None
- max_idx: int = len(self._mpv.playlist_filenames) - 1
- if self._mpv.playlist_pos < len(self._mpv.playlist_filenames) - 1:
- self._mpv.playlist_next()
+ max_idx = len(self._mpv.playlist) - 1
+ if self._mpv.playlist_pos < max_idx:
+ self._mpv.command('playlist-next')
else:
- self._mpv.playlist_play_index(max_idx)
+ self._mpv.command('playlist-play-index', max_idx)
def reload(self) -> None:
"""Close MPV, re-read (and re-shuffle) filenames, then re-start MPV."""