Difference between revisions of "Video Service"

From MythTV Official Wiki
Jump to: navigation, search
(Created page with '=Video Service API List= <center> {| cellpadding="4" border="1" | align="center" |<b>API Command</b> | align="center" |<b>POST Required?</b> | align="center" |<b>Descripti…')
 
Line 25: Line 25:
 
|-  
 
|-  
 
| style="background:silver" | [[Video_Service#RemoveVideoFromDB | RemoveVideoFromDB]]
 
| style="background:silver" | [[Video_Service#RemoveVideoFromDB | RemoveVideoFromDB]]
| style="background:silver" align="center" | No
+
| style="background:silver" align="center" | Yes
 
| style="background:silver" | Remove a single video from the database by database id.
 
| style="background:silver" | Remove a single video from the database by database id.
 
|-  
 
|-  
Line 200: Line 200:
 
     <Trailer></Trailer>
 
     <Trailer></Trailer>
 
</VideoMetadataInfo>
 
</VideoMetadataInfo>
 +
</pre>
 +
 +
==AddVideo==
 +
 +
The <span style="color:LimeGreen">AddVideo</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Filename</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The filename (including relative path from the root of the video storage group) to be added to the database.
 +
 +
:<span style="color:SteelBlue">Host</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The backend hostname where the file can be found.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Video/AddVideo?Filename=300.mkv&Hostname=localhost</code>
 +
 +
Example Return:
 +
 +
Returns a boolean value.  True if the file was successfully added, false if the insert failed for any reason.
 +
 +
<pre>
 +
<bool>true</bool>
 +
</pre>
 +
 +
==RemoveVideoFromDB==
 +
 +
The <span style="color:LimeGreen">RemoveVideoFromDB</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database id of the metadata record to be removed.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Video/RemoveVideoFromDB?Id=106</code>
 +
 +
Example Return:
 +
 +
Returns a boolean value.  True if the file was successfully removed, false if the removal failed for any reason.
 +
 +
<pre>
 +
<bool>true</bool>
 
</pre>
 
</pre>

Revision as of 04:23, 3 October 2011

Video Service API List

API Command POST Required? Description
GetVideos No Get a list of videos and their metadata.
GetVideoById No Get a single video's metadata by database id.
GetVideoByFilename No Get a single video's metadata by filename.
AddVideo Yes Add a new filename to the video database.
RemoveVideoFromDB Yes Remove a single video from the database by database id.
LookupVideo No Perform an online metadata lookup for a given title, subtitle, inetref, season, or episode number.
GetBluray No Query technical data for a Blu-ray disc or folder.

Video APIs

GetVideos

The GetVideos API takes the following arguments:

Descending (Optional)
Parameter Type: Boolean
Whether to return results in ascending or descending order.
StartIndex (Optional)
Parameter Type: Integer
The first index number to return.
Count (Optional)
Parameter Type: Integer
The number of records to return.

Example Query:

http://BackendServerIP:6544/Video/GetVideos?StartIndex=100&Count=1

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<VideoMetadataInfoList version="1.01" serializerVersion="1.1">
<StartIndex>100</StartIndex>
<Count>1</Count>
<CurrentPage>101</CurrentPage>
<TotalPages>1656</TotalPages>
<TotalAvailable>1656</TotalAvailable>
<AsOf>2011-10-02T21:03:35</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<VideoMetadataInfos>
    <VideoMetadataInfo>
        <Id>106</Id>
        <Title>Men In Black</Title>
        <SubTitle></SubTitle>
        <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
        <Director>Barry Sonnenfeld</Director>
        <Studio>Amblin Entertainment</Studio>
        The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
        <Certification>PG-13</Certification>
        <InetRef>607</InetRef>
        <HomePage>http://www.themoviedb.org/movie/607</HomePage>
        <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
        <AddDate>2010-06-03T00:00:00</AddDate>
        <UserRating>7</UserRating>
        <Length>98</Length>
        <Season>0</Season>
        <Episode>0</Episode>
        <ParentalLevel>3</ParentalLevel>
        <Visible>true</Visible>
        <Watched>false</Watched>
        <Processed>true</Processed>
        <FileName>Men in Black.mkv</FileName>
        <Hash>22be408157d11281</Hash>
        <Host>holmes</Host>
        <Coverart>607_coverart.jpg</Coverart>
        <Fanart>607_fanart.jpg</Fanart>
        <Banner></Banner>
        <Screenshot></Screenshot>
        <Trailer></Trailer>
    </VideoMetadataInfo>
</VideoMetadataInfos>
</VideoMetadataInfoList>

GetVideoById

The GetVideoById API takes the following arguments:

Id (Required)
Parameter Type: Integer
The database id of the requested metadata record.

Example Query:

http://BackendServerIP:6544/Video/GetVideoById?Id=106

Example Return:

<VideoMetadataInfo>
    <Id>106</Id>
    <Title>Men In Black</Title>
    <SubTitle></SubTitle>
    <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
    <Director>Barry Sonnenfeld</Director>
    <Studio>Amblin Entertainment</Studio>
    The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
    <Certification>PG-13</Certification>
    <InetRef>607</InetRef>
    <HomePage>http://www.themoviedb.org/movie/607</HomePage>
    <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
    <AddDate>2010-06-03T00:00:00</AddDate>
    <UserRating>7</UserRating>
    <Length>98</Length>
    <Season>0</Season>
    <Episode>0</Episode>
    <ParentalLevel>3</ParentalLevel>
    <Visible>true</Visible>
    <Watched>false</Watched>
    <Processed>true</Processed>
    <FileName>Men in Black.mkv</FileName>
    <Hash>22be408157d11281</Hash>
    <Host>holmes</Host>
    <Coverart>607_coverart.jpg</Coverart>
    <Fanart>607_fanart.jpg</Fanart>
    <Banner></Banner>
    <Screenshot></Screenshot>
    <Trailer></Trailer>
</VideoMetadataInfo>

GetVideoByFilename

The GetVideoByFilename API takes the following arguments:

Filename (Required)
Parameter Type: String
The filename of the requested metadata record.

Example Query:

http://BackendServerIP:6544/Video/GetVideoByFilename?Filename=Men%20in%20Black.mkv

Example Return:

<VideoMetadataInfo>
    <Id>106</Id>
    <Title>Men In Black</Title>
    <SubTitle></SubTitle>
    <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
    <Director>Barry Sonnenfeld</Director>
    <Studio>Amblin Entertainment</Studio>
    The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
    <Certification>PG-13</Certification>
    <InetRef>607</InetRef>
    <HomePage>http://www.themoviedb.org/movie/607</HomePage>
    <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
    <AddDate>2010-06-03T00:00:00</AddDate>
    <UserRating>7</UserRating>
    <Length>98</Length>
    <Season>0</Season>
    <Episode>0</Episode>
    <ParentalLevel>3</ParentalLevel>
    <Visible>true</Visible>
    <Watched>false</Watched>
    <Processed>true</Processed>
    <FileName>Men in Black.mkv</FileName>
    <Hash>22be408157d11281</Hash>
    <Host>holmes</Host>
    <Coverart>607_coverart.jpg</Coverart>
    <Fanart>607_fanart.jpg</Fanart>
    <Banner></Banner>
    <Screenshot></Screenshot>
    <Trailer></Trailer>
</VideoMetadataInfo>

AddVideo

The AddVideo API takes the following arguments:

Filename (Required)
Parameter Type: String
The filename (including relative path from the root of the video storage group) to be added to the database.
Host (Required)
Parameter Type: String
The backend hostname where the file can be found.

Example Query:

http://BackendServerIP:6544/Video/AddVideo?Filename=300.mkv&Hostname=localhost

Example Return:

Returns a boolean value. True if the file was successfully added, false if the insert failed for any reason.

<bool>true</bool>

RemoveVideoFromDB

The RemoveVideoFromDB API takes the following arguments:

Id (Required)
Parameter Type: Integer
The database id of the metadata record to be removed.

Example Query:

http://BackendServerIP:6544/Video/RemoveVideoFromDB?Id=106

Example Return:

Returns a boolean value. True if the file was successfully removed, false if the removal failed for any reason.

<bool>true</bool>