Set time by ended or added correctly
This commit is contained in:
@@ -365,6 +365,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
selectedFiles = append(selectedFiles, &File{
|
||||
File: file,
|
||||
Added: info.Added,
|
||||
Ended: info.Ended,
|
||||
Link: "", // no link yet
|
||||
ZurgFS: hashStringToFh(file.Path + info.Hash),
|
||||
})
|
||||
@@ -495,6 +496,7 @@ func (t *TorrentManager) organizeChaos(links []string, selectedFiles []*File) ([
|
||||
}
|
||||
if !found {
|
||||
if result.Response.Streamable == 1 {
|
||||
now := time.Now().Format(time.RFC3339)
|
||||
selectedFiles = append(selectedFiles, &File{
|
||||
File: realdebrid.File{
|
||||
ID: math.MaxInt32,
|
||||
@@ -502,7 +504,8 @@ func (t *TorrentManager) organizeChaos(links []string, selectedFiles []*File) ([
|
||||
Bytes: result.Response.Filesize,
|
||||
Selected: 1,
|
||||
},
|
||||
Added: time.Now().Format(time.RFC3339),
|
||||
Added: now,
|
||||
Ended: now,
|
||||
Link: result.Response.Link,
|
||||
ZurgFS: hashStringToFh(result.Response.Filename),
|
||||
})
|
||||
@@ -593,6 +596,7 @@ func (t *TorrentManager) Repair(accessKey string) {
|
||||
fileCopy := &File{
|
||||
File: file.File,
|
||||
Added: file.Added,
|
||||
Ended: file.Ended,
|
||||
Link: file.Link,
|
||||
ZurgFS: file.ZurgFS,
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ func (t *Torrent) InProgress() bool {
|
||||
type File struct {
|
||||
realdebrid.File
|
||||
Added string
|
||||
Ended string
|
||||
Link string
|
||||
ZurgFS uint64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user