Add category associated to each torrent

This commit is contained in:
LIAUD Corentin
2023-11-22 14:08:10 +01:00
parent 286609acec
commit 8c92856595
22 changed files with 171 additions and 70 deletions

View File

@@ -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)