model

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// content type
	PgcSn    = "7"
	PgcEp    = "8"
	UgcArc   = "9"
	UgcVideo = "10"
)

audit related consts

Variables

This section is empty.

Functions

This section is empty.

Types

type AIData

type AIData struct {
	AID         int `json:"aid"`
	MID         int `json:"mid"`
	Pts         int `json:"pts"`
	Play        int `json:"play"`
	Coints      int `json:"coins"`
	VideoReview int `json:"video_review"`
}

AIData is the ai card structure

type ArcCMS

type ArcCMS struct {
	Title   string
	AID     int64
	Content string
	Cover   string
	TypeID  int
	Pubtime time.Time
	Videos  int
	Valid   int
	Deleted int
	Result  int
}

ArcCMS reprensents the archive data structure in MC

func (*ArcCMS) CanPlay

func (s *ArcCMS) CanPlay() bool

CanPlay returns whether the arc can play or not

func (*ArcCMS) NotDeleted

func (s *ArcCMS) NotDeleted() bool

NotDeleted def.

func (ArcCMS) ToCard

func (a ArcCMS) ToCard() *Card

ToCard transforms an ArcCMS to Card

func (ArcCMS) ToIdxSn

func (a ArcCMS) ToIdxSn() *IdxSeason

ToIdxSn transforms an ArcCMS to IdxSeason

type ArcType

type ArcType struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

ArcType def.

type Audit

type Audit struct {
	IDList   []*IDList `json:"id_list"`
	OpType   string    `json:"optype"`
	Count    int       `json:"count"`
	AuditMsg string    `json:"audit_msg"`
}

Audit def.

type AuditOp

type AuditOp struct {
	KID         int64 // aid/cid/sid/epid
	Result      int   // pgc sn: `check`, pgc ep: state, ugc: result
	Valid       int
	AuditMsg    string
	ContentType string // type
}

AuditOp def.

func (*AuditOp) FromIDList

func (v *AuditOp) FromIDList(req *IDList) (err error)

FromIDList def.

func (*AuditOp) ToMsg

func (v *AuditOp) ToMsg() string

ToMsg def

type Card

type Card struct {
	SeasonID   int          `json:"season_id"`
	Title      string       `json:"title"`
	Cover      string       `json:"cover"`
	Type       int          `json:"type"` // 1=pgc, 2=ugc
	NewEP      *NewEP       `json:"new_ep"`
	CornerMark *SnVipCorner `json:"cornermark"`
}

Card is the unit to display

func (*Card) BePGC

func (c *Card) BePGC()

BePGC def.

func (Card) IsUGC

func (c Card) IsUGC() bool

IsUGC returns whether the card is ugc card

type Channel

type Channel struct {
	ID      int
	Title   string
	Desc    string
	Splash  string
	Deleted int
	Ctime   time.Time
	Mtime   time.Time
}

Channel defines the structure of the channel & splash data

type Cont

type Cont struct {
	ID    int
	Title string
}

Cont : UGC content struct

type Content

type Content struct {
	ID         int64
	Title      string
	Subtitle   string
	Desc       string
	Cover      string
	SeasonID   int
	CID        int
	EPID       int
	MenuID     int
	State      int
	Valid      int
	AuditTime  int
	PayStatus  int
	IsDeleted  int
	Ctime      time.Time
	Mtime      time.Time
	InjectTime time.Time
	Reason     string
}

Content content def.

type CornerMark

type CornerMark struct {
	Title string `json:"title"`
	Cover string `json:"cover"`
}

CornerMark def.

type EP

type EP struct {
	AVID       string `json:"av_id"`
	Coins      string `json:"coins"`
	Cover      string `json:"cover"`
	Danmaku    string `json:"danmaku"`
	EpisodeID  string `json:"episode_id"`
	Index      string `json:"index"`
	IndexTitle string `json:"index_title"`
	IsWebplay  string `json:"is_webplay"`
	Page       string `json:"page"`
	Up         *Up    `json:"up"`
	UpdateTime string `json:"update_time"`
	WebplayURL string `json:"webplay_url"`
}

