guiapp

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: GPL-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveAssets

func ResolveAssets(override fs.FS) (fs.FS, error)

func Run

func Run(opts RunOptions) error

Run starts the Wails GUI with a background context.

func RunWithContext

func RunWithContext(ctx context.Context, opts RunOptions) error

RunWithContext starts the Wails GUI after resolving assets and creating the bound app with ctx.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App owns the Wails-bound backend state for the desktop GUI.

func NewApp

func NewApp(configPath string, configProvided bool) (*App, error)

NewApp creates a Wails backend using the default background context.

func NewAppWithContext

func NewAppWithContext(ctx context.Context, configPath string, configProvided bool) (*App, error)

NewAppWithContext bootstraps config, logging, repository access, and the core service used by Wails calls. Invalid runtime config leaves upload features disabled until settings are saved, while config/settings calls remain usable.

func (*App) BrowseDirectory

func (a *App) BrowseDirectory(path string, mode string) (api.BrowseDirectoryResponse, error)

func (*App) BrowseFile

func (a *App) BrowseFile() (string, error)

func (*App) BrowseFiles

func (a *App) BrowseFiles() ([]string, error)

func (*App) BrowseFolder

func (a *App) BrowseFolder() (string, error)

func (*App) BrowseImageFiles

func (a *App) BrowseImageFiles() ([]string, error)

func (*App) BrowsePath

func (a *App) BrowsePath() (string, error)

func (*App) CancelDVDMenuCapture added in v0.2.4

func (a *App) CancelDVDMenuCapture(jobID string) error

CancelDVDMenuCapture requests cancellation for an existing capture job. Completion is asynchronous and is reflected in later snapshots.

func (*App) CancelDupeCheck

func (a *App) CancelDupeCheck(jobID string) error

CancelDupeCheck requests cancellation for an existing dupe check job.

func (*App) CancelTrackerUpload

func (a *App) CancelTrackerUpload(jobID string) error

CancelTrackerUpload requests cancellation for a Wails tracker upload job.

func (*App) CheckDupes

func (a *App) CheckDupes(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string) (api.DupeCheckSummary, error)

func (*App) CreateWebAuth

func (a *App) CreateWebAuth(username string, password string) (WebAuthStatus, error)

func (*App) DeleteDVDMenuScreenshot added in v0.2.4

func (a *App) DeleteDVDMenuScreenshot(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, imagePath string) error

DeleteDVDMenuScreenshot removes one persisted image from the prepared release's managed directory and local records. Remote-host assets remain.

func (*App) DeleteHistoryRelease

func (a *App) DeleteHistoryRelease(sourcePath string) error

func (*App) DeleteScreenshot

func (a *App) DeleteScreenshot(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, imagePath string) error

func (*App) DeleteTrackerAuth added in v0.2.1

func (a *App) DeleteTrackerAuth(tracker string) (api.TrackerAuthStatus, error)

DeleteTrackerAuth removes stored auth material for one tracker and returns refreshed local status using the current Wails runtime context.

func (*App) DeleteTrackerImageURL

func (a *App) DeleteTrackerImageURL(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, url string) error

func (*App) DeleteUploadedImage

func (a *App) DeleteUploadedImage(path string, imagePath string, host string) error

func (*App) DetectDiscType

func (a *App) DetectDiscType(path string) (string, error)

func (*App) DiscoverPlaylists

func (a *App) DiscoverPlaylists(path string) ([]api.PlaylistInfo, error)

func (*App) ExportConfig

func (a *App) ExportConfig() (string, error)

ExportConfig opens a native save dialog and writes the GUI config as YAML. It returns the written host path, or an empty string when the dialog is canceled or yields a blank path.

func (*App) FetchDescriptionBuilder

func (a *App) FetchDescriptionBuilder(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string, ignoreDupesFor []string) (api.DescriptionBuilderPreview, error)

func (*App) FetchMetadata

