mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
remove title from fname
This commit is contained in:
@@ -72,12 +72,6 @@ func stream(c *gin.Context) {
|
|||||||
data = tor.Data
|
data = tor.Data
|
||||||
}
|
}
|
||||||
if tor == nil || tor.Stat == state.TorrentInDB {
|
if tor == nil || tor.Stat == state.TorrentInDB {
|
||||||
if title == "" {
|
|
||||||
title = c.Param("fname")
|
|
||||||
title, _ = url.PathUnescape(title)
|
|
||||||
title = strings.TrimLeft(title, "/")
|
|
||||||
}
|
|
||||||
|
|
||||||
tor, err = torr.AddTorrent(spec, title, poster, data)
|
tor, err = torr.AddTorrent(spec, title, poster, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusInternalServerError, err)
|
c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
@@ -90,6 +84,10 @@ func stream(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tor.Title == "" {
|
||||||
|
tor.Title = tor.Name()
|
||||||
|
}
|
||||||
|
|
||||||
// save to db
|
// save to db
|
||||||
if save {
|
if save {
|
||||||
torr.SaveTorrentToDB(tor)
|
torr.SaveTorrentToDB(tor)
|
||||||
@@ -169,12 +167,6 @@ func streamNoAuth(c *gin.Context) {
|
|||||||
data = tor.Data
|
data = tor.Data
|
||||||
}
|
}
|
||||||
if tor == nil || tor.Stat == state.TorrentInDB {
|
if tor == nil || tor.Stat == state.TorrentInDB {
|
||||||
if title == "" {
|
|
||||||
title = c.Param("fname")
|
|
||||||
title, _ = url.PathUnescape(title)
|
|
||||||
title = strings.TrimLeft(title, "/")
|
|
||||||
}
|
|
||||||
|
|
||||||
tor, err = torr.AddTorrent(spec, title, poster, data)
|
tor, err = torr.AddTorrent(spec, title, poster, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusInternalServerError, err)
|
c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
@@ -187,6 +179,10 @@ func streamNoAuth(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tor.Title == "" {
|
||||||
|
tor.Title = tor.Name()
|
||||||
|
}
|
||||||
|
|
||||||
// find file
|
// find file
|
||||||
index := -1
|
index := -1
|
||||||
if len(tor.Files()) == 1 {
|
if len(tor.Files()) == 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user