EP is the newest EP info

type EpAuth

type EpAuth struct {
	ID        int64 `json:"id"`
	EPID      int64 `json:"epid"`
	SeasonID  int64 `json:"season_id"`
	State     int   `json:"state"`
	Valid     int   `json:"valid"`
	IsDeleted int   `json:"is_deleted"`
	NoMark    int   `json:"no_mark"`
}

EpAuth is the structure of ep in mc

func (EpAuth) CanPlay

func (s EpAuth) CanPlay() bool

CanPlay returns whether the season is able to play

func (EpAuth) NotDeleted

func (s EpAuth) NotDeleted() bool

NotDeleted def.

func (EpAuth) Whitelist

func (s EpAuth) Whitelist() bool

Whitelist checks whether the ep is in the whitelist of no mark eps

type EpCMS

type EpCMS struct {
	EPID      int64  `json:"epid"`
	Cover     string `json:"cover"`
	Title     string `json:"title"`
	Subtitle  string `json:"subtitle"`
	PayStatus int    `json:"pay_status"`
}

EpCMS defines the elements could be changed from TV CMS side

func (*EpCMS) IsFree

func (v *EpCMS) IsFree() bool

IsFree def.

type EpDecor

type EpDecor struct {
	*EpCMS
	Watermark bool `json:"watermark"`
}

EpDecor is used to decorate ep

type Episode

type Episode struct {
	AID           int    `json:"aid"`
	CID           int    `json:"cid"`
	Cover         string `json:"cover"`
	EPID          int64  `json:"ep_id"`
	EpisodeStatus int    `json:"episode_status"`
	From          string `json:"from"`
	Index         string `json:"index"`
	IndexTitle    string `json:"index_title"`
	MID           int    `json:"mid"`
	Page          int    `json:"page"`
	ShareURL      string `json:"share_url"`
	VID           string `json:"vid"`
	WaterMark     bool   `json:"hidemark"` // true means in the whitelist
}

Episode def

func (*Episode) CmsInterv

func (v *Episode) CmsInterv(epCMS *EpCMS)

CmsInterv def.

type EpisodeV2

type EpisodeV2 struct {
	AID        int64       `json:"aid"`
	Badge      string      `json:"badge"`
	BadgeType  int         `json:"badge_type"`
	CID        int64       `json:"cid"`
	Cover      string      `json:"cover"`
	From       string      `json:"from"`
	ID         int64       `json:"id"`
	LongTitle  string      `json:"long_title"`
	ShareURL   string      `json:"share_url"`
	Status     int         `json:"status"`
	Title      string      `json:"title"`
	VID        string      `json:"vid"`
	WaterMark  bool        `json:"hidemark"` // true means in the whitelist
	CornerMark *CornerMark `json:"cornermark"`
}

EpisodeV2 def.

func (*EpisodeV2) CmsInterv

func (v *EpisodeV2) CmsInterv(epCMS *EpCMS)

CmsInterv def.

type FavMList

type FavMList struct {
	Page struct {
		Num   int `json:"num"`
		Size  int `json:"size"`
		Count int `json:"count"`
	} `json:"page"`
	List []*arcwar.Arc `json:"list"`
}

FavMList def.

type Follow

