jhurliman / node-echoprint-server

A node.js implementation of the Echoprint music identification server
74 stars 37 forks source link

Always getting "error: Failed to ingest track: Attempted to add track with missing fields." #6

Closed connorlandgraf closed 11 years ago

connorlandgraf commented 11 years ago

when attempting to ingest or ingest using the debug, I get the same error. I'm inputting all required fields.. any ideas?

delcroip commented 11 years ago

EDIT: Don't do that ... the source of the issue is the ID type in the database, you need to change the type of all ids for a INT with auto_increment and remove the test on the id length.

It's happend because the id are not filled, I don't know why (should be linked with MySQL). I made a workarround by

adding the id fields in the SQL request and I fill it with the MySQL command UUID()

modeld/mysql.js l198 : var sql = 'INSERT INTO artists (name) VALUES (?)'; to: var sql = 'INSERT INTO artists (name,id) VALUES (?,UUID())'; modeld/mysql.js l148: var sql = 'INSERT INTO tracks ' + l149: '(name,artist_id,length,import_date) ' + l150: 'VALUES (?,?,?,?)'; to var sql = 'INSERT INTO tracks ' + '(name,artist_id,length,import_date,id) ' + 'VALUES (?,?,?,?,UUID())';

jhurliman commented 11 years ago

This should be fixed as of edf0cb8208babd4e8ac9bd258e386995f4baf62c