fix: improve cloud mount scanning feedback

This commit is contained in:
ShukeBta
2026-06-10 18:46:30 +08:00
parent 6a892d6549
commit 0bf983cec8
19 changed files with 1414 additions and 119 deletions
+5 -1
View File
@@ -299,7 +299,11 @@ func (r *MediaRepository) Upsert(ctx context.Context, m *model.Media) error {
if m.ScrapeStatus == "" {
m.ScrapeStatus = "pending"
}
return r.db.WithContext(ctx).Create(m).Error
if createErr := r.db.WithContext(ctx).Create(m).Error; createErr == nil {
return nil
} else if retryErr := r.db.WithContext(ctx).Unscoped().Where("path = ?", m.Path).First(&existing).Error; retryErr != nil {
return createErr
}
}
if err != nil {
return err