diff options
| author | Felix Hanley <felix@userspace.com.au> | 2018-03-13 11:29:49 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2018-03-13 11:29:49 +0000 |
| commit | 79c6a22d81e6ceadb23636e90e5d53f2a86e090d (patch) | |
| tree | 33776c9bedc99ccd87c1c7061b6195500c05f54d /models/torrent.go | |
| parent | a67075e332458002ce4c56c0aa07e03807dc22ea (diff) | |
| download | dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.gz dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.bz2 | |
Fix tagging and announce callbacks
Diffstat (limited to 'models/torrent.go')
| -rw-r--r-- | models/torrent.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/torrent.go b/models/torrent.go index 4ff3143..6cae23c 100644 --- a/models/torrent.go +++ b/models/torrent.go @@ -3,7 +3,6 @@ package models import ( "bytes" "crypto/sha1" - "encoding/hex" "fmt" "os" "strings" @@ -16,11 +15,12 @@ import ( // Data for persistent storage type Torrent struct { ID int `json:"-"` - Infohash string `json:"infohash"` + Infohash Infohash `json:"infohash"` Name string `json:"name"` Files []File `json:"files" db:"-"` Size int `json:"size"` - Seen time.Time `json:"seen"` + Updated time.Time `json:"updated"` + Created time.Time `json:"created"` Tags []string `json:"tags" db:"-"` } @@ -52,7 +52,7 @@ func TorrentFromMetadata(ih Infohash, md []byte) (*Torrent, error) { } bt := Torrent{ - Infohash: hex.EncodeToString([]byte(ih)), + Infohash: ih, Name: name, } |
