# Jellycleanarr TUI Fixes ## Issues Fixed ### 1. API Route Error - Data Format Mismatch **Problem**: The Playback Reporting Plugin API returns results as lists of lists with separate column names, but the code was treating them as dictionaries. **Fix**: Updated `client.py` to convert the API response format: - The API returns `{"colums": [...], "results": [[...], [...]]}` - Now converts this to a list of dictionaries by mapping column names to values **Files Changed**: - `src/jellycleanarr/api/client.py` (lines 96-156) ### 2. DataTable Column Initialization **Problem**: DataTable columns were being added during `__init__`, which doesn't work in Textual's widget lifecycle. **Fix**: Moved column initialization to the `on_mount()` method where the widget DOM is available. **Files Changed**: - `src/jellycleanarr/ui/widgets/stats_table.py` ### 3. Widget Height Configuration **Problem**: Widget containers weren't getting proper height allocation. **Fix**: Added explicit height rules in CSS for the stats widgets. **Files Changed**: - `src/jellycleanarr/ui/styles/main.tcss` ## Testing All data services verified working: - ✓ User stats: 7 users with playback data - ✓ Series stats: 50+ items with playback data - ✓ Library stats: 3 libraries tracked ## How to Run ```bash # Using the virtual environment directly .venv/Scripts/python.exe -m jellycleanarr # Or using uv uv run python -m jellycleanarr ``` ## Keyboard Shortcuts - `q` - Quit - `r` - Refresh current tab - `1` - Switch to User Statistics - `2` - Switch to Series Statistics - `3` - Switch to Library Statistics ## Expected Behavior The TUI should now display: 1. Header with title 2. Three tabs (User Statistics, Series Statistics, Library Statistics) 3. Two tables per tab showing "Most" and "Least" statistics 4. Footer with keyboard shortcuts Each table should show data loaded from your Jellyfin server via the Playback Reporting Plugin.