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

pt

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: MIT Imports: 7 Imported by: 2

README

movie

movie utility library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DigitalFormatMap = map[DigitalFormat][]string{
	Blueray:   []string{"bluray", "blu-ray", "blueray", "bd"},
	HDTV:      []string{"hdtv"},
	WebDL:     []string{"webdl", "web-dl", "webrip", "web"},
	UHDTV:     []string{"uhdtv"},
	Blueray3D: []string{"3d", "sbs"},
}
View Source
var DigitalResolutionMap = map[DigitalResolution][]string{
	FHD:   []string{"1080", "1080p", "1080i"},
	HD:    []string{"720", "720p"},
	UHD4K: []string{"4k", "2160p"},
}
View Source
var DigitalResolutionString = []string{
	"1080p",
	"720p",
	"4K",
	"Unknown",
}

DigitalResolutionString string name of each resolution type

Functions

This section is empty.

Types

type DigitalFileSize

type DigitalFileSize uint64

type DigitalFormat

type DigitalFormat uint8
const (
	UnknownDigitalFormat DigitalFormat = iota
	Blueray
	HDTV
	WebDL
	UHDTV
	Blueray3D
)

func (*DigitalFormat) MarshalJSON

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

MarshalJSON marshals the enum as a quoted json 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
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 (i 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
}

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