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
|
||||
}
|
||||
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)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
@@ -90,6 +84,10 @@ func stream(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if tor.Title == "" {
|
||||
tor.Title = tor.Name()
|
||||
}
|
||||
|
||||
// save to db
|
||||
if save {
|
||||
torr.SaveTorrentToDB(tor)
|
||||
@@ -169,12 +167,6 @@ func streamNoAuth(c *gin.Context) {
|
||||
data = tor.Data
|
||||
}
|
||||
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)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
@@ -187,6 +179,10 @@ func streamNoAuth(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if tor.Title == "" {
|
||||
tor.Title = tor.Name()
|
||||
}
|
||||
|
||||
// find file
|
||||
index := -1
|
||||
if len(tor.Files()) == 1 {
|
||||
|
||||
Reference in New Issue
Block a user