Skip to content

Movida Resource: Subtitle

rnaveiras edited this page Apr 10, 2012 · 30 revisions

Introduction

The subtitle resource represents

In Movida land, a subtitle looks like this:

<?xml version='1.0' encoding='utf-8' ?>
<subtitle>
  <id type="integer">13</id>
  <language>eng</language>
  <burnt-in type="boolean">false</burnt-in>
  <for-the-hearing-impaired type="boolean">false</for-the-hearing-impaired>
  <file-name>subtitle.srt</file-name>
  <file-size type="integer">2345569434</file-size>
  <file-md5>1bbc4c41ea7c9d3a7dc1509727f698b7</file-md5>
  <link rel="self" href="http://movida.example.com/api/subtitles/13"/>
  <link rel="file" href="http://wadus.bebanjo.net/subtitle.srt"/>
</subtitle>

### GET a List for all subtitles for a rendition

Subtitles are accessed via a Rendition. Refer to the [Movida Resource: Rendition page](https://github.com/bebanjo/almodovar/wiki/Movida-Resource:-Rendition) to find out how to access a Rendition. Inside a Rendition, one of the related link nodes identified by the rel attribute: Like here: 

```xml
<?xml version='1.0' encoding='utf-8' ?>
<rendition>
 <!-- ... —>
 <link rel="subtitles" href="http://movida.example.com/api/renditions/39/subtitles"/>
 <!-- ... —>

If we follow that link, we'd fetch the list of all subtitles for that rendition.

$ curl —digest -u roboot_user:password https://movida.example.com/api/renditions/39/subtitles
<?xml version="1.0" encoding="UTF-8"?>
<subtitles type="array">
 <subtitle>
  <id type="integer">13</id>
  <language>eng</language>
  <burnt-in type="boolean">false</burnt-in>
  <for-the-hearing-impaired type="boolean">false</for-the-hearing-impaired>
  <file-name>subtitle.srt</file-name>
  <file-size type="integer">2345569434</file-size>
  <file-md5>1bbc4c41ea7c9d3a7dc1509727f698b7</file-md5>
  <link rel="self" href="http://movida.example.com/api/subtitles/13"/>
  <link rel="file" href="http://wadus.bebanjo.net/subtitle.srt"/>
 </subtitle>
 <subtitle>
  <id type="integer">14</id>
  <language>spa</language>
  <burnt-in type="boolean">false</burnt-in>
  <for-the-hearing-impaired type="boolean">false</for-the-hearing-impaired>
  <file-name>subtitle.srt</file-name>
  <file-size type="integer">2345569433</file-size>
  <file-md5>1bbc4c41ea7c9d3a7dc1509727f698b8</file-md5>
  <link rel="self" href="http://movida.example.com/api/subtitles/14"/>
  <link rel="file" href="http://wadus.bebanjo.net/subtitle.srt"/>
 </subtitle>
</subtitles>

Creating subtitles for a rendition

For create subtitles, you just need to POST a proper XML subtitle representation (similar to the ones you get when fetching an subtitle) to the proper URL. That URL can be found in a link whose rel is subtitles. The only mandatory field

Clone this wiki locally