mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 22:06:38 +08:00
fix library deletion and strm path handling
This commit is contained in:
@@ -232,6 +232,21 @@ func TestSTRMLibraryOutputSubdirUsesLibraryCategoryPath(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSTRMLibrarySpecificOutputDirStripsPreviousLibraryCategory(t *testing.T) {
|
||||
base := filepath.Join(t.TempDir(), "strm", "电影", "演唱会")
|
||||
lib := model.Library{
|
||||
Name: "国产剧",
|
||||
Path: BuildCloudLibraryPath("openlist", "/电视剧/国产剧", "/电视剧/国产剧"),
|
||||
Type: "tv",
|
||||
}
|
||||
|
||||
got := strmLibrarySpecificOutputDir(base, &lib)
|
||||
want := filepath.Join(filepath.Dir(filepath.Dir(base)), "电视剧", "国产剧")
|
||||
if got != want {
|
||||
t.Fatalf("strmLibrarySpecificOutputDir() = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateSTRMForLibraryUsesCategoryDefaultOutputDir(t *testing.T) {
|
||||
db := newServiceTestDB(t, &model.Library{}, &model.Media{}, &model.STRMRecord{}, &model.Setting{})
|
||||
repos := repository.New(db)
|
||||
|
||||
Reference in New Issue
Block a user