mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-11 07:46:37 +08:00
fix subscription existing torrent tracking
This commit is contained in:
@@ -62,9 +62,15 @@ func (d *DownloadService) AddDownloadWithMeta(ctx context.Context, userID, urlSt
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if strings.TrimSpace(req.meta.SubscriptionID) != "" {
|
||||
return task, nil
|
||||
}
|
||||
return task, ErrDownloadAlreadyExists
|
||||
}
|
||||
if err := d.addPreparedDownloadToClient(ctx, urlStr, &req); err != nil {
|
||||
if errors.Is(err, ErrDownloadAlreadyExists) && strings.TrimSpace(req.meta.SubscriptionID) != "" {
|
||||
return d.createTask(ctx, userID, urlStr, req.savePath, req.meta)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return d.createTask(ctx, userID, urlStr, req.savePath, req.meta)
|
||||
|
||||
Reference in New Issue
Block a user