performer

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package performer provides the application logic for performer functionality.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameMissing = errors.New("performer name must not be blank")
)

Functions

func ByAlias added in v0.24.0

func ByAlias(ctx context.Context, r models.PerformerQueryer, alias string) ([]*models.Performer, error)

func CountByAppearsWith added in v0.21.0

func CountByAppearsWith(ctx context.Context, r models.PerformerQueryer, id int) (int, error)

func CountByStudioID added in v0.19.0

func CountByStudioID(ctx context.Context, r models.PerformerQueryer, id int, depth *int) (int, error)

func CountByTagID added in v0.22.0

func CountByTagID(ctx context.Context, r models.PerformerQueryer, id int, depth *int) (int, error)

func GetIDs

func GetIDs(performers []*models.Performer) []int

func GetNames

func GetNames(performers []*models.Performer) []string

func IsInstagramURL added in v0.27.0

func IsInstagramURL(url string) bool

func IsTwitterURL added in v0.27.0

func IsTwitterURL(url string) bool

func ToJSON

ToJSON converts a Performer object into its JSON equivalent.

func ValidateAliases added in v0.24.0

func ValidateAliases(name string, aliases models.RelatedStrings) error

func ValidateCreate added in v0.24.0

func ValidateCreate(ctx context.Context, performer models.Performer, qb models.PerformerReader) error

func ValidateDeathDate added in v0.7.0

func ValidateDeathDate(birthdate *models.Date, deathDate *models.Date) error

ValidateDeathDate returns an error if the birthdate is after the death date.

func ValidateName added in v0.24.0

func ValidateName(ctx context.Context, name string, disambig string, qb models.PerformerQueryer) error

ValidateName returns an error if the performer name and disambiguation provided is used by another performer.

func ValidateUpdate added in v0.24.0

func ValidateUpdate(ctx context.Context, id int, partial models.PerformerPartial, qb models.PerformerReader) error

func ValidateUpdateAliases added in v0.24.0

func ValidateUpdateAliases(existing models.Performer, name models.OptionalString, aliases *models.UpdateStrings) error

func ValidateUpdateDeathDate added in v0.24.0

func ValidateUpdateDeathDate(existing models.Performer, birthdate models.OptionalDate, deathDate models.OptionalDate) error

ValidateUpdateDeathDate performs the same check as ValidateDeathDate, but is used when modifying an existing performer.

func ValidateUpdateName added in v0.24.0

func ValidateUpdateName(ctx context.Context, existing models.Performer, name models.OptionalString, disambig models.OptionalString, qb models.PerformerQueryer) error

ValidateUpdateName performs the same check as ValidateName, but is used when modifying an existing performer.

Types

type DeathDateError added in v0.24.0

type DeathDateError struct {
	Birthdate models.Date
	DeathDate models.Date
}

func (*DeathDateError) Error added in v0.24.0

func (e *DeathDateError) Error() string

type DuplicateAliasError added in v0.24.0

type DuplicateAliasError struct {
	Alias string
}

func (*DuplicateAliasError) Error added in v0.24.0

func (e *DuplicateAliasError) Error() string

type ImageAliasStashIDGetter added in v0.19.0

type ImageAliasStashIDGetter interface {
	GetImage(ctx context.Context, performerID int) ([]byte, error)
	models.AliasLoader
	models.StashIDLoader
	models.URLLoader
}

type Importer

type Importer struct {
	ReaderWriter        ImporterReaderWriter
	TagWriter           models.TagFinderCreator
	Input               jsonschema.Performer
	MissingRefBehaviour models.ImportMissingRefEnum

	ID int
	// contains filtered or unexported fields
}

func (*Importer) Create

func (i *Importer) Create(ctx context.Context) (*int, error)

func (*Importer) FindExistingID

func (i *Importer) FindExistingID(ctx context.Context) (*int, error)

func (*Importer) Name

func (i *Importer) Name() string

func (*Importer) PostImport

func (i *Importer) PostImport(ctx context.Context, id int) error

func (*Importer) PreImport

func (i *Importer) PreImport(ctx context.Context) error

func (*Importer) Update

func (i *Importer) Update(ctx context.Context, id int) error

type ImporterReaderWriter added in v0.23.0

type ImporterReaderWriter interface {
	models.PerformerCreatorUpdater
	models.PerformerQueryer
}

type NameExistsError added in v0.24.0

type NameExistsError struct {
	Name           string
	Disambiguation string
}

func (*NameExistsError) Error added in v0.24.0

func (e *NameExistsError) Error() string

type NotFoundError added in v0.24.0

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

func (*NotFoundError) Error added in v0.24.0

func (e *NotFoundError) Error() string

Jump to

Keyboard shortcuts

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