prepare for release
This commit is contained in:
@@ -53,7 +53,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent, t
|
||||
// TODO: trigger a re-add for the file
|
||||
// It is selected but no link is available
|
||||
// I think this is handled on the manager side so we just need to refresh
|
||||
t.RefreshInfo(torrent.ID)
|
||||
// t.RefreshInfo(torrent.ID)
|
||||
continue
|
||||
}
|
||||
filename := filepath.Base(file.Path)
|
||||
|
||||
@@ -297,6 +297,15 @@ func (t *TorrentManager) writeToFile(torrentID string, torrent *Torrent) {
|
||||
|
||||
func (t *TorrentManager) readFromFile(torrentID string) *Torrent {
|
||||
filePath := fmt.Sprintf("data/%s.bin", torrentID)
|
||||
fileInfo, err := os.Stat(filePath)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if time.Since(fileInfo.ModTime()) > time.Duration(t.config.GetCacheTimeHours())*time.Hour {
|
||||
return nil
|
||||
}
|
||||
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user