[Bug]: Author/Series with non-ASCII names are listed once for every book when updated #1681

Closed
opened 2026-04-24 23:54:36 +02:00 by adam · 9 comments
Owner

Originally created by @thatguy7 on GitHub (Jan 21, 2024).

Describe the issue

When the author's name is in cyrillic letters, it seems like ABS does not reliably process it.

error

As can be seen, e.g. I have 10 books by Анджей Сапковский (Andrzej Sapkowski, red), but instead of listing the author once with 10 books, the author is listed 10 times, once for each book.

I set the author's name using multple-selection and mapping the authors field, just to be sure it's the same for all of them.
When I changed the author Василий Маханенко (Vasily Mahanenko, blue) to the latin-lettered version, all his books were linked to a single author entry.

Interestingly, this bug does not seem to always happen - there clearly are multiple authors with more than 1 book in the screenshot.

The books by Sapkowski and Mahanenko are a single series each, wheres the books by Dostoevsky (green) are not part of a series.

Steps to reproduce the issue

  1. I guess just adding multiple books with the same author name in cyrillic letters.
  2. Go to Authors tab.

UPDATE:

This error occurs only, when the tag is edited post import in ABS:
Pick any number of books and add the same cyrillic name to the authors tag, it will create a new author for every book.

Audiobookshelf version

v2.7.2

How are you running audiobookshelf?

Docker

Originally created by @thatguy7 on GitHub (Jan 21, 2024). ### Describe the issue When the author's name is in cyrillic letters, it seems like ABS does not reliably process it. ![error](https://github.com/advplyr/audiobookshelf/assets/5512286/6175aeb1-399e-4b46-8831-207677676b22) As can be seen, e.g. I have 10 books by Анджей Сапковский (Andrzej Sapkowski, red), but instead of listing the author once with 10 books, the author is listed 10 times, once for each book. I set the author's name using multple-selection and mapping the authors field, just to be sure it's the same for all of them. When I changed the author Василий Маханенко (Vasily Mahanenko, blue) to the latin-lettered version, all his books were linked to a single author entry. Interestingly, this bug does not seem to always happen - there clearly are multiple authors with more than 1 book in the screenshot. The books by Sapkowski and Mahanenko are a single series each, wheres the books by Dostoevsky (green) are not part of a series. ### Steps to reproduce the issue 1. I guess just adding multiple books with the same author name in cyrillic letters. 2. Go to Authors tab. #### UPDATE: This error occurs only, when the tag is edited post import in ABS: Pick any number of books and add the same cyrillic name to the authors tag, it will create a new author for every book. ### Audiobookshelf version v2.7.2 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:54:36 +02:00
adam closed this issue 2026-04-24 23:54:36 +02:00
Author
Owner

@nichwall commented on GitHub (Jan 21, 2024):

Have you verified that every author is identical and there are no differences in the Unicode or hidden characters?

This issue came up a few months ago in Discord, and was resolved once the user fixed the Unicode.

"Might be that ABS handles that fine, but й (U+0439) and й (U+0306 and U+0438) look the same for example"

Beginning of conversation: https://discord.com/channels/942908292873723984/942908295579062335/1176217664918663229

@nichwall commented on GitHub (Jan 21, 2024): Have you verified that every author is identical and there are no differences in the Unicode or hidden characters? This issue came up a few months ago in Discord, and was resolved once the user fixed the Unicode. "Might be that ABS handles that fine, but й (U+0439) and й (U+0306 and U+0438) look the same for example" Beginning of conversation: https://discord.com/channels/942908292873723984/942908295579062335/1176217664918663229
Author
Owner

@thatguy7 commented on GitHub (Jan 21, 2024):

Thanks for pointing me to the conversation, I will report back once I had a look.

@thatguy7 commented on GitHub (Jan 21, 2024): Thanks for pointing me to the conversation, I will report back once I had a look.
Author
Owner

@nichwall commented on GitHub (Jan 21, 2024):