func (a *App) FetchMetadata(path string, sourceLookupURL string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string) (api.MetadataPreview, error)

func (*App) FetchPreparation

func (a *App) FetchPreparation(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string, ignoreDupesFor []string) (api.PreparationPreview, error)

func (*App) FetchScreenshotPlan

func (a *App) FetchScreenshotPlan(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) (api.ScreenshotPlan, error)

func (*App) FetchTrackerDryRun

func (a *App) FetchTrackerDryRun(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string, ignoreDupesFor []string, questionnaireAnswers map[string]map[string]string, descriptionGroups []api.DescriptionBuilderGroup, debug bool, noSeed bool, runLogLevel string) (preview api.TrackerDryRunPreview, err error)

FetchTrackerDryRun builds tracker upload payload previews for a GUI-selected path. It seeds a run-scoped core snapshot, emits upload/BDInfo progress events, and rejects on missing paths, run-option errors, preparation errors, or dry-run build failures.

func (*App) GenerateScreenshots

func (a *App) GenerateScreenshots(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, selections []api.ScreenshotSelection, purpose api.ScreenshotPurpose) (api.ScreenshotResult, error)

func (*App) GetApplicationInfo

func (a *App) GetApplicationInfo() (api.ApplicationInfo, error)

GetApplicationInfo returns build/runtime metadata plus a bounded, path-free DVD menu capability probe for frontend diagnostics.

func (*App) GetConfig

func (a *App) GetConfig() (string, error)

GetConfig returns the GUI settings payload as encrypted JSON. If no config rows exist yet, it exports the current runtime config without persisting it.

func (*App) GetDVDMenuCaptureSnapshot added in v0.2.4

func (a *App) GetDVDMenuCaptureSnapshot(jobID string) (api.DVDMenuCaptureSnapshot, error)

GetDVDMenuCaptureSnapshot returns the current capture job state. It rejects unknown or expired job IDs. Terminal snapshots have bounded time and capacity retention, so callers should consume their final state promptly.

func (*App) GetDefaultConfig

func (a *App) GetDefaultConfig() (string, error)

func (*App) GetDupeCheckSnapshot

func (a *App) GetDupeCheckSnapshot(jobID string) (DupeCheckSnapshot, error)

GetDupeCheckSnapshot returns the current state for an existing dupe check job.

func (*App) GetHistoryOverview

func (a *App) GetHistoryOverview(sourcePath string) (api.HistoryOverview, error)

func (*App) GetImageHostPolicyMetadata

func (a *App) GetImageHostPolicyMetadata() (imagehostpolicy.Metadata, error)

func (*App) GetLogExclusions

func (a *App) GetLogExclusions() ([]string, error)

func (*App) GetLogPath

func (a *App) GetLogPath() (string, error)

func (*App) GetRecentLogs

func (a *App) GetRecentLogs(limit int) ([]logging.Entry, error)

func (*App) GetTrackerAuthStatus added in v0.2.1

func (a *App) GetTrackerAuthStatus(tracker string) (api.TrackerAuthStatus, error)

GetTrackerAuthStatus returns the current local auth status for one tracker.

func (*App) GetTrackerIcon

func (a *App) GetTrackerIcon(trackerNameOrDomain string, customURL string) (string, error)

func (*App) GetTrackerUploadSnapshot

func (a *App) GetTrackerUploadSnapshot(jobID string) (TrackerUploadSnapshot, error)

GetTrackerUploadSnapshot returns the current Wails tracker upload job state.

func (*App) GetWebAuthStatus

func (a *App) GetWebAuthStatus() (WebAuthStatus, error)

func (*App) ImportConfig

func (a *App) ImportConfig() (ImportResult, error)

ImportConfig opens a native file picker, imports the selected config, builds the replacement runtime, migrates shared cookies, then saves the non-env config. Runtime build, migration, or save failures leave the persisted config and active runtime unchanged; env overrides apply only to the installed runtime config.

