wiki:XmlRpcCheckSubHash

CheckSubHash

Intro

check if given subtitle files are already stored in the database


Description

struct CheckSubHash(string $token, array($subhash, $subhash, ...) $hashes)

This function returns subtitle file IDs for given subtitle file hashes.

This can be used to quickly check (for a large list of subtitle files) which subtitle files are already stored in the database (e.g. before uploading).


Parameters

token (required)
token string identifying user's session, taken from LogIn output structure.
hashes (required)
array of subtitle file hashes (MD5 hashes of subtitle file contents)

Return Values

Output is returned in this structure:

  struct(
    (string) [status],
    struct(
      (string) [<subtitle file hash>],
      (string) [<subtitle file hash>],
    ) [data],
    (double) [seconds]
  )

and contains these elements:

status
function result code, see list of status codes
data
contains key/value pairs where key is the subtitle file hash and value is subtitle file ID (if found)
seconds
time taken to execute this command on server

The value in the struct for missing movies will be int(0), not string!


Implementations

There are currently no available sample implementations.


Changelog

Version 1: created this function


Examples

Input

<methodCall>
 <methodName>CheckSubHash</methodName>
 <params>
  <param>
   <value><string>gqb4qjfkc66vb0sarm8j60o3t7</string></value>
  </param>
  <param>
   <value>
    <array>
     <data>
      <value><string>b76fb8e344e771de7df3f735c2f216bc</string></value>
      <value><string>84b3ecc07aa36820449c287e2f1d345d</string></value>
      
      ... more subtitle file hashes go here (if any) ...
      
     </data>
    </array>
   </value>
  </param>
 </params>
</methodCall>

Output

<methodResponse>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>status</name>
      <value><string>200 OK</string></value>
     </member>
     <member>
      <name>data</name>
      <value>
       <struct>
        <member>
         <name>b76fb8e344e771de7df3f735c2f216bc</name>
         <value><string>1951678165</string></value>
        </member>
        <member>
         <name>84b3ecc07aa36820449c287e2f1d345d</name>
         <value><string>1951915776</string></value>
        </member>
        
        ... more subtitle file hashes go here (if any) ...
        
       </struct>
      </value>
     </member>
     <member>
      <name>seconds</name>
      <value><double>0.207</double></value>
     </member>
    </struct>
   </value>
  </param>
 </params>
</methodResponse>

Notes

none yet


See also


Comments

add your comments, hints and suggestions here if you like ...


Prev (CheckMovieHash) Home [Next]

Last modified 11 years ago Last modified on Jul 20, 2013, 8:50:40 PM