Content Service
Iamlindoro (Talk | contribs) |
Iamlindoro (Talk | contribs) |
||
| Line 53: | Line 53: | ||
|- | |- | ||
| [[Content_Service#DownloadFile | DownloadFile]] | | [[Content_Service#DownloadFile | DownloadFile]] | ||
| − | | align="center" | | + | | align="center" | Yes |
| Instruct the backend to download a remote file into a storage group. | | Instruct the backend to download a remote file into a storage group. | ||
| Line 69: | Line 69: | ||
:: The Storage Group name in which you wish to search for the file. | :: The Storage Group name in which you wish to search for the file. | ||
| − | :<span style="color:SteelBlue"> | + | :<span style="color:SteelBlue">FileName</Span> ('''Required''') |
:: '''Parameter Type:''' String | :: '''Parameter Type:''' String | ||
:: The filename (and relative path if necessary) of the file you wish to receive. | :: The filename (and relative path if necessary) of the file you wish to receive. | ||
| Line 89: | Line 89: | ||
:: The Storage Group name in which you wish to search for the file. | :: The Storage Group name in which you wish to search for the file. | ||
| − | :<span style="color:SteelBlue"> | + | :<span style="color:SteelBlue">FileName</Span> ('''Required''') |
:: '''Parameter Type:''' String | :: '''Parameter Type:''' String | ||
:: The filename (and relative path if necessary) of the file you wish to receive. | :: The filename (and relative path if necessary) of the file you wish to receive. | ||
| Line 254: | Line 254: | ||
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate. | The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate. | ||
| + | |||
| + | ==GetRecording== | ||
| + | |||
| + | The <span style="color:LimeGreen">GetRecording</span> API takes the following arguments: | ||
| + | |||
| + | :<span style="color:SteelBlue">ChanId</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The database channel id for the recording. | ||
| + | |||
| + | :<span style="color:SteelBlue">StartTime</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T. | ||
| + | |||
| + | Example Query: | ||
| + | |||
| + | <code>http://BackendServerIP:6544/Content/GetRecording?ChanId=34736&StartTime=2011-08-29T18:59:00</code> | ||
| + | |||
| + | Example Return: | ||
| + | |||
| + | The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate. | ||
| + | |||
| + | ==GetVideo== | ||
| + | |||
| + | The <span style="color:LimeGreen">GetVideo</span> API takes the following arguments: | ||
| + | |||
| + | :<span style="color:SteelBlue">Id</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The database id for the video file. | ||
| + | |||
| + | Example Query: | ||
| + | |||
| + | <code>http://BackendServerIP:6544/Content/GetVideo?Id=100</code> | ||
| + | |||
| + | Example Return: | ||
| + | |||
| + | The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate. | ||
| + | |||
| + | ==GetMusic== | ||
| + | |||
| + | The <span style="color:LimeGreen">GetMusic</span> API takes the following arguments: | ||
| + | |||
| + | :<span style="color:SteelBlue">Id</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The database id for the music file. | ||
| + | |||
| + | Example Query: | ||
| + | |||
| + | <code>http://BackendServerIP:6544/Content/GetMusic?Id=100</code> | ||
| + | |||
| + | Example Return: | ||
| + | |||
| + | The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate. | ||
| + | |||
| + | ==GetHash== | ||
| + | |||
| + | The <span style="color:LimeGreen">GetHash</span> API takes the following arguments: | ||
| + | |||
| + | :<span style="color:SteelBlue">StorageGroup</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The Storage Group name in which you wish to search for the file. | ||
| + | |||
| + | :<span style="color:SteelBlue">FileName</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The filename (and relative path if necessary) of the file you wish to hash. | ||
| + | |||
| + | Example Query: | ||
| + | |||
| + | <code>http://BackendServerIP:6544/Content/GetHash?StorageGroup=Recordings&FileName=244001_20110922210000.mpg</code> | ||
| + | |||
| + | Example Return: | ||
| + | |||
| + | <pre> | ||
| + | <?xml version="1.0" encoding="UTF-8"?> | ||
| + | <QString>c80767b59e4d96d2</QString> | ||
| + | </pre> | ||
| + | |||
| + | ==DownloadFile== | ||
| + | |||
| + | The <span style="color:LimeGreen">DownloadFile</span> API takes the following arguments: | ||
| + | |||
| + | :<span style="color:SteelBlue">StorageGroup</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The Storage Group name to which you wish to download the file. | ||
| + | |||
| + | :<span style="color:SteelBlue">URL</Span> ('''Required''') | ||
| + | :: '''Parameter Type:''' String | ||
| + | :: The URL that you wish to download. | ||
| + | |||
| + | Example Query: | ||
| + | |||
| + | <code>http://BackendServerIP:6544/Content/DownloadFile?StorageGroup=Videos&URL=http://www.mythtv.org/index.html</code> | ||
| + | |||
| + | Example Return: | ||
| + | |||
| + | <pre> | ||
| + | <?xml version="1.0" encoding="UTF-8"?> | ||
| + | <bool>true</bool> | ||
| + | </pre> | ||
Revision as of 21:57, 2 October 2011
Contents |
Content Service API List
| API Command | POST Required? | Description |
| GetFile | No | Download a given file from a given storage group. |
| GetImageFile | No | Display, and optionally scale, an image file from a given storage group. |
| GetFileList | No | Get a list of files in a specified storage group. |
| GetRecordingArtwork | No | Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recording's inetref and season number. |
| GetVideoArtwork | No | Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given video's database id number. |
| GetAlbumArt | No | Display, and optionally scale, the album art for a given music file's database id number. |
| GetPreviewImage | No | Display, and optionally scale, an preview thumbnail for a given recording by timestamp, chanid and starttime. |
| GetRecording | No | Download a given recording file by chanid and starttime. |
| GetMusic | No | Download a given music file by database id. |
| GetVideo | No | Download a given video by database id. |
| GetHash | No | Perform a unique identifying hash on a given file in a given storage group. |
| DownloadFile | Yes | Instruct the backend to download a remote file into a storage group. |
Content APIs
GetFile
The GetFile API takes the following arguments:
- StorageGroup (Required)
- Parameter Type: String
- The Storage Group name in which you wish to search for the file.
- FileName (Required)
- Parameter Type: String
- The filename (and relative path if necessary) of the file you wish to receive.
Example Query:
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetImageFile
The GetImageFile API takes the following arguments:
- StorageGroup (Required)
- Parameter Type: String
- The Storage Group name in which you wish to search for the file.
- FileName (Required)
- Parameter Type: String
- The filename (and relative path if necessary) of the file you wish to receive.
- Width (Optional)
- Parameter Type: Integer
- The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- Height (Optional)
- Parameter Type: Integer
- The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Example Query:
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetFileList
The GetFileList API takes the following arguments:
- StorageGroup (Required)
- Parameter Type: String
- The Storage Group name for which you wish to see a list of files.
Example Query:
http://BackendServerIP:6544/Content/GetFileList?StorageGroup=Fanart
Example Return:
<?xml version="1.0" encoding="UTF-8"?>
<QStringList>
<String>10020_fanart.jpg</String>
<String>10074_fanart.jpg</String>
<String>10126_fanart.jpg</String>
<String>10138_fanart.jpg</String>
<String>10139_fanart.jpg</String>
<String>10140_fanart.jpg</String>
<String>10189_fanart.jpg</String>
<String>10191_fanart.jpg</String>
<String>10192_fanart.jpg</String>
<String>10196_fanart.jpg</String>
</QStringList>
GetRecordingArtwork
The GetRecordingArtwork API takes the following arguments:
- Inetref (Required)
- Parameter Type: String
- The inetref for the recording you are looking up. This information is available in the Program construct, which can be queried in the DVR Service.
- Type (Optional)
- Parameter Type: String
- The type of artwork you wish to download. Valid types are coverart, fanart, and banner. If no type is present, the query will fall back to coverart.
- Season (Optional)
- Parameter Type: Integer
- The season number of the artwork you wish to receive. If no season number is present, the query will fall back to the latest available season.
- Width (Optional)
- Parameter Type: Integer
- The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- Height (Optional)
- Parameter Type: Integer
- The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Example Query:
http://BackendServerIP:6544/Content/GetRecordingArtwork?Inetref=80552&Type=fanart&Season=2
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetVideoArtwork
The GetVideoArtwork API takes the following arguments:
- Id (Required)
- Parameter Type: String
- The database id for the video you are looking up. This information is available in the VideoMetadataInfo construct, which can be queried in the Video Service.
- Type (Optional)
- Parameter Type: String
- The type of artwork you wish to download. Valid types are coverart, fanart, and banner. If no type is present, the query will fall back to coverart.
- Width (Optional)
- Parameter Type: Integer
- The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- Height (Optional)
- Parameter Type: Integer
- The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Example Query:
http://BackendServerIP:6544/Content/GetVideoArtwork?Id=100&Type=fanart
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetAlbumArt
The GetAlbumArt API takes the following arguments:
- Id (Required)
- Parameter Type: String
- The database id for the album you are looking up.
- Width (Optional)
- Parameter Type: Integer
- The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- Height (Optional)
- Parameter Type: Integer
- The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Example Query:
http://BackendServerIP:6544/Content/GetAlbumArt?Id=585
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetPreviewImage
The GetPreviewImage API takes the following arguments:
- ChanId (Required)
- Parameter Type: String
- The database channel id for the recording.
- StartTime (Required)
- Parameter Type: String
- The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.
- Width (Optional)
- Parameter Type: Integer
- The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- Height (Optional)
- Parameter Type: Integer
- The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
- SecsIn (Optional)
- Parameter Type: Integer
- The number of seconds into the recording to fast forward before generating a preview image.
Example Query:
http://BackendServerIP:6544/Content/GetPreviewImage?ChanId=34736&StartTime=2011-08-29T18:59:00
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetRecording
The GetRecording API takes the following arguments:
- ChanId (Required)
- Parameter Type: String
- The database channel id for the recording.
- StartTime (Required)
- Parameter Type: String
- The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.
Example Query:
http://BackendServerIP:6544/Content/GetRecording?ChanId=34736&StartTime=2011-08-29T18:59:00
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetVideo
The GetVideo API takes the following arguments:
- Id (Required)
- Parameter Type: String
- The database id for the video file.
Example Query:
http://BackendServerIP:6544/Content/GetVideo?Id=100
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetMusic
The GetMusic API takes the following arguments:
- Id (Required)
- Parameter Type: String
- The database id for the music file.
Example Query:
http://BackendServerIP:6544/Content/GetMusic?Id=100
Example Return:
The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.
GetHash
The GetHash API takes the following arguments:
- StorageGroup (Required)
- Parameter Type: String
- The Storage Group name in which you wish to search for the file.
- FileName (Required)
- Parameter Type: String
- The filename (and relative path if necessary) of the file you wish to hash.
Example Query:
Example Return:
<?xml version="1.0" encoding="UTF-8"?> <QString>c80767b59e4d96d2</QString>
DownloadFile
The DownloadFile API takes the following arguments:
- StorageGroup (Required)
- Parameter Type: String
- The Storage Group name to which you wish to download the file.
- URL (Required)
- Parameter Type: String
- The URL that you wish to download.
Example Query:
Example Return:
<?xml version="1.0" encoding="UTF-8"?> <bool>true</bool>