Implement songs in unique dirs

This commit is contained in:
2025-05-24 15:51:04 +02:00
parent af7fcbb4c4
commit ddc1448acc
+9 -1
View File
@@ -42,4 +42,12 @@ class Library:
For deduplication, it is helpful to assume every song is in its own directory. This returns a sequence of songs filtered so For deduplication, it is helpful to assume every song is in its own directory. This returns a sequence of songs filtered so
that there are no two songs sharing the same base dir. This filtering is done arbitrarily. that there are no two songs sharing the same base dir. This filtering is done arbitrarily.
""" """
raise NotImplementedError() # TODO Implement unique_dirs: set[Path] = set()
songs_in_unique_dirs: list[Song] = []
for song in self.songs:
if song.dir not in unique_dirs:
songs_in_unique_dirs.append(song)
unique_dirs.add(song.dir)
return tuple(songs_in_unique_dirs)