generated from brennen/python_project
do not update tracks already referenced via relative paths
This commit is contained in:
@@ -18,7 +18,10 @@ def main(music_folder: Path):
|
|||||||
|
|
||||||
with m3u.open("w") as updated_contents:
|
with m3u.open("w") as updated_contents:
|
||||||
for track in tracks:
|
for track in tracks:
|
||||||
|
if track.is_absolute():
|
||||||
updated_contents.write(str(track.relative_to(m3u, walk_up=True)).replace("\\", "/"))
|
updated_contents.write(str(track.relative_to(m3u, walk_up=True)).replace("\\", "/"))
|
||||||
|
else:
|
||||||
|
updated_contents.write(str(track).replace("\\", "/"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user