type Follow struct {
	Actor          []string     `json:"actor"`
	Alias          string       `json:"alias"`
	AllowBP        string       `json:"allow_bp"`
	AllowDownload  string       `json:"allow_download"`
	Area           string       `json:"area"`
	AreaLimit      int          `json:"arealimit"`
	BangumiID      string       `json:"bangumi_id"`
	BangumiTitle   string       `json:"bangumi_title"`
	Brief          string       `json:"brief"`
	Coins          string       `json:"coins"`
	Copyright      string       `json:"copyright"`
	Cover          string       `json:"cover"`
	DanmakuCount   string       `json:"danmaku_count"`
	Episodes       []string     `json:"episodes"`
	EDJump         int          `json:"ed_jump"`
	Evaluate       string       `json:"evaluate"`
	Favorites      string       `json:"favorites"`
	IsFinish       string       `json:"is_finish"`
	Progress       string       `json:"progress"`
	NewEP          *EP          `json:"new_ep"`
	NewestEPID     string       `json:"newest_ep_id"`
	NewestEPIndex  string       `json:"newest_ep_index"`
	PlayCount      string       `json:"play_count"`
	PubTime        string       `json:"pub_time"`
	RelatedSeasons []string     `json:"related_seasons"`
	SeasonID       string       `json:"season_id"`
	SeasonTitle    string       `json:"season_title"`
	Seasons        []string     `json:"seasons"`
	ShareURL       string       `json:"share_url"`
	SPID           string       `json:"spid"`
	SquareCover    string       `json:"squareCover"`
	Staff          string       `json:"staff"`
	Tag2s          []string     `json:"tag2s"`
	Tags           []*Tag       `json:"tags"`
	Title          string       `json:"title"`
	TotalCount     string       `json:"total_count"`
	UserSeason     *UserSeason  `json:"user_season"`
	Weekday        string       `json:"weekday"`
	CornerMark     *SnVipCorner `json:"cornermark"`
}

Follow is the main structure of the followed season

type FormFav

type FormFav struct {
	AccessKey string `form:"access_key" validate:"required"`
	Pn        int    `form:"pn" default:"1"`
}

FormFav is the form validation for favorites display

func (*FormFav) ToReq

func (f *FormFav) ToReq(mid int64) *ReqFav

ToReq def.

type FormFavAct

type FormFavAct struct {
	AccessKey string `form:"access_key" validate:"required"`
	AID       int64  `form:"aid" validate:"required"`
	Action    int    `form:"action" validate:"min=1,max=2"`
}

FormFavAct is the form validation for favorite action

func (*FormFavAct) ToReq

func (f *FormFavAct) ToReq(mid int64) *ReqFavAct

ToReq def.

type HTTPData

type HTTPData struct {
	Ver     string `json:"ver"`
	Build   int    `json:"build"`
	Info    string `json:"info"`
	Size    string `json:"size"`
	URL     string `json:"url"`
	Hash    string `json:"hash"`
	Policy  int    `json:"policy"`
	IsForce int    `json:"is_force"`
	IsPush  int    `json:"is_push"`
	IsGray  int    `json:"is_gray"`
	Mtime   int    `json:"mtime"`
	Patch   *Patch `json:"patch"`
}

HTTPData response

type Homepage

type Homepage struct {
	Recom  []*Card            `json:"recom"`
	Latest []*Card            `json:"latest"`
	Lists  map[string][]*Card `json:"lists"`
	Follow []*Follow          `json:"follow,omitempty"`
}

Homepage is the home page struct

type Hotword

type Hotword struct {
	Keyword string `json:"keyword"`
	Status  string `json:"status"`
}

Hotword item def.

type IDList

type IDList struct {
	Type     string `json:"type"`
	VID      string `json:"vid"`
	Action   string `json:"action"`
	AuditMsg string `json:"audit_msg"`
}

IDList def.

func (*IDList) IsReject

func (v *IDList) IsReject() bool

IsReject def.

func (*IDList) IsShell

func (v *IDList) IsShell() bool

IsShell tells whether it's about archive/season

type IdxData

type IdxData struct {
	List  []*IdxSeason `json:"list"`
	Pager *IdxPager    `json:"pager"`
}

IdxData is the zone index data struct in http response

type IdxPager

type IdxPager struct {
	CurrentPage int `json:"current_page"`
	TotalItems  int `json:"total_items"`
	TotalPages  int `json:"total_pages"`
	PageSize    int `json:"page_size"`
}

IdxPager is the pager struct to return in zone index page

type IdxSeason

type IdxSeason struct {
	SeasonID int64  `json:"season_id"`
	Title    string `json:"title"`
	Cover    string `json:"cover"`
	Upinfo   string `json:"upinfo"`
}

IdxSeason is the struct of season in zone index page

type List

