Documentation ¶
Index ¶
- Variables
- func AddPerformer(ctx context.Context, qb PartialUpdater, i *models.Image, performerID int) error
- func AddTag(ctx context.Context, qb PartialUpdater, i *models.Image, tagID int) error
- func CountByPerformerID(ctx context.Context, r CountQueryer, id int) (int, error)
- func CountByStudioID(ctx context.Context, r CountQueryer, id int) (int, error)
- func CountByTagID(ctx context.Context, r CountQueryer, id int) (int, error)
- func FindByGalleryID(ctx context.Context, r Queryer, galleryID int, sortBy string, ...) ([]*models.Image, error)
- func GetStudioName(ctx context.Context, reader studio.Finder, image *models.Image) (string, error)
- func GetVipsPath() string
- func IsCover(img *models.Image) bool
- func PathsFilter(paths []string) *models.ImageFilterType
- func Query(ctx context.Context, qb Queryer, imageFilter *models.ImageFilterType, ...) ([]*models.Image, error)
- func QueryOptions(imageFilter *models.ImageFilterType, findFilter *models.FindFilterType, ...) models.ImageQueryOptions
- func ToBasicJSON(image *models.Image) *jsonschema.Image
- type CountQueryer
- type Destroyer
- type FileDeleter
- type FinderByFile
- type FinderCreatorUpdater
- type FullCreatorUpdater
- type GalleryFinder
- type GalleryFinderCreator
- type Importer
- func (i *Importer) Create(ctx context.Context) (*int, error)
- func (i *Importer) FindExistingID(ctx context.Context) (*int, error)
- func (i *Importer) Name() string
- func (i *Importer) PostImport(ctx context.Context, id int) error
- func (i *Importer) PreImport(ctx context.Context) error
- func (i *Importer) Update(ctx context.Context, id int) error
- type PartialUpdater
- type Queryer
- type Repository
- type ScanConfig
- type ScanHandler
- type Service
- type ThumbnailEncoder
- type ThumbnailGenerator
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupportedImageFormat = errors.New("unsupported image format") // ErrNotSupportedForThumbnail is returned if the image format is not supported for thumbnail generation ErrNotSupportedForThumbnail = errors.New("unsupported image format for thumbnail") )
var (
ErrNotImageFile = errors.New("not an image file")
)
Functions ¶
func AddPerformer ¶ added in v0.7.0
func CountByPerformerID ¶ added in v0.7.0
func CountByStudioID ¶ added in v0.7.0
func CountByTagID ¶ added in v0.7.0
func FindByGalleryID ¶ added in v0.14.0
func GetStudioName ¶
GetStudioName returns the name of the provided image's studio. It returns an empty string if there is no studio assigned to the image.
func GetVipsPath ¶ added in v0.10.0
func GetVipsPath() string
func PathsFilter ¶ added in v0.12.0
func PathsFilter(paths []string) *models.ImageFilterType
func Query ¶ added in v0.11.0
func Query(ctx context.Context, qb Queryer, imageFilter *models.ImageFilterType, findFilter *models.FindFilterType) ([]*models.Image, error)
Query queries for images using the provided filters.
func QueryOptions ¶ added in v0.11.0
func QueryOptions(imageFilter *models.ImageFilterType, findFilter *models.FindFilterType, count bool) models.ImageQueryOptions
QueryOptions returns a ImageQueryResult populated with the provided filters.
func ToBasicJSON ¶
func ToBasicJSON(image *models.Image) *jsonschema.Image
ToBasicJSON converts a image object into its JSON object equivalent. It does not convert the relationships to other objects, with the exception of cover image.
Types ¶
type CountQueryer ¶ added in v0.17.0
type CountQueryer interface {
QueryCount(ctx context.Context, imageFilter *models.ImageFilterType, findFilter *models.FindFilterType) (int, error)
}
type FileDeleter ¶ added in v0.12.0
FileDeleter is an extension of file.Deleter that handles deletion of image files.
func (*FileDeleter) MarkGeneratedFiles ¶ added in v0.12.0
func (d *FileDeleter) MarkGeneratedFiles(image *models.Image) error
MarkGeneratedFiles marks for deletion the generated files for the provided image.
type FinderByFile ¶ added in v0.17.0
type FinderCreatorUpdater ¶ added in v0.17.0
type FinderCreatorUpdater interface { FindByFileID(ctx context.Context, fileID file.ID) ([]*models.Image, error) FindByFolderID(ctx context.Context, folderID file.FolderID) ([]*models.Image, error) FindByFingerprints(ctx context.Context, fp []file.Fingerprint) ([]*models.Image, error) Create(ctx context.Context, newImage *models.ImageCreateInput) error UpdatePartial(ctx context.Context, id int, updatedImage models.ImagePartial) (*models.Image, error) AddFileID(ctx context.Context, id int, fileID file.ID) error models.GalleryIDLoader models.ImageFileLoader }
type FullCreatorUpdater ¶ added in v0.17.0
type GalleryFinder ¶ added in v0.17.0
type GalleryFinderCreator ¶ added in v0.17.0
type Importer ¶
type Importer struct { ReaderWriter FullCreatorUpdater FileFinder file.Getter StudioWriter studio.NameFinderCreator GalleryFinder GalleryFinder PerformerWriter performer.NameFinderCreator TagWriter tag.NameFinderCreator Input jsonschema.Image MissingRefBehaviour models.ImportMissingRefEnum ID int // contains filtered or unexported fields }
func (*Importer) FindExistingID ¶
type PartialUpdater ¶ added in v0.17.0
type Queryer ¶ added in v0.11.0
type Queryer interface {
Query(ctx context.Context, options models.ImageQueryOptions) (*models.ImageQueryResult, error)
}
type Repository ¶ added in v0.17.0
type Repository interface { FinderByFile Destroyer models.ImageFileLoader }
type ScanConfig ¶ added in v0.17.0
type ScanHandler ¶ added in v0.17.0
type ScanHandler struct { CreatorUpdater FinderCreatorUpdater GalleryFinder GalleryFinderCreator ThumbnailGenerator ThumbnailGenerator ScanConfig ScanConfig PluginCache *plugin.Cache Paths *paths.Paths }
type Service ¶ added in v0.17.0
type Service struct { File file.Store Repository Repository }
func (*Service) Destroy ¶ added in v0.17.0
func (s *Service) Destroy(ctx context.Context, i *models.Image, fileDeleter *FileDeleter, deleteGenerated, deleteFile bool) error
Destroy destroys an image, optionally marking the file and generated files for deletion.
func (*Service) DestroyZipImages ¶ added in v0.17.0
func (s *Service) DestroyZipImages(ctx context.Context, zipFile file.File, fileDeleter *FileDeleter, deleteGenerated bool) ([]*models.Image, error)
DestroyZipImages destroys all images in zip, optionally marking the files and generated files for deletion. Returns a slice of images that were destroyed.
type ThumbnailEncoder ¶ added in v0.10.0
type ThumbnailEncoder struct {
// contains filtered or unexported fields
}
func NewThumbnailEncoder ¶ added in v0.10.0
func NewThumbnailEncoder(ffmpegEncoder ffmpeg.FFMpeg) ThumbnailEncoder
func (*ThumbnailEncoder) GetThumbnail ¶ added in v0.10.0
GetThumbnail returns the thumbnail image of the provided image resized to the provided max size. It resizes based on the largest X/Y direction. It returns nil and an error if an error occurs reading, decoding or encoding the image, or if the image is not suitable for thumbnails.