Fix filename generation

This commit is contained in:
2022-01-09 16:15:59 +03:00
parent 5136994dd3
commit feaa3d03cb
3 changed files with 4 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ def get_short_name(author: BookAuthor) -> str:
return " ".join(name_parts)
def get_filename(book: Book, file_type: str) -> str:
def get_filename(book_id: int, book: Book, file_type: str) -> str:
filename_parts = []
if book.authors:
@@ -86,6 +86,6 @@ def get_filename(book: Book, file_type: str) -> str:
):
filename = filename.replace(c, r)
right_part = f".{book.id}.{file_type}"
right_part = f".{book_id}.{file_type}"
return filename[: 64 - len(right_part)] + right_part