mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
add title and poster to upload
This commit is contained in:
@@ -20,6 +20,14 @@ func torrentUpload(c *gin.Context) {
|
|||||||
|
|
||||||
save := len(form.Value["save"]) > 0
|
save := len(form.Value["save"]) > 0
|
||||||
var retList []*state.TorrentStatus
|
var retList []*state.TorrentStatus
|
||||||
|
title := ""
|
||||||
|
if len(form.Value["title"]) > 0 {
|
||||||
|
title = form.Value["title"][0]
|
||||||
|
}
|
||||||
|
poster := ""
|
||||||
|
if len(form.Value["poster"]) > 0 {
|
||||||
|
poster = form.Value["poster"][0]
|
||||||
|
}
|
||||||
|
|
||||||
for name, file := range form.File {
|
for name, file := range form.File {
|
||||||
log.TLogln("add torrent file", name)
|
log.TLogln("add torrent file", name)
|
||||||
@@ -37,7 +45,7 @@ func torrentUpload(c *gin.Context) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
tor, err := torr.AddTorrent(spec, "", "")
|
tor, err := torr.AddTorrent(spec, title, poster)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.TLogln("error upload torrent:", err)
|
log.TLogln("error upload torrent:", err)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user