This commit is contained in:
Jakob Moser 2025-05-24 14:52:24 +02:00
parent 6e982950b4
commit 5232a12738
Signed by: jakob
GPG Key ID: 3EF2BA2851B3F53C

View File

@ -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