cli

package
v0.13.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Types

type BrowseResult added in v0.3.0

type BrowseResult struct {
	SelectedFile string // Full remote path of selected file
	Cancelled    bool   // User quit without selecting
}

BrowseResult holds the result of browsing

func RunBrowseTUI added in v0.3.0

func RunBrowseTUI(client *webdav.Client, serverName, initialPath string) (*BrowseResult, error)

RunBrowseTUI runs the file browser TUI and returns the selected file path

type FileEntry added in v0.3.0

type FileEntry struct {
	Name  string `json:"name"`
	Path  string `json:"path"`
	IsDir bool   `json:"is_dir"`
	Size  int64  `json:"size"`
}

FileEntry represents a file or directory for JSON output

type ItemType

type ItemType int

ItemType distinguishes between podcasts and episodes

const (
	ItemTypePodcast ItemType = iota
	ItemTypeEpisode
)

type SearchItem

type SearchItem struct {
	Title       string
	Subtitle    string // e.g., "Duration: 45:30 | Plays: 1234"
	URL         string
	DownloadURL string   // Direct download URL if available
	Selectable  bool     // Whether this item can be selected
	Type        ItemType // Podcast or Episode
	// For podcasts (used to fetch episodes)
	PodcastID string // iTunes collection ID or Xiaoyuzhou pid
	FeedURL   string // RSS feed URL (for iTunes)
}

SearchItem represents a selectable item (podcast or episode)

func RunSearchTUI

func RunSearchTUI(sections []SearchSection, query, lang string) ([]SearchItem, error)

RunSearchTUI runs the search TUI and returns selected items

func RunSearchTUIWithBack added in v0.3.0

func RunSearchTUIWithBack(sections []SearchSection, query, lang string, allowBack bool) ([]SearchItem, error)

RunSearchTUIWithBack runs the search TUI with optional back navigation

type SearchSection

type SearchSection struct {
	Title string
	Items []SearchItem
}

SearchSection represents a section (Podcasts or Episodes)

type SearchTUIResult added in v0.3.0

type SearchTUIResult struct {
	Items  []SearchItem
	GoBack bool
}

SearchTUIResult holds the result of RunSearchTUI

type XiaoyuzhouEpisode

type XiaoyuzhouEpisode struct {
	Type      string `json:"type"`
	Eid       string `json:"eid"`
	Pid       string `json:"pid"`
	Title     string `json:"title"`
	Duration  int    `json:"duration"`
	PlayCount int    `json:"playCount"`
	PubDate   string `json:"pubDate"`
	Enclosure struct {
		URL string `json:"url"`
	} `json:"enclosure"`
	Podcast struct {
		Title string `json:"title"`
	} `json:"podcast"`
}

type XiaoyuzhouPodcast

type XiaoyuzhouPodcast struct {
	Type              string `json:"type"`
	Pid               string `json:"pid"`
	Title             string `json:"title"`
	Author            string `json:"author"`
	Brief             string `json:"brief"`
	SubscriptionCount int    `json:"subscriptionCount"`
	EpisodeCount      int    `json:"episodeCount"`
}

type XiaoyuzhouSearchResponse

type XiaoyuzhouSearchResponse struct {
	Data struct {
		Episodes []XiaoyuzhouEpisode `json:"episodes"`
		Podcasts []XiaoyuzhouPodcast `json:"podcasts"`
	} `json:"data"`
}

XiaoyuzhouSearchResponse represents the API response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL