feat: better seeding status

This commit is contained in:
Simon Ding
2024-08-11 23:09:34 +08:00
parent a0e211c328
commit 6fd39d818c
9 changed files with 57 additions and 49 deletions

View File

@@ -33,7 +33,7 @@ func (c *Client) Init() {
}
func (c *Client) reloadTasks() {
allTasks := c.db.GetHistories()
allTasks := c.db.GetRunningHistories()
for _, t := range allTasks {
torrent, err := transmission.ReloadTorrent(t.Saved)
if err != nil {
@@ -78,8 +78,7 @@ func (c *Client) MustTMDB() *tmdb.Client {
return t
}
func (c *Client) RemoveTaskAndTorrent(id int)error {
func (c *Client) RemoveTaskAndTorrent(id int) error {
torrent := c.tasks[id]
if torrent != nil {
if err := torrent.Remove(); err != nil {
@@ -92,4 +91,4 @@ func (c *Client) RemoveTaskAndTorrent(id int)error {
func (c *Client) GetTasks() map[int]*Task {
return c.tasks
}
}