mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
invert the sense of the -s switch, default skipping intial scan
This commit is contained in:
parent
f68f7678fb
commit
e60d1f75ec
@ -1,5 +1,6 @@
|
||||
# $Id$
|
||||
#
|
||||
SUBDIRS=plugins
|
||||
|
||||
sbin_PROGRAMS = mt-daapd
|
||||
bin_PROGRAMS = wavstreamer mtd-update
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
10
src/db-sql.c
10
src/db-sql.c
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
14
src/plugin.c
14
src/plugin.c
@ -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
7
src/plugins/Makefile.am
Normal 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
|
Loading…
Reference in New Issue
Block a user