func (*App) ImportMenuImages

func (a *App) ImportMenuImages(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, paths []string) error

func (*App) ImportTrackerAuthCookieContent added in v0.2.1

func (a *App) ImportTrackerAuthCookieContent(tracker string, fileName string, content string) (api.TrackerAuthStatus, error)

ImportTrackerAuthCookieContent imports caller-supplied cookie content for one tracker using the current Wails runtime context and returns updated auth status.

func (*App) ImportTrackerAuthCookies added in v0.2.1

func (a *App) ImportTrackerAuthCookies(tracker string) (api.TrackerAuthStatus, error)

ImportTrackerAuthCookies opens a native file picker, reads the selected file with the shared bounded reader, and returns updated tracker auth status. A cancelled picker or empty selection returns the current status without error.

func (*App) ListDVDMenuScreenshots added in v0.2.4

func (a *App) ListDVDMenuScreenshots(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) ([]api.ScreenshotImage, error)

ListDVDMenuScreenshots returns persisted manual and automatic menu images for one host filesystem source path. The call requires prepared GUI metadata.

func (*App) ListHistory

func (a *App) ListHistory() ([]api.HistoryEntry, error)

func (*App) ListKnownTrackers

func (a *App) ListKnownTrackers() ([]string, error)

func (*App) ListTrackerAuthCapabilities added in v0.2.1

func (a *App) ListTrackerAuthCapabilities() ([]api.TrackerAuthCapability, error)

ListTrackerAuthCapabilities returns tracker auth support metadata through the Wails bridge.

func (*App) ListUploadCandidates

func (a *App) ListUploadCandidates(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) ([]api.ScreenshotImage, error)

func (*App) ListUploadedImages

func (a *App) ListUploadedImages(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) ([]api.UploadedImageLink, error)

func (*App) LoadPlaylistSelection

func (a *App) LoadPlaylistSelection(path string) (api.PlaylistSelection, error)

func (*App) LoginTrackerAuth added in v0.2.1

func (a *App) LoginTrackerAuth(tracker string, req api.TrackerAuthLoginRequest) (api.TrackerAuthStatus, error)

LoginTrackerAuth attempts credential-based tracker auth with the current Wails runtime context and returns status for missing credentials, unsupported login, or 2FA.

func (*App) OpenExternalURL

func (a *App) OpenExternalURL(rawURL string) error

func (*App) PreviewScreenshotFrame

func (a *App) PreviewScreenshotFrame(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, timestampSeconds float64) (string, error)

func (*App) ReadScreenshotImage

func (a *App) ReadScreenshotImage(path string) (string, error)

func (*App) RenderDescription

func (a *App) RenderDescription(raw string) (string, error)

func (*App) ResetMetadata

func (a *App) ResetMetadata(path string, sourceLookupURL string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string) (api.MetadataPreview, error)

func (*App) RetryFailedTrackerUpload

func (a *App) RetryFailedTrackerUpload(jobID string) (string, error)

RetryFailedTrackerUpload starts a new Wails upload job for trackers that failed in the original job. The retry reuses the original job's run options, upload options, questionnaire answers, description groups, and ignore-dupe list instead of rebuilding them from current settings.

func (*App) SaveConfig

func (a *App) SaveConfig(payload string) error

SaveConfig validates encrypted GUI settings, builds the replacement runtime, migrates shared cookies, then saves the non-env config. Runtime build, migration, or save failures leave the persisted config and active runtime unchanged; env overrides apply only to the installed runtime config.

func (*App) SaveDescriptionOverride

func (a *App) SaveDescriptionOverride(path string, groupKey string, raw string, trackers []string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) (api.DescriptionBuilderGroup, error)

func (*App) SaveFinalScreenshotSelections

func (a *App) SaveFinalScreenshotSelections(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, images []api.ScreenshotImage) error

func (*App) SavePlaylistSelection

func (a *App) SavePlaylistSelection(path string, playlists []string, useAll bool) error

