Change 'index' column to 'playlist_index' due to syntax error and 78/176578/2 accepted/tizen/unified/20180423.062727 submit/tizen/20180419.225455
authorJiyong Min <jiyong.min@samsung.com>
Fri, 20 Apr 2018 05:32:42 +0000 (14:32 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Fri, 20 Apr 2018 05:37:56 +0000 (14:37 +0900)
add the column into enum

Change-Id: Ic5245360cb03ef4ccabb2cce936c958b62328afd

src/media_controller_db.c

index 493347c..f4e47ed 100755 (executable)
@@ -31,6 +31,7 @@ typedef enum {
        MC_SERVER_FIELD_SERVER_STATE,
        MC_SERVER_FIELD_PLAYBACK_STATE,
        MC_SERVER_FIELD_PLAYBACK_POSITION,
+       MC_SERVER_FIELD_PLAYLIST_INDEX,
        MC_SERVER_FIELD_TITLE,
        MC_SERVER_FIELD_ARTIST,
        MC_SERVER_FIELD_ALBUM,
@@ -275,7 +276,7 @@ int mc_db_update_playback_info(void *handle, const char *server_name, int playba
        mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
        mc_retvm_if(server_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "server_name is NULL");
 
-       sql_str = sqlite3_mprintf("UPDATE '%q' SET playback_state=%d, playback_position=%llu, index=%Q;", server_name, playback_state, playback_position, index);
+       sql_str = sqlite3_mprintf("UPDATE '%q' SET playback_state=%d, playback_position=%llu, playlist_index=%Q;", server_name, playback_state, playback_position, index);
 
        ret = __mc_db_update_db(handle, sql_str);
 
@@ -398,7 +399,7 @@ int mc_db_get_playback_info(void *handle, const char *server_name, mc_playback_h
        mc_retvm_if(server_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "server_name is NULL");
        mc_retvm_if(playback == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "playback is NULL");
 
-       sql_str = sqlite3_mprintf("SELECT playback_state, playback_position, index FROM '%q';", server_name);
+       sql_str = sqlite3_mprintf("SELECT playback_state, playback_position, playlist_index FROM '%q';", server_name);
        mc_retvm_if(!MC_STRING_VALID(sql_str), MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "SQL string is null");
 
        ret = sqlite3_prepare_v2(db_handle, sql_str, strlen(sql_str), &stmt, NULL);
@@ -610,7 +611,7 @@ int mc_db_create_server_table(void *handle, const char *server_name)
                                server_state                    INTEGER DEFAULT 1, \
                                playback_state          INTEGER DEFAULT 0, \
                                playback_position       INTEGER DEFAULT 0, \
-                               index                           TEXT, \
+                               playlist_index          TEXT, \
                                title                           TEXT, \
                                artist                          TEXT, \
                                album                           TEXT, \