One way you can check is by comparing the metadata.json for the library items. That will show you what ABS is using, depending on whether you got author names from metadata tags, the filesystem, or an online match, or a combination of sources

@nichwall commented on GitHub (Jan 21, 2024): One way you can check is by comparing the `metadata.json` for the library items. That will show you what ABS is using, depending on whether you got author names from metadata tags, the filesystem, or an online match, or a combination of sources
Author
Owner

@thatguy7 commented on GitHub (Jan 22, 2024):

I checked the metadata.json. They seem to be the same for all of the books.

rg "Фёдор Михайлович Достоевский"
9551d32c-3b00-4864-a4b2-f58bf9077496/metadata.json
254:    "Фёдор Михайлович Достоевский"

0620818c-ba36-4749-83c8-4fde3711ee87/metadata.json
164:    "Фёдор Михайлович Достоевский"

52cb39c8-2e85-4e64-a5f2-5c461b567a61/metadata.json
308:    "Фёдор Михайлович Достоевский"

This is the й (U+0439), if I use the other one, it does not find the files. Same goes for the other replicated entries.

As was discussed in the linked conversation on Discord I can fix this issue by writing the author tag to file, removing the items from my library and rescanning.

This means the problem occurs when I use ABS to set the author - when it is read on import things are fine. This explains why it worked for some authors, but not for all: If the tag was set correctly on import, it works fine. If I modify the value after import, it does not. Here it does not matter wether I edit the tag to the same value for all books or not - if the name is cyrillic, it will create a new author every time. If I put a latin name, it works as expected.

@thatguy7 commented on GitHub (Jan 22, 2024): I checked the metadata.json. They seem to be the same for all of the books. ``` rg "Фёдор Михайлович Достоевский" 9551d32c-3b00-4864-a4b2-f58bf9077496/metadata.json 254: "Фёдор Михайлович Достоевский" 0620818c-ba36-4749-83c8-4fde3711ee87/metadata.json 164: "Фёдор Михайлович Достоевский" 52cb39c8-2e85-4e64-a5f2-5c461b567a61/metadata.json 308: "Фёдор Михайлович Достоевский" ``` This is the й (U+0439), if I use the other one, it does not find the files. Same goes for the other replicated entries. As was discussed in the linked conversation on Discord I can fix this issue by writing the author tag to file, removing the items from my library and rescanning. This means the problem occurs when I use ABS to set the author - when it is read on import things are fine. This explains why it worked for some authors, but not for all: If the tag was set correctly on import, it works fine. If I modify the value after import, it does not. Here it does not matter wether I edit the tag to the same value for all books or not - if the name is cyrillic, it will create a new author every time. If I put a latin name, it works as expected.
Author
Owner

@thatguy7 commented on GitHub (Jan 22, 2024):

I updated the issue, but to summarize the state so far:

Problem

Authors with cyrillic name are listed multiple times in the authors tab of the UI - but only if the authors tag is edited.

Steps to reproduce

Pick any number of books and add the same cyrillic name to the authors tag; ABS will create a new author for every book.

Workaround

After editing the author tag, write the metadata to file, remove the edited books from your library and add them back in.

@thatguy7 commented on GitHub (Jan 22, 2024): I updated the issue, but to summarize the state so far: #### Problem Authors with cyrillic name are listed multiple times in the authors tab of the UI - but only if the authors tag is edited. #### Steps to reproduce Pick any number of books and add the same cyrillic name to the authors tag; ABS will create a new author for every book. #### Workaround After editing the author tag, write the metadata to file, remove the edited books from your library and add them back in.
Author
Owner

@thatguy7 commented on GitHub (Jan 26, 2024):

I just realised the behavior is the same for the series field. If I set the series using the web-gui it creates a new series for every book with one book in the series.

According to the discord discussion, this happens with other non-latin languages as well.

@thatguy7 commented on GitHub (Jan 26, 2024): I just realised the behavior is the same for the series field. If I set the series using the web-gui it creates a new series for every book with one book in the series. According to the discord discussion, this happens with other non-latin languages as well.
Author
Owner

