models

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	JSExt = ".js"
	PyExt = ".py"
)
View Source
const (
	MagnetType  = "magnet"
	TorrentType = "torrent"
)

Variables

This section is empty.

Functions

This section is empty.

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
	ID   int
	Date string
	Ep   int
}

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"`   // 种子大小
}

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 RenameOptions added in v0.5.0

type RenameOptions struct {
	Src            string
	Dst            string
	State          <-chan TorrentState
	RenameCallback func() // 重命名完成后回调
	Callback       func() // 完成重命名所有流程后回调
}

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)
	Progress     float64 `json:"progress"`     //File progress (percentage/100)
	Priority     int     `json:"priority"`     //File priority. See possible values here below
	IsSeed       bool    `json:"is_seed"`      //True if file is seeding/complete
	PieceRange   []int   `json:"piece_range"`  //The first number is the starting piece index and the second number is the ending piece index (inclusive)
	Availability float64 `json:"availability"` //Percentage of file pieces currently available (percentage/100)

	Path string
	Hash string
}

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"`
	// SuperSeeding    bool   `json:"super_seeding"`
	Tags string `json:"tags"`
	// TimeActive      int    `json:"time_active"`
	TotalSize int `json:"total_size"`
}

type TorrentState

type TorrentState string

Jump to

Keyboard shortcuts

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