models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenreMap = map[string]int{
	"ACTION":      1,
	"ADVENTURE":   2,
	"ANIMATION":   3,
	"BIOGRAPHY":   4,
	"COMEDY":      5,
	"CRIME":       6,
	"DOCUMENTARY": 7,
	"DRAMA":       8,
	"FAMILY":      9,
	"FANTASY":     10,
	"GAME SHOW":   11,
	"HISTORY":     12,
	"HORROR":      13,
	"MUSIC":       14,
	"MUSICAL":     15,
	"MYSTERY":     16,
	"NEWS":        17,
	"REALITY-TV":  18,
	"ROMANCE":     19,
	"SCI-FI":      20,
	"SPORT":       21,
	"SUPER-HERO":  22,
	"TALK SHOW":   23,
	"THRILLER":    24,
	"WAR":         25,
	"WESTERN":     26,
}

GenreMap represents a genre map for common transmission between movie services.

Functions

This section is empty.

Types

type CacheData

type CacheData struct {
	Service string
	Title   string
	File    *os.File
	Time    *time.Duration
}

CacheData stores a cache info for a service

type CreditInfo

type CreditInfo struct {
	Directors []string
	Writers   []string
	Stars     []string
}

CreditInfo stores credit informations like (Directors, Writers, Stars)

type HistoryRequest

type HistoryRequest struct {
	NOP          bool
	ScanSearches bool
	ScanWatches  bool
}

HistoryRequest represents a connection between CLI and Printer

type HistoryResponse

type HistoryResponse struct {
	Search     MovieSearchInfo
	MovieTitle string
	MovieYear  string
}

HistoryResponse stores an information about MovieSearchInfo response

type LearnRequest

type LearnRequest struct {
	Filename string
}

LearnRequest represents a connection between CLI and Printer

type LearnResponse

type LearnResponse struct {
	Success bool
	Error   string
	Result  LearnResult
}

LearnResponse stores an information about LearnResult

type LearnResult

type LearnResult struct {
	Title      string
	IsTVSeries bool
	WatchDate  string
}

LearnResult stores an information about movie

type Movie

type Movie struct {
	Info MovieInfo
	TL   Tagline
	PS   PlotSummary
	PK   PlotKeywords
	PG   ParentsGuide
}

Movie stores the master informations using MovieInfo, TagLine, PlotSummary, PlotKeywords, ParentsGuide

type MovieInfo

type MovieInfo struct {
	ID                int64
	Title             string
	Year              string
	Rating            string
	Votes             string
	Reviews           string
	Genres            []string
	Duration          string
	Released          string
	IsTVSeries        bool
	Seasons           string
	Episodes          string
	Summary           string
	Credit            CreditInfo
	Metascore         string
	ReviewCountUser   string
	ReviewCountCritic string
	RTMeter           string
	URLTrailerIMDB    string
	URLPosterIMDB     string
	Created           int64
	Updated           int64
}

MovieInfo stores all of the informations about the movie

type MovieLearnInfo

type MovieLearnInfo struct {
	ID      int64
	MovieID int64
	Created int64
	Updated int64
	Liked   bool
}

MovieLearnInfo represents a database row from the table (movie_learns)

type MovieNoteInfo

type MovieNoteInfo struct {
	ID      int64
	MovieID int64
	Created int64
	Updated int64
	From    int64
	Season  uint8
	Episode uint8
	Hour    uint8
	Minute  uint8
	Second  uint8
	Text    string
}

MovieNoteInfo represents a database row from the table (movie_notes)

type MovieSearchInfo

type MovieSearchInfo struct {
	ID      int64
	MovieID int64
	Created int64
	From    string
}

MovieSearchInfo represents a database row from the table (movie_searches)

type MovieStore

type MovieStore interface {
	// Create persists a new movie info to the datastore.
	Create(context.Context, *MovieInfo) error

	// CreateSearch persists a new movie search info to the datastore.
	CreateSearch(context.Context, *MovieInfo, string) error

	// CreateNI persists a new note info to the datastore.
	CreateNI(context.Context, *MovieInfo, *MovieNoteInfo) error

	// CreateML persists a new movie like to the datastore.
	CreateML(context.Context, *MovieInfo, bool) error

	// CreateWL persists a new watch later to the datastore.
	CreateWL(context.Context, *MovieInfo, bool) error

	// Update persists an updated movie to the datastore.
	Update(context.Context, *MovieInfo) error

	// UpdateNI persists an updated note info to the datastore.
	UpdateNI(context.Context, *MovieInfo, *MovieNoteInfo) error

	// UpdateWL persists an updated watch later to the datastore by watched
	UpdateWL(context.Context, *MovieInfo, bool) error

	// UpdateML persists an updated movie info to the datastore by like.
	UpdateML(context.Context, *MovieInfo, bool) error

	// Delete deletes a movie from the datastore.
	Delete(context.Context, *MovieInfo) error

	// GetMovies resutns a list of MovieInfo from the datastore.
	GetMovies(context.Context) ([]*MovieInfo, error)

	// GetSearches resutns a list of MovieSearchInfo from the datastore.
	GetSearches(context.Context) ([]*MovieSearchInfo, error)

	// GetMovieNoteList resutns a list of MovieNoteInfo from the datastore.
	GetMovieNoteList(context.Context) ([]*MovieNoteInfo, error)

	// GetWatchLaterList resutns a list of MovieWatchLaterInfo from the datastore.
	GetWatchLaterList(context.Context) ([]*MovieWatchLaterInfo, error)

	// GetMovieLearnList resutns a list of MovieLearnInfo from the datastore.
	GetMovieLearnList(context.Context) ([]*MovieLearnInfo, error)

	// FindByTitle returns a MovieInfo from the datastore by movie Title.
	FindByTitle(context.Context, string) (*MovieInfo, error)

	// FindByID returns a MovieInfo from the datastore by movie ID.
	FindByID(context.Context, int64) (*MovieInfo, error)

	// FindNI returns a MovieNoteInfo from the datastore by movie ID.
	FindNI(context.Context, int64) (*MovieNoteInfo, error)

	// FindWL returns a MovieWatchLaterInfo from the datastore by movie ID.
	FindWL(context.Context, int64) (*MovieWatchLaterInfo, error)

	// FindML returns a MovieLearnInfo from the datastore by movie ID.
	FindML(context.Context, int64) (*MovieLearnInfo, error)

	// Count returns a a count of movie infos.
	Count(context.Context) (int64, error)

	// CountNI returns a a count of note infos.
	CountNI(context.Context) (int64, error)

	// CountWL returns a a count of watch later.
	CountWL(context.Context) (int64, error)

	// CountML returns a a count of movies like.
	CountML(context.Context) (int64, error)
}

MovieStore defines operations for working with movies.

type MovieWatchLaterInfo

type MovieWatchLaterInfo struct {
	ID      int64
	MovieID int64
	Created int64
	Updated int64
	Watched bool
}

MovieWatchLaterInfo represents a database row from the table (movie_watchlist)

type MyListRequest

type MyListRequest struct {
	NOP     bool
	ScanWLs bool
	ScanMLs bool
}

MyListRequest represents a connection between CLI and Printer

type MyListResponse

type MyListResponse struct {
	WL         MovieWatchLaterInfo
	ML         MovieLearnInfo
	MovieTitle string
	MovieYear  string
}

MyListResponse stores an information about both of MovieWatchLaterInfo and MovieLearnInfo responses

type NoteRequest

type NoteRequest struct {
	NOP bool
}

NoteRequest represents a connection between CLI and Printer

type NoteResponse

type NoteResponse struct {
	Note       MovieNoteInfo
	MovieTitle string
	MovieYear  string
}

NoteResponse stores an information about MovieNoteInfo response

type ParentsGuide

type ParentsGuide struct {
	TotalVote   uint
	Nudity      SeverityRate
	Violence    SeverityRate
	Profanity   SeverityRate
	Alcohol     SeverityRate
	Frightening SeverityRate
}

ParentsGuide stores SeverityRate informations about the Nudity, Violence, Profanity, Alcohol and Frightening

type PlotKeywords

type PlotKeywords struct {
	Keywords []string
	Total    uint
}

PlotKeywords stores the Keywords about the movie

type PlotSummary

type PlotSummary struct {
	Summaries []Summary
	Total     uint
}

PlotSummary stores a list of Summary

type RTActorInfo

type RTActorInfo struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	Image string `json:"image"`
}

RTActorInfo represents an actor information

type RTSearchMovieCastItem

type RTSearchMovieCastItem struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

RTSearchMovieCastItem represents a Casting information

type RTSearchMovieInfo

type RTSearchMovieInfo struct {
	Name       string                  `json:"name"`
	Year       uint                    `json:"year"`
	URL        string                  `json:"url"`
	Image      string                  `json:"image"`
	MeterClass string                  `json:"meterClass"`
	MeterScore uint                    `json:"meterScore"`
	Casts      []RTSearchMovieCastItem `json:"castItems"`
	Subline    string                  `json:"subline"`
}

RTSearchMovieInfo represents a movie info that fetched from RottenTomatoes

type RTSearchResult

type RTSearchResult struct {
	ActorCount     uint                `json:"actorCount"`
	Actors         []RTActorInfo       `json:"actors"`
	CriticCount    uint                `json:"criticCount"`
	FranchiseCount uint                `json:"franchiseCount"`
	MovieCount     uint                `json:"movieCount"`
	MovieInfos     []RTSearchMovieInfo `json:"movies"`
	TVSeries       []RTTVSeriesInfo    `json:"tvSeries"`
	TVCount        uint                `json:"tvCount"`
}

RTSearchRequest represents a movie search request that to be sent to RottenTomatoes service

type RTTVSeriesInfo

type RTTVSeriesInfo struct {
	Title      string `json:"title"`
	StartYear  uint   `json:"startYear"`
	EndYear    uint   `json:"endYear"`
	URL        string `json:"url"`
	MeterClass string `json:"meterClass"`
	Image      string `json:"image"`
}

RTTVSeriesInfo represents a TV Series information

type ResultFilter

type ResultFilter struct {
	NoBanner     bool
	NoColor      bool
	Title        bool
	Year         bool
	Released     bool
	Rating       bool
	Duration     bool
	Summary      bool
	Directors    bool
	Writers      bool
	Stars        bool
	Genres       bool
	Tagline      bool
	Summaries    bool
	Keywords     bool
	ParentsGuide bool
	ShowWLs      bool
	ShowMLs      bool
}

ResultFilter represents a CLI output filter

type SearchRequest

type SearchRequest struct {
	Title       string
	Year        string
	ID          string
	URL         string
	ExactSearch bool
	ResultLimit int
	ScanIMDB    bool
	ScanRT      bool
}

SearchRequest represents a movie search request that to be sent to a service

type SearchResponse

type SearchResponse struct {
	SearchEngine string
	Searches     []SearchResult
	Error        string
	TotalFound   uint
}

SearchResponse represents a list of SearchResult that fetched from a service

type SearchResult

type SearchResult struct {
	URL    string
	ID     string
	Title  string
	Year   string
	TVShow bool
}

SearchResult represents a movie in the search list

type SearchTorrentRequest

type SearchTorrentRequest struct {
	Title           string
	Year            string
	ResultLimit     int
	ScanTorrentsCSV bool
	Scan1337x       bool
}

SearchTorrentRequest represents a torrent search request

type SearchTorrentResponse

type SearchTorrentResponse struct {
	SearchEngine string
	Searches     []SearchTorrentResult
	Error        string
	TotalFound   uint
}

SearchTorrentResponse represents a list of SearchTorrentResult that fetched from a torrent service

type SearchTorrentResult

type SearchTorrentResult struct {
	Name     string
	URL      string
	Seeders  string
	Leechers string
	Date     string
	Size     string
	Uploader string
	Info     parsetorrentname.TorrentInfo
}

SearchTorrentResult represents a torrent search result

type SeverityRate

type SeverityRate struct {
	NONE      uint
	MILD      uint
	MODERATE  uint
	SEVERE    uint
	TotalRate uint
	FinalRate string
}

SeverityRate stores a list of integers for the ParentsGuide

type Summary

type Summary struct {
	Author string
	Text   string
}

Summary stores the informations about the summary's Author and Text

type Tagline

type Tagline struct {
	Tags []string
}

Tagline stores a list of tag about the movie

type UpdateRequest

type UpdateRequest struct {
	NOP bool
}

UpdateRequest represents a connection between CLI and Printer

type UpdateResponse

type UpdateResponse struct {
	UpdateList []MovieInfo
}

UpdateResponse stores an information about list of MovieInfo

Jump to

Keyboard shortcuts

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