Compare commits
2 Commits
542d59562a
...
fix/reinde
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b22c80e5c | ||
|
|
6805d1cbe6 |
@@ -6,8 +6,8 @@ logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
if __name__ == "__main__":
|
||||
commands = [
|
||||
"s: #a Crystal F",
|
||||
"d: 20"
|
||||
"s: #a Psychonaut 4",
|
||||
"d: 0"
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def write_metadata_to_target(metadata: Metadata, target: Target, song: Song):
|
||||
with temp_target.open("wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
converted_target: Target = Target.temp(name=f"{song.title}.jpeg")
|
||||
converted_target: Target = Target.temp(name=f"{song.title.replace('/', '_')}")
|
||||
with Image.open(temp_target.file_path) as img:
|
||||
# crop the image if it isn't square in the middle with minimum data loss
|
||||
width, height = img.size
|
||||
|
||||
@@ -122,6 +122,9 @@ class SourceCollection:
|
||||
yield from self._page_to_source_list[page]
|
||||
|
||||
def append(self, source: Source):
|
||||
if source is None:
|
||||
return
|
||||
|
||||
existing_source = None
|
||||
for key in source.indexing_values:
|
||||
if key in self._indexed_sources:
|
||||
|
||||
@@ -19,7 +19,7 @@ DEBUG_OBJECT_TRACE = DEBUG and False
|
||||
DEBUG_OBJECT_TRACE_CALLSTACK = DEBUG_OBJECT_TRACE and False
|
||||
DEBUG_YOUTUBE_INITIALIZING = DEBUG and False
|
||||
DEBUG_PAGES = DEBUG and False
|
||||
DEBUG_DUMP = DEBUG and True
|
||||
DEBUG_DUMP = DEBUG and False
|
||||
DEBUG_PRINT_ID = DEBUG and True
|
||||
|
||||
if DEBUG:
|
||||
|
||||
@@ -52,7 +52,14 @@ def fit_to_file_system(string: Union[str, Path], hidden_ok: bool = False) -> Uni
|
||||
string = string[1:]
|
||||
|
||||
string = string.replace("/", "_").replace("\\", "_")
|
||||
|
||||
try:
|
||||
string = translit(string, reversed=True)
|
||||
except LanguageDetectionError:
|
||||
pass
|
||||
|
||||
string = sanitize_filename(string)
|
||||
|
||||
return string
|
||||
|
||||
if isinstance(string, Path):
|
||||
|
||||
Reference in New Issue
Block a user