Remove cancel
This commit is contained in:
12
handlers.go
12
handlers.go
@@ -756,18 +756,6 @@ func videoHandler(c echo.Context) error {
|
||||
})
|
||||
}
|
||||
|
||||
func videoCancelHandler(c echo.Context) error {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
var video Video
|
||||
if err := db.First(&video, id).Error; err != nil {
|
||||
return c.Redirect(http.StatusSeeOther, "/videos")
|
||||
}
|
||||
|
||||
// Cancel the download (this is a simplified version, you might need to implement a more robust cancellation mechanism)
|
||||
|
||||
return c.Redirect(http.StatusSeeOther, "/videos")
|
||||
}
|
||||
|
||||
func videoRestartHandler(c echo.Context) error {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
var orig Original
|
||||
|
3
main.go
3
main.go
@@ -101,14 +101,13 @@ func main() {
|
||||
e.POST("/download", downloadPostHandler, authMiddleware)
|
||||
e.GET("/videos", videosHandler, authMiddleware)
|
||||
e.GET("/video/:id", videoHandler, authMiddleware)
|
||||
e.POST("/video/:id/cancel", videoCancelHandler, authMiddleware)
|
||||
e.POST("/video/:id/restart", videoRestartHandler, authMiddleware)
|
||||
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
|
||||
e.GET("/temp/:token", tempHandler)
|
||||
|
||||
staticGroup := e.Group("/data")
|
||||
staticGroup.Use(authMiddleware)
|
||||
staticGroup.Static("/", getDataDir())
|
||||
e.GET("/temp/:token", tempHandler)
|
||||
|
||||
secure := getSecure()
|
||||
|
||||
|
@@ -66,9 +66,6 @@
|
||||
<button type="submit">Restart</button>
|
||||
</form>
|
||||
{{else if eq .Status "downloading"}}
|
||||
<form action="/video/{{.ID}}/cancel" method="post" style="display:inline;">
|
||||
<button type="submit">Cancel</button>
|
||||
</form>
|
||||
{{end}}
|
||||
<form action="/video/{{.ID}}/delete" method="post" style="display:inline;">
|
||||
<button type="submit">Delete</button>
|
||||
|
Reference in New Issue
Block a user