type List struct {
	Face  string `json:"face"`
	UID   int    `json:"uid"`
	Uname string `json:"uname"`
}

List def

type MediaParam

type MediaParam struct {
	SeasonID  int64  `form:"season_id"`
	EpID      int64  `form:"ep_id"`
	TrackPath string `form:"track_path" validate:"required"`
	AccessKey string `form:"access_key"`
	MobiAPP   string `form:"mobi_app" validate:"required"`
	Platform  string `form:"platform"`
	Build     int64  `form:"build"`
}

MediaParam def.

func (*MediaParam) GenerateUrl

func (v *MediaParam) GenerateUrl() (params url.Values)

GenerateUrl generates url.Values from tv media param struct

type MediaResp

type MediaResp struct {
	Response
	Result *SeasonDetail `json:"result"`
}

MediaResp is the structure of PGC display api response

type MediaRespV2

type MediaRespV2 struct {
	Response
	Result *SnDetailV2 `json:"result"`
}

MediaRespV2 is the structure of PGC display api response

type ModCard

type ModCard struct {
	Card
	LastEPIndex   string `json:"last_ep_index"`
	NewestEPIndex string `json:"newest_ep_index"`
	TotalCount    string `json:"total_count"`
	IsFinish      string `json:"is_finish"`
}

ModCard structure, based on normal Card, 4 more fields for Follow Module

type Module

type Module struct {
	ID          int        `json:"id"`
	PageID      int        `json:"page_id"`
	Type        int        `json:"type"`
	Title       string     `json:"title"`
	Icon        string     `json:"icon"`
	Source      int        `json:"source"`
	Flexible    int        `json:"flexible"`
	Capacity    int        `json:"capacity"`
	More        int        `json:"more"`
	MoreType    int        `json:"more_type"`
	MoreNewPage int        `json:"more_new_page"`
	MorePage    int        `json:"more_page"`
	Order       int        `json:"order"`
	Data        []*ModCard `json:"data"`
	SrcType     int        `json:"src_type"`
}

Module def.

func (Module) IsUGC

func (m Module) IsUGC() bool

IsUGC returns whether the module is filled by ugc or not

func (*Module) JumpNewIdx

func (m *Module) JumpNewIdx() bool

JumpNewIdx tells whether this modules jumps to the new idx page

func (*Module) MoreTreat

func (m *Module) MoreTreat()

MoreTreat treats the morepage and moretype related, used for zone/modpages, not homepage

func (*Module) OnHomepage

func (m *Module) OnHomepage() bool

OnHomepage tells whether the module is on the homepage

type NewEP

type NewEP struct {
	ID        int64  `json:"id"`
	Index     string `json:"index"`
	IndexShow string `json:"index_show"`
	Cover     string `json:"cover"`
}

NewEP is the latest EP of a season

type NewEPV2

type NewEPV2 struct {
	Desc  string `json:"desc"`
	ID    int64  `json:"id"`
	IsNew int    `json:"is_new"`
	Title string `json:"title"`
}

NewEPV2 def.

type NewestEP

type NewestEP struct {
	Desc  string `json:"desc"`
	ID    int    `json:"id"`
	Index string `json:"index"`
	IsNew int    `jsontt:"is_new"`
}

NewestEP def

type ParamStyle

type ParamStyle struct {
	Name    string `json:"name"`
	StyleID int    `json:"style_id"`
}

ParamStyle .

type Paster

type Paster struct {
	AID       int    `json:"aid"`
	CID       int    `json:"cid"`
	AllowJump int    `json:"allow_jump"`
	Duration  int    `json:"duration"`
	Type      int    `json:"type"`
	URL       string `json:"url"`
}

Paster def

type Patch

type Patch struct {
	NewID string `json:"new_id"`
	OldID string `json:"old_id"`
	URL   string `json:"url"`
	Md5   string `json:"md5"`
	Size  int    `json:"size"`
}

Patch fix

type PgcNewEP

type PgcNewEP struct {
	ID        int    `json:"id"`
	IndexShow string `json:"index_show"`
	Cover     string `json:"cover"`
}