func (*App) SelectBlurayCandidate

func (a *App) SelectBlurayCandidate(path string, releaseID string) (api.MetadataPreview, error)

func (*App) StartDVDMenuCapture added in v0.2.4

func (a *App) StartDVDMenuCapture(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides) (string, error)

StartDVDMenuCapture starts a background capture using the current prepared GUI metadata and returns its job ID. Progress is emitted on dvdmenu:job:<jobID>; setup errors reject the frontend call.

func (*App) StartDupeCheck

func (a *App) StartDupeCheck(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string) (string, error)

StartDupeCheck starts a background dupe check for selected trackers and returns the job ID. When the active core exposes the GUI prepared-metadata cache, the matching metadata preview must already exist before a durable job is created. The job captures a runtime snapshot so later config/core swaps do not change the cache proof or execution core.

func (*App) StartLogStream

func (a *App) StartLogStream() (string, error)

func (*App) StartTrackerUpload

func (a *App) StartTrackerUpload(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string, ignoreDupesFor []string, questionnaireAnswers map[string]map[string]string, descriptionGroups []api.DescriptionBuilderGroup, debug bool, noSeed bool, runLogLevel string) (string, error)

StartTrackerUpload starts a Wails upload job for selected trackers and returns its job ID. Snapshots preserve partial upload counts returned with later tracker errors or cancellation. The job captures upload options at start time so failed-tracker retries reuse the original option set.

func (*App) StopLogStream

func (a *App) StopLogStream(streamID string) error

func (*App) SubmitTrackerAuth2FA added in v0.2.1

func (a *App) SubmitTrackerAuth2FA(challengeID string, code string) (api.TrackerAuthStatus, error)

SubmitTrackerAuth2FA submits a manual 2FA code for an active tracker auth challenge using the current Wails runtime context.

func (*App) TestTrackerAuth added in v0.2.1

func (a *App) TestTrackerAuth(tracker string) (api.TrackerAuthStatus, error)

TestTrackerAuth validates tracker auth remotely when supported, using the current Wails runtime context so cancellation can stop remote validation. Unsupported trackers return local status with an unsupported message.

func (*App) UpdateLogExclusions

func (a *App) UpdateLogExclusions(patterns []string) error

func (*App) UploadImages

func (a *App) UploadImages(path string, overrides api.ExternalIDOverrides, nameOverrides api.ReleaseNameOverrides, trackers []string, host string, images []api.ScreenshotImage) (api.UploadImagesResult, error)

type DupeCheckSnapshot

type DupeCheckSnapshot struct {
	JobID          string                  `json:"jobID"`
	SourcePath     string                  `json:"sourcePath"`
	Status         string                  `json:"status"`
	Trackers       []DupeCheckTrackerState `json:"trackers"`
	CompletedCount int                     `json:"completedCount"`
	TotalCount     int                     `json:"totalCount"`
	Summary        api.DupeCheckSummary    `json:"summary"`
	Error          string                  `json:"error"`
	StartedAt      string                  `json:"startedAt"`
	FinishedAt     string                  `json:"finishedAt"`
}

DupeCheckSnapshot reports Wails-visible state for a dupe check job.

type DupeCheckTrackerState

type DupeCheckTrackerState struct {
	Tracker    string              `json:"tracker"`
	Status     string              `json:"status"`
	Message    string              `json:"message"`
	Result     api.DupeCheckResult `json:"result"`
	StartedAt  string              `json:"startedAt"`
	FinishedAt string              `json:"finishedAt"`
}

DupeCheckTrackerState reports Wails-visible state for one tracker in a dupe check job.

type ImportResult

type ImportResult struct {
	// Message is a user-displayable import summary.
	Message string `json:"message"`
	// Warnings contains non-fatal parser/import warnings.
	Warnings []string `json:"warnings"`
}

ImportResult is returned to the GUI after an interactive config import.

