mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-04 20:46:37 +08:00
处理删库重建库没有媒体数据bug
本地文件入库媒体库删除后重新入库导致0条目bug
This commit is contained in:
@@ -51,6 +51,13 @@ func TestDeleteLibraryHardDeletesLibraryRoots(t *testing.T) {
|
||||
if visibleLibraryCount != 0 {
|
||||
t.Fatalf("deleted library should not remain visible, count=%d", visibleLibraryCount)
|
||||
}
|
||||
var mediaCount int64
|
||||
if err := db.Unscoped().Model(&model.Media{}).Where("library_id = ?", lib.ID).Count(&mediaCount).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if mediaCount != 0 {
|
||||
t.Fatalf("local library media rows should be hard deleted, count=%d", mediaCount)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteCloudLibraryPurgesMountWithoutRecycleBin(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user