Documentation
¶
Overview ¶
Package unit3d builds and cleans descriptions shared by Unit3D trackers.
Index ¶
- func AppendDVDVOBMediaInfoBlock(description string, meta api.DescriptionSubject) string
- func BlurayBlock(meta api.DescriptionSubject, appConfig config.Config) string
- func BuildDescription(ctx context.Context, meta api.DescriptionSubject, appConfig config.Config, ...) (string, error)
- func DVDVOBMediaInfoBlock(meta api.DescriptionSubject) string
- func EpisodeOverviewBlock(meta api.DescriptionSubject, appConfig config.Config) string
- func ResolveLogo(meta api.DescriptionSubject, appConfig config.Config) (string, int)
- func SaveDescriptionDebug(meta api.DescriptionSubject, tracker string, dbPath string, description string, ...)
- func ShouldIncludeTonemappedHeader(meta api.DescriptionSubject, appConfig config.Config, ...) bool
- func UppbrrSignatureLink() (string, string)
- type Image
- type Note
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDVDVOBMediaInfoBlock ¶
func AppendDVDVOBMediaInfoBlock(description string, meta api.DescriptionSubject) string
AppendDVDVOBMediaInfoBlock appends DVD VOB MediaInfo when meta contains it.
func BlurayBlock ¶
func BlurayBlock(meta api.DescriptionSubject, appConfig config.Config) string
BlurayBlock renders the Blu-ray metadata section when applicable.
func BuildDescription ¶
func BuildDescription( ctx context.Context, meta api.DescriptionSubject, appConfig config.Config, _ config.TrackerConfig, logger api.Logger, keptDescription string, menuImages []api.ScreenshotImage, screenshots []api.ScreenshotImage, ) (string, error)
BuildDescription composes the shared Unit3D upload description from prepared metadata and selected images. Existing NFO and known uploader signature blocks are removed; when screenshots are supplied, prior screenshot blocks are replaced. Case-insensitive duplicate top-level parts are skipped. The general MediaInfo payload intended for the upload API is not embedded, though DVD VOB MediaInfo may be rendered as a dedicated block.
func DVDVOBMediaInfoBlock ¶
func DVDVOBMediaInfoBlock(meta api.DescriptionSubject) string
DVDVOBMediaInfoBlock renders MediaInfo for DVD VOB content.
func EpisodeOverviewBlock ¶
func EpisodeOverviewBlock(meta api.DescriptionSubject, appConfig config.Config) string
EpisodeOverviewBlock renders the episode overview section when applicable.
func ResolveLogo ¶
ResolveLogo returns the configured description logo URL and display width for meta.
func SaveDescriptionDebug ¶
func SaveDescriptionDebug(meta api.DescriptionSubject, tracker string, dbPath string, description string, logger api.Logger)
SaveDescriptionDebug best-effort writes a tracker description diagnostic beneath the database's managed temp directory; newly created files use mode 0600. A blank dbPath is a no-op. Directory-resolution failures are silently ignored; write failures are logged when logger is non-nil, and no error is returned.
func ShouldIncludeTonemappedHeader ¶
func ShouldIncludeTonemappedHeader(meta api.DescriptionSubject, appConfig config.Config, screenshots []api.ScreenshotImage) bool
ShouldIncludeTonemappedHeader reports whether the description should label tonemapped screenshots.
func UppbrrSignatureLink ¶
UppbrrSignatureLink returns the project URL followed by the signature label used in descriptions.
Types ¶
type Image ¶
type Image struct {
// ImgURL is the BBCode-ready image URL, which may point at a thumbnail.
ImgURL string
// RawURL is the direct image URL.
RawURL string
// WebURL is the image host's browser-facing page URL when available.
WebURL string
// Host is the normalized image-host name.
Host string
}
Image describes an image extracted from a Unit3D description.
type Note ¶
type Note struct {
// Kind categorizes the note for downstream handling.
Kind string
// Message contains caller-visible detail about the condition.
Message string
}
Note reports a non-fatal condition encountered while cleaning a Unit3D description.
type Report ¶
type Report struct {
// Description is the normalized BBCode that remains after cleanup.
Description string
// Images contains images removed or identified during cleanup.
Images []Image
// Notes contains non-fatal cleanup diagnostics.
Notes []Note
}
Report contains a cleaned Unit3D description and extracted content.
func CleanDescription ¶
CleanDescription normalizes entities and site-local references, removes all image markup from the body, and returns the first non-poster image set. A leading poster-only set does not prevent a later screenshot set from being selected.
func CleanDescriptionBody ¶
CleanDescriptionBody applies the same entity and site-reference normalization as CleanDescription and removes all image markup without returning extracted images.
func CleanDescriptionImages ¶
CleanDescriptionImages returns the first non-poster image set after entity and site-reference normalization without producing a cleaned body.