Documentation
¶
Index ¶
- func CountItemsWithProgress(items []*plex.MediaItem) int
- func DownloadPoster(plexURL, thumbPath, token string) string
- func GetEpisodesForSeason(episodes []plex.MediaItem, showName string, seasonNum int) []plex.MediaItem
- func GetRecentlyAddedTVShows(episodes []plex.MediaItem, limit int) []string
- func GetSeasonsForShow(episodes []plex.MediaItem, showName string) []int
- func GetUniqueTVShows(episodes []plex.MediaItem) []string
- func HasResumableProgress(media *plex.MediaItem) bool
- func IsAvailable(fzfPath string) bool
- func Logo(version string)
- func PluralizeItems(count int) string
- func PromptAction(fzfPath string) (string, error)
- func PromptActionWithQueue(fzfPath string, selectionCount, queueCount, outplayerCount int) (string, error)
- func PromptMoreAction(fzfPath string) (string, error)
- func PromptQueueAction(fzfPath string, queueCount, outplayerCount int) (string, error)
- func SelectMedia(media []plex.MediaItem, prompt string, fzfPath string) (*plex.MediaItem, error)
- func SelectMediaType(fzfPath string) (string, error)
- func SelectMediaTypeWithQueue(fzfPath string, queueCount, continueCount int) (string, error)
- func SelectMediaWithCustomLabels(media []plex.MediaItem, labels []string, prompt string, fzfPath string, ...) (int, error)
- func SelectMediaWithPreview(media []plex.MediaItem, prompt string, fzfPath string, plexURL string, ...) ([]int, error)
- func SelectQueueItemsForRemoval(queue []*plex.MediaItem, fzfPath string) ([]int, error)
- func SelectSeason(seasons []int, showName string, fzfPath string) (int, error)
- func SelectTVShow(shows []string, fzfPath string) (string, error)
- func SelectWithFzf(items []string, prompt string, fzfPath string) (string, int, error)
- type BrowserModel
- type MultiResumeChoice
- type ResumeChoice
- type ResumePromptOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountItemsWithProgress ¶ added in v0.2.2
CountItemsWithProgress counts how many items in the list have resumable progress.
func DownloadPoster ¶
DownloadPoster downloads the poster image and returns the local path
func GetEpisodesForSeason ¶ added in v0.2.2
func GetEpisodesForSeason(episodes []plex.MediaItem, showName string, seasonNum int) []plex.MediaItem
GetEpisodesForSeason filters episodes for a specific show and season number. It returns all episodes matching the show name and season (ParentIndex). Use seasonNum=0 to get specials. Returns episodes sorted by episode number (Index). Returns an empty slice if no matching episodes are found.
func GetRecentlyAddedTVShows ¶ added in v0.2.7
GetRecentlyAddedTVShows returns unique show names ordered by how recently their newest episode was added (newest first), capped at limit. A limit of 0 means no cap. Episodes are grouped by show (ParentTitle), and each show is ranked by the most recent AddedAt across its episodes.
func GetSeasonsForShow ¶ added in v0.2.2
GetSeasonsForShow extracts unique season numbers for a specific show. It filters episodes by show name and collects unique ParentIndex values. Season 0 (specials) is placed at the end of the list if present. Returns a numerically sorted slice of season numbers.
func GetUniqueTVShows ¶ added in v0.2.2
GetUniqueTVShows extracts unique TV show titles from a slice of media items. It only considers items with Type "episode" and a non-empty ParentTitle. Returns an alphabetically sorted slice of unique show names. Returns an empty slice if no TV shows are found.
func HasResumableProgress ¶ added in v0.2.2
HasResumableProgress returns true if the media has progress that can be resumed. Returns false if no progress or if >=95% complete (treated as watched).
func IsAvailable ¶
IsAvailable checks if fzf is available on the system
func Logo ¶ added in v0.2.0
func Logo(version string)
Logo prints a styled ASCII art logo with version information
func PluralizeItems ¶ added in v0.2.0
PluralizeItems returns "1 item" or "N items" based on count
func PromptAction ¶
PromptAction asks the user what action to take
func PromptActionWithQueue ¶ added in v0.2.0
func PromptActionWithQueue(fzfPath string, selectionCount, queueCount, outplayerCount int) (string, error)
PromptActionWithQueue asks the user what action to take, showing queue count. "Transfer to Outplayer" is only offered when outplayerCount > 0.
func PromptMoreAction ¶ added in v0.2.6
PromptMoreAction shows the secondary action menu containing the less-common playback/streaming options (SenPlayer, Stream) that would otherwise clutter the main action menu. Returns "cancel" when the user backs out.
func PromptQueueAction ¶ added in v0.2.0
PromptQueueAction shows queue management options. "Transfer to Outplayer" is only offered when outplayerCount > 0.
func SelectMedia ¶
SelectMedia presents media items in fzf and returns the selected item
func SelectMediaType ¶
SelectMediaType asks user to select Movies or TV Shows
func SelectMediaTypeWithQueue ¶ added in v0.2.0
SelectMediaTypeWithQueue presents the top-level browse menu. It adds a "View Queue" option when the queue has items and a "Continue Watching" hub when continueCount items have resumable progress. Returns a normalized selection token: "queue", "continue watching", "recently added movies", "recently added tv shows", "movies", "tv shows", or "all".
func SelectMediaWithCustomLabels ¶ added in v0.2.2
func SelectMediaWithCustomLabels(media []plex.MediaItem, labels []string, prompt string, fzfPath string, plexURL string, plexToken string) (int, error)
SelectMediaWithCustomLabels is like SelectMediaWithPreview but uses caller-supplied labels (one per media item) and single-select. Used by search where labels carry extra context (e.g. "matched description") that FormatMediaTitle wouldn't produce. Returns the selected index, or -1 with errors.ErrCancelled if the user cancels.
func SelectMediaWithPreview ¶
func SelectMediaWithPreview(media []plex.MediaItem, prompt string, fzfPath string, plexURL string, plexToken string) ([]int, error)
SelectMediaWithPreview presents media in fzf with preview window showing metadata and poster
func SelectQueueItemsForRemoval ¶ added in v0.2.0
SelectQueueItemsForRemoval shows queue items for multi-select removal
func SelectSeason ¶ added in v0.2.2
SelectSeason presents seasons in fzf and returns the selected season number. It displays "Specials" for Season 0 and "Season N" for regular seasons. Returns the season number (0 for specials, positive for regular seasons). Returns -1 and an error if no seasons are available or selection fails.
func SelectTVShow ¶ added in v0.2.2
SelectTVShow presents TV shows in fzf and returns the selected show name. It displays the shows in an interactive fzf picker. Returns the selected show name or an error if cancelled or no shows available.
Types ¶
type BrowserModel ¶
type BrowserModel struct {
// contains filtered or unexported fields
}
Browser is a TUI browser for media items
func NewBrowser ¶
func NewBrowser(media []plex.MediaItem, plexURL, plexToken string) *BrowserModel
NewBrowser creates a new browser model
func (*BrowserModel) GetSelected ¶
func (m *BrowserModel) GetSelected() *plex.MediaItem
GetSelected returns the selected media item (if any)
func (*BrowserModel) Init ¶
func (m *BrowserModel) Init() tea.Cmd
func (*BrowserModel) View ¶
func (m *BrowserModel) View() string
type MultiResumeChoice ¶ added in v0.2.2
type MultiResumeChoice int
MultiResumeChoice represents the user's choice when multiple items have progress.
const ( // ResumeAll indicates resuming all items from their saved positions. ResumeAll MultiResumeChoice = iota // StartAllFromBeginning indicates starting all items from the beginning. StartAllFromBeginning // ChooseIndividually indicates the user wants to choose for each item. ChooseIndividually )
func PromptMultiResume ¶ added in v0.2.2
func PromptMultiResume(itemsWithProgress int, totalItems int, fzfPath string) (MultiResumeChoice, error)
PromptMultiResume displays a prompt when multiple items have progress.
type ResumeChoice ¶ added in v0.2.2
type ResumeChoice int
ResumeChoice represents the user's choice for resuming playback.
const ( // ResumeFromPosition indicates the user wants to resume from saved position. ResumeFromPosition ResumeChoice = iota // StartFromBeginning indicates the user wants to start from the beginning. StartFromBeginning )
func PromptResume ¶ added in v0.2.2
func PromptResume(opts ResumePromptOptions) (ResumeChoice, error)
PromptResume displays a resume prompt using fzf and returns the user's choice.