firstrun

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package firstrun gives a fresh install working defaults, the way Sonarr ships with quality profiles and asks only for a root folder.

On startup, and only while the database has no quality profiles and no libraries, it creates:

  • default quality profiles (Any, SD, HD-720p, HD-1080p, HD - 720p/1080p, Ultra-HD), and
  • a "TV" library at the first usable path from Options.LibraryPaths (by default /data/media/tv in the single-/data-mount layout, falling back to /tv for the older three-mount layout).

Anything the user has already set up is left alone: if a profile or a library exists, that part is skipped.

Index

Constants

View Source
const DefaultProfileName = "HD-1080p"

DefaultProfileName is the profile the default library uses.

Variables

View Source
var DefaultLibraryPaths = []string{"/data/media/tv", "/tv"}

DefaultLibraryPaths is where the default TV library goes, in order of preference. A path is used when its parent folder exists (the folder itself is created if needed): /data/media/tv for the single /data mount, /tv for the older layout.

Functions

func DefaultProfiles

func DefaultProfiles() []quality.CreateRequest

DefaultProfiles returns the profiles a fresh install starts with, modelled on Sonarr's. Matching uses resolution + source only, so codec and HDR are left empty. Qualities are ordered best first.

func Run

func Run(ctx context.Context, profiles profileStore, libraries libraryStore, opts Options, logger *slog.Logger) error

Run applies the first-run defaults. It is safe to call on every start.

Types

type Options

type Options struct {
	// LibraryPaths overrides DefaultLibraryPaths (tests, custom layouts).
	LibraryPaths []string
}

Options configures Run.

Jump to

Keyboard shortcuts

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