plexbar 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plexbar-0.1.2 → plexbar-0.1.3}/PKG-INFO +17 -1
- {plexbar-0.1.2 → plexbar-0.1.3}/README.md +16 -0
- {plexbar-0.1.2 → plexbar-0.1.3}/pyproject.toml +1 -1
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/app.py +14 -1
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/playback.py +12 -2
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/__init__.py +0 -0
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/__main__.py +0 -0
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/models.py +0 -0
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/plex_client.py +0 -0
- {plexbar-0.1.2 → plexbar-0.1.3}/src/plexbar/settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: plexbar
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A command-line TUI music player for Plex
|
|
5
5
|
Author: Christopher Patti
|
|
6
6
|
Author-email: Christopher Patti <feoh@feoh.org>
|
|
@@ -16,6 +16,8 @@ Plexbar is a keyboard-driven terminal music player for Plex. It gives you a
|
|
|
16
16
|
simple Textual TUI for browsing and playing your Plex music library without
|
|
17
17
|
opening a web browser.
|
|
18
18
|
|
|
19
|
+

|
|
20
|
+
|
|
19
21
|
## Features
|
|
20
22
|
|
|
21
23
|
- First-run Plex connection setup
|
|
@@ -33,6 +35,20 @@ opening a web browser.
|
|
|
33
35
|
- A Plex server with at least one music library
|
|
34
36
|
- A Plex token
|
|
35
37
|
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Install Plexbar as a standalone command with `uv`:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv tool install plexbar
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Run Plexbar:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
plexbar
|
|
50
|
+
```
|
|
51
|
+
|
|
36
52
|
## Installation for development
|
|
37
53
|
|
|
38
54
|
Clone the repository and sync dependencies with `uv`:
|
|
@@ -4,6 +4,8 @@ Plexbar is a keyboard-driven terminal music player for Plex. It gives you a
|
|
|
4
4
|
simple Textual TUI for browsing and playing your Plex music library without
|
|
5
5
|
opening a web browser.
|
|
6
6
|
|
|
7
|
+

|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- First-run Plex connection setup
|
|
@@ -21,6 +23,20 @@ opening a web browser.
|
|
|
21
23
|
- A Plex server with at least one music library
|
|
22
24
|
- A Plex token
|
|
23
25
|
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install Plexbar as a standalone command with `uv`:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv tool install plexbar
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Run Plexbar:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
plexbar
|
|
38
|
+
```
|
|
39
|
+
|
|
24
40
|
## Installation for development
|
|
25
41
|
|
|
26
42
|
Clone the repository and sync dependencies with `uv`:
|
|
@@ -207,6 +207,7 @@ class PlexbarApp(App[None]):
|
|
|
207
207
|
|
|
208
208
|
def on_mount(self) -> None:
|
|
209
209
|
self.query_one("#search", Input).display = False
|
|
210
|
+
self.set_interval(0.5, self.advance_finished_track)
|
|
210
211
|
if config_exists():
|
|
211
212
|
try:
|
|
212
213
|
self.start_with_config(load_config())
|
|
@@ -344,9 +345,21 @@ class PlexbarApp(App[None]):
|
|
|
344
345
|
self.player.pause_resume()
|
|
345
346
|
|
|
346
347
|
def action_next_track(self) -> None:
|
|
348
|
+
self.play_next_track("End of queue.")
|
|
349
|
+
|
|
350
|
+
def advance_finished_track(self) -> None:
|
|
351
|
+
"""Continue playback when mpv exits at the end of a track."""
|
|
352
|
+
|
|
353
|
+
if self.player is None or not self.player.reap_finished():
|
|
354
|
+
return
|
|
355
|
+
self.play_next_track("End of queue.")
|
|
356
|
+
|
|
357
|
+
def play_next_track(self, end_status: str) -> None:
|
|
358
|
+
"""Advance the queue and play the next track, if any."""
|
|
359
|
+
|
|
347
360
|
track = self.queue.next()
|
|
348
361
|
if track is None:
|
|
349
|
-
self.set_status(
|
|
362
|
+
self.set_status(end_status)
|
|
350
363
|
self.refresh_queue()
|
|
351
364
|
return
|
|
352
365
|
self.play(track)
|
|
@@ -29,9 +29,10 @@ class PlaybackQueue:
|
|
|
29
29
|
def append(self, tracks: list[QueueTrack]) -> None:
|
|
30
30
|
"""Append tracks to the queue."""
|
|
31
31
|
|
|
32
|
+
first_new_index = len(self.tracks)
|
|
32
33
|
self.tracks.extend(tracks)
|
|
33
|
-
if self.current_index == -1 and
|
|
34
|
-
self.current_index =
|
|
34
|
+
if self.current_index == -1 and tracks:
|
|
35
|
+
self.current_index = first_new_index
|
|
35
36
|
|
|
36
37
|
def replace(self, tracks: list[QueueTrack]) -> QueueTrack | None:
|
|
37
38
|
"""Replace the queue and return the first track."""
|
|
@@ -100,6 +101,15 @@ class MpvPlayer:
|
|
|
100
101
|
self._process.stdin.flush()
|
|
101
102
|
self._paused = not self._paused
|
|
102
103
|
|
|
104
|
+
def reap_finished(self) -> bool:
|
|
105
|
+
"""Clear and report a naturally finished mpv process."""
|
|
106
|
+
|
|
107
|
+
if self._process is None or self._process.poll() is None:
|
|
108
|
+
return False
|
|
109
|
+
self._process = None
|
|
110
|
+
self._paused = False
|
|
111
|
+
return True
|
|
112
|
+
|
|
103
113
|
def stop(self) -> None:
|
|
104
114
|
"""Stop mpv if it is running."""
|
|
105
115
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|