初始化

初始化项目
This commit is contained in:
truewhile
2026-08-23 22:12:32 +08:00
parent 0bcb1fec87
commit 71bf60c69c
631 changed files with 2121 additions and 76050 deletions
@@ -98,28 +98,3 @@ func TestCreateLibraryWithRootsKeepsDifferentTypesSeparate(t *testing.T) {
t.Fatalf("library count = %d, want separate libraries for different types", libraryCount)
}
}
func TestCreateLibraryWithRootsAcceptsCloudRoot(t *testing.T) {
db := newServiceTestDB(t, &model.Library{}, &model.LibraryRoot{}, &model.Media{})
repos := repository.New(db)
svc := NewMediaService(&config.Config{}, zap.NewNop(), repos)
lib, err := svc.CreateLibraryWithRoots(t.Context(), "国漫", "anime", []LibraryRootInput{{
Name: "OpenList",
Path: "cloud://openlist/动漫/国漫?dir=国漫&auto_category=1",
}})
if err != nil {
t.Fatal(err)
}
roots, err := repos.Library.ListRoots(t.Context(), lib.ID)
if err != nil {
t.Fatal(err)
}
if len(roots) != 1 {
t.Fatalf("roots = %#v, want one cloud root", roots)
}
info, ok := ParseCloudLibraryMount(roots[0].Path)
if !ok || info.DisplayDir != "动漫/国漫" || info.ScanDir != "国漫" || !CloudLibraryAutoCategory(model.Library{Path: roots[0].Path}) {
t.Fatalf("cloud root = %#v info=%#v", roots[0], info)
}
}