Skip to content

Only last "dc:title" is used when multiple are present in metadata. #502

@outis

Description

@outis

Synopsis

When there are multiple dc:title elements in an epub's publication metadata (in the OPF Package Document), FBReader uses the last one (in source order) as the book title, which doesn't match what's done in publications and is incorrect according to standards.

Description

The current Epub standard supports multiple titles, but FBReader does not. The following is valid in an epub:

    <dc:title id="maintitle">Main Title</dc:title>
    <meta property="title-type" refines="#maintitle">main</meta>
    <meta property="display-seq" refines="#maintitle">1</meta>
    <dc:title id="subtitle">Subtitle</dc:title>
    <meta property="title-type" refines="#subtitle">subtitle</meta>
    <meta property="display-seq" refines="#subtitle">2</meta>

FBReader won't use "Main Title" but rather "Subtitle" as the book's title, despite the former having a title-type of "main" and occurring first in the document order.

Something similar to the example occurs in various books I've read, but since they're copyrighted, I can't attach those. Instead, I can do one better: reprexes. The following epubs (submitted as ZIPs, since GitHub doesn't allow epub), one with #maintitle last, the other with #subtitle last, demonstrate this behavior:

Expected result

The first dc:title, or the dc:title with title-type of "main" (and the lowest display-seq) is displayed as the book's title wherever the book's title is used (e.g. the library, book info, the reader's title bar). Additional titles might (or might not) be displayed as well as part of the title.

Actual result

The dc:title that appears last in the source is used as the book's title.

System Info

Platform: Android
FBReader version: 3.0.35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions