Classify static and smart crates
This commit is contained in:
@@ -18,8 +18,7 @@ def build_sample(output: Optional[Path] = None) -> Path:
|
||||
root = output or SAMPLE_ROOT / "generated"
|
||||
manifest = load_manifest()
|
||||
music_root = root / "Music"
|
||||
crate_root = root / "Serato" / "_Serato_" / "Subcrates"
|
||||
crate_root.mkdir(parents=True, exist_ok=True)
|
||||
serato_root = root / "Serato" / "_Serato_"
|
||||
|
||||
for relative_path in manifest["tracks"]:
|
||||
track_path = music_root / relative_path
|
||||
@@ -29,6 +28,13 @@ def build_sample(output: Optional[Path] = None) -> Path:
|
||||
)
|
||||
|
||||
for crate in manifest["crates"]:
|
||||
folder_name = "Smartcrates" if crate["type"] == "smart" else "Subcrates"
|
||||
crate_root = serato_root / folder_name
|
||||
crate_root.mkdir(parents=True, exist_ok=True)
|
||||
other_folder = "Subcrates" if folder_name == "Smartcrates" else "Smartcrates"
|
||||
stale_path = serato_root / other_folder / crate["name"]
|
||||
if stale_path.exists():
|
||||
stale_path.unlink()
|
||||
records = "".join(
|
||||
f"{SERATO_PATH_PREFIX}{relative_path}otrk"
|
||||
for relative_path in crate["references"]
|
||||
|
||||
Reference in New Issue
Block a user