view

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package view holds shared HTML view models for Outtake pages and widgets.

Index

Constants

View Source
const (
	// ClipStatusPending is a queued clip that has not started encoding.
	ClipStatusPending = "pending"
	// ClipStatusProcessing is a clip that is currently encoding.
	ClipStatusProcessing = "processing"
	// ClipStatusCompleted is a clip that finished encoding.
	ClipStatusCompleted = "completed"
	// ClipStatusFailed is a clip that failed to encode.
	ClipStatusFailed = "failed"
	// ClipStatusCancelled is a clip stopped by the user.
	// The persisted job status literal is "canceled".
	ClipStatusCancelled = "canceled"
)

Variables

This section is empty.

Functions

func ClipTypeLabel

func ClipTypeLabel(clipType string) string

ClipTypeLabel is the user-facing name for a clip type.

Types

type AudioTrackOption

type AudioTrackOption struct {
	Index int
	Label string
}

AudioTrackOption is a probed audio stream in an audio select.

type ClipItem

type ClipItem struct {
	ID            string
	Name          string
	MediaID       string
	MediaTitle    string
	ClipType      string
	Status        string
	Progress      int
	CreatedAt     string
	StartTime     float64
	Duration      float64
	Quality       string
	ProfileName   string
	Profiles      []ClipProfileOption
	FileExists    bool
	AudioIndex    int
	AudioTracks   []AudioTrackOption
	CropBlackBars bool
	WebSafeColor  bool
	Width         int
	FPS           int
	MaxDur        int
	Error         string
}

ClipItem is one clip card on the clips list and media item pages.

func (*ClipItem) CanPlay

func (item *ClipItem) CanPlay() bool

CanPlay reports whether a completed clip file is available for preview.

Returns:

  • playable: True when status is completed and the file exists.

func (*ClipItem) DisplayName

func (item *ClipItem) DisplayName() string

DisplayName returns the clip name, or the media title when the name is empty.

Returns:

  • name: The label shown on clip cards.

func (*ClipItem) EndTime

func (item *ClipItem) EndTime() float64

EndTime is the clip end as start plus duration.

Returns:

  • end: StartTime + Duration in seconds.

func (*ClipItem) GIFFPS

func (item *ClipItem) GIFFPS() int

GIFFPS is the GIF frame rate, or the New export default when unset.

Returns:

  • fps: Stored fps, or 10 when FPS is 0.

func (*ClipItem) GIFWidth

func (item *ClipItem) GIFWidth() int

GIFWidth is the GIF export width, or the New export default when unset.

Returns:

  • width: Stored width, or 480 when Width is 0.

func (*ClipItem) IsActive

func (item *ClipItem) IsActive() bool

IsActive reports whether the clip is still queued or encoding.

Returns:

  • active: True when status is pending or processing.

type ClipProfileOption

type ClipProfileOption struct {
	ID        string
	Name      string
	IsDefault bool
}

ClipProfileOption is a named encode profile in a quality select.

type Crumb

type Crumb struct {
	Title string
	URL   string
}

Crumb is one step in the media library trail.

type LetterIndex

type LetterIndex struct {
	Title string
	Size  int
	Start int
}

LetterIndex is one first-character jump target on a library section.

type LibraryItem

type LibraryItem struct {
	ID        string
	Title     string
	Type      string
	ThumbPath string
}

LibraryItem is a Plex library in the sidebar and media browse grid.

type MediaItem

type MediaItem struct {
	ID           string
	Title        string
	Type         string
	Duration     float64
	ThumbPath    string
	Browsable    bool
	BrowseURL    string
	Year         int
	Index        int
	ParentIndex  int
	ShowTitle    string
	EpisodeLabel string
	TitleSort    string
	AddedAt      int64
}

MediaItem is one title or container in the media library grid.

type MediaProps

type MediaProps struct {
	Items       []MediaItem
	Libraries   []LibraryItem
	Crumbs      []Crumb
	Letters     []LetterIndex
	Query       string
	LibraryID   string
	ParentID    string
	ParentTitle string
	UpID        string
	UpTitle     string
	Sort        string
	Letter      string
	Start       int
	Total       int
	PageSize    int
	HasServer   bool
}

MediaProps is the media library page and its HTMX results fragment.

type Playback

type Playback struct {
	Playing    bool
	ViewOffset float64
	Title      string
}

Playback is live Plex playback for a media item.

Jump to

Keyboard shortcuts

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