fix(downloads): support Transmission and aria2 end to end

Fixes #65
This commit is contained in:
ShukeBta
2026-08-10 21:04:04 +08:00
parent c0d743d89d
commit 42ef19b7e5
43 changed files with 2350 additions and 480 deletions
+4 -1
View File
@@ -35,7 +35,10 @@ func (r *DownloadClientRepository) FindByID(ctx context.Context, id string) (*mo
// FindDefault returns the default download client, or (nil, nil).
func (r *DownloadClientRepository) FindDefault(ctx context.Context) (*model.DownloadClient, error) {
var c model.DownloadClient
err := r.db.WithContext(ctx).Where("is_default = ? AND enabled = ?", true, true).First(&c).Error
err := r.db.WithContext(ctx).
Where("is_default = ? AND enabled = ?", true, true).
Order("created_at asc").
First(&c).Error
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, nil
}