feat: genius fixes and duplicate detection
This commit is contained in:
@@ -175,6 +175,7 @@ class ArtworkCollection:
|
||||
This will make the artworks ready for download and delete duplicates.
|
||||
"""
|
||||
artwork_hashes: list = list()
|
||||
artwork_urls: list = list()
|
||||
for artwork in self._data:
|
||||
index = 0
|
||||
for artwork_variant in artwork.variants:
|
||||
@@ -182,6 +183,12 @@ class ArtworkCollection:
|
||||
url=artwork_variant.url,
|
||||
name=artwork_variant.url,
|
||||
)
|
||||
|
||||
if artwork_variant.url in artwork_urls:
|
||||
artwork.variants.pop(index)
|
||||
continue
|
||||
artwork_urls.append(artwork_variant.url)
|
||||
|
||||
target: Target = artwork_variant.target
|
||||
with target.open("wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
@@ -185,7 +185,7 @@ class Song(Base):
|
||||
return
|
||||
|
||||
def _compile(self):
|
||||
self.artwork.compile(self.target_collection.get(0))
|
||||
self.artwork.compile()
|
||||
|
||||
|
||||
INDEX_DEPENDS_ON = ("title", "isrc", "source_collection")
|
||||
|
||||
Reference in New Issue
Block a user