Add {series_sort} to the download template

It gives the series with a leading article at the end, as Calibre's default does for {series}.
This commit is contained in:
tim
2026-10-03 08:09:41 +02:00
parent dcdd8e4ac7
commit ece59c2558
5 changed files with 19 additions and 4 deletions
+2
View File
@@ -164,6 +164,8 @@ def test_download_template_names_the_file(client, story):
# The default moves the article to the end, as Calibre's default does.
client.put("/api/settings", json={"download_template": ""}, headers=H)
assert 'filename="Book, The - Ann Writer.epub"' in download_name(client, sid)
client.put("/api/settings", json={"download_template": "{series_sort} - {title} - {id}"}, headers=H)
assert f'filename="Saga, The - The Book - {sid}.epub"' in download_name(client, sid)
# The ID is that of the CWA book, when the story has one.
o.store.update_story(sid, calibre_id=77, pinned={"title": "Caf\u00e9", "series": ["", None]})
client.put("/api/settings", json={"download_template": "{series:|| - }{title} - {id}"}, headers=H)