mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-12 23:43:23 -05:00
reverse default in follow_symlink option, fix some warnings in plugin.c, fix errors in update as result of new db fields
This commit is contained in:
parent
671148d7cf
commit
b5008ded8d
@ -965,7 +965,7 @@ int db_sql_update(char **pe, MP3FILE *pmp3, int *id) {
|
||||
"rating=%d," // rating
|
||||
"sample_count=%s," // sample_count
|
||||
"codectype='%q'," // codec
|
||||
"album_artist='%q',"
|
||||
"album_artist='%q'"
|
||||
" WHERE path='%q' and idx=%d");
|
||||
|
||||
path = _db_proper_path(pmp3->path);
|
||||
|
@ -157,7 +157,7 @@ typedef struct tag_plugin_input_fn {
|
||||
void (*conf_dispose_string)(char *str);
|
||||
int (*conf_get_int)(char *section, char *key, int dflt);
|
||||
|
||||
int (*config_set_status)(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...);
|
||||
void (*config_set_status)(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...);
|
||||
} PLUGIN_INPUT_FN;
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ int scan_path(char *path) {
|
||||
int is_compdir;
|
||||
int follow_symlinks = 0;
|
||||
|
||||
follow_symlinks = conf_get_int("scanning","follow_symlinks",0);
|
||||
follow_symlinks = conf_get_int("scanning","follow_symlinks",1);
|
||||
extensions = conf_alloc_string("general","extensions",".mp3,.m4a,.m4p");
|
||||
|
||||
if((current_dir=opendir(path)) == NULL) {
|
||||
|
14
src/plugin.c
14
src/plugin.c
@ -80,6 +80,7 @@ void _plugin_unlock(void);
|
||||
int _plugin_error(char **pe, int error, ...);
|
||||
void _plugin_free(int *pi);
|
||||
void _plugin_recalc_codecs(void);
|
||||
int _plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers);
|
||||
|
||||
/* webserver helpers */
|
||||
char *pi_ws_uri(WS_CONNINFO *pwsc);
|
||||
@ -103,6 +104,9 @@ int pi_db_count_items(int what);
|
||||
int pi_db_wait_update(WS_CONNINFO *pwsc);
|
||||
void pi_conf_dispose_string(char *str);
|
||||
|
||||
/* transcode helpers */
|
||||
int pi_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec);
|
||||
|
||||
PLUGIN_INPUT_FN pi = {
|
||||
pi_ws_uri,
|
||||
pi_ws_will_close,
|
||||
@ -118,7 +122,7 @@ PLUGIN_INPUT_FN pi = {
|
||||
pi_server_ver,
|
||||
pi_server_name,
|
||||
pi_log,
|
||||
plugin_ssc_should_transcode,
|
||||
pi_ssc_should_transcode,
|
||||
|
||||
pi_db_count,
|
||||
pi_db_enum_start,
|
||||
@ -448,7 +452,7 @@ void plugin_event_dispatch(int event_id, int intval, void *vp, int len) {
|
||||
* @param codec the codec we are trying to serve
|
||||
* @returns TRUE if we can transcode, FALSE otherwise
|
||||
*/
|
||||
int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) {
|
||||
int pi_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) {
|
||||
int result;
|
||||
char *native_codecs=NULL;
|
||||
char *user_agent=NULL;
|
||||
@ -549,7 +553,7 @@ int _plugin_ssc_copy(WS_CONNINFO *pwsc, PLUGIN_TRANSCODE_FN *pfn,
|
||||
* @param duration time in ms
|
||||
* @returns bytes transferred, or -1 on error
|
||||
*/
|
||||
int plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers) {
|
||||
int _plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers) {
|
||||
PLUGIN_ENTRY *ppi, *ptc=NULL;
|
||||
PLUGIN_TRANSCODE_FN *pfn = NULL;
|
||||
void *vp_ssc;
|
||||
@ -849,7 +853,7 @@ void pi_stream(WS_CONNINFO *pwsc, char *id) {
|
||||
DPRINTF(E_LOG,L_DAAP|L_WS|L_DB,"Could not find requested item %lu\n",item);
|
||||
config_set_status(pwsc,session,NULL);
|
||||
ws_returnerror(pwsc,404,"File Not Found");
|
||||
} else if (plugin_ssc_should_transcode(pwsc,pmp3->codectype)) {
|
||||
} else if (pi_ssc_should_transcode(pwsc,pmp3->codectype)) {
|
||||
/************************
|
||||
* Server side conversion
|
||||
************************/
|
||||
@ -861,7 +865,7 @@ void pi_stream(WS_CONNINFO *pwsc, char *id) {
|
||||
"Session %d: Streaming file '%s' to %s (offset %ld)\n",
|
||||
session,pmp3->fname, pwsc->hostname,(long)offset);
|
||||
|
||||
bytes_copied = plugin_ssc_transcode(pwsc,pmp3->path,pmp3->codectype,
|
||||
bytes_copied = _plugin_ssc_transcode(pwsc,pmp3->path,pmp3->codectype,
|
||||
pmp3->song_length,offset,1);
|
||||
|
||||
config_set_status(pwsc,session,NULL);
|
||||
|
@ -38,8 +38,6 @@ extern int plugin_rend_register(char *name, int port, char *iface, char *txt);
|
||||
extern void plugin_event_dispatch(int event_id, int intval, void *vp, int len);
|
||||
|
||||
/* these should really get rows */
|
||||
extern int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec);
|
||||
extern int plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers);
|
||||
|
||||
#define PLUGIN_E_SUCCESS 0
|
||||
#define PLUGIN_E_NOLOAD 1
|
||||
|
Loading…
Reference in New Issue
Block a user