plex-tui 0.2.0__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.
@@ -0,0 +1,19 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .tox/
8
+ .nox/
9
+ .coverage
10
+ .coverage.*
11
+ coverage.xml
12
+ htmlcov/
13
+ dist/
14
+ build/
15
+ *.egg-info/
16
+ .env
17
+ .env.*
18
+ .DS_Store
19
+ mpv-shot*.jpg
@@ -0,0 +1,80 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+
5
+ This is a Python/Textual terminal app for browsing Plex and launching playback
6
+ through `mpv`.
7
+
8
+ - `src/plextui/`: application source.
9
+ - `app.py`: Textual UI, navigation, settings, and high-level actions.
10
+ - `plex_service.py`: Plex API mapping and media detail extraction.
11
+ - `player.py`: `mpv` launch, stream selection, and playback diagnostics.
12
+ - `config.py`, `auth.py`, `artwork.py`, `models.py`: supporting modules.
13
+ - `tests/`: pytest suite, split by app helpers/navigation and service modules.
14
+ - `README.md`, `PACKAGING.md`, `RELEASE.md`, `ROADMAP.md`: user and release docs.
15
+ - `config.example.toml`: example user configuration.
16
+
17
+ ## Build, Test, and Development Commands
18
+
19
+ Use the project Makefile from the repository root:
20
+
21
+ ```bash
22
+ make install-dev # install editable package with dev dependencies
23
+ make run # start the TUI locally
24
+ make smoke # import/app construction sanity check
25
+ make test # run pytest
26
+ make compile # compile src and tests
27
+ make build # build sdist and wheel
28
+ make check-package # build and validate package metadata
29
+ make check # smoke, tests, compile, and package validation
30
+ ```
31
+
32
+ The app requires Python 3.11+ and uses external `mpv` for playback.
33
+
34
+ ## Coding Style & Naming Conventions
35
+
36
+ Use standard Python style with 4-space indentation and type annotations for new
37
+ public helpers or cross-module data. Prefer small pure helper functions for
38
+ rendering/status logic, and keep Textual event handling in `PlexTuiApp`.
39
+
40
+ Naming conventions:
41
+
42
+ - Classes: `PascalCase`, for example `MediaGrid`.
43
+ - Functions and variables: `snake_case`.
44
+ - Tests: `test_<behavior>` or async helpers named `run_<behavior>_check`.
45
+
46
+ No formatter is currently enforced. Keep edits minimal and consistent with
47
+ nearby code.
48
+
49
+ ## Testing Guidelines
50
+
51
+ Tests use `pytest`. Add focused unit tests for helper logic and app navigation
52
+ tests for Textual behavior. Prefer deterministic fake objects over live Plex
53
+ calls. Run at least:
54
+
55
+ ```bash
56
+ make test
57
+ make compile
58
+ make smoke
59
+ ```
60
+
61
+ For packaging or metadata changes, also run `make check-package` or `make check`.
62
+
63
+ ## Commit & Pull Request Guidelines
64
+
65
+ Git history uses short imperative subjects, such as `Speed up grid navigation`
66
+ and `Polish settings and grid navigation`. Keep commits scoped to one logical
67
+ change and include docs/tests with behavior changes.
68
+
69
+ Pull requests should include:
70
+
71
+ - A concise summary of user-visible behavior.
72
+ - Tests run and results.
73
+ - Screenshots or terminal notes for TUI changes when useful.
74
+ - Any config, packaging, or migration impact.
75
+
76
+ ## Security & Configuration Tips
77
+
78
+ Never commit real Plex tokens, account tokens, debug logs, or local config files.
79
+ Use `config.example.toml` for examples. Logs should redact tokens; preserve that
80
+ behavior when changing playback or request diagnostics.
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 - 2026-06-11
4
+
5
+ - Improved README structure and expanded the post-0.1.0 roadmap.
6
+ - Grouped the Settings screen into account, stream, playback, artwork, browsing, and diagnostics sections.
7
+ - Added direct Settings input for custom `mpv` window sizes.
8
+ - Added direct Settings input for custom page size and auto-load threshold values.
9
+ - Added confirmation for destructive Settings preference clears.
10
+ - Replaced the heavy selected grid-card border with a quieter marker/footer treatment.
11
+ - Added configurable compact, comfortable, and large grid density modes.
12
+ - Kept Settings open after value changes and added clearer changed-value feedback.
13
+ - Preserved Settings row highlighting after opening Settings and changing values.
14
+ - Added README screenshots for grid and list views.
15
+ - Clarified README install instructions for `main` versus tagged releases.
16
+ - Improved active playback status, details-pane playback context, and abnormal `mpv` exit diagnostics.
17
+
18
+ ## 0.1.0 - 2026-06-11
19
+
20
+ - Added Plex PIN login and server selection.
21
+ - Added library browsing with paged loading and automatic loading near the end of the list.
22
+ - Added current-library search with paged results and bounded global search.
23
+ - Added playback through `mpv` with Plex resume and progress reporting.
24
+ - Added audio and subtitle pickers with saved language preferences.
25
+ - Added support for external subtitles and embedded PGS/VOBSUB subtitle playback.
26
+ - Added media details for metadata, audio tracks, subtitle tracks, and saved stream preferences.
27
+ - Added settings actions for reload, relogin, and audio/subtitle preference management.
28
+ - Added settings actions for page size, auto-load threshold, mpv window sizing, and debug log visibility.
29
+ - Added playback diagnostics with token-redacted `debug.log` output.
30
+ - Added development workflow targets, smoke checks, and Linux/macOS setup documentation.
31
+ - Added release checklist and packaging option documentation.
32
+ - Added CLI flags for version, config/debug paths, and smoke checks.
33
+ - Added configurable page size and auto-load threshold for browsing performance.
34
+ - Added grid page navigation, richer grid status text, and adjacent-page artwork prefetching.
plex_tui-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 so1omon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ .PHONY: install-dev run test compile smoke build check-package check clean
2
+
3
+ PYTHON ?= .venv/bin/python
4
+
5
+ install-dev:
6
+ $(PYTHON) -m pip install -e ".[dev]"
7
+
8
+ run:
9
+ $(PYTHON) -m plextui
10
+
11
+ test:
12
+ $(PYTHON) -m pytest
13
+
14
+ compile:
15
+ python3 -m compileall -f src tests
16
+
17
+ smoke:
18
+ $(PYTHON) -m plextui.smoke
19
+
20
+ build:
21
+ $(PYTHON) -m build --no-isolation
22
+
23
+ check-package: build
24
+ $(PYTHON) -m twine check dist/*
25
+
26
+ check: smoke test compile check-package
27
+
28
+ clean:
29
+ rm -rf build dist *.egg-info src/*.egg-info
@@ -0,0 +1,108 @@
1
+ # Packaging Options
2
+
3
+ ## Current Target
4
+
5
+ The current package is a standard Python project with a `plex-tui` console
6
+ script. The best short-term install path is:
7
+
8
+ ```bash
9
+ pipx install .
10
+ ```
11
+
12
+ This keeps Python dependencies isolated while still exposing a normal command.
13
+ Users must install `mpv` separately with their system package manager.
14
+
15
+ Once pushed to GitHub, users can also install from:
16
+
17
+ ```bash
18
+ pipx install "git+https://github.com/so1omon563/plex-tui.git"
19
+ ```
20
+
21
+ Before the first push, configure the repository remote:
22
+
23
+ ```bash
24
+ git remote add origin https://github.com/so1omon563/plex-tui.git
25
+ git push -u origin main
26
+ ```
27
+
28
+ For local package validation, test both source and wheel installs:
29
+
30
+ ```bash
31
+ pipx install --force .
32
+ plex-tui --version
33
+ plex-tui --smoke
34
+ python -m build
35
+ pipx install --force dist/plex_tui-*.whl
36
+ plex-tui --version
37
+ plex-tui --smoke
38
+ ```
39
+
40
+ ## Recommended Path
41
+
42
+ 1. **PyPI + pipx**
43
+
44
+ Publish the Python package to PyPI once tagged GitHub releases are stable.
45
+ Users install with:
46
+
47
+ ```bash
48
+ pipx install plex-tui
49
+ ```
50
+
51
+ This is the lowest-maintenance distribution path for Python/Textual apps.
52
+ It does not solve the external `mpv` dependency, so docs must keep calling
53
+ that out explicitly.
54
+
55
+ 2. **Homebrew tap**
56
+
57
+ Add a Homebrew formula after PyPI packaging is stable. The formula can depend
58
+ on `mpv` and install the Python package through a virtualenv.
59
+
60
+ This would give macOS users a single command:
61
+
62
+ ```bash
63
+ brew install <tap>/plex-tui
64
+ ```
65
+
66
+ Formula requirements:
67
+
68
+ - Depend on `python@3.13` or the current Homebrew Python.
69
+ - Depend on `mpv`.
70
+ - Install from a tagged source archive or PyPI release.
71
+ - Run `plex-tui --smoke` in the formula test.
72
+
73
+ 3. **Arch AUR**
74
+
75
+ Add an AUR package for Arch users. This can depend on `mpv` and Python
76
+ dependencies from Arch packages where practical.
77
+
78
+ Package requirements:
79
+
80
+ - `depends=('python' 'mpv' ...)`
81
+ - Use a tagged GitHub source archive for `plex-tui`.
82
+ - Prefer system Python packages for `python-textual`, `python-pillow`,
83
+ `python-plexapi`, and `python-platformdirs` when available.
84
+ - Include a `check()` step that runs `plex-tui --smoke`.
85
+
86
+ 4. **Standalone binaries**
87
+
88
+ Consider PyInstaller or Shiv/Pex only after the app behavior stabilizes.
89
+ Standalone artifacts are convenient but add CI and platform complexity.
90
+ They still cannot bundle every user's `mpv` setup cleanly, so they do not
91
+ remove the external player dependency.
92
+
93
+ ## Not Recommended Yet
94
+
95
+ - System distro packages before the app has tagged releases.
96
+ - Bundling `mpv` into the Python package.
97
+ - Native image protocol support as a packaging requirement.
98
+
99
+ ## Packaging Requirements
100
+
101
+ Every distribution path should preserve:
102
+
103
+ - `plex-tui` command name.
104
+ - Python 3.11+ support.
105
+ - MIT license metadata.
106
+ - Clear external `mpv` dependency.
107
+ - Config paths based on `platformdirs`.
108
+ - Smoke/test/build checks from `RELEASE.md`.
@@ -0,0 +1,226 @@
1
+ Metadata-Version: 2.4
2
+ Name: plex-tui
3
+ Version: 0.2.0
4
+ Summary: A small standalone Plex terminal UI.
5
+ Project-URL: Homepage, https://github.com/so1omon563/plex-tui
6
+ Project-URL: Issues, https://github.com/so1omon563/plex-tui/issues
7
+ Project-URL: Repository, https://github.com/so1omon563/plex-tui
8
+ Author: so1omon
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: mpv,plex,textual,tui
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Multimedia :: Video
24
+ Classifier: Topic :: Terminals
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: pillow>=10.0
27
+ Requires-Dist: platformdirs>=4.2
28
+ Requires-Dist: plexapi>=4.15
29
+ Requires-Dist: textual>=0.86
30
+ Provides-Extra: dev
31
+ Requires-Dist: build>=1.2; extra == 'dev'
32
+ Requires-Dist: hatchling>=1.25; extra == 'dev'
33
+ Requires-Dist: pytest>=8.0; extra == 'dev'
34
+ Requires-Dist: twine>=5.0; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # plex-tui
38
+
39
+ A standalone Python/Textual terminal UI for browsing Plex and launching playback
40
+ through `mpv`.
41
+
42
+ plex-tui is currently an early release. It supports Plex login, server
43
+ selection, paged library browsing, search, list/grid views, stream preferences,
44
+ terminal poster artwork, and playback progress reporting.
45
+
46
+ ## Screenshots
47
+
48
+ ### Grid view
49
+
50
+ ![plex-tui grid view](docs/assets/grid-view.png)
51
+
52
+ ### List view
53
+
54
+ ![plex-tui list view](docs/assets/list-view.png)
55
+
56
+ ## Requirements
57
+
58
+ - Python 3.11 or newer
59
+ - `mpv` available on `PATH`
60
+ - A Plex account/server
61
+
62
+ Install `mpv` with your platform package manager:
63
+
64
+ ```bash
65
+ # macOS
66
+ brew install mpv
67
+
68
+ # Debian / Ubuntu
69
+ sudo apt install mpv
70
+
71
+ # Fedora
72
+ sudo dnf install mpv
73
+
74
+ # Arch Linux / Manjaro
75
+ sudo pacman -S mpv
76
+ ```
77
+
78
+ ## Install
79
+
80
+ The README tracks the current `main` branch. Tagged releases are available on
81
+ the GitHub Releases page.
82
+
83
+ The recommended install path for the latest `main` branch is `pipx`:
84
+
85
+ ```bash
86
+ pipx install "git+https://github.com/so1omon563/plex-tui.git"
87
+ plex-tui --smoke
88
+ plex-tui
89
+ ```
90
+
91
+ To install the latest tagged release instead:
92
+
93
+ ```bash
94
+ pipx install "git+https://github.com/so1omon563/plex-tui.git@v0.2.0"
95
+ ```
96
+
97
+ Useful CLI checks:
98
+
99
+ ```bash
100
+ plex-tui --version
101
+ plex-tui --config-path
102
+ plex-tui --debug-log-path
103
+ plex-tui --smoke
104
+ ```
105
+
106
+ For local development:
107
+
108
+ ```bash
109
+ git clone https://github.com/so1omon563/plex-tui.git
110
+ cd plex-tui
111
+ python3 -m venv .venv
112
+ source .venv/bin/activate
113
+ make install-dev
114
+ make run
115
+ ```
116
+
117
+ ## First Run & Configuration
118
+
119
+ On first run, plex-tui starts a Plex browser login and asks which server
120
+ connection to save. If a browser cannot be opened, use the login URL shown in
121
+ the terminal.
122
+
123
+ You can also configure a server manually. macOS config path:
124
+
125
+ ```bash
126
+ mkdir -p "$HOME/Library/Application Support/plex-tui"
127
+ $EDITOR "$HOME/Library/Application Support/plex-tui/config.toml"
128
+ ```
129
+
130
+ Linux config path:
131
+
132
+ ```bash
133
+ mkdir -p "$HOME/.config/plex-tui"
134
+ $EDITOR "$HOME/.config/plex-tui/config.toml"
135
+ ```
136
+
137
+ Minimal config:
138
+
139
+ ```toml
140
+ base_url = "http://127.0.0.1:32400"
141
+ token = "your-plex-token"
142
+ ```
143
+
144
+ Environment variables also work:
145
+
146
+ ```bash
147
+ export PLEX_TUI_BASE_URL="http://127.0.0.1:32400"
148
+ export PLEX_TUI_TOKEN="your-plex-token"
149
+ ```
150
+
151
+ See `config.example.toml` for optional settings.
152
+
153
+ ## Key Bindings
154
+
155
+ | Key | Action |
156
+ | --- | --- |
157
+ | `q` | Quit |
158
+ | `r` | Reload Plex connection |
159
+ | `/` | Search current library |
160
+ | `g` | Search all libraries |
161
+ | `?` | Show help |
162
+ | `tab` / `shift+tab` | Move focus |
163
+ | `l` | Focus libraries |
164
+ | `m` | Focus media |
165
+ | `v` | Toggle list/grid view |
166
+ | `pageup` / `pagedown` | Move one page in grid view |
167
+ | `,` | Show settings |
168
+ | `escape` | Clear search, go back, or close current view |
169
+ | `enter` | Open selected item |
170
+ | `p` | Play selected item with `mpv` |
171
+ | `a` / `s` | Choose audio / subtitle preference |
172
+ | `A` / `S` | Clear audio preference / cycle subtitle mode |
173
+ | `x` | Stop launched `mpv` |
174
+
175
+ ## Features
176
+
177
+ - Plex PIN login and server selection.
178
+ - Paged library browsing with automatic loading near the end of loaded items.
179
+ - Current-library search and bounded global search.
180
+ - List view plus configurable-density grid view with terminal poster artwork.
181
+ - External subtitle support and direct playback for embedded PGS/VOBSUB tracks.
182
+ - Audio and subtitle pickers with saved language preferences.
183
+ - Plex resume support and playback progress reporting.
184
+ - Settings screen for stream preferences, artwork modes, grid density, page
185
+ size, auto-load threshold, media view, and `mpv` window size.
186
+
187
+ ## Artwork
188
+
189
+ Poster artwork renders as portable colored block art, so it works in ordinary
190
+ terminals without Kitty, iTerm2, or Sixel support. Native terminal image output
191
+ is disabled for now because Kitty protocol rendering conflicts with Textual's
192
+ screen renderer in practice.
193
+
194
+ Grid view prefetches artwork for the visible page immediately and the next page
195
+ after selection settles. Compact, comfortable, and large density modes adjust
196
+ card and poster sizing. The artwork cache is bounded and stored in the app cache
197
+ directory shown in Settings.
198
+
199
+ ## Diagnostics
200
+
201
+ Playback diagnostics are written to `debug.log` in the app config directory.
202
+ Tokens are redacted from logged `mpv` arguments.
203
+
204
+ Enable browsing performance timings before launch:
205
+
206
+ ```bash
207
+ PLEX_TUI_PERF_LOG=1 plex-tui
208
+ ```
209
+
210
+ ## Development
211
+
212
+ Common commands:
213
+
214
+ ```bash
215
+ make smoke # app construction and helper sanity check
216
+ make test # pytest suite
217
+ make compile # compile src and tests
218
+ make check-package # build and validate package metadata
219
+ make check # smoke, tests, compile, package validation
220
+ ```
221
+
222
+ Packaging and release docs:
223
+
224
+ - `PACKAGING.md`: PyPI/pipx, Homebrew, AUR, and standalone packaging options.
225
+ - `RELEASE.md`: release validation and tagging checklist.
226
+ - `ROADMAP.md`: planned follow-up work.