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:
@@ -21,6 +21,7 @@ type torrReqJS struct {
|
||||
Link string `json:"link,omitempty"`
|
||||
Hash string `json:"hash,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Category string `json:"category,omitempty"`
|
||||
Poster string `json:"poster,omitempty"`
|
||||
Data string `json:"data,omitempty"`
|
||||
SaveToDB bool `json:"save_to_db,omitempty"`
|
||||
@@ -90,7 +91,10 @@ func addTorrent(req torrReqJS, c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
tor, err := torr.AddTorrent(torrSpec, req.Title, req.Poster, req.Data)
|
||||
tor, err := torr.AddTorrent(torrSpec, req.Title, req.Poster, req.Data, req.Category)
|
||||
|
||||
log.TLogln("Final torrent category: ", tor.Category)
|
||||
|
||||
if err != nil {
|
||||
log.TLogln("error add torrent:", err)
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
|
||||
Reference in New Issue
Block a user