New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata: support multiple authors #3624

Merged
merged 4 commits into from Jan 21, 2018

Conversation

Projects
None yet
3 participants
@poire-z
Contributor

poire-z commented Jan 20, 2018

crengine may now give us multiple authors (if multiple <dc:creator> in epub metadata) separated by \n.
Deal with that where needed. Limit the number of authors displayed in coverbrowser views.
See discussion in #3583. Closes #3583.
Will need a crengine bump for koreader/crengine#93 to get these \n.

Should give us:

list_et_al

mosaic_et_al

When Hold on book and using Book information:
bookinfo_kvpage

bookinfo_kvpage2
(I had to choose a generic separator, as \n were displayed as an ugly white square by KeyValuePage - so we lose the ; hardcoded for Keywords).

When Hold on truncated metadata to view it with text viewer (we let the original \n be)

textviewer

if authors and authors:find("\n") then
authors = util.splitToArray(authors, "\n")
if #authors > 2 then
authors = { authors[1], authors[2].." et al." }

This comment has been minimized.

@Frenzie

Frenzie Jan 20, 2018

Member

Although et al. will work in many indo-European languages and might've been borrowed in more, it should still be a proper localizable string. ;-)

T("%1 et al.", authors[2])
if authors and authors:find("\n") then
authors = util.splitToArray(authors, "\n")
if #authors > 3 then
authors = { authors[1], authors[2], authors[3], _("et al.") }

This comment has been minimized.

@Frenzie

Frenzie Jan 20, 2018

Member

Probably better as T(_("%1 et al."), authors[3])?

This comment has been minimized.

@poire-z

poire-z Jan 20, 2018

Contributor

OK, less room wasted = bigger font possible.

This comment has been minimized.

@Frenzie

Frenzie Jan 20, 2018

Member

If it's all by itself I think it should be et alia, which as you already indicated is kind of weird in a way. :-P

@poire-z

This comment has been minimized.

Contributor

poire-z commented Jan 21, 2018

Shall I bump crengine and base and merge this?

@Frenzie

This comment has been minimized.

Member

Frenzie commented Jan 21, 2018

Sure thing!

poire-z added some commits Jan 20, 2018

metadata: support multiple authors
crengine may now give us multiple authors (if multiple <dc:creator>
in epub metadata) separated by \n.
Deal with that where needed.
Limit the number of authors displayed in coverbrowser views

@poire-z poire-z force-pushed the poire-z:multiauthors branch from d93474c to 7883bbf Jan 21, 2018

@poire-z poire-z force-pushed the poire-z:multiauthors branch from 7883bbf to 1ac9a66 Jan 21, 2018

@poire-z poire-z merged commit ba389c9 into koreader:master Jan 21, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@poire-z poire-z deleted the poire-z:multiauthors branch Jan 21, 2018

@cramoisi

This comment has been minimized.

Contributor

cramoisi commented Apr 4, 2018

@poire-z : could we restrain the dc:creator to <dc:creator opf:role="aut" ? I ask that because I noticed there is a key=value role=trl (for translation) that we ( I ) don't care most of the time which is the translator and it's not easily removable with calibre edit metadata (you have to edit the book and delete the metadata in content.opf). What do you think ?

@cramoisi

This comment has been minimized.

Contributor

cramoisi commented Apr 5, 2018

( in fact <dc:creator id="id">mon auteur</dc:creator> is the tag used by calibre !!)

@poire-z

This comment has been minimized.

Contributor

poire-z commented Apr 5, 2018

I don't know. I looked at a few of my epubs, and only 50% of them had opf:role="aut". 20% others have id="id". Other have just <dc:creator> or <dc:creator id="creator1">.
Hard to make decisions that would work in all cases.
The best would be to have crengine pass all these and their attributes to lua side (but that's C stuff I don't feel like doing), and have options on lua side to do decide what to use.

But, in general, when metadata is crappy, I just select "Ignore metadata" in hold menu so only the filename is displayed, which I usually set at everything I like to see :)

@cramoisi

This comment has been minimized.

Contributor

cramoisi commented Apr 6, 2018

@poire-z you're right , i checked others yesterday and I found ever more couple of keys=values I had no idea...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment