engine

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Unrated float64 = math.NaN()

Unrated is a constant to be used with Title.rating to indicate that a title has no rating

Functions

func ReadImdbTitleFiles

func ReadImdbTitleFiles(titleFilePaths ImdbTitleFilePaths) map[string]Title

ReadImdbTitleFiles parses the results of imdb_downloader into a format that Suggest can use.

Types

type ImdbTitleFilePaths

type ImdbTitleFilePaths struct {
	// contains filtered or unexported fields
}

ImdbTitleFilePaths represents local file paths corresponding to downloaded IMDB data

func DownloadImdbTitleData

func DownloadImdbTitleData() ImdbTitleFilePaths

DownloadImdbTitleData downloads current copies of IMDB's title data to a temp directory and outputs the resulting file paths.

type SuggestOptions

type SuggestOptions struct {
	MinRating      float64
	MinRatingCount int32
	SeenTitles     []string
}

SuggestOptions is the options type for the Suggest function ^^^ This is why required comments are idiotic

type Title

type Title struct {
	TitleType      string
	PrimaryTitle   string
	RuntimeMinutes string
	Genres         string
	Rating         float64
	RatingCount    int32
	// contains filtered or unexported fields
}

Title represents one line of IMDB title.basics.tsv data

func RandTitle

func RandTitle(list []Title) Title

RandTitle selects a title from an array of title uniformly at random

func Suggest

func Suggest(options SuggestOptions) Title

Suggest uses IMDB data to suggest the title of a movie to watch

Jump to

Keyboard shortcuts

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