mpclibrary

package
v0.0.0-...-41adc92 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

MPC Library handles the library videos, scans them process them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID     int       `json:"id"`
	Name   string    `json:"name"`
	Gender string    `json:"gender"`
	Birth  time.Time `json:birth`
}

type ByDuractionDesc

type ByDuractionDesc struct {
	Videos
}

func (ByDuractionDesc) Less

func (s ByDuractionDesc) Less(i, j int) bool

type ByDuration

type ByDuration struct {
	Videos
}

func (ByDuration) Less

func (s ByDuration) Less(i, j int) bool

type ByRandom

type ByRandom struct {
	Videos
}

func (ByRandom) Less

func (s ByRandom) Less(i, j int) bool

type ByTitle

type ByTitle struct {
	Videos
}

func (ByTitle) Less

func (s ByTitle) Less(i, j int) bool

type ByTitleDesc

type ByTitleDesc struct {
	Videos
}

func (ByTitleDesc) Less

func (s ByTitleDesc) Less(i, j int) bool

type Category

type Category struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Library

type Library struct {
	Path     string
	Videos   Videos
	Settings Settings
}

func (*Library) GenerateScreenshots

func (lib *Library) GenerateScreenshots(videoData Video) (err error)

GenerateScreenshots saves video screenshots as jpg

func (*Library) ImportVideo

func (lib *Library) ImportVideo(file string) (video Video, err error)

importVideo gets md5sum of video and copies it to the library folder and return video info

func (*Library) SaveJSONData

func (lib *Library) SaveJSONData(videoData Video) (err error)

SaveJSONData saves the video data on a json file

func (*Library) Scan

func (lib *Library) Scan(directory string) (err error)

ScanDirectory scans a folder to find videos

type Settings

type Settings struct {
	LibraryPath string
	ClusterID   string
	InstanceID  string
	HMACkey     []byte
}

type Video

type Video struct {
	ID           string     `json:"id"`
	Title        string     `json:"title"`
	ThumbURL     string     `json:"thumbURL"`
	ImgURL       string     `json:"imgURL"`
	VideoURL     string     `json:"videoURL"`
	Description  string     `json:"description"`
	PubDate      time.Time  `json:"pubDate"`
	SubtitlesURL string     `json:"subtitlesURL"`
	Categories   []Category `json:"categories"`
	Actors       []Actor    `json:"actors"`
	Extension    string     `json:"extension"`
	Width        int        `json:"width"`
	Height       int        `json:"height"`
	Duration     int        `json:"duration"`
	Step         int        `json:"step"`
	File         string     `json:"file"`
	OrigFile     string     `json:"orig_file"`
	Path         string     `json:"path"`
	Md5Sum       string     `json:"md5sum"`
	Encrypted    bool       `json:"encrypted"`
	Order        int        `json:"order"`
}

func GetJSONData

func GetJSONData(videoJSON string) (thisVideo Video, err error)

GetJSONData gets the video data from json file

type VideoJSON

type VideoJSON struct {
	Actors      []string `json:"actors"`
	ReleaseDate string   `json:"releaseDate"`
	Description string   `json:"description"`
	Title       string   `json:"title"`
	Who         []string `json:"who"`
	Categories  []string `json:"categories"`
	URL         string   `json:"url"`
	Image       string   `json:"image"`
	Md5Sum      string   `json:"md5sum"`
}

type Videos

type Videos []Video

func (Videos) Len

func (s Videos) Len() int

func (Videos) Swap

func (s Videos) Swap(i, j int)

Jump to

Keyboard shortcuts

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