autotag

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package autotag provides methods to auto-tag scenes with performers, studios and tags.

The autotag engine tags scenes with performers/studios/tags if the scene's path matches the performer/studio/tag name. A scene's path is considered a match if it contains the performer/studio/tag's full name, ignoring any '.', '-', '_' characters in the path.

For example, for a performer "foo bar", the following paths would be considered a match: "foo bar.mp4", "foobar.mp4", "foo.bar.mp4", "foo-bar.mp4", "aaa.foo bar.bbb.mp4". The following would not be considered a match: "aafoo bar.mp4", "foo barbb.mp4", "foo/bar.mp4"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GalleryPerformers

func GalleryPerformers(ctx context.Context, s *models.Gallery, rw GalleryPerformerUpdater, performerReader match.PerformerAutoTagQueryer, cache *match.Cache) error

GalleryPerformers tags the provided gallery with performers whose name matches the gallery's path.

func GalleryStudios

func GalleryStudios(ctx context.Context, s *models.Gallery, rw GalleryFinderUpdater, studioReader match.StudioAutoTagQueryer, cache *match.Cache) error

GalleryStudios tags the provided gallery with the first studio whose name matches the gallery's path.

Gallerys will not be tagged if studio is already set.

func GalleryTags

func GalleryTags(ctx context.Context, s *models.Gallery, rw GalleryTagUpdater, tagReader match.TagAutoTagQueryer, cache *match.Cache) error

GalleryTags tags the provided gallery with tags whose name matches the gallery's path.

func ImagePerformers

func ImagePerformers(ctx context.Context, s *models.Image, rw ImagePerformerUpdater, performerReader match.PerformerAutoTagQueryer, cache *match.Cache) error

ImagePerformers tags the provided image with performers whose name matches the image's path.

func ImageStudios

func ImageStudios(ctx context.Context, s *models.Image, rw ImageFinderUpdater, studioReader match.StudioAutoTagQueryer, cache *match.Cache) error

ImageStudios tags the provided image with the first studio whose name matches the image's path.

Images will not be tagged if studio is already set.

func ImageTags

func ImageTags(ctx context.Context, s *models.Image, rw ImageTagUpdater, tagReader match.TagAutoTagQueryer, cache *match.Cache) error

ImageTags tags the provided image with tags whose name matches the image's path.

func ScenePerformers

func ScenePerformers(ctx context.Context, s *models.Scene, rw ScenePerformerUpdater, performerReader match.PerformerAutoTagQueryer, cache *match.Cache) error

ScenePerformers tags the provided scene with performers whose name matches the scene's path.

func SceneStudios

func SceneStudios(ctx context.Context, s *models.Scene, rw SceneFinderUpdater, studioReader match.StudioAutoTagQueryer, cache *match.Cache) error

SceneStudios tags the provided scene with the first studio whose name matches the scene's path.

Scenes will not be tagged if studio is already set.

func SceneTags

func SceneTags(ctx context.Context, s *models.Scene, rw SceneTagUpdater, tagReader match.TagAutoTagQueryer, cache *match.Cache) error

SceneTags tags the provided scene with tags whose name matches the scene's path.

Types

type GalleryFinderUpdater added in v0.17.0

type GalleryFinderUpdater interface {
	gallery.Queryer
	gallery.PartialUpdater
	Find(ctx context.Context, id int) (*models.Gallery, error)
}

type GalleryPerformerUpdater added in v0.17.0

type GalleryPerformerUpdater interface {
	models.PerformerIDLoader
	gallery.PartialUpdater
}

type GalleryQueryPerformerUpdater added in v0.17.0

type GalleryQueryPerformerUpdater interface {
	gallery.Queryer
	models.PerformerIDLoader
	gallery.PartialUpdater
}

type GalleryQueryTagUpdater added in v0.17.0

type GalleryQueryTagUpdater interface {
	gallery.Queryer
	models.TagIDLoader
	gallery.PartialUpdater
}

type GalleryTagUpdater added in v0.17.0

type GalleryTagUpdater interface {
	models.TagIDLoader
	gallery.PartialUpdater
}

type ImageFinderUpdater added in v0.17.0

type ImageFinderUpdater interface {
	image.Queryer
	Find(ctx context.Context, id int) (*models.Image, error)
	UpdatePartial(ctx context.Context, id int, partial models.ImagePartial) (*models.Image, error)
}

type ImagePerformerUpdater added in v0.17.0

