Documentation
¶
Index ¶
- Variables
- func CalculateTotalProgress(tasks map[string]*worker.TaskProgress) float64
- func Dimmed(text string) string
- func Error(text string) string
- func FormatFileStatus(file FileItem) string
- func FormatTaskStatus(status worker.TaskStatus) string
- func HandleProgressUpdate(tasks map[string]*worker.TaskProgress, update worker.ProgressUpdate) map[string]*worker.TaskProgress
- func HandleStats(currentStats worker.ProgressStats, poolStats worker.PoolStats) worker.ProgressStats
- func Highlight(text string) string
- func Info(text string) string
- func IsValidView(view ViewMode) bool
- func RenderActressMergeModal(m *Model) string
- func RenderManualSearchModal(m *Model) string
- func Subtitle(text string) string
- func Success(text string) string
- func Title(text string) string
- func Warning(text string) string
- type Browser
- func (b *Browser) CursorDown()
- func (b *Browser) CursorUp()
- func (b *Browser) DeselectAll()
- func (b *Browser) Init() tea.Cmd
- func (b *Browser) SelectAll()
- func (b *Browser) SetDestPath(path string)
- func (b *Browser) SetItems(items []FileItem)
- func (b *Browser) SetPathDisplay(display string)
- func (b *Browser) SetSize(width, height int)
- func (b *Browser) SetSourcePath(path string)
- func (b *Browser) ToggleSelection(path string)
- func (b *Browser) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (b *Browser) View() string
- type CancelTaskMsg
- type Console
- func (c *Console) AddEntry(entry string)
- func (c *Console) Clear()
- func (c *Console) Init() tea.Cmd
- func (c *Console) ScrollDown()
- func (c *Console) ScrollToBottom()
- func (c *Console) ScrollToTop()
- func (c *Console) ScrollUp()
- func (c *Console) SetSize(width, height int)
- func (c *Console) ToggleAutoScroll()
- func (c *Console) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (c *Console) View() string
- type Dashboard
- type DownloaderInterface
- type ErrorMsg
- type FileItem
- type FileSelectedMsg
- type FolderItem
- type Header
- type HelpView
- type LogEntry
- type LogMsg
- type LogViewer
- func (l *LogViewer) AddLog(entry LogEntry)
- func (l *LogViewer) Init() tea.Cmd
- func (l *LogViewer) ScrollDown()
- func (l *LogViewer) ScrollToBottom()
- func (l *LogViewer) ScrollToTop()
- func (l *LogViewer) ScrollUp()
- func (l *LogViewer) SetSize(width, height int)
- func (l *LogViewer) ToggleAutoScroll()
- func (l *LogViewer) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (l *LogViewer) View() string
- type Model
- func (m *Model) AddConsoleOutput(output string)
- func (m *Model) AddLog(level, message string)
- func (m *Model) CloseFolderPicker()
- func (m *Model) Error() error
- func (m *Model) GetDestPath() string
- func (m *Model) GetSelectedFiles() []string
- func (m *Model) Init() tea.Cmd
- func (m *Model) NavigateToFolder(path string)
- func (m *Model) OpenFolderPicker(startPath, mode string)
- func (m *Model) Rescan(path string)
- func (m *Model) SelectCurrentFolder()
- func (m *Model) SetActressRepo(repo *database.ActressRepository)
- func (m *Model) SetDestPath(path string)
- func (m *Model) SetDryRun(dryRun bool)
- func (m *Model) SetFiles(files []FileItem)
- func (m *Model) SetMatchResults(matches map[string]matcher.MatchResult)
- func (m *Model) SetProcessor(processor *ProcessingCoordinator)
- func (m *Model) SetScanner(s *scanner.Scanner, mat *matcher.Matcher, recursive bool)
- func (m *Model) SetSize(width, height int)
- func (m *Model) SetSourcePath(path string)
- func (m *Model) SetUpdateMode(updateMode bool)
- func (m *Model) SetWorkerPool(pool *worker.Pool, progressChan chan worker.ProgressUpdate)
- func (m *Model) StartProcessing(ctx context.Context) error
- func (m *Model) ToggleFileSelection(path string)
- func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Model) UpdateProgress(update worker.ProgressUpdate)
- func (m *Model) UpdateStats(stats worker.ProgressStats)
- func (m *Model) View() string
- type PauseMsg
- type PoolInterface
- type ProcessingCoordinator
- func (pc *ProcessingCoordinator) GetCustomScrapers() []string
- func (pc *ProcessingCoordinator) ProcessFiles(ctx context.Context, files []FileItem, matches map[string]matcher.MatchResult) error
- func (pc *ProcessingCoordinator) SetConfig(cfg *config.Config)
- func (pc *ProcessingCoordinator) SetCustomScrapers(scrapers []string)
- func (pc *ProcessingCoordinator) SetDestPath(destPath string)
- func (pc *ProcessingCoordinator) SetDownloadEnabled(enabled bool)
- func (pc *ProcessingCoordinator) SetDownloadExtrafanart(enabled bool)
- func (pc *ProcessingCoordinator) SetDryRun(dryRun bool)
- func (pc *ProcessingCoordinator) SetForceRefresh(forceRefresh bool)
- func (pc *ProcessingCoordinator) SetForceUpdate(forceUpdate bool)
- func (pc *ProcessingCoordinator) SetLinkMode(mode organizer.LinkMode)
- func (pc *ProcessingCoordinator) SetMergeStrategies(scalarStrategy, arrayStrategy string)
- func (pc *ProcessingCoordinator) SetMoveFiles(moveFiles bool)
- func (pc *ProcessingCoordinator) SetNFOEnabled(enabled bool)
- func (pc *ProcessingCoordinator) SetOptions(scrape, download, organize, nfo bool)
- func (pc *ProcessingCoordinator) SetOptionsFromConfig(cfg *config.Config)
- func (pc *ProcessingCoordinator) SetOrganizeEnabled(enabled bool)
- func (pc *ProcessingCoordinator) SetScrapeEnabled(enabled bool)
- func (pc *ProcessingCoordinator) SetTemplateEngine(engine *template.Engine)
- func (pc *ProcessingCoordinator) SetUpdateMode(enabled bool)
- func (pc *ProcessingCoordinator) Stop()
- func (pc *ProcessingCoordinator) Wait() error
- type ProgressMsg
- type ProgressTrackerInterface
- type QuitMsg
- type RescanMsg
- type ResumeMsg
- type ScanCompleteMsg
- type SettingsView
- type StartProcessingMsg
- type State
- func CycleView(state State) State
- func MoveCursorDown(state State, maxItems int) State
- func MoveCursorUp(state State) State
- func NewState() *State
- func SetFileCount(state State, count int) State
- func SwitchToView(state State, view ViewMode) State
- func ToggleHelp(state State, previousView ViewMode) State
- type StatsMsg
- type TaskCompleteMsg
- type TaskList
- type TickMsg
- type ViewMode
Constants ¶
This section is empty.
Variables ¶
var ( ColorPrimary = lipgloss.Color("#8B5CF6") // Bright Purple ColorSuccess = lipgloss.Color("#22C55E") // Bright Green ColorWarning = lipgloss.Color("#FBBF24") // Bright Amber ColorError = lipgloss.Color("#EF4444") // Red ColorInfo = lipgloss.Color("#60A5FA") // Bright Blue ColorMuted = lipgloss.Color("#9CA3AF") // Light Gray ColorBorder = lipgloss.Color("#6B7280") // Medium gray ColorBackground = lipgloss.Color("#111827") // Very dark ColorForeground = lipgloss.Color("#F9FAFB") // Very light ColorHighlight = lipgloss.Color("#A78BFA") // Light purple ColorTab = lipgloss.Color("#4B5563") // Medium dark gray ColorTabActive = lipgloss.Color("#8B5CF6") // Active tab purple )
Color palette
var ( // Header styles HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). Background(ColorBackground). Padding(0, 1) StatusStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Padding(0, 1) // Border styles BorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1) ActiveBorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(0, 1) // Title styles TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). MarginBottom(1) SubtitleStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Italic(true) // List item styles SelectedItemStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true). PaddingLeft(2) UnselectedItemStyle = lipgloss.NewStyle(). Foreground(ColorForeground). PaddingLeft(2) CheckedItemStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). PaddingLeft(2) // Progress bar styles ProgressBarStyle = lipgloss.NewStyle(). Foreground(ColorPrimary) ProgressEmptyStyle = lipgloss.NewStyle(). Foreground(ColorMuted) // Status badge styles SuccessBadge = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) ErrorBadge = lipgloss.NewStyle(). Foreground(ColorError). Bold(true) WarningBadge = lipgloss.NewStyle(). Foreground(ColorWarning). Bold(true) InfoBadge = lipgloss.NewStyle(). Foreground(ColorInfo). Bold(true) RunningBadge = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) // Log styles LogDebugStyle = lipgloss.NewStyle(). Foreground(ColorMuted) LogInfoStyle = lipgloss.NewStyle(). Foreground(ColorInfo) LogWarnStyle = lipgloss.NewStyle(). Foreground(ColorWarning) LogErrorStyle = lipgloss.NewStyle(). Foreground(ColorError). Bold(true) // Help styles HelpKeyStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) HelpDescStyle = lipgloss.NewStyle(). Foreground(ColorMuted) HelpSeparatorStyle = lipgloss.NewStyle(). Foreground(ColorBorder) // Dimmed text DimmedStyle = lipgloss.NewStyle(). Foreground(ColorMuted) // Highlight HighlightStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) // Error text ErrorStyle = lipgloss.NewStyle(). Foreground(ColorError). Bold(true) // Success text SuccessStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) // Tab styles TabStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Background(ColorTab). Padding(0, 2). MarginRight(1) ActiveTabStyle = lipgloss.NewStyle(). Foreground(ColorForeground). Background(ColorTabActive). Padding(0, 2). MarginRight(1). Bold(true) // Panel style with lighter border PanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(1, 2) )
Styles
Functions ¶
func CalculateTotalProgress ¶
func CalculateTotalProgress(tasks map[string]*worker.TaskProgress) float64
CalculateTotalProgress computes the aggregate progress across all tasks. This is a pure function with no side effects.
Parameters:
- tasks: Map of task IDs to TaskProgress
Returns:
- Average progress (0.0 to 1.0), or 0.0 if no tasks exist
func FormatFileStatus ¶
FormatFileStatus returns a human-readable status string for a file based on its matched state. This is a pure function with no side effects.
Status format:
- "matched [ID]" - file has been matched to a JAV ID
- "unmatched" - file has not been matched yet
Note: FileItem struct currently tracks Matched and ID fields only. Processing/Progress state is tracked separately in the TUI Model.
Parameters:
- file: FileItem to format status for
Returns:
- formatted status string
func FormatTaskStatus ¶
func FormatTaskStatus(status worker.TaskStatus) string
FormatTaskStatus returns a human-readable status badge for a worker task. This is a pure function extracted from the TaskList component.
Status format:
- worker.TaskStatusRunning -> "RUN"
- worker.TaskStatusSuccess -> "OK"
- worker.TaskStatusFailed -> "ERR"
- worker.TaskStatusPending -> "..."
Parameters:
- status: worker.TaskStatus enum value
Returns:
- formatted status badge string (without styling)
func HandleProgressUpdate ¶
func HandleProgressUpdate(tasks map[string]*worker.TaskProgress, update worker.ProgressUpdate) map[string]*worker.TaskProgress
HandleProgressUpdate updates task progress state based on a progress message. This is a pure function with no side effects - it creates a new tasks map with the updated progress data for the specified task.
Parameters:
- tasks: Current map of task IDs to TaskProgress
- update: Progress update containing task ID, status, and progress data
Returns:
- New map with updated task progress (immutable transformation)
func HandleStats ¶
func HandleStats(currentStats worker.ProgressStats, poolStats worker.PoolStats) worker.ProgressStats
HandleStats updates overall statistics based on worker pool stats. This is a pure function that creates a new ProgressStats with updated values.
Parameters:
- currentStats: Current progress statistics
- poolStats: New statistics from worker pool
Returns:
- New ProgressStats with updated values
func IsValidView ¶
IsValidView checks if the given view mode is valid. Valid views: Browser(0), Dashboard(1), Logs(2), Settings(3), Help(4)
func RenderActressMergeModal ¶
RenderActressMergeModal renders the actress merge modal overlay.
func RenderManualSearchModal ¶
RenderManualSearchModal renders the manual search modal overlay
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser component
func NewBrowser ¶
func NewBrowser() *Browser
func (*Browser) CursorDown ¶
func (b *Browser) CursorDown()
func (*Browser) DeselectAll ¶
func (b *Browser) DeselectAll()
func (*Browser) SetDestPath ¶
func (*Browser) SetPathDisplay ¶
func (*Browser) SetSourcePath ¶
func (*Browser) ToggleSelection ¶
type CancelTaskMsg ¶
type CancelTaskMsg struct {
TaskID string
}
CancelTaskMsg signals to cancel a specific task
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console component - shows live output and metadata preview
func NewConsole ¶
func NewConsole() *Console
func (*Console) ScrollDown ¶
func (c *Console) ScrollDown()
func (*Console) ScrollToBottom ¶
func (c *Console) ScrollToBottom()
func (*Console) ScrollToTop ¶
func (c *Console) ScrollToTop()
func (*Console) ToggleAutoScroll ¶
func (c *Console) ToggleAutoScroll()
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
Dashboard component
func NewDashboard ¶
func NewDashboard() *Dashboard
func (*Dashboard) UpdateStats ¶
func (d *Dashboard) UpdateStats(stats worker.ProgressStats, elapsed time.Duration)
type DownloaderInterface ¶
type DownloaderInterface interface {
SetDownloadExtrafanart(enabled bool)
}
DownloaderInterface defines the contract for media download operations used by ProcessingCoordinator. Only includes methods directly called by processor.go (SetDownloadExtrafanart). Implemented by: *downloader.Downloader
type FileItem ¶
type FileItem struct {
Path string
Name string
Size int64
IsDir bool
Selected bool
Matched bool
ID string // JAV ID if matched
Depth int // Indentation depth for tree display
Parent string // Parent directory path
}
FileItem represents a file in the browser
func FilterVideoFiles ¶
FilterVideoFiles returns only video files matching the provided extensions. This is a pure function: it creates a new slice without modifying the input.
Parameters:
- files: slice of FileItem to filter
- extensions: list of valid video extensions (e.g., ".mp4", ".mkv", ".avi")
Returns:
- new slice containing only files matching the extensions
func SortFilesByStatus ¶
SortFilesByStatus sorts files by matched state and then alphabetically by path. This is a pure function: it creates a new sorted slice without modifying the input.
Sort order:
- Matched files (sorted alphabetically by path)
- Unmatched files (sorted alphabetically by path)
- Directories (sorted alphabetically by path)
Parameters:
- files: slice of FileItem to sort
Returns:
- new sorted slice (original unchanged)
type FileSelectedMsg ¶
FileSelectedMsg indicates files were selected/deselected
type FolderItem ¶
FolderItem represents a folder in the folder picker
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header component
func (*Header) UpdateStats ¶
func (h *Header) UpdateStats(stats worker.ProgressStats)
type HelpView ¶
type HelpView struct {
// contains filtered or unexported fields
}
HelpView component
func NewHelpView ¶
func NewHelpView() *HelpView
type LogEntry ¶
LogEntry represents a log message
func HandleError ¶
HandleError processes an error message and creates a log entry. This is a convenience function that wraps HandleLogMessage with "error" level.
Parameters:
- err: Error to process
Returns:
- Log entry with error level and error message
func HandleLogMessage ¶
HandleLogMessage processes a log message and creates a log entry. This is a pure function that returns a formatted log entry.
Parameters:
- level: Log level (info, warn, error, etc.)
- message: Log message content
Returns:
- Formatted log entry struct
type LogViewer ¶
type LogViewer struct {
// contains filtered or unexported fields
}
LogViewer component
func NewLogViewer ¶
func NewLogViewer() *LogViewer
func (*LogViewer) ScrollDown ¶
func (l *LogViewer) ScrollDown()
func (*LogViewer) ScrollToBottom ¶
func (l *LogViewer) ScrollToBottom()
func (*LogViewer) ScrollToTop ¶
func (l *LogViewer) ScrollToTop()
func (*LogViewer) ToggleAutoScroll ¶
func (l *LogViewer) ToggleAutoScroll()
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the TUI application state
func (*Model) AddConsoleOutput ¶
AddConsoleOutput adds output to the console
func (*Model) CloseFolderPicker ¶
func (m *Model) CloseFolderPicker()
CloseFolderPicker closes the folder picker
func (*Model) GetDestPath ¶
GetDestPath returns the destination path
func (*Model) GetSelectedFiles ¶
GetSelectedFiles returns the list of selected files
func (*Model) NavigateToFolder ¶
NavigateToFolder navigates to a folder in the picker
func (*Model) OpenFolderPicker ¶
OpenFolderPicker opens the folder picker at the given path
func (*Model) SelectCurrentFolder ¶
func (m *Model) SelectCurrentFolder()
SelectCurrentFolder selects the current folder and closes the picker
func (*Model) SetActressRepo ¶
func (m *Model) SetActressRepo(repo *database.ActressRepository)
SetActressRepo sets the actress repository used by the merge modal.
func (*Model) SetDestPath ¶
SetDestPath sets the destination path for organized files
func (*Model) SetMatchResults ¶
func (m *Model) SetMatchResults(matches map[string]matcher.MatchResult)
SetMatchResults sets the match results for files
func (*Model) SetProcessor ¶
func (m *Model) SetProcessor(processor *ProcessingCoordinator)
SetProcessor sets the processing coordinator
func (*Model) SetScanner ¶
SetScanner sets the scanner for rescanning files
func (*Model) SetSourcePath ¶
SetSourcePath sets the source path being scanned
func (*Model) SetUpdateMode ¶
SetUpdateMode sets update mode and syncs it to processor.
func (*Model) SetWorkerPool ¶
func (m *Model) SetWorkerPool(pool *worker.Pool, progressChan chan worker.ProgressUpdate)
SetWorkerPool sets the worker pool and progress channel
func (*Model) StartProcessing ¶
StartProcessing begins processing selected files
func (*Model) ToggleFileSelection ¶
ToggleFileSelection toggles selection of a file
func (*Model) UpdateProgress ¶
func (m *Model) UpdateProgress(update worker.ProgressUpdate)
UpdateProgress updates task progress
func (*Model) UpdateStats ¶
func (m *Model) UpdateStats(stats worker.ProgressStats)
UpdateStats updates statistics
type PoolInterface ¶
PoolInterface defines the contract for worker pool operations. Implemented by: *worker.Pool
type ProcessingCoordinator ¶
type ProcessingCoordinator struct {
// contains filtered or unexported fields
}
ProcessingCoordinator coordinates task execution for the TUI
func NewProcessingCoordinator ¶
func NewProcessingCoordinator( pool PoolInterface, progressTracker ProgressTrackerInterface, movieRepo *database.MovieRepository, registry *models.ScraperRegistry, agg *aggregator.Aggregator, dl DownloaderInterface, org *organizer.Organizer, nfoGen *nfo.Generator, destPath string, moveFiles bool, ) *ProcessingCoordinator
NewProcessingCoordinator creates a new processing coordinator
IMPORTANT: This constructor requires concrete types that implement the interfaces:
- pool must be *worker.Pool (type assertion in ProcessFiles)
- progressTracker must be *worker.ProgressTracker (type assertion in ProcessFiles)
- dl must be *downloader.Downloader (type assertion in ProcessFiles)
Passing incorrect types will cause a runtime panic when ProcessFiles is called.
func (*ProcessingCoordinator) GetCustomScrapers ¶
func (pc *ProcessingCoordinator) GetCustomScrapers() []string
GetCustomScrapers returns the current custom scraper priority Returns a copy to prevent external mutation
func (*ProcessingCoordinator) ProcessFiles ¶
func (pc *ProcessingCoordinator) ProcessFiles( ctx context.Context, files []FileItem, matches map[string]matcher.MatchResult, ) error
ProcessFiles processes the selected files with matched JAV IDs
func (*ProcessingCoordinator) SetConfig ¶
func (pc *ProcessingCoordinator) SetConfig(cfg *config.Config)
SetConfig provides runtime config for template-aware NFO merge path resolution.
func (*ProcessingCoordinator) SetCustomScrapers ¶
func (pc *ProcessingCoordinator) SetCustomScrapers(scrapers []string)
SetCustomScrapers sets custom scraper priority for manual search Makes a defensive copy to prevent data races with worker goroutines
func (*ProcessingCoordinator) SetDestPath ¶
func (pc *ProcessingCoordinator) SetDestPath(destPath string)
SetDestPath sets the destination path for organized files
func (*ProcessingCoordinator) SetDownloadEnabled ¶
func (pc *ProcessingCoordinator) SetDownloadEnabled(enabled bool)
SetDownloadEnabled sets whether media downloads are enabled
func (*ProcessingCoordinator) SetDownloadExtrafanart ¶
func (pc *ProcessingCoordinator) SetDownloadExtrafanart(enabled bool)
SetDownloadExtrafanart sets whether extrafanart downloads are enabled
func (*ProcessingCoordinator) SetDryRun ¶
func (pc *ProcessingCoordinator) SetDryRun(dryRun bool)
SetDryRun sets whether to run in dry-run mode (preview only)
func (*ProcessingCoordinator) SetForceRefresh ¶
func (pc *ProcessingCoordinator) SetForceRefresh(forceRefresh bool)
SetForceRefresh sets whether to force refresh from scrapers (clear cache)
func (*ProcessingCoordinator) SetForceUpdate ¶
func (pc *ProcessingCoordinator) SetForceUpdate(forceUpdate bool)
SetForceUpdate sets whether to force update existing files
func (*ProcessingCoordinator) SetLinkMode ¶
func (pc *ProcessingCoordinator) SetLinkMode(mode organizer.LinkMode)
SetLinkMode sets how copy operations materialize files (copy/hardlink/softlink). Link mode is ignored when move mode is enabled.
func (*ProcessingCoordinator) SetMergeStrategies ¶
func (pc *ProcessingCoordinator) SetMergeStrategies(scalarStrategy, arrayStrategy string)
SetMergeStrategies sets scalar/array merge behavior for update mode.
func (*ProcessingCoordinator) SetMoveFiles ¶
func (pc *ProcessingCoordinator) SetMoveFiles(moveFiles bool)
SetMoveFiles sets whether to move files instead of copying
func (*ProcessingCoordinator) SetNFOEnabled ¶
func (pc *ProcessingCoordinator) SetNFOEnabled(enabled bool)
SetNFOEnabled sets whether NFO generation is enabled
func (*ProcessingCoordinator) SetOptions ¶
func (pc *ProcessingCoordinator) SetOptions(scrape, download, organize, nfo bool)
SetOptions configures which operations to perform
func (*ProcessingCoordinator) SetOptionsFromConfig ¶
func (pc *ProcessingCoordinator) SetOptionsFromConfig(cfg *config.Config)
SetOptionsFromConfig configures which operations to perform based on the application config This should be called after SetConfig to apply metadata.nfo.enabled setting
func (*ProcessingCoordinator) SetOrganizeEnabled ¶
func (pc *ProcessingCoordinator) SetOrganizeEnabled(enabled bool)
SetOrganizeEnabled sets whether file organization is enabled
func (*ProcessingCoordinator) SetScrapeEnabled ¶
func (pc *ProcessingCoordinator) SetScrapeEnabled(enabled bool)
SetScrapeEnabled sets whether metadata scraping is enabled
func (*ProcessingCoordinator) SetTemplateEngine ¶
func (pc *ProcessingCoordinator) SetTemplateEngine(engine *template.Engine)
func (*ProcessingCoordinator) SetUpdateMode ¶
func (pc *ProcessingCoordinator) SetUpdateMode(enabled bool)
SetUpdateMode sets whether update-mode merge behavior is enabled.
func (*ProcessingCoordinator) Stop ¶
func (pc *ProcessingCoordinator) Stop()
Stop stops the worker pool
func (*ProcessingCoordinator) Wait ¶
func (pc *ProcessingCoordinator) Wait() error
Wait waits for all tasks to complete
type ProgressMsg ¶
type ProgressMsg struct {
TaskID string
Type worker.TaskType
Status worker.TaskStatus
Progress float64
Message string
BytesDone int64
Error error
Timestamp time.Time
}
ProgressMsg represents a progress update from a worker
type ProgressTrackerInterface ¶
type ProgressTrackerInterface interface {
Update(id string, progress float64, message string, bytesProcessed int64)
Complete(id string, message string)
Fail(id string, err error)
}
ProgressTrackerInterface defines the contract for progress tracking operations. Implemented by: *worker.ProgressTracker
type RescanMsg ¶
type RescanMsg struct {
Path string
}
RescanMsg signals to rescan a new folder path
type ScanCompleteMsg ¶
ScanCompleteMsg indicates file scanning is complete
type SettingsView ¶
type SettingsView struct {
// contains filtered or unexported fields
}
SettingsView component
func NewSettingsView ¶
func NewSettingsView() *SettingsView
func (*SettingsView) Init ¶
func (s *SettingsView) Init() tea.Cmd
func (*SettingsView) SetSize ¶
func (s *SettingsView) SetSize(width, height int)
func (*SettingsView) UpdateSettings ¶
func (s *SettingsView) UpdateSettings( cursor int, dryRun, forceUpdate, forceRefresh, moveFiles bool, scrapeEnabled, downloadEnabled, downloadExtrafanart, organizeEnabled, nfoEnabled, updateMode bool, )
func (*SettingsView) View ¶
func (s *SettingsView) View() string
type StartProcessingMsg ¶
type StartProcessingMsg struct{}
StartProcessingMsg signals to start processing selected files
type State ¶
type State struct {
// View state
CurrentView ViewMode
// File browser state
Cursor int
FileCount int
SelectedIdx int // Currently selected file index in browser
// Modal states
ShowingFolderPicker bool
ShowingManualSearch bool
EditingPath bool
// Processing state
IsProcessing bool
IsPaused bool
ProcessingComplete bool
}
State represents the testable business state of the TUI. This is separated from the Model struct to enable unit testing independent of Bubble Tea's event-driven framework.
Philosophy: 60% testable (business logic), 40% excluded (UI rendering). This struct contains ONLY business state fields that can be tested with pure functions, NOT UI-specific fields like viewport, help, styles.
func CycleView ¶
CycleView cycles to the next view in sequence. Order: Browser -> Dashboard -> Logs -> Settings -> Browser (skips Help view). Returns a new state with the updated view.
func MoveCursorDown ¶
MoveCursorDown moves the cursor down by one position. Returns a new state with the updated cursor (clamped to < maxItems).
func MoveCursorUp ¶
MoveCursorUp moves the cursor up by one position. Returns a new state with the updated cursor (clamped to >= 0).
func SetFileCount ¶
SetFileCount updates the file count in the state. Used when files are loaded or rescanned.
func SwitchToView ¶
SwitchToView switches to the specified view. Returns a new state with the updated view. This is a pure function with no side effects.
func ToggleHelp ¶
ToggleHelp toggles between the current view and the Help view. Returns a new state with the toggled view.
type StatsMsg ¶
type StatsMsg struct {
TotalTasks int
Pending int
Running int
Success int
Failed int
Canceled int
TotalBytes int64
DoneBytes int64
OverallProgress float64
ElapsedTime time.Duration
}
StatsMsg provides overall statistics update
type TaskCompleteMsg ¶
type TaskCompleteMsg struct {
TaskID string
Type worker.TaskType
Success bool
Error error
Duration time.Duration
}
TaskCompleteMsg indicates a task has completed
type TaskList ¶
type TaskList struct {
// contains filtered or unexported fields
}
TaskList component
func NewTaskList ¶
func NewTaskList() *TaskList
func (*TaskList) UpdateTask ¶
func (t *TaskList) UpdateTask(update worker.ProgressUpdate)