* Replace sqlite_int64 with int64_t in many places, to better allow for the possibility of other databases. (Thanks Douglas Carmichael)

This commit is contained in:
Justin Maggard
2012-06-29 23:14:27 +00:00
parent 2c7a3bfc06
commit 61fbce18ba
19 changed files with 151 additions and 138 deletions

View File

@ -15,6 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -104,7 +106,8 @@ update_if_album_art(const char *path)
DIR *dh;
struct dirent *dp;
enum file_types type = TYPE_UNKNOWN;
sqlite_int64 art_id = 0;
int64_t art_id = 0;
int ret;
strncpyt(fpath, path, sizeof(fpath));
match = basename(fpath);
@ -150,7 +153,8 @@ update_if_album_art(const char *path)
DPRINTF(E_DEBUG, L_METADATA, "New file %s looks like cover art for %s\n", path, dp->d_name);
snprintf(file, sizeof(file), "%s/%s", dir, dp->d_name);
art_id = find_album_art(file, NULL, 0);
if( sql_exec(db, "UPDATE DETAILS set ALBUM_ART = %lld where PATH = '%q'", art_id, file) != SQLITE_OK )
ret = sql_exec(db, "UPDATE DETAILS set ALBUM_ART = %lld where PATH = '%q'", (long long)art_id, file);
if( ret != SQLITE_OK )
DPRINTF(E_WARN, L_METADATA, "Error setting %s as cover art for %s\n", match, dp->d_name);
}
}
@ -334,14 +338,14 @@ found_file:
return NULL;
}
sqlite_int64
int64_t
find_album_art(const char *path, const char *image_data, int image_size)
{
char *album_art = NULL;
char *sql;
char **result;
int cols, rows;
sqlite_int64 ret = 0;
int64_t ret = 0;
if( (image_size && (album_art = check_embedded_art(path, image_data, image_size))) ||
(album_art = check_for_album_file(path)) )