fix organize trigger task flow

This commit is contained in:
ShukeBta
2026-06-13 17:08:56 +08:00
parent 4e0929bbca
commit 5f42836bbf
15 changed files with 312 additions and 39 deletions
+3 -3
View File
@@ -369,7 +369,7 @@ func TestDownloadPollSkipsRecordedCompletedTorrentCatchup(t *testing.T) {
}
}
func TestAutoOrganizeSkipsScanWhenNoFilesChanged(t *testing.T) {
func TestAutoOrganizeSyncsVisibilityWhenTargetAlreadyExists(t *testing.T) {
root := t.TempDir()
src := filepath.Join(root, "downloads", "国产剧", "狂飙.S01E01.2023.1080p.mkv")
dest := filepath.Join(root, "media")
@@ -413,8 +413,8 @@ func TestAutoOrganizeSkipsScanWhenNoFilesChanged(t *testing.T) {
if err := repos.DB.Model(&model.Media{}).Count(&count).Error; err != nil {
t.Fatal(err)
}
if count != 0 {
t.Fatalf("no-op auto organize triggered scan and created %d media rows, want 0", count)
if count != 1 {
t.Fatalf("target already exists should still be scanned into DB, count=%d want 1", count)
}
}