Update torrentParam.go
Cette révision appartient à :
Parent
ac933b1ec0
révision
67ab9dfa8c
|
@ -48,6 +48,7 @@ type TorrentParam struct {
|
||||||
Dlsite string
|
Dlsite string
|
||||||
VideoQuality string
|
VideoQuality string
|
||||||
Tags Tags
|
Tags Tags
|
||||||
|
Abort bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identifier returns a unique identifier for the struct
|
// Identifier returns a unique identifier for the struct
|
||||||
|
@ -136,6 +137,8 @@ func (p *TorrentParam) FromRequest(c *gin.Context) {
|
||||||
user, _, _, err := users.FindByUsername(username)
|
user, _, _, err := users.FindByUsername(username)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
p.UserID = uint32(user.ID)
|
p.UserID = uint32(user.ID)
|
||||||
|
} else {
|
||||||
|
p.Abort = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// For other functions, we need to set userID in the request query
|
// For other functions, we need to set userID in the request query
|
||||||
|
|
Référencer dans un nouveau ticket