mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: aria2 RPC retry / return NoT_FOUND error while listing not existed path
This commit is contained in:
@@ -92,3 +92,14 @@ func ListDownloading(c *gin.Context) {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
// ListFinished 获取已完成的任务
|
||||
func ListFinished(c *gin.Context) {
|
||||
var service aria2.DownloadListService
|
||||
if err := c.ShouldBindQuery(&service); err == nil {
|
||||
res := service.Finished(c, CurrentUser(c))
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,3 +341,14 @@ func GetUploadCredential(c *gin.Context) {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
// SearchFile 搜索文件
|
||||
func SearchFile(c *gin.Context) {
|
||||
var service explorer.ItemDecompressService
|
||||
if err := c.ShouldBindJSON(&service); err == nil {
|
||||
res := service.CreateDecompressTask(c)
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +271,8 @@ func InitMasterRouter() *gin.Engine {
|
||||
file.POST("compress", controllers.Compress)
|
||||
// 创建文件解压缩任务
|
||||
file.POST("decompress", controllers.Decompress)
|
||||
// 创建文件解压缩任务
|
||||
file.GET("search/:type/:keywords", controllers.SearchFile)
|
||||
}
|
||||
|
||||
// 离线下载任务
|
||||
@@ -286,6 +288,8 @@ func InitMasterRouter() *gin.Engine {
|
||||
aria2.DELETE("task/:gid", controllers.CancelAria2Download)
|
||||
// 获取正在下载中的任务
|
||||
aria2.GET("downloading", controllers.ListDownloading)
|
||||
// 获取已完成的任务
|
||||
aria2.GET("finished", controllers.ListFinished)
|
||||
}
|
||||
|
||||
// 目录
|
||||
|
||||
Reference in New Issue
Block a user