Skip to content

Commit

Permalink
Fixed empty subjects and wrong link in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
svera authored Nov 1, 2023
1 parent d0f1c6e commit bdced60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Some features rely on having an SMTP email service set up, and won't be availabl
* Send document to email.
* Recover user password.

You can use any email service that allow sending emails using the SMTP protocol, like [GMX](gmx.com). The following environment variables need to be defined:
You can use any email service that allow sending emails using the SMTP protocol, like [GMX](https://gmx.com/mail). The following environment variables need to be defined:

* `SMTP_SERVER`: The URL of the SMTP server to be used, for example `mail.gmx.com`.
* `SMTP_PORT`: The port number used by the email service, defaults to `587`.
Expand Down
4 changes: 4 additions & 0 deletions internal/metadata/epub.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func (e EpubReader) Metadata(file string) (Metadata, error) {
var subjects []string
if len(opf.Metadata.Subject) > 0 {
for _, subject := range opf.Metadata.Subject {
subject.Value = strings.TrimSpace(subject.Value)
if subject.Value == "" {
continue
}
// Some epub files mistakenly put all subjects in a single field instead of using a field for each one.
// We want to identify those cases looking for specific separators and then indexing each subject properly.
names := strings.Split(subject.Value, ",")
Expand Down

0 comments on commit bdced60

Please sign in to comment.