mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
Final work to add torrents categories
This commit is contained in:
@@ -114,7 +114,7 @@ func GetTorrent(hashHex string) *Torrent {
|
||||
return tor
|
||||
}
|
||||
|
||||
func SetTorrent(hashHex, title, poster, data string) *Torrent {
|
||||
func SetTorrent(hashHex, title, poster, category string, data string) *Torrent {
|
||||
hash := metainfo.NewHashFromHex(hashHex)
|
||||
torr := bts.GetTorrent(hash)
|
||||
torrDb := GetTorrentDB(hash)
|
||||
@@ -133,12 +133,14 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent {
|
||||
}
|
||||
torr.Title = title
|
||||
torr.Poster = poster
|
||||
torr.Category = category
|
||||
torr.Data = data
|
||||
}
|
||||
|
||||
if torrDb != nil {
|
||||
torrDb.Title = title
|
||||
torrDb.Poster = poster
|
||||
torrDb.Category = category
|
||||
torrDb.Data = data
|
||||
AddTorrentDB(torrDb)
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ func ListTorrentsDB() map[metainfo.Hash]*Torrent {
|
||||
torr.Poster = db.Poster
|
||||
torr.Timestamp = db.Timestamp
|
||||
torr.Size = db.Size
|
||||
torr.Category = db.Category
|
||||
torr.Data = db.Data
|
||||
torr.Stat = state.TorrentInDB
|
||||
ret[torr.TorrentSpec.InfoHash] = torr
|
||||
|
||||
@@ -153,7 +153,7 @@ func setTorrent(req torrReqJS, c *gin.Context) {
|
||||
c.AbortWithError(http.StatusBadRequest, errors.New("hash is empty"))
|
||||
return
|
||||
}
|
||||
torr.SetTorrent(req.Hash, req.Title, req.Poster, req.Data)
|
||||
torr.SetTorrent(req.Hash, req.Title, req.Poster, req.Category, req.Data)
|
||||
c.Status(200)
|
||||
}
|
||||
|
||||
|
||||
@@ -118,20 +118,20 @@ var Mstile150x150png []byte
|
||||
//go:embed pages/site.webmanifest
|
||||
var Sitewebmanifest []byte
|
||||
|
||||
//go:embed pages/static/js/2.916c2545.chunk.js
|
||||
var Staticjs2916c2545chunkjs []byte
|
||||
//go:embed pages/static/js/2.00261e25.chunk.js
|
||||
var Staticjs200261e25chunkjs []byte
|
||||
|
||||
//go:embed pages/static/js/2.916c2545.chunk.js.LICENSE.txt
|
||||
var Staticjs2916c2545chunkjsLICENSEtxt []byte
|
||||
//go:embed pages/static/js/2.00261e25.chunk.js.LICENSE.txt
|
||||
var Staticjs200261e25chunkjsLICENSEtxt []byte
|
||||
|
||||
//go:embed pages/static/js/2.916c2545.chunk.js.map
|
||||
var Staticjs2916c2545chunkjsmap []byte
|
||||
//go:embed pages/static/js/2.00261e25.chunk.js.map
|
||||
var Staticjs200261e25chunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/main.55f380e1.chunk.js
|
||||
var Staticjsmain55f380e1chunkjs []byte
|
||||
//go:embed pages/static/js/main.4f4f0915.chunk.js
|
||||
var Staticjsmain4f4f0915chunkjs []byte
|
||||
|
||||
//go:embed pages/static/js/main.55f380e1.chunk.js.map
|
||||
var Staticjsmain55f380e1chunkjsmap []byte
|
||||
//go:embed pages/static/js/main.4f4f0915.chunk.js.map
|
||||
var Staticjsmain4f4f0915chunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/runtime-main.f542387e.js
|
||||
var Staticjsruntimemainf542387ejs []byte
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"files": {
|
||||
"main.js": "/static/js/main.55f380e1.chunk.js",
|
||||
"main.js.map": "/static/js/main.55f380e1.chunk.js.map",
|
||||
"main.js": "/static/js/main.4f4f0915.chunk.js",
|
||||
"main.js.map": "/static/js/main.4f4f0915.chunk.js.map",
|
||||
"runtime-main.js": "/static/js/runtime-main.f542387e.js",
|
||||
"runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map",
|
||||
"static/js/2.916c2545.chunk.js": "/static/js/2.916c2545.chunk.js",
|
||||
"static/js/2.916c2545.chunk.js.map": "/static/js/2.916c2545.chunk.js.map",
|
||||
"static/js/2.00261e25.chunk.js": "/static/js/2.00261e25.chunk.js",
|
||||
"static/js/2.00261e25.chunk.js.map": "/static/js/2.00261e25.chunk.js.map",
|
||||
"index.html": "/index.html",
|
||||
"static/js/2.916c2545.chunk.js.LICENSE.txt": "/static/js/2.916c2545.chunk.js.LICENSE.txt"
|
||||
"static/js/2.00261e25.chunk.js.LICENSE.txt": "/static/js/2.00261e25.chunk.js.LICENSE.txt"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.f542387e.js",
|
||||
"static/js/2.916c2545.chunk.js",
|
||||
"static/js/main.55f380e1.chunk.js"
|
||||
"static/js/2.00261e25.chunk.js",
|
||||
"static/js/main.4f4f0915.chunk.js"
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -207,7 +207,7 @@ func RouteWebPages(route gin.IRouter) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Browserconfigxml))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/xml; charset=utf-8", Browserconfigxml)
|
||||
c.Data(200, "text/xml; charset=utf-8", Browserconfigxml)
|
||||
})
|
||||
|
||||
route.GET("/dlnaicon-120.png", func(c *gin.Context) {
|
||||
@@ -280,46 +280,46 @@ func RouteWebPages(route gin.IRouter) {
|
||||
c.Data(200, "application/manifest+json", Sitewebmanifest)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.916c2545.chunk.js", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjs))
|
||||
route.GET("/static/js/2.00261e25.chunk.js", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjs))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjs2916c2545chunkjs)
|
||||
c.Data(200, "text/javascript; charset=utf-8", Staticjs200261e25chunkjs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.916c2545.chunk.js.LICENSE.txt", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjsLICENSEtxt))
|
||||
route.GET("/static/js/2.00261e25.chunk.js.LICENSE.txt", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjsLICENSEtxt))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "text/plain; charset=utf-8", Staticjs2916c2545chunkjsLICENSEtxt)
|
||||
c.Data(200, "text/plain; charset=utf-8", Staticjs200261e25chunkjsLICENSEtxt)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.916c2545.chunk.js.map", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjsmap))
|
||||
route.GET("/static/js/2.00261e25.chunk.js.map", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjsmap))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/json", Staticjs2916c2545chunkjsmap)
|
||||
c.Data(200, "application/json", Staticjs200261e25chunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.55f380e1.chunk.js", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain55f380e1chunkjs))
|
||||
route.GET("/static/js/main.4f4f0915.chunk.js", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain4f4f0915chunkjs))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsmain55f380e1chunkjs)
|
||||
c.Data(200, "text/javascript; charset=utf-8", Staticjsmain4f4f0915chunkjs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.55f380e1.chunk.js.map", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain55f380e1chunkjsmap))
|
||||
route.GET("/static/js/main.4f4f0915.chunk.js.map", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain4f4f0915chunkjsmap))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/json", Staticjsmain55f380e1chunkjsmap)
|
||||
c.Data(200, "application/json", Staticjsmain4f4f0915chunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) {
|
||||
etag := fmt.Sprintf("%x", md5.Sum(Staticjsruntimemainf542387ejs))
|
||||
c.Header("Cache-Control", "public, max-age=31536000")
|
||||
c.Header("ETag", etag)
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsruntimemainf542387ejs)
|
||||
c.Data(200, "text/javascript; charset=utf-8", Staticjsruntimemainf542387ejs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/runtime-main.f542387e.js.map", func(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user