This commit is contained in:
YouROK
2020-12-04 23:37:01 +03:00
parent 9cf6b6f03e
commit 30604c6e94
3 changed files with 8 additions and 7 deletions

View File

@@ -42,10 +42,6 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string) (*Torrent, erro
}
}
if torr.Title == "" {
torr.Title = torr.Name()
}
return torr, nil
}

View File

@@ -14,8 +14,14 @@ func AddTorrentDB(torr *Torrent) {
t.TorrentSpec = torr.TorrentSpec
t.Name = torr.Name()
t.Title = torr.Title
if t.Title == "" {
t.Title = t.Name
}
t.Poster = torr.Poster
t.Size = torr.Size
if t.Size == 0 && torr.Torrent != nil {
t.Size = torr.Torrent.Length()
}
t.Timestamp = time.Now().Unix()
settings.AddTorrent(t)
}

File diff suppressed because one or more lines are too long