match

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: 16 Imported by: 0

Documentation

Overview

Package match provides functions for matching paths to models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathToGalleriesFn added in v0.18.0

func PathToGalleriesFn(ctx context.Context, name string, paths []string, galleryReader models.GalleryQueryer, fn func(ctx context.Context, scene *models.Gallery) error) error

func PathToImagesFn added in v0.18.0

func PathToImagesFn(ctx context.Context, name string, paths []string, imageReader models.ImageQueryer, fn func(ctx context.Context, scene *models.Image) error) error

func PathToPerformers

func PathToPerformers(ctx context.Context, path string, reader models.PerformerAutoTagQueryer, cache *Cache, trimExt bool) ([]*models.Performer, error)

func PathToScenesFn added in v0.18.0

func PathToScenesFn(ctx context.Context, name string, paths []string, sceneReader models.SceneQueryer, fn func(ctx context.Context, scene *models.Scene) error) error

func PathToStudio added in v0.12.0

func PathToStudio(ctx context.Context, path string, reader models.StudioAutoTagQueryer, cache *Cache, trimExt bool) (*models.Studio, error)

PathToStudio returns the Studio that matches the given path. Where multiple matching studios are found, the one that matches the latest position in the path is returned.

func PathToTags

func PathToTags(ctx context.Context, path string, reader models.TagAutoTagQueryer, cache *Cache, trimExt bool) ([]*models.Tag, error)

func ScrapedGroup added in v0.27.0

func ScrapedGroup(ctx context.Context, qb GroupNamesFinder, storedID *string, name *string) (matchedID *string, err error)

ScrapedGroup matches the provided movie with the movies in the database and returns the ID field if one is found.

func ScrapedPerformer

func ScrapedPerformer(ctx context.Context, qb PerformerFinder, p *models.ScrapedPerformer, stashBoxEndpoint *string) error

ScrapedPerformer matches the provided performer with the performers in the database and sets the ID field if one is found.

func ScrapedStudio

func ScrapedStudio(ctx context.Context, qb StudioFinder, s *models.ScrapedStudio, stashBoxEndpoint *string) error

ScrapedStudio matches the provided studio with the studios in the database and sets the ID field if one is found.

func ScrapedTag

func ScrapedTag(ctx context.Context, qb models.TagQueryer, s *models.ScrapedTag) error

ScrapedTag matches the provided tag with the tags in the database and sets the ID field if one is found.

Types

type Cache added in v0.14.0

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

Cache is used to cache queries that should not change across an autotag process.

type GroupNamesFinder added in v0.27.0

type GroupNamesFinder interface {
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Group, error)
}

type PerformerFinder added in v0.17.0

type PerformerFinder interface {
	models.PerformerQueryer
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Performer, error)
	FindByStashID(ctx context.Context, stashID models.StashID) ([]*models.Performer, error)
}

type StudioFinder added in v0.17.0

type StudioFinder interface {
	models.StudioQueryer
	FindByStashID(ctx context.Context, stashID models.StashID) ([]*models.Studio, error)
}

Jump to

Keyboard shortcuts

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