@thatguy7 commented on GitHub (Sep 13, 2024):

I have dug a bit deeper and the problem arises in these functions:
https://github.com/advplyr/audiobookshelf/blob/01fbea02f19bb19b5d2e8629fdbe4662d278e872/server/models/Author.js#L55
https://github.com/advplyr/audiobookshelf/blob/01fbea02f19bb19b5d2e8629fdbe4662d278e872/server/models/Series.js#L41

If I run the following query on the DB: SELECT LOWER(name), name, lastFirst FROM authors;, the output looks like:

LOWER(name)                 |name                        |lastFirst                    |
----------------------------+----------------------------+-----------------------------+
...
dirk maggs                  |Dirk Maggs                  |Maggs, Dirk                  |
erich maria remarque        |Erich Maria Remarque        |Remarque, Erich Maria        |
alina bronsky               |Alina Bronsky               |Bronsky, Alina               |
ada fink                    |Ada Fink                    |Fink, Ada                    |
Энди Вейер                  |Энди Вейер                  |Вейер, Энди                  |
Харари Юваль Ной            |Харари Юваль Ной            |Ной, Харари Юваль            |
Бакман Фредерик             |Бакман Фредерик             |Фредерик, Бакман             |
...

Notice how the ASCII characters were properly set to lower case but the non-ASCII characters remained unaffected.

This is a limitation of SQLite.

The easy workaround is checking if authorName (or seriesName) contains non-ASCII chars and avoiding the lower function in that case. This could be used for the check: https://stackoverflow.com/questions/13522782/how-can-i-tell-if-a-string-has-any-non-ascii-characters-in-it

It would be better to figure out how to get SQLite to do behave as expected.

@thatguy7 commented on GitHub (Sep 13, 2024): I have dug a bit deeper and the problem arises in these functions: https://github.com/advplyr/audiobookshelf/blob/01fbea02f19bb19b5d2e8629fdbe4662d278e872/server/models/Author.js#L55 https://github.com/advplyr/audiobookshelf/blob/01fbea02f19bb19b5d2e8629fdbe4662d278e872/server/models/Series.js#L41 If I run the following query on the DB: `SELECT LOWER(name), name, lastFirst FROM authors;`, the output looks like: ``` LOWER(name) |name |lastFirst | ----------------------------+----------------------------+-----------------------------+ ... dirk maggs |Dirk Maggs |Maggs, Dirk | erich maria remarque |Erich Maria Remarque |Remarque, Erich Maria | alina bronsky |Alina Bronsky |Bronsky, Alina | ada fink |Ada Fink |Fink, Ada | Энди Вейер |Энди Вейер |Вейер, Энди | Харари Юваль Ной |Харари Юваль Ной |Ной, Харари Юваль | Бакман Фредерик |Бакман Фредерик |Фредерик, Бакман | ... ``` Notice how the ASCII characters were properly set to lower case but the non-ASCII characters remained unaffected. This is a limitation of SQLite. The easy workaround is checking if `authorName` (or `seriesName`) contains non-ASCII chars and avoiding the `lower` function in that case. This could be used for the check: https://stackoverflow.com/questions/13522782/how-can-i-tell-if-a-string-has-any-non-ascii-characters-in-it It would be better to figure out how to get SQLite to do behave as expected.
Author
Owner

@nichwall commented on GitHub (Sep 13, 2024):

Related discussion here https://github.com/advplyr/audiobookshelf/issues/2678 and in the referenced PRs

@nichwall commented on GitHub (Sep 13, 2024): Related discussion here https://github.com/advplyr/audiobookshelf/issues/2678 and in the referenced PRs
Author
Owner

@github-actions[bot] commented on GitHub (Oct 5, 2024):

Fixed in v2.14.0.

@github-actions[bot] commented on GitHub (Oct 5, 2024): Fixed in [v2.14.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.14.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1681