PgcNewEP is the result from pgc return pgc new ep value

type PgcResponse

type PgcResponse struct {
	Code    int                    `json:"code"`
	Message string                 `json:"message"`
	Result  map[string]*SeasonCard `json:"result"`
}

PgcResponse is the result structure from PGC API

type PlayURLReq

type PlayURLReq struct {
	Platform  string `form:"platform" validate:"required"`
	Device    string `form:"device"`
	Expire    string `form:"expire"`
	Cid       string `form:"cid" validate:"required"`
	Avid      int64  `form:"avid" validate:"required"`
	Build     string `form:"build"`
	Qn        string `form:"qn"`
	Mid       string `form:"mid"`
	Npcybs    string `form:"npcybs"`
	Buvid     string `form:"buvid"`
	TrackPath string `form:"track_path"`
	AccessKey string `form:"access_key"`
}

PlayURLReq is used for getting ugc play url param from app

type PlayURLResp

type PlayURLResp struct {
	Code              int      `json:"code"`
	Result            string   `json:"result"`
	Message           string   `json:"message"`
	From              string   `json:"from"`
	Quality           int      `json:"quality"`
	Format            string   `json:"format"`
	Timelength        int      `json:"timelength"`
	AcceptFormat      string   `json:"accept_format"`
	AcceptDescription []string `json:"accept_description"`
	AcceptQuality     []int    `json:"accept_quality"`
	AcceptWatermark   []bool   `json:"accept_watermark"`
	VideoCodecid      int      `json:"video_codecid"`
	VideoProject      bool     `json:"video_project"`
	SeekParam         string   `json:"seek_param"`
	SeekType          string   `json:"seek_type"`
	Durl              []struct {
		Order  int    `json:"order"`
		Length int    `json:"length"`
		Size   int    `json:"size"`
		Ahead  string `json:"ahead"`
		Vhead  string `json:"vhead"`
		URL    string `json:"url"`
	} `json:"durl"`
}

PlayURLResp is used for return ugc play url result

type PointActivity

type PointActivity struct {
	Content string `json:"content"`
	Link    string `json:"link"`
	Tip     string `json:"tip"`
}

PointActivity def

type Publish

type Publish struct {
	IsFinish    int    `json:"is_finish"`
	IsStarted   int    `json:"is_started"`
	PubTime     string `json:"pub_time"`
	PubTimeShow string `json:"pub_time_show"`
	Weekday     int    `json:"weekday"`
}

Publish def

type Rank

type Rank struct {
	ID        int64
	Rank      int
	Title     string
	Type      int8
	CID       int64
	ContID    int64
	Category  int8
	Position  int32
	IsDeleted int8
	Ctime     time.Time
	Mtime     time.Time
}

Rank represents the table TV_RANK

type Rating

type Rating struct {
	Count int     `json:"count"`
	Score float64 `json:"score"`
}

Rating def

type Recom

type Recom struct {
	Cover          string       `json:"cover"`
	FollowCount    int          `json:"follow_count"`
	IsFinish       int          `json:"is_finish"`
	IsStarted      int          `json:"is_started"`
	NewestEPCover  string       `json:"newest_ep_cover"`
	NewestEPIndex  string       `json:"newest_ep_index"`
	SeasonID       int64        `json:"season_id"`
	SeasonStatus   int          `json:"season_status"`
	SeasonType     int          `json:"season_type"`
	SeasonTypeName string       `json:"season_type_name"`
	Title          string       `json:"title"`
	TotalCount     int          `json:"total_count"`
	CornerMark     *SnVipCorner `json:"cornermark"`
}

Recom def.

type Region

type Region struct {
	PageID    int    `json:"id"`
	Title     string `json:"name"`
	IndexTid  int    `json:"index_tid"`
	IndexType int    `json:"index_type"`
}

Region .

type ReqApply

type ReqApply struct {
	CID       int64 `form:"cid" validate:"required"`
	ApplyTime int64 `form:"apply_time" validate:"required"`
}

ReqApply is request for apply time storage

type ReqFav

