diff --git a/karaokatalog/Library.py b/karaokatalog/Library.py index 6d22b7a..c5c144b 100644 --- a/karaokatalog/Library.py +++ b/karaokatalog/Library.py @@ -1,5 +1,6 @@ from collections.abc import Sequence from dataclasses import dataclass +from functools import cached_property from pathlib import Path from typing import Self @@ -31,3 +32,14 @@ class Library: ) return cls(songs, unparseable_song_txts) + + @cached_property + def songs_in_unique_dirs(self) -> Sequence[Song]: + """ + Sometimes, more than one song can share the same base directory in a library (this usually happens when there are variants + of the song which share the same audio file). + + 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. + """ + raise NotImplementedError() # TODO Implement