type ImagePerformerUpdater interface {
	models.PerformerIDLoader
	image.PartialUpdater
}

type ImageQueryPerformerUpdater added in v0.17.0

type ImageQueryPerformerUpdater interface {
	image.Queryer
	models.PerformerIDLoader
	image.PartialUpdater
}

type ImageQueryTagUpdater added in v0.17.0

type ImageQueryTagUpdater interface {
	image.Queryer
	models.TagIDLoader
	image.PartialUpdater
}

type ImageTagUpdater added in v0.17.0

type ImageTagUpdater interface {
	models.TagIDLoader
	image.PartialUpdater
}

type SceneFinderUpdater added in v0.17.0

type SceneFinderUpdater interface {
	scene.Queryer
	scene.PartialUpdater
}

type ScenePerformerUpdater added in v0.17.0

type ScenePerformerUpdater interface {
	models.PerformerIDLoader
	scene.PartialUpdater
}

type SceneQueryPerformerUpdater added in v0.17.0

type SceneQueryPerformerUpdater interface {
	scene.Queryer
	models.PerformerIDLoader
	scene.PartialUpdater
}

type SceneQueryTagUpdater added in v0.17.0

type SceneQueryTagUpdater interface {
	scene.Queryer
	models.TagIDLoader
	scene.PartialUpdater
}

type SceneTagUpdater added in v0.17.0

type SceneTagUpdater interface {
	models.TagIDLoader
	scene.PartialUpdater
}

type Tagger added in v0.18.0

type Tagger struct {
	TxnManager txn.Manager
	Cache      *match.Cache
}

func (*Tagger) PerformerGalleries added in v0.18.0

func (tagger *Tagger) PerformerGalleries(ctx context.Context, p *models.Performer, paths []string, rw GalleryQueryPerformerUpdater) error

PerformerGalleries searches for galleries whose path matches the provided performer name and tags the gallery with the performer.

func (*Tagger) PerformerImages added in v0.18.0

func (tagger *Tagger) PerformerImages(ctx context.Context, p *models.Performer, paths []string, rw ImageQueryPerformerUpdater) error

PerformerImages searches for images whose path matches the provided performer name and tags the image with the performer.

func (*Tagger) PerformerScenes added in v0.18.0

func (tagger *Tagger) PerformerScenes(ctx context.Context, p *models.Performer, paths []string, rw SceneQueryPerformerUpdater) error

PerformerScenes searches for scenes whose path matches the provided performer name and tags the scene with the performer. Performer aliases must be loaded.

func (*Tagger) StudioGalleries added in v0.18.0

func (tagger *Tagger) StudioGalleries(ctx context.Context, p *models.Studio, paths []string, aliases []string, rw GalleryFinderUpdater) error

StudioGalleries searches for galleries whose path matches the provided studio name and tags the gallery with the studio, if studio is not already set on the gallery.

func (*Tagger) StudioImages added in v0.18.0

func (tagger *Tagger) StudioImages(ctx context.Context, p *models.Studio, paths []string, aliases []string, rw ImageFinderUpdater) error

StudioImages searches for images whose path matches the provided studio name and tags the image with the studio, if studio is not already set on the image.

func (*Tagger) StudioScenes added in v0.18.0

func (tagger *Tagger) StudioScenes(ctx context.Context, p *models.Studio, paths []string, aliases []string, rw SceneFinderUpdater) error

StudioScenes searches for scenes whose path matches the provided studio name and tags the scene with the studio, if studio is not already set on the scene.

func (*Tagger) TagGalleries added in v0.18.0

func (tagger *Tagger) TagGalleries(ctx context.Context, p *models.Tag, paths []string, aliases []string, rw GalleryQueryTagUpdater) error

TagGalleries searches for galleries whose path matches the provided tag name and tags the gallery with the tag.

func (*Tagger) TagImages added in v0.18.0

func (tagger *Tagger) TagImages(ctx context.Context, p *models.Tag, paths []string, aliases []string, rw ImageQueryTagUpdater) error

TagImages searches for images whose path matches the provided tag name and tags the image with the tag.

func (*Tagger) TagScenes added in v0.18.0

func (tagger *Tagger) TagScenes(ctx context.Context, p *models.Tag, paths []string, aliases []string, rw SceneQueryTagUpdater) error

TagScenes searches for scenes whose path matches the provided tag name and tags the scene with the tag.

Jump to

Keyboard shortcuts

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