Compare commits
2 Commits
72531f0bee
...
2bf362c696
Author | SHA1 | Date | |
---|---|---|---|
2bf362c696 | |||
1b0749a962 |
@ -72,7 +72,7 @@ def write_metadata_to_target(metadata: Metadata, target: Target, song: Song):
|
|||||||
|
|
||||||
r = artwork_connection.get(
|
r = artwork_connection.get(
|
||||||
url=best_variant["url"],
|
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()
|
temp_target: Target = Target.temp()
|
||||||
|
@ -194,7 +194,7 @@ class Connection:
|
|||||||
additional_info = cached.attribute.additional_info
|
additional_info = cached.attribute.additional_info
|
||||||
|
|
||||||
body = cached.content
|
body = cached.content
|
||||||
if "encoding" in additional_info:
|
if additional_info.get("encoding", None) is not None:
|
||||||
body = body.decode(additional_info["encoding"])
|
body = body.decode(additional_info["encoding"])
|
||||||
|
|
||||||
resp.add(
|
resp.add(
|
||||||
|
@ -8,7 +8,7 @@ from .metadata import (
|
|||||||
ID3Timestamp,
|
ID3Timestamp,
|
||||||
Metadata
|
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
|
from .parents import OuterProxy as Base
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ class Artwork:
|
|||||||
return None
|
return None
|
||||||
return min(self._variant_mapping.values(), key=lambda x: x["deviation"])
|
return min(self._variant_mapping.values(), key=lambda x: x["deviation"])
|
||||||
|
|
||||||
def get_variant_name(self, variant: ArtworkVariant, option_string: str) -> str:
|
def get_variant_name(self, variant: ArtworkVariant) -> str:
|
||||||
return f"artwork_{variant['width']}x{variant['height']}_{option_string}"
|
return f"artwork_{variant['width']}x{variant['height']}_{hash_url(variant['url']).replace('/', '_')}"
|
||||||
|
|
||||||
def __merge__(self, other: Artwork, override: bool = False) -> None:
|
def __merge__(self, other: Artwork, override: bool = False) -> None:
|
||||||
for key, value in other._variant_mapping.items():
|
for key, value in other._variant_mapping.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user