Skip to content

Add section-level info for "Collection" / "is_compilation" projects to API #253

@redrun45

Description

@redrun45

There are several fields in the sections table that are only used in "Collection" projects. Following the pattern of #246, we might add those fields to the API.

Most projects only have a single source document, stored as projects.url_text_source. They have a single language, and a single group of authors, which are all assumed to apply to every audio section recorded for that project.

The main exception is "Collection" projects, where readers can submit recordings from any number of different sources. Those projects are marked with projects.is_compilation = 1. For these projects, and these projects only, our code uses the following fields, which are not currently returned as part of the API:

  • sections.source
  • sections.language_id
  • sections.author_id

The place to start is application/libraries/Librivox_API.php. We'll want this to be behind a new flag, so that existing API users aren't suddenly receiving new data they don't know what to do with. For those '_id' fields, it looks like we have a nicer way of returning the data, rather than sending the raw IDs. 😉

Personally, this is low on the list of "me writing new code". But if someone comes along with some code, I'd be willing to comment and help test and/or refine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions