metadata

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XMeta    MetaType = "xmeta"
	HathMeta          = "hathmeta"
	EHDLMeta          = "ehdlmeta"
)

Variables

This section is empty.

Functions

func ParseEHDL added in v0.3.0

func ParseEHDL(filePath string) (model.Gallery, []model.Tag, error)

ParseEHDL parses given text file. Input file is expected to be in the H@H (Hath) format (galleryinfo.txt). Input file is expected to be in the E-Hentai-Downloader format (info.txt).

func ParseHath added in v0.3.0

func ParseHath(filePath string) (model.Gallery, []model.Tag, error)

ParseHath parses given text file. Input file is expected to be in the H@H (Hath) format (galleryinfo.txt).

func ParseMetadata added in v0.3.0

func ParseMetadata(metaTypes map[MetaType]bool)

ParseMetadata scans all libraries for metadata files (json, txt).

func ParseTitles

func ParseTitles(tryNative bool, overwrite bool)

ParseTitles parses all filenames and titles of the saved galleries in db. tryNative tries to preserve the native language (usually Japanese) text. overwrite writes over the previous values.

func ParseX

func ParseX(metaData []byte, metaPath string, archivePath string, internal bool) (model.Gallery, []model.Tag, model.Reference, error)

ParseX parses x JSON file (x: https://github.com/dnsev-h/x).

Types

type FuzzyResult

type FuzzyResult struct {
	MetaTitleMatch     bool
	Similarity         float64
	MatchedArchivePath string
	RelativeMetaPath   string
}

type MetaType added in v0.3.0

type MetaType string

type NoMatchPaths

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

type Tags

type Tags map[string][]string

type TitleMeta

type TitleMeta struct {
	Released string
	Circle   string
	Artists  []string
	Title    string
	Series   string
	Language string
}

func ParseTitle

func ParseTitle(title string) TitleMeta

ParseTitle parses the filename or title following the standard: (Release) [Circle (Artist)] Title (Series) [<usually> Language] or (Release) [Artist] Title (Series) [<usually> Language]

type XMetadata

type XMetadata struct {
	GalleryInfo struct {
		Title         *string `json:"title"`
		TitleOriginal *string `json:"title_original"`
		Link          *string `json:"link"`
		Category      *string `json:"category"`
		Tags          Tags    `json:"tags"`
		Language      *string `json:"language"`
		Translated    *bool   `json:"translated"`
		UploadDate    *[]int  `json:"upload_date"`
		Source        *struct {
			Site  *string `json:"site"`
			Gid   *int32  `json:"gid"`
			Token *string `json:"token"`
		} `json:"source"`
	} `json:"gallery_info"`
	GalleryInfoFull *struct {
		Gallery struct {
			Gid   *int32  `json:"gid"`
			Token *string `json:"token"`
		} `json:"gallery"`
		Title               *string `json:"title"`
		TitleOriginal       *string `json:"title_original"`
		DateUploaded        *int64  `json:"date_uploaded"`
		Category            *string `json:"category"`
		Uploader            *string `json:"uploader"`
		ImageCount          *int32  `json:"image_count"`
		ImagesResized       *bool   `json:"images_resized"`
		TotalFileSizeApprox *int32  `json:"total_file_size_approx"`
		Language            *string `json:"language"`
		Translated          *bool   `json:"translated"`
		Tags                Tags    `json:"tags"`
		TagsHaveNamespace   *bool   `json:"tags_have_namespace"`
		Source              *string `json:"source"`
		SourceSite          *string `json:"source_site"`
	} `json:"gallery_info_full"`
}

Jump to

Keyboard shortcuts

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