models

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagnetType  = "magnet"
	TorrentType = "torrent"
)

Variables

This section is empty.

Functions

func Filename added in v0.7.1

func Filename(filename string) string

func Format added in v0.7.1

func Format(format string, p map[string]any) string

func Md5Str added in v0.7.1

func Md5Str(str string) string

Types

type AnimeEntity

type AnimeEntity struct {
	ID           int    `json:"id"`            // bangumi id
	ThemoviedbID int    `json:"themoviedb_id"` // themoviedb ID
	MikanID      int    `json:"mikan_id"`      // [暂时无用] rss id
	Name         string `json:"name"`          // 名称,从bgm获取
	NameCN       string `json:"name_cn"`       // 中文名称,从bgm获取
	Season       int    `json:"season"`        // 当前季,从themoviedb获取
	Ep           int    `json:"ep"`            // 当前集,从下载文件名解析
	Eps          int    `json:"eps"`           // [暂时无用] 总集数,从bgm获取
	AirDate      string `json:"air_date"`      // 最初播放日期,从bgm获取
	*DownloadInfo
}

AnimeEntity 动画信息结构体

必须要有的值
  NameCN: 用于保存文件名,可用 Name 和 ID 替代
  Season: 用于保存文件名
  Ep: 用于保存文件名
可选值
  ID: bangumi id,用于生成nfo文件
  ThemoviedbID: themoviedb id,用于生成nfo文件

func (*AnimeEntity) DirName

func (b *AnimeEntity) DirName() string

func (*AnimeEntity) FileName

func (b *AnimeEntity) FileName() string

func (*AnimeEntity) FullName

func (b *AnimeEntity) FullName() string

func (*AnimeEntity) Meta

func (b *AnimeEntity) Meta() string

type AnimeParseOptions

type AnimeParseOptions struct {
	Url    string
	Name   string
	Parsed *TitleParsed
}

type ClientAddOptions

type ClientAddOptions struct {
	Urls        []string
	SavePath    string
	Category    string
	Tag         string
	SeedingTime int    // 分钟
	Rename      string // 保存名字
}

type ClientDeleteOptions

type ClientDeleteOptions struct {
	Hash       []string
	DeleteFile bool
}

type ClientGetOptions

type ClientGetOptions struct {
	Hash string
	Item *TorrentItem
}

type ClientListOptions

type ClientListOptions struct {
	Status   string
	Category string
	Tag      string
}

type DownloadInfo added in v0.4.3

type DownloadInfo struct {
	Url  string `json:"url"`  // 当前集下载链接
	Hash string `json:"hash"` // 当前集Hash,唯一ID
}

type DownloadStatus added in v0.5.0

type DownloadStatus struct {
	Hash     string       `json:"hash"`
	State    TorrentState `json:"state"`
	Path     string       `json:"path"`      // 文件存储相对
	ExpireAt int64        `json:"expire_at"` // 过期时间

	Init       bool `json:"init"`       // 是否初始化
	Renamed    bool `json:"renamed"`    // 是否已重命名/移动
	Downloaded bool `json:"downloaded"` // 是否已下载完成
	Seeded     bool `json:"seeded"`     // 是否做种
	Scraped    bool `json:"scraped"`    // 是否已经完成搜刮
}

type FeedItem

type FeedItem struct {
	Url        string       `json:"url"`      // Link,详情页连接,用于下一步解析番剧信息
	Name       string       `json:"name"`     // 种子名
	Date       string       `json:"date"`     // 发布日期
	Type       string       `json:"type"`     // 下载类型,[application/x-bittorrent]
	Download   string       `json:"download"` // 下载链接
	Length     int64        `json:"length"`   // 种子大小
	NameParsed *TitleParsed // 标题解析信息
}

func (FeedItem) DownloadType added in v0.4.3

func (i FeedItem) DownloadType() string

DownloadType

