-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify CLI: Replace browse with direct movie/tv/queue commands #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Replace browse command with direct movie, tv, and queue commands to streamline user experience and eliminate media type selection step. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
10-task plan to replace browse with movie/tv/queue commands Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace browse with direct movie/tv/queue commands Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the runMediaBrowser function that handles the shared media browsing
flow for movie and tv commands. This function is parameterized by media
type ("movie" or "episode") and extracts common browsing logic that will
be used by both runMovie and runTV.
Note: Build currently fails with "undefined: ui.PromptViewQueue" as this
function will be added in a subsequent task.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add UI prompt function that asks users whether they want to view their queue or continue browsing media. This function will be called by runMediaBrowser when items exist in the queue. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the command runner functions that connect Cobra commands to the implementation. runMovie and runTV are thin wrappers that call runMediaBrowser with the appropriate media type filter. runQueueCommand provides standalone queue access without the full browse loop. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the deprecated browse command now that movie, tv, and queue commands provide the same functionality with a cleaner UX. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This function is no longer needed after the browse command was removed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This function was only used by the browse command which has been removed. The movie and tv commands use their own dedicated selection logic. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
After successful login, users are now shown both the cache reindex command and the new movie/tv browse commands for better discoverability. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Standardize formatting across the codebase using go fmt. Fixes trailing whitespace and blank line consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request simplifies the CLI user experience by replacing the browse command with three direct commands: movie, tv, and queue. This eliminates an unnecessary media type selection step, streamlining the workflow from "browse → select type → pick item" to just "movie/tv → pick item".
Changes:
- Added three new commands (
movie,tv,queue) that provide direct access to specific media types and queue management - Removed the
browsecommand and extracted shared logic into arunMediaBrowser()helper function - Added
PromptViewQueue()function to allow viewing the queue before browsing media (fzf only)
Reviewed changes
Copilot reviewed 5 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/goplexcli/main.go | Added movie/tv/queue commands, removed browse command, extracted shared browsing logic into runMediaBrowser(), updated login help text |
| internal/ui/fzf.go | Added PromptViewQueue() for queue access, whitespace cleanup |
| internal/ui/browser.go | Struct field alignment improvements |
| internal/stream/web.go | Whitespace cleanup |
| internal/stream/server.go | Struct constant alignment and whitespace cleanup |
| internal/plex/client.go | Struct field alignment and whitespace cleanup |
| internal/player/player.go | Whitespace cleanup |
| internal/download/download.go | Whitespace cleanup |
| internal/config/config.go | Struct field alignment and whitespace cleanup |
| internal/cache/cache.go | Whitespace cleanup |
| cmd/preview/main.go | Whitespace cleanup |
| docs/plans/2026-01-29-cli-command-simplification.md | Implementation plan documentation |
| docs/plans/2026-01-29-cli-command-simplification-design.md | Design documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if user wants to view queue first (show option at top of list) | ||
| if q.Len() > 0 && ui.IsAvailable(cfg.FzfPath) { | ||
| // Show queue option in selection | ||
| viewQueue, err := ui.PromptViewQueue(cfg.FzfPath, q.Len()) | ||
| if err != nil { | ||
| if err.Error() == "cancelled by user" { | ||
| return nil | ||
| } | ||
| return fmt.Errorf("media type selection failed: %w", err) | ||
| } | ||
| } else { | ||
| // Fallback to manual selection | ||
| var err error | ||
| mediaType, err = selectMediaTypeManualWithQueue(q.Len()) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
|
|
||
| // Handle queue view | ||
| if mediaType == "queue" { | ||
| result, err := handleQueueView(cfg, q) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if result == "done" { | ||
| return nil | ||
| } | ||
| continue browseLoop | ||
| } | ||
|
|
||
| // Filter media by type | ||
| var filteredMedia []plex.MediaItem | ||
| switch mediaType { | ||
| case "movies": | ||
| for _, item := range mediaCache.Media { | ||
| if item.Type == "movie" { | ||
| filteredMedia = append(filteredMedia, item) | ||
| if viewQueue { | ||
| result, err := handleQueueView(cfg, q) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
| case "tv shows": | ||
| for _, item := range mediaCache.Media { | ||
| if item.Type == "episode" { | ||
| filteredMedia = append(filteredMedia, item) | ||
| if result == "done" { | ||
| return nil | ||
| } | ||
| continue browseLoop | ||
| } | ||
| case "all": | ||
| filteredMedia = mediaCache.Media | ||
| default: | ||
| filteredMedia = mediaCache.Media | ||
| } | ||
|
|
||
| if len(filteredMedia) == 0 { | ||
| fmt.Println(warningStyle.Render("No media found for selected type.")) | ||
| continue browseLoop | ||
| } |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When fzf is not available, users cannot view the queue before browsing media. The queue viewing prompt at line 507 is only shown when ui.IsAvailable(cfg.FzfPath) is true. Consider adding a manual prompt option similar to other parts of the code that have fzf/manual fallbacks, or document this as a limitation.
| // If user wants to go back, just exit (no browse to return to) | ||
| if result == "back" { | ||
| return nil |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Back to Browse" label in the queue action prompt may be misleading when accessed via the standalone goplexcli queue command, since there's no browse session to return to. Consider updating the label to be more generic like "Back" or "Exit", or pass a context parameter to customize the label based on how the queue was accessed.
Summary
browsecommand with directmovie,tv, andqueuecommandsgoplexcli queueBefore:
goplexcli browse→ Select "Movies" or "TV Shows" → Pick itemAfter:
goplexcli movie→ Pick item (one less step)Changes
moviecommand - jumps directly to movie listtvcommand - jumps directly to TV episode listqueuecommand - standalone queue managementbrowsecommand entirelyrunMediaBrowser()helperTest plan
goplexcli --helpshows movie, tv, queue (no browse)goplexcli movie --helpworksgoplexcli tv --helpworksgoplexcli queue --helpworks🤖 Generated with Claude Code