mirror of
https://github.com/zoriya/tide.git
synced 2026-06-05 03:30:07 +00:00
Create a basic addItem
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package models
|
||||
|
||||
type ItemType string
|
||||
|
||||
const (
|
||||
Torrent ItemType = "torrent"
|
||||
Magnet ItemType = "magnet"
|
||||
Direct ItemType = "direct"
|
||||
)
|
||||
|
||||
type NewItem struct {
|
||||
Uri string
|
||||
Type *ItemType
|
||||
Path *string
|
||||
}
|
||||
+44
-17
@@ -1,30 +1,57 @@
|
||||
package models
|
||||
|
||||
import "time";
|
||||
import "time"
|
||||
|
||||
type State string
|
||||
|
||||
const (
|
||||
Stale State = "stale"
|
||||
Stale State = "stale"
|
||||
Downloading State = "downloading"
|
||||
Seeding State = "seeding"
|
||||
Finished State = "finished"
|
||||
Seeding State = "seeding"
|
||||
Finished State = "finished"
|
||||
Paused State = "paused"
|
||||
Errored State = "errored"
|
||||
)
|
||||
|
||||
type Priority string
|
||||
|
||||
const (
|
||||
None Priority = "none"
|
||||
Low Priority = "low"
|
||||
Medium Priority = "medium"
|
||||
High Priority = "high"
|
||||
)
|
||||
|
||||
type File struct {
|
||||
Name string
|
||||
Priority int
|
||||
Size uint64
|
||||
AvailableSize uint64
|
||||
Path string
|
||||
Index uint `json:"index"`
|
||||
Name string `json:"name"`
|
||||
Priority Priority `json:"priority"`
|
||||
Size uint64 `json:"size"`
|
||||
AvailableSize uint64 `json:"availableSize"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
Id string
|
||||
Name string
|
||||
State State
|
||||
Size uint64
|
||||
AvailableSize uint64
|
||||
Path string
|
||||
AddedDate time.Time
|
||||
Files []File
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
AddedDate time.Time `json:"addedDate"`
|
||||
Files []File `json:"files"`
|
||||
|
||||
State State `json:"state"`
|
||||
Size uint64 `json:"size"`
|
||||
AvailableSize uint64 `json:"availableSize"`
|
||||
UploadedSize uint64 `json:"uploadedSize"`
|
||||
// Hexadecimal representation of the download progress.
|
||||
// The highest bit corresponds to the piece at index 0. Any set bits indicate loaded pieces,
|
||||
// while unset bits indicate not yet loaded and/or missing pieces.
|
||||
// Any overflow bits at the end are set to zero.
|
||||
// When the download was not started yet, this will be an empty string.
|
||||
BitField string `json:"bitfield"`
|
||||
DownloadSpeed uint `json:"downloadSpeed"`
|
||||
UploadSpeed uint `json:"uploadSpeed"`
|
||||
SeedCount uint `json:"seedCount"`
|
||||
Connections uint `json:"connections"`
|
||||
|
||||
ErrorMessage *string `json:"errorMessage"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user