type ReqFav struct {
	MID int64
	Pn  int
}

ReqFav is request for favorites function

type ReqFavAct

type ReqFavAct struct {
	MID    int64
	AID    int64 // resource id ( ugc avid )
	Action int   // 1=add,2=delete
}

ReqFavAct is request for favorites action ( add/del ) function

type ReqHomeFollow

type ReqHomeFollow struct {
	AccessKey string `form:"access_key"`
	Build     int    `form:"build"`
}

ReqHomeFollow is the request body to HomeFollow function

type ReqModData

type ReqModData struct {
	Mod      *Module
	PGCListM map[int][]*Card
	UGCListM map[int][]*Card
}

ReqModData is the request body to modData function

type ReqPageFollow

type ReqPageFollow struct {
	AccessKey string `form:"access_key"`
	PageID    int    `form:"page_id" validate:"min=0"`
	Build     int    `form:"build"`
}

ReqPageFollow is the request body to PageFollow function

type ReqTransode

type ReqTransode struct {
	ContType string `form:"cont_type" validate:"required"` // content type: pgc/ugc
	CID      int64  `form:"cid" validate:"required"`
	Action   int64  `form:"action" validate:"min=0,max=2"` // 1 = finished, others = failed
}

ReqTransode is the request structure for the transcode api

type ReqZone

type ReqZone struct {
	SType       int
	IntervType  int
	LengthLimit int
	IntervM     int
	PGCListM    map[int][]*Card
}

ReqZone is the request struct of zone page

type ReqZoneInterv

type ReqZoneInterv struct {
	RankType int
	Category int
	Limit    int
}

ReqZoneInterv is the request structure for zone intervention

type ResFollow

type ResFollow struct {
	Code    int       `json:"code"`
	Count   string    `json:"count"`
	Pages   string    `json:"pages"`
	Message string    `json:"message"`
	Result  []*Follow `json:"result"`
}

ResFollow is the result structure from PGC API

type RespAI

type RespAI struct {
	Note       string    `json:"note"`
	SourceData string    `json:"source_data"`
	Code       int       `json:"code"`
	Num        int       `json:"num"`
	List       []*AIData `json:"list"`
}

RespAI is the response of AI ugc rank data

type RespFavAct

type RespFavAct struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

RespFavAct is response strure for favorite actions

type RespModInterv

type RespModInterv struct {
	Ranks []*SimpleRank
	AIDs  []int64
	SIDs  []int64
}

RespModInterv is the response struct for mod intervention

type Response

type Response struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Response standard structure

func (*Response) CodeErr

func (r *Response) CodeErr() (err error)

CodeErr generates the code error

type ResponseRecom

type ResponseRecom struct {
	Code    int          `json:"code"`
	Message string       `json:"message"`
	Result  *ResultRecom `json:"result"`
}

ResponseRecom is the result structure from PGC API

type ResultRecom

type ResultRecom struct {
	SeasonID int      `json:"season_id"`
	From     int      `json:"from"`
	Title    string   `json:"title"`
	List     []*Recom `json:"list"`
}

ResultRecom def.

type ReviewV2

type ReviewV2 struct {
	IsOpen int `json:"is_open"`
}

ReviewV2 def.

type Rights

type Rights struct {
	AllowBp       int    `json:"allow_bp"`
	AllowDownload int    `json:"allow_download"`
	AllowReview   int    `json:"allow_review"`
	AreaLimit     int    `json:"area_limit"`
	BanAreaShow   int    `json:"ban_area_show"`
	Copyright     string `json:"copyright"`
	IsPreview     int    `json:"is_preview"`
}

Rights def

type Season

type Season struct {
	SeasonV2
	Title string `json:"title"`
}

Season def

type SeasonCMS

type SeasonCMS struct {
	SeasonID    int64
	Cover       string
	Desc        string
	Title       string
	UpInfo      string
	Category    int8   // - cn, jp, movie, tv, documentary
	Area        string // - cn, jp, others
	Playtime    time.Time
	Role        string
	Staff       string
	NewestOrder int   // the newest passed ep's order
	NewestEPID  int64 // the newest passed ep's ID
	NewestNb    int   // the newest ep's number ( after keyword filter )
	TotalNum    int
	Style       string
	OriginName  string
	Alias       string
	PayStatus   int
}

