| 1 | |
| 2 | [[PageOutline(3-4, Sections)]] |
| 3 | |
| 4 | == !InsertMovie == |
| 5 | |
| 6 | === Intro === |
| 7 | |
| 8 | insert a movie into the database |
| 9 | |
| 10 | |
| 11 | ---- |
| 12 | === Description === |
| 13 | |
| 14 | '''struct !InsertMovie(string $token, struct('moviename' => string $moviename, 'movieyear' => string $movieyear) $movieinfo)''' |
| 15 | |
| 16 | Allows registered users to insert new movies (not stored in IMDb) to the database. |
| 17 | |
| 18 | Guidelines for implementation: |
| 19 | * when loading a movie first try to auto-detect IMDb ID from .NFO files accompanying the release. |
| 20 | * when uploading without IMDb ID user enters a movie title (and year) first call [wiki:XmlRpcSearchMoviesOnIMDB SearchMoviesOnIMDB()]. |
| 21 | * If this returns no matches and user checks that the movie doesn't exist on IMDb, allow to insert a new movie using this function. |
| 22 | * this needs to be done to avoid duplicates. |
| 23 | |
| 24 | |
| 25 | ---- |
| 26 | === Parameters === |
| 27 | |
| 28 | {{{ |
| 29 | struct( |
| 30 | (string) [token], |
| 31 | struct( |
| 32 | (string) [moviename], |
| 33 | (string) [movieyear] |
| 34 | ) [movieinfo] |
| 35 | ) |
| 36 | }}} |
| 37 | |
| 38 | ''token'':: |
| 39 | token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] output structure. |
| 40 | ''movieinfo (required)'':: |
| 41 | information about the movie to be inserted containing: |
| 42 | * ''moviename'': movie title |
| 43 | * ''movieyear'': release year |
| 44 | |
| 45 | ---- |
| 46 | === Return Values === |
| 47 | |
| 48 | Output is returned in this structure: |
| 49 | |
| 50 | {{{ |
| 51 | struct( |
| 52 | (string) [status], |
| 53 | (string) [id], |
| 54 | (string) [seconds] |
| 55 | ) |
| 56 | }}} |
| 57 | |
| 58 | and contains these elements: |
| 59 | ''status'':: |
| 60 | function result code, see [wiki:XmlRpcStatusCode list of status codes] |
| 61 | ''id'':: |
| 62 | * ID of the newly inserted movie in the database |
| 63 | * you can use it later for uploading subtitles. |
| 64 | ''seconds'':: |
| 65 | time taken to execute this command on server |
| 66 | |
| 67 | |
| 68 | ---- |
| 69 | === Implementations === |
| 70 | |
| 71 | There are currently no available sample implementations. |
| 72 | |
| 73 | |
| 74 | ---- |
| 75 | === Changelog === |
| 76 | |
| 77 | Version 1: created this function |
| 78 | |
| 79 | |
| 80 | ---- |
| 81 | === Examples === |
| 82 | |
| 83 | |
| 84 | ==== Input ==== |
| 85 | |
| 86 | {{{ |
| 87 | #!xml |
| 88 | <methodCall> |
| 89 | <methodName>InsertMovie</methodName> |
| 90 | <params> |
| 91 | <param> |
| 92 | <value><string>5ge539v8jsvqimnimtbcefaem1</string></value> |
| 93 | </param> |
| 94 | <param> |
| 95 | <value> |
| 96 | <struct> |
| 97 | <member> |
| 98 | <name>moviename</name> |
| 99 | <value><string>Three koalas and the tiger Volume 1</string></value> |
| 100 | </member> |
| 101 | <member> |
| 102 | <name>movieyear</name> |
| 103 | <value><string>2008</string></value> |
| 104 | </member> |
| 105 | </struct> |
| 106 | </value> |
| 107 | </param> |
| 108 | </params> |
| 109 | </methodCall> |
| 110 | }}} |
| 111 | |
| 112 | |
| 113 | ==== Output ==== |
| 114 | |
| 115 | {{{ |
| 116 | #!xml |
| 117 | <methodResponse> |
| 118 | <params> |
| 119 | <param> |
| 120 | <value> |
| 121 | <struct> |
| 122 | <member> |
| 123 | <name>status</name> |
| 124 | <value><string>200 OK</string></value> |
| 125 | </member> |
| 126 | <member> |
| 127 | <name>id</name> |
| 128 | <value><string>10000044</string></value> |
| 129 | </member> |
| 130 | <member> |
| 131 | <name>seconds</name> |
| 132 | <value><double>0.018</double></value> |
| 133 | </member> |
| 134 | </struct> |
| 135 | </value> |
| 136 | </param> |
| 137 | </params> |
| 138 | </methodResponse> |
| 139 | }}} |
| 140 | |
| 141 | |
| 142 | ---- |
| 143 | === Notes === |
| 144 | |
| 145 | none yet |
| 146 | |
| 147 | |
| 148 | ---- |
| 149 | === See also === |
| 150 | |
| 151 | * [wiki:XmlRpcSearchMoviesOnIMDB SearchMoviesOnIMDB()] |
| 152 | |
| 153 | |
| 154 | ---- |
| 155 | === Comments === |
| 156 | |
| 157 | add your comments, hints and suggestions here if you like ... |
| 158 | |
| 159 | |
| 160 | -------- |
| 161 | [Prev] [wiki:XmlRpcIntro Home] [Next] |