mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
Add category associated to each torrent
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
// @Param file formData file true "Torrent file to insert"
|
||||
// @Param save formData string false "Save to DB"
|
||||
// @Param title formData string false "Torrent title"
|
||||
// @Param category formData string false "Torrent category"
|
||||
// @Param poster formData string false "Torrent poster"
|
||||
// @Param data formData string false "Torrent data"
|
||||
//
|
||||
@@ -41,6 +42,10 @@ func torrentUpload(c *gin.Context) {
|
||||
if len(form.Value["title"]) > 0 {
|
||||
title = form.Value["title"][0]
|
||||
}
|
||||
category := ""
|
||||
if len(form.Value["category"]) > 0 {
|
||||
category = form.Value["category"][0]
|
||||
}
|
||||
poster := ""
|
||||
if len(form.Value["poster"]) > 0 {
|
||||
poster = form.Value["poster"][0]
|
||||
@@ -66,7 +71,7 @@ func torrentUpload(c *gin.Context) {
|
||||
continue
|
||||
}
|
||||
|
||||
tor, err = torr.AddTorrent(spec, title, poster, data)
|
||||
tor, err = torr.AddTorrent(spec, title, poster, data, category)
|
||||
if err != nil {
|
||||
log.TLogln("error upload torrent:", err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user