Documentation ¶
Index ¶
- func AddOrUpdatePin(session *xorm.Session, p *Pin) (e error)
- func AddOrUpdateUnfinished(session *xorm.Session, unfin *Unfinished) (e error)
- func AddOrUpdateVideo(session *xorm.Session, video *Video, ...) (e error)
- func AllPin(session *xorm.Session, limit int, start ...int) (pins *[]*Pin, e error)
- func AllUnfinished(session *xorm.Session, limit int, start ...int) (unfins *[]*Unfinished, e error)
- func AllVideos(session *xorm.Session, limit int, start ...int) (videos *[]*Video, e error)
- func Checksum(filepath string) string
- func DeepFind(session *xorm.Session, s string, videos *[]*Video) (e error)
- func InitDB(db *DatabaseConfig) (eng *xorm.Engine, e error)
- func InitSQLite3(name string) (eng *xorm.Engine, e error)
- func IsExist(session *xorm.Session, table interface{}) bool
- func MustDatabase(engine *xorm.Engine, err error) *xorm.Engine
- func MustSession(session *xorm.Session) *xorm.Session
- func PinHash(path path.Resolved) string
- func Register(name string, table interface{})
- func RegisterTable(v interface{})
- func SQLite3DB(name string) string
- func Sync(db *xorm.Engine) (e error)
- func Tables() []interface{}
- func Top(session *xorm.Session, limit int, start ...int) (videos *[]*Video, e error)
- func UpdatePinVideoID(session *xorm.Session, p *Pin) (e error)
- func Visited(session *xorm.Session, video *Video) (err error)
- type DatabaseConfig
- type Model
- type Modeler
- type Pin
- type SourceInfo
- type SourceInfoDetail
- type SourcePeer
- type SourcePeerDetail
- type Type
- type Unfinished
- type Video
- type VideoGroup
- type VideoLink
- type VideoObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdatePin ¶
AddOrUpdatePin ...
func AddOrUpdateUnfinished ¶
func AddOrUpdateUnfinished(session *xorm.Session, unfin *Unfinished) (e error)
AddOrUpdateUnfinished ...
func AddOrUpdateVideo ¶
func AddOrUpdateVideo(session *xorm.Session, video *Video, checkFn ...func(session *xorm.Session) *xorm.Session) (e error)
AddOrUpdateVideo ...
func AllUnfinished ¶
AllUnfinished ...
func UpdatePinVideoID ¶
UpdatePinVideoID ...
Types ¶
type DatabaseConfig ¶
type DatabaseConfig struct { ShowSQL bool `toml:"show_sql"` ShowExecTime bool `toml:"show_exec_time"` UseCache bool `json:"use_cache"` Type string `toml:"type"` Addr string `toml:"addr"` Port string `toml:"port"` Username string `toml:"username"` Password string `toml:"password"` Schema string `toml:"schema"` Charset string `toml:"charset"` Prefix string `toml:"prefix"` Loc string `toml:"loc"` // contains filtered or unexported fields }
DatabaseConfig ...
func LoadDatabaseConfig ¶
func LoadDatabaseConfig(path string) (db *DatabaseConfig)
LoadDatabaseConfig ...
func (*DatabaseConfig) SetLocation ¶
func (d *DatabaseConfig) SetLocation(loc string)
SetLocation ...
type Model ¶
type Model struct { ID string `xorm:"id pk"` CreatedAt time.Time `xorm:"created_at created"` UpdatedAt time.Time `xorm:"updated_at updated"` DeletedAt *time.Time `xorm:"deleted_at deleted"` Version int `xorm:"version"` }
Model ...
type Pin ¶
type Pin struct { Model `xorm:"extends" json:"-"` PinHash string `xorm:"pin_hash"` PeerID string `xorm:"peer_id"` VideoID string `xorm:"video_id"` IsPinned string `xorm:"is_pinned"` //TODO:status is now not used }
Pin ...
type SourceInfo ¶
type SourceInfo struct { Model `xorm:"extends"` SourceInfoDetail `xorm:"extends"` }
SourceInfo ...
type SourceInfoDetail ¶
type SourceInfoDetail struct { ID string `xorm:"source_id" json:"id"` PublicKey string `json:"public_key"` Addresses []string `xorm:"json" json:"addresses"` //一组节点源列表 AgentVersion string `json:"agent_version"` ProtocolVersion string `json:"protocol_version"` }
SourceInfoDetail ...
type SourcePeer ¶
type SourcePeer struct { Model `xorm:"extends"` Index int SourcePeerDetail `xorm:"extends"` }
SourcePeer ...
type SourcePeerDetail ¶
SourcePeerDetail ...
type Type ¶
type Type string
Type ...
const TypeCaption Type = "caption"
TypeCaption caption file
const TypeOther Type = "other"
TypeOther ...
const TypePoster Type = "poster"
TypePoster ...
const TypeSlice Type = "slice"
TypeSlice ...
const TypeThumb Type = "thumb"
TypeThumb ...
const TypeVideo Type = "video"
TypeVideo ...
type Unfinished ¶
type Unfinished struct { Model `xorm:"extends"` Checksum string `xorm:"default() checksum"` //sum值 Type Type `xorm:"default() type"` //类型 Relate string `xorm:"default()" json:"relate"` //关联信息 Name string `xorm:"default() name"` //名称 Hash string `xorm:"default() hash"` //哈希地址 Sharpness string `xorm:"default()" json:"sharpness"` //清晰度 Caption string `xorm:"default()" json:"caption"` //字幕 Encrypt bool `json:"encrypt"` //加密 Key string `xorm:"default()" json:"key"` //秘钥 M3U8 string `xorm:"m3u8 default()" json:"m3u8"` //M3U8名 SegmentFile string `xorm:"default()" json:"segment_file"` //ts切片名 Sync bool `xorm:"notnull default(0)"` //是否已同步 Object *VideoObject `xorm:"json" json:"object,omitempty"` //视频信息 }
Unfinished 未分类
func FindUnfinished ¶
func FindUnfinished(session *xorm.Session, checksum string) (unfin *Unfinished, e error)
FindUnfinished ...
type Video ¶
type Video struct { Model `xorm:"extends" json:"-"` FindNo string `json:"-"` //查找号 Bangumi string `xorm:"bangumi" json:"bangumi"` //番組 Intro string `xorm:"varchar(2048)" json:"intro"` //简介 Alias []string `xorm:"json" json:"alias"` //别名,片名 ThumbHash string `xorm:"thumb_hash" json:"thumb_hash"` //缩略图 PosterHash string `xorm:"poster_hash" json:"poster_hash"` //海报地址 SourceHash string `xorm:"source_hash" json:"source_hash"` //原片地址 M3U8Hash string `xorm:"m3u8_hash" json:"m3u8_hash"` //切片地址 Key string `json:"-"` //秘钥 M3U8 string `xorm:"m3u8" json:"-"` //M3U8名 Role []string `xorm:"json" json:"role"` //主演 Director string `json:"-"` //导演 Systematics string `json:"-"` //分级 Season string `json:"-"` //季 TotalEpisode string `json:"-"` //总集数 Episode string `json:"-"` //集数 Producer string `json:"-"` //生产商 Publisher string `json:"-"` //发行商 Type string `json:"-"` //类型:film,FanDrama Format string `json:"format"` //输出格式:3D,2D,VR(VR格式:Half-SBS:左右半宽,Half-OU:上下半高,SBS:左右全宽) Language string `json:"-"` //语言 Caption string `json:"-"` //字幕 Group string `json:"-"` //分组 Index string `json:"-"` //索引 Date string `json:"-"` //发行日期 Sharpness string `json:"sharpness"` //清晰度 Visit uint64 `json:"-" xorm:"notnull default(0)"` //访问数 Series string `json:"series"` //系列 Tags []string `xorm:"json" json:"tags"` //标签 Length string `json:"length"` //时长 MagnetLinks []string `json:"-"` //磁链 Uncensored bool `json:"uncensored"` //有码,无码 }
Video ...
type VideoGroup ¶
type VideoGroup struct { Model `xorm:"extends"` Index string `json:"index"` //索引 Checksum string `json:"checksum"` //文件Hash Sliced bool `json:"sliced"` //切片 Encrypt bool `json:"encrypt"` //加密 Key string `json:"key"` //秘钥 M3U8 string `json:"m3u8"` //M3U8名 SegmentFile string `json:"segment_file"` //ts切片名 Object []*VideoObject `xorm:"json" json:"object,omitempty"` //视频信息 }
VideoGroup ...
type VideoLink ¶
type VideoLink struct { Hash string `json:"hash"` Name string `json:"name"` Size uint64 `json:"size"` Type int `json:"type"` }
VideoLink ...
type VideoObject ¶
type VideoObject struct { Links []*VideoLink `json:"links,omitempty"` Link *VideoLink `xorm:"extends" json:",inline,omitempty"` }
VideoObject ...
func (*VideoObject) ParseLinks ¶
func (obj *VideoObject) ParseLinks(links []*shell.Object) *VideoLink
ParseLinks ...
Click to show internal directories.
Click to hide internal directories.