1CDDB SUBMISSION 2--------------- 3 4Your software may allow users to enter CDDB data and then submit them 5to the freedb archive. 6There are two methods of submission: <a href="#email">via e-mail</a> or <a href="#http">via http</a> using submit.cgi 7 8<a name="email"></a>1. Submission via e-mail 9------------------------ 10 11Your software has to send the entry to the 12following address: 13 14 freedb-submit@freedb.org 15 16You may implement a button or somesuch in your software's user-interface 17to facilitate this. The destination e-mail address should be made 18user-configurable. 19 20There should be one e-mail message per freedb entry. The mail Subject 21line should be in the form "cddb category discid". For example: 22 23Subject: cddb rock 850f970b 24 25The body of the e-mail message should be in the format of a CDDB file 26entry as described <a href="http://freedb.freedb.org/software/old/DBFORMAT">here</a>. The messages should contain only 27plain ASCII text. Do not attach encoded information or add special 28escape sequences. 29 30Note that the disc ID specified in the mail Subject line should 31also appear in the list of disc IDs in the DISCID= field of the 32CDDB file entry. If not, it is considered an error and the submission 33will be rejected. 34 35You should only allow categories that are currently supported by the 36freedb (blues, classical, country, data, folk, jazz, misc, newage, 37reggae, rock, soundtrack). Submissions specifying unsupported 38categories will be rejected. 39 40Please do not allow a user to submit CD database entries that 41have completely unfilled contents (i.e., blank information in the 42disc artist/title as well as the track titles, or filled with 43useless default information like "track 1", "track 2", etc.). 44While the current CD database server checks and rejects submissions 45that have a blank DTITLE line, it doesn't (and can't feasibly) check 46the track titles effectively, nor can it check any of these fields 47if they are filled with a default string. If it were, it would 48have to be hacked to know about the default strings of every possible 49client. 50 51Thus, please design your client with this in mind. This is a somewhat 52tricky thing to do, as some CDs contain blank tracks with no titles 53and you need to allow for that. An example minimum requirement 54that a CD player client should meet is listed below: 55 561. Don't allow the "send" or "submit" feature to be activated if 57 the CD database information form is not edited at all. 582. Check that the disc artist/title contains something (that the user 59 typed in). 603. Check that all of the tracks have a title filled in by the user 61 (some (but not all!) may be blank, but not the default string). 62 63This should minimize the number of useless garbage being submitted 64into the CD database. 65 66Before you release your software, please be sure that it produces 67submissions that adheres to the CDDB file format, and that the frame 68offset, disc length, and disc ID information are correctly computed. 69For testing, please make your software send submissions to the 70following e-mail address (rather than the real submission site at 71freedb-submit@freedb.org): 72 73 test-submit@freedb.org 74 75The test address performs sanity checking on the CDDB submission and 76sends back pass/fail confirmation, but does not actually deposit the 77entry in the CD database. 78 79<a name="http"></a>2. Submission via http 80---------------------- 81 82For submit via http, your application has to transmit the entry to the 83database through a CGI program at the following URL: 84 85http://freedb.freedb.org/~cddb/submit.cgi 86 87Submissions are made through the CGI program as follows. You must only use 88the "POST" method of sending data; "GET" is not supported. There are several 89HTTP "Entity-Header" fields that must be included in the data followed by a 90blank line, followed by the "Entity-Body" (a.k.a the CDDB entry) in the 91format described in Appendix B below. The required header fields are: 92 93Category: CDDB_category 94Discid: CDDB_discid 95User-Email: user@domain 96Submit-Mode: test_or_submit 97Content-Length: length_of_CDDB_entry 98 99Where: 100 101- "CDDB_category" is one of the valid CDDB categories (blues, classical, 102 country, data, folk, jazz, misc, newage, reggae, rock, soundtrack). 103 Invalid categories will result in the entry being rejected. 104 105- "CDDB_discid" is the 8-digit hex CDDB disc ID of the entry as described in 106 the "<a href="http://freedb.freedb.org/sections.php?op=viewarticle&artid=6">Discid howto</a>" section. This must be the same disc ID that appears 107 in the "DISCID=" section of the entry being submitted. If not, the entry 108 will be rejected. 109 110- "user@domain" is the valid email address of the user submitting the entry. 111 This is required in case a submission failure notice must be sent to the 112 user. 113 114- "test_or_submit" is the word "test" or "submit" (without the surrounding 115 quotes) to indicate whether the submission is a test submission or a real 116 submission to the database, respectively. See <a href="#testsubmission">below</a> for an explanation of 117 test submissions. 118 119- "length_of_CDDB_entry" is the size in bytes of the CDDB entry being 120 submitted. This number does not include the length of the header or the 121 blank line separating the HTTP header and the CDDB entry. 122 123There are several additional optional HTTP header fields that may also 124be specified (but which are currently not used by the freedb): 125 126Charset: character_set_of_CDDB_entry 127X-Cddbd-Note: message for user 128 129Where: 130 131- "character_set_of_CDDB_entry" is one of ISO-8859-1 or US-ASCII (lower case 132 may be used if desired). This specifies to the CDDB server which character 133 set the CDDB entry has been encoded in. If your application knows the 134 user's character set, then you should specify it here. Only these two 135 character sets are supported currently. DO NOT specify the character set 136 if your application does not have any way of verifying the user's character 137 set (i.e. do not guess; it's better not to specify it at all). 138 139- "message for user" is an arbitrary message to be included at the top of 140 any rejection notice that may be sent to the submitting user. 141 142An example submission showing the HTTP command, "Entity-Header" and "Entity- 143Body" follows: 144 145POST /~cddb/submit.cgi HTTP/1.0 146Category: rock 147Discid: 2a09310a 148User-Email: joe@joeshost.joesdomain.com 149Submit-Mode: submit 150Charset: ISO-8859-1 151X-Cddbd-Note: Problems with Super CD Player? Send email to support@supercd.com. 152Content-Length: 820 153 154# xmcd 155# 156# Track frame offsets: 157[ data omitted in this example for brevity ] 158PLAYORDER= 159 160Note the blank line between the "Content-Length" header field and the 161"# xmcd" which marks the beginning of the CDDB entry. 162 163When your application submits an entry through the CGI program, it will 164respond with a 3-digit response code indicating whether or not the entry has 165been forwarded to the freedb server for inclusion in the database, followed 166by a textual description of the response code. For example: 167 168200 OK, submission has been sent. 169400 Internal error: failed to forward submission. 170500 Missing required header information. 171 172These are but a few of the possible responses. 173See the description of the <a href="http://freedb.freedb.org/sections.php?op=viewarticle&artid=28">CDDB server protocol</a> for more information on 174handling response codes. 175 176The body of the freedb entry being submitted should be sent verbatim as 177described in the <a href="http://freedb.freedb.org/software/old/DBFORMAT">database-format specification</a>. DO NOT encode the data in any 178way before transmitting it; data must be sent as raw text. For example, 179Windows programmers should not use the Windows URL encode function prior to 180calling the submit CGI program. Doing so may lead to corrupt data being sent 181and also possibly to rejected submissions. 182 183You may implement a button or somesuch in your software's user interface 184to initiate submissions. Rejected submissions are automatically returned 185via email to the sender specified in the "User-Email" header field with an 186explanation of the reason for the rejection. 187 188Please do not allow a user to submit CD database entries that 189have completely unfilled contents (i.e., blank information in the 190disc artist/title as well as the track titles, or filled with 191useless default information like "track 1", "track 2", etc.). 192While the current CD database server checks and rejects submissions 193that have a blank DTITLE line, it doesn't (and can't feasibly) check 194the track titles effectively, nor can it check any of these fields 195if they are filled with a default string. If it were, it would 196have to be hacked to know about the default strings of every possible 197client. 198 199Thus, please design your client with this in mind. This is a somewhat 200tricky thing to do, as some CDs contain blank tracks with no titles 201and you need to allow for that. An example minimum requirement 202that a CD player client should meet is listed below: 203 2041. Don't allow the "send" or "submit" feature to be activated if 205 the CD database information form is not edited at all. 2062. Check that the disc artist/title contains something (that the user 207 typed in). 2083. Check that all of the tracks have a title filled in by the user. 209 (some (but not all!) may be blank, but not the default string). 210 211Before you release your software, please be sure that it produces 212submissions that adhere to the CDDB file format, and that the frame 213offset, disc length, and disc ID information are correctly computed. 214For testing, please make your software send submissions with the 215"Submit-Mode" HTTP header field set to "test". 216 217<a name="testsubmission"></a>CDDB submissions sent in test mode will be sanity-checked by the freedb server 218and pass/fail confirmation sent back to the submitter, but will not actually 219be deposited in the CD database. Please DO NOT send submisions in "submit" 220mode until you have tested your program with several different CD's. 221