invert the sense of the -s switch, default skipping intial scan

This commit is contained in:
Ron Pedde 2006-05-01 08:06:19 +00:00
parent f68f7678fb
commit e60d1f75ec
8 changed files with 35 additions and 13 deletions

View File

@ -1,5 +1,6 @@
# $Id$
#
SUBDIRS=plugins
sbin_PROGRAMS = mt-daapd
bin_PROGRAMS = wavstreamer mtd-update

View File

@ -49,7 +49,7 @@
typedef struct tag_db_functions {
char *name;
int(*dbs_open)(char **, char *);
int(*dbs_init)(int);
int(*dbs_init)(int*);
int(*dbs_deinit)(void);
int(*dbs_add)(char **, MP3FILE*, int*);
int(*dbs_add_playlist)(char **, char *, int, char *,char *, int, int *);
@ -524,7 +524,7 @@ int db_open(char **pe, char *type, char *parameters) {
*
* \param reload whether or not to do a full reload of the database
*/
int db_init(int reload) {
int db_init(int *reload) {
return db_current->dbs_init(reload);
}

View File

@ -147,7 +147,7 @@ typedef struct tag_daap_items {
extern DAAP_ITEMS taglist[];
extern int db_open(char **pe, char *type, char *parameters);
extern int db_init(int reload);
extern int db_init(int *reload);
extern int db_deinit(void);
extern int db_revision(void);

View File

@ -304,14 +304,14 @@ int db_sql_open(char **pe, char *parameters) {
* initialize the sqlite database, reloading if requested
*
* @param reload whether or not to do a full reload on the db
* on return, reload is set to 1 if the db MUST be rescanned
* @returns DB_E_SUCCESS on success, error code otherwise
*/
int db_sql_init(int reload) {
int db_sql_init(int *reload) {
int items;
int rescan = 0;
int err;
err=db_sql_get_count(NULL,&items, countSongs);
if(err != DB_E_SUCCESS)
items = 0;
@ -321,18 +321,20 @@ int db_sql_init(int reload) {
"term='rescan'") == DB_E_SUCCESS)
{
if(rescan)
reload=1;
*reload=1;
}
if(reload || (!items)) {
if(*reload || (!items)) {
DPRINTF(E_LOG,L_DB,"Full reload...\n");
db_sql_event_fn(DB_SQL_EVENT_FULLRELOAD);
db_sql_reload=1;
*reload=1;
} else {
db_sql_event_fn(DB_SQL_EVENT_STARTUP);
db_sql_reload=0;
*reload=0;
}
return DB_E_SUCCESS;

View File

@ -32,7 +32,7 @@ extern int db_sql_open_sqlite3(char **pe, char *parameters);
#endif
extern int db_sql_open(char **pe, char *parameters);
extern int db_sql_init(int reload);
extern int db_sql_init(int *reload);
extern int db_sql_deinit(void);
extern int db_sql_escape(char *buffer, int *size, char *fmt, ...);
extern int db_sql_add(char **pe, MP3FILE *pmp3, int *id);

View File

@ -206,7 +206,7 @@ int main(int argc, char *argv[]) {
int rescan_counter=0;
int old_song_count, song_count;
int force_non_root=0;
int skip_initial=0;
int skip_initial=1;
int convert_conf=0;
char *logfile,*db_type,*db_parms,*web_root,*runas;
char **mp3_dir_array;
@ -259,7 +259,7 @@ int main(int argc, char *argv[]) {
break;
case 's':
skip_initial=1;
skip_initial=0;
break;
case 'y':
@ -386,12 +386,12 @@ int main(int argc, char *argv[]) {
/* Initialize the database before starting */
DPRINTF(E_LOG,L_MAIN|L_DB,"Initializing database\n");
if(db_init(reload)) {
if(db_init(&reload)) {
DPRINTF(E_FATAL,L_MAIN|L_DB,"Error in db_init: %s\n",strerror(errno));
}
if(conf_get_array("general","mp3_dir",&mp3_dir_array)) {
if(!skip_initial) {
if((!skip_initial) || (reload)) {
DPRINTF(E_LOG,L_MAIN|L_SCAN,"Starting mp3 scan\n");
if(scan_init(mp3_dir_array)) {

View File

@ -328,6 +328,8 @@ int plugin_rend_register(char *name, int port, char *iface) {
PLUGIN_ENTRY *ppi;
PLUGIN_REND_INFO *pri;
char *txt;
char *new_name;
_plugin_readlock();
ppi = _plugin_list.next;
@ -342,7 +344,17 @@ int plugin_rend_register(char *name, int port, char *iface) {
txt = "";
DPRINTF(E_DBG,L_PLUG,"Registering %s\n",pri->type);
rend_register(name,pri->type,port,iface,txt);
new_name=(char*)malloc(strlen(name) + 3 +
strlen(ppi->versionstring));
if(conf_get_int("plugins","mangle_rendezvous",1)) {
sprintf(new_name,"%s (%s)",name,ppi->versionstring);
} else {
sprintf(new_name,"%s",name);
}
rend_register(new_name,pri->type,port,iface,txt);
free(new_name);
pri++;
}
}

7
src/plugins/Makefile.am Normal file
View File

@ -0,0 +1,7 @@
# $Id: $
#
rspdir = ${pkgdatadir}/plugins
lib_LTLIBRARIES=rsp.la
rsp_la_LDFLAGS=-module -avoid-version
rsp_la_SOURCES = compat.c rsp.c xml-rpc.c