type LogExclusions

type LogExclusions struct {
	Patterns []string `json:"patterns"`
}

LogExclusions stores muted log patterns for the UI.

type RunOptions

type RunOptions struct {
	// Assets overrides the embedded or discovered frontend asset filesystem.
	Assets fs.FS
	// ConfigPath is passed to config bootstrap as the optional config file path.
	ConfigPath string
	// ConfigProvided reports whether ConfigPath came from an explicit user flag.
	ConfigProvided bool
}

RunOptions configures Wails GUI startup.

type TrackerUploadSnapshot

type TrackerUploadSnapshot struct {
	JobID                  string                      `json:"jobID"`
	SourcePath             string                      `json:"sourcePath"`
	Status                 string                      `json:"status"`
	CurrentTask            string                      `json:"currentTask"`
	CurrentTaskStatus      string                      `json:"currentTaskStatus"`
	CurrentMessage         string                      `json:"currentMessage"`
	CurrentCompletedPieces int                         `json:"currentCompletedPieces"`
	CurrentTotalPieces     int                         `json:"currentTotalPieces"`
	CurrentPercent         int                         `json:"currentPercent"`
	CurrentHashRateMiB     float64                     `json:"currentHashRateMiB"`
	Trackers               []TrackerUploadTrackerState `json:"trackers"`
	FailedTrackers         []string                    `json:"failedTrackers"`
	UploadedCount          int                         `json:"uploadedCount"`
	Error                  string                      `json:"error"`
	StartedAt              string                      `json:"startedAt"`
	FinishedAt             string                      `json:"finishedAt"`
}

TrackerUploadSnapshot reports frontend-visible state for a tracker upload job. UploadedCount is the sum of per-tracker accepted uploads, including partial counts returned with non-nil errors.

type TrackerUploadTrackerState

type TrackerUploadTrackerState struct {
	Tracker         string  `json:"tracker"`
	Status          string  `json:"status"`
	Task            string  `json:"task"`
	TaskStatus      string  `json:"taskStatus"`
	Message         string  `json:"message"`
	CompletedPieces int     `json:"completedPieces"`
	TotalPieces     int     `json:"totalPieces"`
	Percent         int     `json:"percent"`
	HashRateMiB     float64 `json:"hashRateMiB"`
	UploadedCount   int     `json:"uploadedCount"`
	StartedAt       string  `json:"startedAt"`
	FinishedAt      string  `json:"finishedAt"`
}

TrackerUploadTrackerState reports frontend-visible state for one tracker in an upload job. UploadedCount includes accepted uploads returned before a later tracker error or cancellation.

type WebAuthStatus

type WebAuthStatus struct {
	// Path is the host filesystem path to the web auth material file.
	Path string `json:"path"`
	// Exists reports whether web auth material was found on disk.
	Exists bool `json:"exists"`
	// Usable reports whether the auth material can decrypt/encrypt config secrets.
	Usable bool `json:"usable"`
	// CanCreate reports whether the GUI may create new auth material at Path.
	CanCreate bool `json:"canCreate"`
	// Username is populated only when usable auth material is loaded.
	Username string `json:"username"`
	// AllowUnencryptedExport mirrors the loaded auth policy.
	AllowUnencryptedExport bool `json:"allowUnencryptedExport"`
	// BrowseRoot is the host filesystem root enforced for browser file browsing.
	BrowseRoot string `json:"browseRoot"`
	// AllowUnrestrictedBrowse reports whether browser file browsing may ignore BrowseRoot.
	AllowUnrestrictedBrowse bool `json:"allowUnrestrictedBrowse"`
	// EncryptionEnabled reports whether config secret encryption is active.
	EncryptionEnabled bool `json:"encryptionEnabled"`
	// Message is a user-displayable status summary.
	Message string `json:"message"`
}

WebAuthStatus reports whether the current database has usable web auth material for config secret encryption.

Jump to

Keyboard shortcuts

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