types

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Overview

Contains structs and constants for the xREL package, reflecting the xREL API JSON returns.

Index

Constants

View Source
const (
	TYPE_MOVIE    = "movie"
	TYPE_TV       = "tv"
	TYPE_GAME     = "game"
	TYPE_CONSOLE  = "console"
	TYPE_SOFTWARE = "software"
	TYPE_XXX      = "xxx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Category

type Category struct {
	Name      string `json:"name"`
	ParentCat string `json:"parent_cat"`
}

type Comment

type Comment struct {
	Id       string `json:"id"`
	TimeUnix string `json:"time"`
	Author   Author `json:"author"`
	Text     string `json:"text"`
	LinkHref string `json:"link_href"`
	Rating   Rating `json:"rating"`
	Votes    Votes  `json:"votes"`
	Edits    Edits  `json:"edits"`
}

func (*Comment) GetTime

func (comment *Comment) GetTime() (time.Time, error)

type Comments

type Comments struct {
	TotalCount string     `json:"total_count"`
	Pagination Pagination `json:"pagination"`
	List       []Comment  `json:"list"`
}

type Edits

type Edits struct {
	Count    int    `json:"count"`
	LastUnix string `json:"last"`
}

func (*Edits) GetLast

func (edits *Edits) GetLast() (time.Time, error)

type ExtInfoExternal

type ExtInfoExternal struct {
	Source  ExtInfoExternalSource `json:"source"`
	LinkUrl string                `json:"link_url"`
	Plot    string                `json:"plot"`
}

type ExtInfoExternalSource

type ExtInfoExternalSource struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type ExtInfoMediaItem

type ExtInfoMediaItem struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	TimeUnix    int64  `json:"time"`
	UrlFull     string `json:"url_full"` // IsImage()
	UrlThumb    string `json:"url_thumb"`
	YoutubeId   string `json:"youtube_id"` // IsVideo()
	VideoURL    string `json:"video_url"`  // IsVideo()
}

func (*ExtInfoMediaItem) GetTime

func (extInfoMediaItem *ExtInfoMediaItem) GetTime() time.Time

func (ExtInfoMediaItem) IsImage

func (extInfoMediaItem ExtInfoMediaItem) IsImage() bool

func (ExtInfoMediaItem) IsVideo

func (extInfoMediaItem ExtInfoMediaItem) IsVideo() bool

type ExtInfoReleaseDate

type ExtInfoReleaseDate struct {
	Type string `json:"type"`
	Date string `json:"date"`
}

type ExtInfoSearchResult

type ExtInfoSearchResult struct {
	Total   int            `json:"total"`
	Results []ShortExtInfo `json:"results"`
}

type ExtendedExtInfo

type ExtendedExtInfo struct {
	Id           string               `json:"id"`
	Type         string               `json:"type"`
	Title        string               `json:"title"`
	LinkHref     string               `json:"link_href"`
	Genre        string               `json:"genre"`
	AltTitle     string               `json:"alt_title"`
	CoverUrl     string               `json:"cover_url"`
	URIs         []string             `json:"uris"`
	Rating       float32              `json:"rating"`
	OwnRating    string               `json:"own_rating"`
	NumRatings   int                  `json:"num_ratings"`
	ReleaseDates []ExtInfoReleaseDate `json:"release_dates"`
	Externals    []ExtInfoExternal    `json:"externals"`
	Releases     []Release            `json:"releases"`
	P2PReleases  []P2PRelease         `json:"p2p_releases"`
}

type FavList

type FavList struct {
	Id             int    `json:"id"`
	Name           string `json:"name"`
	IsPublic       bool   `json:"public"`
	DoNotify       bool   `json:"notify"`
	DoAutoRead     bool   `json:"auto_read"`
	IncludesP2P    bool   `json:"include_p2p"`
	Description    string `json:"description"`
	PasswordHash   string `json:"passwort_hash"` // $password_hash = sha1($list->id . "\r\n" . $list->password);
	EntryCount     int    `json:"entry_count"`
	UnreadReleases int    `json:"unread_releases"`
}

type FavListEntryModificationResult

type FavListEntryModificationResult struct {
	Success int          `json:"success"` // TODO: Why is this an int?
	FavList ShortFavList `json:"fav_list"`
	ExtInfo ShortExtInfo `json:"ext_info"`
}

type Filter

type Filter struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Flags

type Flags struct {
	HasReadNFO bool `json:"read_nfo"`
	IsFixRLS   bool `json:"fix_rls"`
	IsTopRLS   bool `json:"top_rls"`
	IsEnglish  bool `json:"english"`
}

http://www.xrel.to/comments/wiki/1680.html#cpost311058

type Group

type Group struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type P2PCategory

type P2PCategory struct {
	Id      string `json:"id"`
	MetaCat string `json:"meta_cat"`
	SubCat  string `json:"sub_cat"`
}

type P2PRelease

type P2PRelease struct {
	Id                string       `json:"id"`
	Dirname           string       `json:"dirname"`
	DirnameNormalized string       `json:"dirname_normalized"`
	LinkHref          string       `json:"link_href"`
	MainLanguage      string       `json:"main_lang"`
	PubTimeUnix       int64        `json:"pub_time"`
	PostTimeUnix      int64        `json:"post_time"`
	SizeInMB          int          `json:"size_mb"`
	Group             Group        `json:"group"`
	NumRatings        int          `json:"num_ratings"`
	VideoRating       float32      `json:"video_rating"`
	AudioRating       float32      `json:"audio_rating"`
	ExtInfo           ShortExtInfo `json:"ext_info"`
	TVSeason          int          `json:"tv_season"`
	TVEpisode         int          `json:"tv_episode"`
	Comments          int          `json:"comments"`
}

