autotag

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 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 models.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 models.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 models.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 models.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 models.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 models.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 models.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 models.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 models.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 {
	models.GalleryQueryer
	models.GalleryUpdater
}

type GalleryPerformerUpdater added in v0.17.0

type GalleryPerformerUpdater interface {
	models.PerformerIDLoader
	models.GalleryUpdater
}

type GalleryQueryPerformerUpdater added in v0.17.0

type GalleryQueryPerformerUpdater interface {
	models.GalleryQueryer
	models.PerformerIDLoader
	models.GalleryUpdater
}

type GalleryQueryTagUpdater added in v0.17.0

type GalleryQueryTagUpdater interface {
	models.GalleryQueryer
	models.TagIDLoader
	models.GalleryUpdater
}

type GalleryTagUpdater added in v0.17.0

type GalleryTagUpdater interface {
	models.TagIDLoader
	models.GalleryUpdater
}

type ImageFinderUpdater added in v0.17.0

type ImageFinderUpdater interface {
	models.ImageQueryer
	models.ImageUpdater
}

type ImagePerformerUpdater added in v0.17.0

type ImagePerformerUpdater interface {
	models.PerformerIDLoader
	models.ImageUpdater
}

type ImageQueryPerformerUpdater added in v0.17.0

type ImageQueryPerformerUpdater interface {
	models.ImageQueryer
	models.PerformerIDLoader
	models.ImageUpdater
}

type ImageQueryTagUpdater added in v0.17.0

type ImageQueryTagUpdater interface {
	models.ImageQueryer
	models.TagIDLoader
	models.ImageUpdater
}

type ImageTagUpdater added in v0.17.0

type ImageTagUpdater interface {
	models.TagIDLoader
	models.ImageUpdater
}

type SceneFinderUpdater added in v0.17.0

type SceneFinderUpdater interface {
	models.SceneQueryer
	models.SceneUpdater
}

type ScenePerformerUpdater added in v0.17.0

type ScenePerformerUpdater interface {
	models.PerformerIDLoader
	models.SceneUpdater
}

type SceneQueryPerformerUpdater added in v0.17.0

type SceneQueryPerformerUpdater interface {
	models.SceneQueryer
	models.PerformerIDLoader
	models.SceneUpdater
}

type SceneQueryTagUpdater added in v0.17.0

type SceneQueryTagUpdater interface {
	models.SceneQueryer
	models.TagIDLoader
	models.SceneUpdater
}

type SceneTagUpdater added in v0.17.0

type SceneTagUpdater interface {
	models.TagIDLoader
	models.SceneUpdater
}

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