metadata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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()

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

Types

type FuzzyResult

type FuzzyResult struct {
	MetaTitleMatch     bool
	Similarity         float64
	MatchedArchivePath string
	RelativeMetaPath   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) [Language] or (Release) [Artist] Title (Series) [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