func (*P2PRelease) GetPostTime

func (p2pRelease *P2PRelease) GetPostTime() time.Time

func (*P2PRelease) GetPubTime

func (p2pRelease *P2PRelease) GetPubTime() time.Time

type P2PReleases

type P2PReleases struct {
	TotalCount int          `json:"total_count"`
	Pagination Pagination   `json:"pagination"`
	List       []P2PRelease `json:"list"`
}

type Pagination

type Pagination struct {
	CurrentPage int `json:"current_page"`
	PerPage     int `json:"per_page"`
	TotalPages  int `json:"total_pages"`
}

type RateLimitStatus

type RateLimitStatus struct {
	RemainingCalls int   `json:"remaining_calls"`
	ResetTimeU     int64 `json:"reset_time_u"`
}

func (*RateLimitStatus) GetResetTime

func (rateLimitStatus *RateLimitStatus) GetResetTime() time.Time

type Rating

type Rating struct {
	Video string `json:"video"`
	Audio string `json:"audio"`
}

type Release

type Release struct {
	Id          string       `json:"id"`
	Dirname     string       `json:"dirname"`
	LinkHref    string       `json:"link_href"`
	TimeUnix    int64        `json:"time"`
	GroupName   string       `json:"group_name"`
	NukeReason  string       `json:"nuke_reason"`
	Size        Size         `json:"size"`
	VideoType   string       `json:"video_type"`
	AudioType   string       `json:"audio_type"`
	NumRatings  int          `json:"num_ratings"`
	VideoRating float32      `json:"video_rating"`
	AudioRating float32      `json:"audio_rating"`
	ExtInfo     ShortExtInfo `json:"ext_info"`
	TVSeason    int          `json:"tv_season"`
	TVEpisode   int          `json:"tv_episode"`
	Comments    int          `json:"comments"`
	Flags       Flags        `json:"flags"`
	ProofUrl    string       `json:"proof_url"`
}

func (*Release) GetTime

func (release *Release) GetTime() time.Time

type ReleaseSearchResult

type ReleaseSearchResult struct {
	Total        int          `json:"total"`
	SceneResults []Release    `json:"results"`
	P2PResults   []P2PRelease `json:"p2p_results"`
}

type Releases

type Releases struct {
	TotalCount int        `json:"total_count"`
	Pagination Pagination `json:"pagination"`
	List       []Release  `json:"list"`
}

type ShortExtInfo

type ShortExtInfo struct {
	Id         string   `json:"id"`
	Type       string   `json:"type"`
	Title      string   `json:"title"`
	LinkHref   string   `json:"link_href"`
	Rating     float32  `json:"rating"`
	NumRatings int      `json:"num_ratings"`
	URIs       []string `json:"uris"`
}

type ShortFavList

type ShortFavList struct {
	Id             string `json:"id"` // TODO: Why is this a string?
	Name           string `json:"string"`
	Entries        string `json:"entries"`         // TODO: Why is this a string?
	UnreadReleases string `json:"unread_releases"` // TODO: Why is this a string?
}

type Size

type Size struct {
	Number int    `json:"number"`
	Unit   string `json:"unit"`
}

type UpcomingTitle

type UpcomingTitle struct {
	Id          string                    `json:"id"`
	Type        string                    `json:"type"`
	Title       string                    `json:"title"`
	LinkHref    string                    `json:"link_href"`
	Genre       string                    `json:"genre"`
	AltTitle    string                    `json:"alt_title"`
	CoverUrl    string                    `json:"cover_url"`
	Releases    []UpcomingTitleRelease    `json:"releases"`
	P2PReleases []UpcomingTitleP2PRelease `json:"p2p_releases"`
}

type UpcomingTitleP2PRelease

type UpcomingTitleP2PRelease struct {
	Id          string `json:"id"`
	Dirname     string `json:"dirname"`
	LinkHref    string `json:"link_href"`
	PubTimeUnix int64  `json:"pub_time"`
}

func (*UpcomingTitleP2PRelease) GetPubTime

func (upcomingTitleP2PRelease *UpcomingTitleP2PRelease) GetPubTime() time.Time

type UpcomingTitleRelease

type UpcomingTitleRelease struct {
	Id       string `json:"id"`
	Dirname  string `json:"dirname"`
	LinkHref string `json:"link_href"`
	TimeUnix int64  `json:"time"`
	Flags    Flags  `json:"flags"`
}

func (*UpcomingTitleRelease) GetTime

func (upcomingTitleRelease *UpcomingTitleRelease) GetTime() time.Time

type User

type User struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	Secret         string `json:"secret"`
	Locale         string `json:"locale"`
	AvatarURL      string `json:"avatar_url"`
	AvatarThumbURL string `json:"avatar_thumb_url"`
}

type Votes

type Votes struct {
	Positive int `json:"positive"`
	Negative int `json:"negative"`
}

Jump to

Keyboard shortcuts

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