SeasonCMS defines the elements could be changed from TV CMS side

func (*SeasonCMS) IdxSn

func (s *SeasonCMS) IdxSn() (idx *IdxSeason)

IdxSn is the structure of season in the index page

func (*SeasonCMS) NeedVip

func (s *SeasonCMS) NeedVip() bool

NeedVip returns whether the season need vip to watch

type SeasonCard

type SeasonCard struct {
	NewEP *PgcNewEP `json:"new_ep"`
}

SeasonCard is the result structure from PGC API

type SeasonDetail

type SeasonDetail struct {
	Episodes     []*Episode  `json:"episodes"`
	IsNewDanmaku int         `json:"is_new_danmaku"`
	NewestEP     *NewestEP   `json:"newest_ep"`
	Stat         *Stat       `json:"stat"`
	UserStatus   *UserStatus `json:"user_status"`
	Sponsor      *Sponsor    `json:"sponsor"`
	SeriesID     int         `json:"series_id"`
	SnDetailCore
}

SeasonDetail def

type SeasonV2

type SeasonV2 struct {
	IsNew       int    `json:"is_new"`
	SeasonID    int    `json:"season_id"`
	SeasonTitle string `json:"season_title"`
}

SeasonV2 def

type Section

type Section struct {
	Episodes []*EpisodeV2 `json:"episodes"`
}

Section def.

type SimpleRank

type SimpleRank struct {
	ContID   int64
	ContType int
}

SimpleRank picks the necessary fields from tv_rank

func (SimpleRank) IsUGC

func (c SimpleRank) IsUGC() bool

IsUGC returns whether the card is ugc card

type SnAuth

type SnAuth struct {
	ID        int64 `json:"id"`
	IsDeleted int8  `json:"is_deleted"`
	Valid     int   `json:"valid"`
	Check     int8  `json:"check"`
}

SnAuth is the structure of season in mc

func (SnAuth) CanPlay

func (s SnAuth) CanPlay() bool

CanPlay returns whether the season is able to play

func (SnAuth) NotDeleted

func (s SnAuth) NotDeleted() bool

NotDeleted def.

type SnDetailCore

type SnDetailCore struct {
	Cover        string        `json:"cover"`
	Evaluate     string        `json:"evaluate"`
	Link         string        `json:"link"`
	MediaID      int           `json:"media_id"`
	Mode         int           `json:"mode"`
	Paster       *Paster       `json:"paster"`
	Publish      *Publish      `json:"publish"`
	Rating       *Rating       `json:"rating"`
	SeasonID     int64         `json:"season_id"`
	SeasonStatus int           `json:"season_status"`
	SeasonTitle  string        `json:"season_title"`
	SeasonType   int           `json:"season_type"`
	ShareURL     string        `json:"share_url"`
	SquareCover  string        `json:"square_cover"`
	Title        string        `json:"title"`
	TotalEp      int           `json:"total_ep"`
	Rights       *Rights       `json:"rights"`
	StyleLabel   []*ParamStyle `json:"style_label"`
}

SnDetailCore is the common part of pgc media v1 and v2

func (*SnDetailCore) CmsInterv

func (v *SnDetailCore) CmsInterv(snCMS *SeasonCMS)

CmsInterv def.

type SnDetailV2

type SnDetailV2 struct {
	Episodes   []*EpisodeV2  `json:"episodes"`
	NewestEP   *NewEPV2      `json:"new_ep"`
	Stat       *StatV2       `json:"stat"`
	UserStatus *UserStatusV2 `json:"user_status"`
	Seasons    []*SeasonV2   `json:"seasons"`
	Section    []*Section    `json:"section"`
	Type       int           `json:"type"`
	SnDetailCore
}

SnDetailV2 def

func (*SnDetailV2) TypeTrans

func (v *SnDetailV2) TypeTrans()

