mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-13 08:36:38 +08:00
初始化
初始化项目
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user