@Description: 下载链接类型,[torrent, magnet, unknown]
@receiver FeedItem
@return string

func (FeedItem) Hash

func (i FeedItem) Hash() string

Hash

@Description: torrent 类型的hash
@receiver FeedItem
@return string

type Object added in v0.6.0

type Object map[string]any

Object 对象类型

type Plugin added in v0.6.5

type Plugin struct {
	Enable bool   `yaml:"enable" json:"enable"`
	Type   string `yaml:"type" json:"type"`
	File   string `yaml:"file" json:"file"`
}

type PluginExecuteOptions added in v0.6.7

type PluginExecuteOptions struct {
	File            string
	SkipSchemaCheck bool
}

type PluginFunctionOptions added in v0.7.1

type PluginFunctionOptions struct {
	Name            string
	ParamsSchema    []string
	ResultSchema    []string
	SkipSchemaCheck bool
}

type PluginLoadOptions added in v0.7.1

type PluginLoadOptions struct {
	File      string
	Functions []*PluginFunctionOptions
	Variables []*PluginVariableOptions
}

type PluginVariableOptions added in v0.7.1

type PluginVariableOptions struct {
	Name     string
	Nullable bool
}

type TitleParsed added in v0.6.5

type TitleParsed struct {
	TitleRaw   string `json:"title_raw"`
	Name       string `json:"title_jp"`
	NameCN     string `json:"title_zh"`
	NameEN     string `json:"title_en"`
	Season     int    `json:"season"`
	SeasonRaw  string `json:"season_raw"`
	Ep         int    `json:"episode"`
	Sub        string `json:"sub"`
	Group      string `json:"group"`
	Definition string `json:"resolution"`
	Source     string `json:"source"`
}

type TorrentContentItem

type TorrentContentItem struct {
	// Index        int     `json:"index"`        //File index
	Name string `json:"name"` //File name (including relative path)
	Size int    `json:"size"` //File size (bytes)

}

type TorrentItem

type TorrentItem struct {
	// AddedOn      int     `json:"added_on"`
	// AmountLeft   int     `json:"amount_left"`
	// AutoTmm      bool    `json:"auto_tmm"`
	// Availability float64 `json:"availability"`
	// Category     string  `json:"category"`
	// Completed         int     `json:"completed"`
	// CompletionOn      int     `json:"completion_on"`
	ContentPath string `json:"content_path"`
	// DlLimit           int    `json:"dl_limit"`
	// Dlspeed           int    `json:"dlspeed"`
	// Downloaded        int    `json:"downloaded"`
	// DownloadedSession int    `json:"downloaded_session"`
	// Eta               int    `json:"eta"`
	// FLPiecePrio       bool    `json:"f_l_piece_prio"`
	// ForceStart        bool    `json:"force_start"`
	Hash string `json:"hash"`
	// LastActivity     int     `json:"last_activity"`
	// MagnetUri string `json:"magnet_uri"`
	// MaxRatio         float64 `json:"max_ratio"`
	// MaxSeedingTime int    `json:"max_seeding_time"`
	Name string `json:"name"`
	// NumComplete      int     `json:"num_complete"`
	// NumIncomplete    int     `json:"num_incomplete"`
	// NumLeechs        int     `json:"num_leechs"`
	// NumSeeds         int     `json:"num_seeds"`
	// Priority         int     `json:"priority"`
	Progress float64 `json:"progress"`
	// Ratio            float64 `json:"ratio"`
	// RatioLimit       float64 `json:"ratio_limit"`
	// SavePath         string  `json:"save_path"`
	// SeedingTime      int     `json:"seeding_time"`
	// SeedingTimeLimit int     `json:"seeding_time_limit"`
	// SeenComplete     int     `json:"seen_complete"`
	// SeqDl            bool    `json:"seq_dl"`
	// Size  int    `json:"size"`
	State string `json:"state"`
}

type TorrentState

type TorrentState string

Jump to

Keyboard shortcuts

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