didnt mean to commit this change
Cette révision appartient à :
Parent
25fd880ab8
révision
7f480bd9f5
1 fichiers modifiés avec 0 ajouts et 21 suppressions
|
@ -21,7 +21,6 @@ import (
|
|||
"github.com/NyaaPantsu/nyaa/utils/format"
|
||||
"github.com/NyaaPantsu/nyaa/utils/log"
|
||||
"github.com/NyaaPantsu/nyaa/utils/sanitize"
|
||||
"github.com/anacrolix/torrent"
|
||||
"github.com/bradfitz/slice"
|
||||
"github.com/fatih/structs"
|
||||
)
|
||||
|
@ -454,26 +453,6 @@ func (t *Torrent) Update(unscope bool) (int, error) {
|
|||
return http.StatusOK, nil
|
||||
}
|
||||
|
||||
func (t *Torrent) CreateFileList(Files []torrent.File) ([]File, error) {
|
||||
var createdFilelist []File
|
||||
t.Filesize = 0
|
||||
|
||||
for _, uploadedFile := range Files {
|
||||
file := File{TorrentID: t.ID, Filesize: uploadedFile.Length()}
|
||||
err := file.SetPath(uploadedFile.FileInfo().Path)
|
||||
if err != nil {
|
||||
return []File{}, err
|
||||
}
|
||||
createdFilelist = append(createdFilelist, file)
|
||||
t.Filesize += uploadedFile.Length()
|
||||
ORM.Create(&file)
|
||||
}
|
||||
|
||||
t.FileList = createdFilelist
|
||||
t.Update(false)
|
||||
return createdFilelist, nil
|
||||
}
|
||||
|
||||
// UpdateUnscope : Update a torrent based on model
|
||||
func (t *Torrent) UpdateUnscope() (int, error) {
|
||||
return t.Update(true)
|
||||
|
|
Référencer dans un nouveau ticket