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:
@@ -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)
|
||||
|
||||
@@ -55,6 +55,11 @@ def test_reference_cases_for_a_missing_series_and_for_alphabetic_order():
|
||||
assert expand("{series}", "strictly_alphabetic") == "The Saga"
|
||||
|
||||
|
||||
def test_series_sort_is_a_bindery_field():
|
||||
assert expand("{series_sort}") == expand("{series_sort}", "strictly_alphabetic") == "Saga, The"
|
||||
assert ft.expand("x{series_sort}x", ft.prepare(NO_SERIES, 42)) == "xx"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"template,expected",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user