Help us shape the future of Go! Take the 2026 Go Developer Survey

performer

package
v0.17.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDs

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

func GetNames

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

func ToJSON

func ToJSON(ctx context.Context, reader ImageStashIDGetter, performer *models.Performer) (*jsonschema.Performer, error)

ToJSON converts a Performer object into its JSON equivalent.

func ValidateDeathDate added in v0.7.0

func ValidateDeathDate(performer *models.Performer, birthdate *string, deathDate *string) error

Types

type ImageStashIDGetter added in v0.17.0

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

type Importer

type Importer struct {
	ReaderWriter        NameFinderCreatorUpdater
	TagWriter           tag.NameFinderCreator
	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 NameFinderCreator added in v0.17.0

type NameFinderCreator interface {
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Performer, error)
	Create(ctx context.Context, newPerformer models.Performer) (*models.Performer, error)
}

type NameFinderCreatorUpdater added in v0.17.0

type NameFinderCreatorUpdater interface {
	NameFinderCreator
	UpdateFull(ctx context.Context, updatedPerformer models.Performer) (*models.Performer, error)
	UpdateTags(ctx context.Context, performerID int, tagIDs []int) error
	UpdateImage(ctx context.Context, performerID int, image []byte) error
	UpdateStashIDs(ctx context.Context, performerID int, stashIDs []models.StashID) error
}

Jump to

Keyboard shortcuts

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