Help us shape the future of Go! Take the 2026 Go Developer Survey

pt

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 7 Imported by: 2

README

movie

movie utility library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DigitalFileSize

type DigitalFileSize uint64

DigitalFileSize file size in Byte

func (DigitalFileSize) String added in v1.1.2

func (s DigitalFileSize) String() string

type DigitalFormat

type DigitalFormat uint8

DigitalFormat blueray, webdl, etc

const (
	//UnknownDigitalFormat unknow foramt
	UnknownDigitalFormat DigitalFormat = iota
	//Blueray blueray disk
	Blueray
	//HDTV recorded from hdtv
	HDTV
	//WebDL web downlaoded source
	WebDL
	//UHDTV recorded from 4K tv
	UHDTV
	//Blueray3D 3D bluray disk
	Blueray3D
)

func (*DigitalFormat) MarshalJSON

func (f *DigitalFormat) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (DigitalFormat) String added in v1.1.1

func (f DigitalFormat) String() string

func (*DigitalFormat) UnmarshalJSON

func (f *DigitalFormat) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type DigitalResolution

type DigitalResolution uint8

DigitalResolution resolution, 4K, 1080p, 720p

const (
	//UnknownResolution unknow resolution
	UnknownResolution DigitalResolution = iota
	//FHD 1080p video
	FHD
	//HD 720p video
	HD
	//UHD4K 4K video
	UHD4K
)

func (*DigitalResolution) MarshalJSON

func (f *DigitalResolution) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (DigitalResolution) String

func (f DigitalResolution) String() string

func (*DigitalResolution) UnmarshalJSON

func (f *DigitalResolution) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type MovieInfo

type MovieInfo struct {
	Title      string
	Year       int
	Group      string
	Source     DigitalFormat
	Resolution DigitalResolution
	Size       DigitalFileSize
}

MovieInfo metadata for a PT movie item

func ParseTitle

func ParseTitle(title string) MovieInfo

ParseTitle parse a movie title string into structured movie information example: movie := ParseTitle("Man.in.Black.1997.UHDTV.4K.HEVC-HDCTV[7.33 GB]") movie will have following value:

{
	Title:      "Man in Black",
	Year:       1997,
	Group:      "HDCTV",
	Source:     UHDTV,
	Resolution: UHD4K,
	Size:       7330000000, //in Bytes
}

Jump to

Keyboard shortcuts

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