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 {
|
func videoRestartHandler(c echo.Context) error {
|
||||||
id, _ := strconv.Atoi(c.Param("id"))
|
id, _ := strconv.Atoi(c.Param("id"))
|
||||||
var orig Original
|
var orig Original
|
||||||
|
3
main.go
3
main.go
@@ -101,14 +101,13 @@ func main() {
|
|||||||
e.POST("/download", downloadPostHandler, authMiddleware)
|
e.POST("/download", downloadPostHandler, authMiddleware)
|
||||||
e.GET("/videos", videosHandler, authMiddleware)
|
e.GET("/videos", videosHandler, authMiddleware)
|
||||||
e.GET("/video/:id", videoHandler, 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/restart", videoRestartHandler, authMiddleware)
|
||||||
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
|
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
|
||||||
|
e.GET("/temp/:token", tempHandler)
|
||||||
|
|
||||||
staticGroup := e.Group("/data")
|
staticGroup := e.Group("/data")
|
||||||
staticGroup.Use(authMiddleware)
|
staticGroup.Use(authMiddleware)
|
||||||
staticGroup.Static("/", getDataDir())
|
staticGroup.Static("/", getDataDir())
|
||||||
e.GET("/temp/:token", tempHandler)
|
|
||||||
|
|
||||||
secure := getSecure()
|
secure := getSecure()
|
||||||
|
|
||||||
|
@@ -66,9 +66,6 @@
|
|||||||
<button type="submit">Restart</button>
|
<button type="submit">Restart</button>
|
||||||
</form>
|
</form>
|
||||||
{{else if eq .Status "downloading"}}
|
{{else if eq .Status "downloading"}}
|
||||||
<form action="/video/{{.ID}}/cancel" method="post" style="display:inline;">
|
|
||||||
<button type="submit">Cancel</button>
|
|
||||||
</form>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
<form action="/video/{{.ID}}/delete" method="post" style="display:inline;">
|
<form action="/video/{{.ID}}/delete" method="post" style="display:inline;">
|
||||||
<button type="submit">Delete</button>
|
<button type="submit">Delete</button>
|
||||||
|
Reference in New Issue
Block a user