feature/sponsorblock #17

Merged
Hazel merged 20 commits from feature/sponsorblock into experimental 2024-04-27 09:41:36 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 1b0749a962 - Show all commits

View File

@ -72,7 +72,7 @@ def write_metadata_to_target(metadata: Metadata, target: Target, song: Song):
r = artwork_connection.get(
url=best_variant["url"],
name=song.artwork.get_variant_name(best_variant, song.option_string),
name=song.artwork.get_variant_name(best_variant),
)
temp_target: Target = Target.temp()

View File

@ -8,7 +8,7 @@ from .metadata import (
ID3Timestamp,
Metadata
)
from ..utils.string_processing import unify, hash_url, hash_url
from ..utils.string_processing import unify, hash_url
from .parents import OuterProxy as Base
@ -50,8 +50,8 @@ class Artwork:
return None
return min(self._variant_mapping.values(), key=lambda x: x["deviation"])
def get_variant_name(self, variant: ArtworkVariant, option_string: str) -> str:
return f"artwork_{variant['width']}x{variant['height']}_{option_string}"
def get_variant_name(self, variant: ArtworkVariant) -> str:
return f"artwork_{variant['width']}x{variant['height']}_{hash_url(variant['url'])}"
def __merge__(self, other: Artwork, override: bool = False) -> None:
for key, value in other._variant_mapping.items():