Commit 61cac2cd authored by Antoine Cellerier's avatar Antoine Cellerier

Add config option to disable album art support in the HTTP interface.

parent d1b5d5b8
...@@ -46,6 +46,10 @@ static void Close( vlc_object_t * ); ...@@ -46,6 +46,10 @@ static void Close( vlc_object_t * );
#define HANDLERS_LONGTEXT N_( \ #define HANDLERS_LONGTEXT N_( \
"List of handler extensions and executable paths (for instance: " \ "List of handler extensions and executable paths (for instance: " \
"php=/usr/bin/php,pl=/usr/bin/perl)." ) "php=/usr/bin/php,pl=/usr/bin/perl)." )
#define ART_TEXT N_( "Export album art as /art." )
#define ART_LONGTEXT N_( \
"Allow exporting album art for current playlist items at the " \
"/art and /art?id=<id> URLs." )
#define CERT_TEXT N_( "Certificate file" ) #define CERT_TEXT N_( "Certificate file" )
#define CERT_LONGTEXT N_( "HTTP interface x509 PEM certificate file " \ #define CERT_LONGTEXT N_( "HTTP interface x509 PEM certificate file " \
"(enables SSL)." ) "(enables SSL)." )
...@@ -68,6 +72,7 @@ vlc_module_begin(); ...@@ -68,6 +72,7 @@ vlc_module_begin();
#if defined( HAVE_FORK ) || defined( WIN32 ) #if defined( HAVE_FORK ) || defined( WIN32 )
add_string ( "http-handlers", NULL, NULL, HANDLERS_TEXT, HANDLERS_LONGTEXT, VLC_TRUE ); add_string ( "http-handlers", NULL, NULL, HANDLERS_TEXT, HANDLERS_LONGTEXT, VLC_TRUE );
#endif #endif
add_bool ( "http-album-art", 1, NULL, ART_TEXT, ART_LONGTEXT, VLC_TRUE );
set_section( N_("HTTP SSL" ), 0 ); set_section( N_("HTTP SSL" ), 0 );
add_string ( "http-intf-cert", NULL, NULL, CERT_TEXT, CERT_LONGTEXT, VLC_TRUE ); add_string ( "http-intf-cert", NULL, NULL, CERT_TEXT, CERT_LONGTEXT, VLC_TRUE );
add_string ( "http-intf-key", NULL, NULL, KEY_TEXT, KEY_LONGTEXT, VLC_TRUE ); add_string ( "http-intf-key", NULL, NULL, KEY_TEXT, KEY_LONGTEXT, VLC_TRUE );
...@@ -344,6 +349,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -344,6 +349,8 @@ static int Open( vlc_object_t *p_this )
E_(ParseDirectory)( p_intf, psz_src, psz_src ); E_(ParseDirectory)( p_intf, psz_src, psz_src );
if( config_GetInt( p_intf, "http-album-art" ) )
{
/* FIXME: we're leaking h */ /* FIXME: we're leaking h */
httpd_handler_sys_t *h = malloc( sizeof( httpd_handler_sys_t ) ); httpd_handler_sys_t *h = malloc( sizeof( httpd_handler_sys_t ) );
if( !h ) if( !h )
...@@ -359,6 +366,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -359,6 +366,7 @@ static int Open( vlc_object_t *p_this )
"/art", NULL, NULL, NULL, "/art", NULL, NULL, NULL,
E_(ArtCallback), h ); E_(ArtCallback), h );
TAB_APPEND( p_sys->i_handlers, p_sys->pp_handlers, h->p_handler ); TAB_APPEND( p_sys->i_handlers, p_sys->pp_handlers, h->p_handler );
}
if( p_sys->i_files <= 0 ) if( p_sys->i_files <= 0 )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment