feat: transmission use hash instead of id

This commit is contained in:
Simon Ding
2024-09-20 10:45:10 +08:00
parent e4e3c9a851
commit 4f3e3e399d
4 changed files with 15 additions and 14 deletions

View File

@@ -107,7 +107,7 @@ func (s *Server) GetMediaDownloadHistory(c *gin.Context) (interface{}, error) {
type TorrentInfo struct {
Name string `json:"name"`
ID int64 `json:"id"`
ID string `json:"id"`
SeedRatio float32 `json:"seed_ratio"`
Progress int `json:"progress"`
}
@@ -128,7 +128,7 @@ func (s *Server) GetAllTorrents(c *gin.Context) (interface{}, error) {
}
infos = append(infos, TorrentInfo{
Name: t.Name(),
ID: t.ID,
ID: t.Hash,
Progress: t.Progress(),
})
}