TypeTrans def.

type SnVipCorner

type SnVipCorner struct {
	Title string `json:"title"`
	Cover string `json:"cover"`
}

SnVipCorner def.

type Sponsor struct {
	List          []*List        `json:"list"`
	PointActivity *PointActivity `json:"point_activity"`
	TotalBpCount  int            `json:"total_bp_count"`
	WeekBpCount   int            `json:"week_bp_count"`
}

Sponsor def

type Stat

type Stat struct {
	Danmakus  int `json:"danmakus"`
	Favorites int `json:"favorites"`
	Views     int `json:"views"`
}

Stat def

type StatV2

type StatV2 struct {
	Coin  int `json:"coin"`
	Reply int `json:"reply"`
	Share int `json:"share"`
	Stat
}

StatV2 def. 3 new fields

type TVEpSeason

type TVEpSeason struct {
	ID         int64
	OriginName string
	Title      string
	Alias      string
	Category   int8
	Desc       string
	Style      string
	Area       string
	PlayTime   time.Time
	Info       int8
	State      int8
	Check      int8
	TotalNum   int32
	Upinfo     string
	Staff      string
	Role       string
	Copyright  string
	Cover      string
	AuditTime  int
	IsDeleted  int8
	Ctime      time.Time
	Mtime      time.Time
	Valid      int8
	InjectTime time.Time
	Reason     string
}

TVEpSeason represents the season table

type Tag

type Tag struct {
	Bottoms   string   `json:"bottoms"`
	Cover     string   `json:"cover"`
	Index     string   `json:"index"`
	OrderType string   `json:"orderType"`
	Seasons   []string `json:"seasons"`
	StyleID   string   `json:"style_id"`
	TagID     string   `json:"tag_id"`
	TagName   string   `json:"tag_name"`
	Tops      string   `json:"tops"`
	Type      string   `json:"type"`
}

Tag is the tag info

type Up

type Up struct {
	Mid string `json:"mid"`
	Up  string `json:"up"`
}

Up is the uploader info

type UserSeason

type UserSeason struct {
	Attention   string `json:"attention"`
	LastEPID    string `json:"last_ep_id"`
	LastEPIndex string `json:"last_ep_index"`
	LastTime    string `json:"last_time"`
}

UserSeason is the user's season info

type UserStatus

type UserStatus struct {
	Follow        int            `json:"follow"`
	IsVip         int            `json:"is_vip"`
	Pay           int            `json:"pay"`
	PayPackPaid   int            `json:"pay_pack_paid"`
	Sponsor       int            `json:"sponsor"`
	WatchProgress *WatchProgress `json:"watch_progress"`
}

UserStatus def

type UserStatusV2

type UserStatusV2 struct {
	Follow   int            `json:"follow"`
	Pay      int            `json:"pay"`
	Progress *WatchProgress `json:"watch_progress"`
	Review   *ReviewV2      `json:"review"`
	Sponsor  int            `json:"sponsor"`
}

UserStatusV2 def.

type VerUpdate

type VerUpdate struct {
	MobiApp string
	Build   int
	Channel string
	Seed    int
	Sdkint  int
	Model   string
	OldID   string
}

VerUpdate Params

type VideoCMS

type VideoCMS struct {
	// Media Info
	CID        int64
	Title      string
	AID        int64
	IndexOrder int
	// Auth Info
	Valid   int
	Deleted int
	Result  int
}

VideoCMS def.

func (*VideoCMS) Auditing

func (s *VideoCMS) Auditing() bool

Auditing returns whether the video is begin audited by the license owner

func (*VideoCMS) CanPlay

func (s *VideoCMS) CanPlay() bool

CanPlay returns whether the arc can play or not

func (*VideoCMS) NotDeleted

func (s *VideoCMS) NotDeleted() bool

NotDeleted def.

type WatchProgress

type WatchProgress struct {
	LastEpID    int    `json:"last_ep_id"`
	LastEPIndex string `json:"last_ep_index"`
	LastTime    int64  `json:"last_time"`
}

WatchProgress def.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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