mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
add data to torrent
This commit is contained in:
@@ -20,7 +20,7 @@ func InitApiHelper(bt *BTServer) {
|
||||
bts = bt
|
||||
}
|
||||
|
||||
func AddTorrent(spec *torrent.TorrentSpec, title, poster string) (*Torrent, error) {
|
||||
func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string) (*Torrent, error) {
|
||||
torr, err := NewTorrent(spec, bts)
|
||||
if err != nil {
|
||||
log.TLogln("error add torrent:", err)
|
||||
@@ -41,6 +41,12 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string) (*Torrent, erro
|
||||
torr.Poster = torDB.Poster
|
||||
}
|
||||
}
|
||||
if torr.Data == "" {
|
||||
torr.Data = data
|
||||
if torr.Data == "" && torDB != nil {
|
||||
torr.Data = torDB.Data
|
||||
}
|
||||
}
|
||||
|
||||
return torr, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user