Stick <info> element into PXML.xml .. parser, disco-t, pxml-t
[pandora-libraries.git] / lib / pnd_discovery.c
index 4087086..eeee25e 100644 (file)
@@ -39,6 +39,9 @@ void pnd_disco_destroy ( pnd_disco_t *p ) {
   if ( p -> alt_category1 ) {  free ( p -> alt_category1 );  }
   if ( p -> alt_category2 ) {  free ( p -> alt_category2 );  }
   if ( p -> mkdir_sp )      {  free ( p -> mkdir_sp );       }
+  if ( p -> info_name )     {  free ( p -> info_name );       }
+  if ( p -> info_type )     {  free ( p -> info_type );       }
+  if ( p -> info_filename ) {  free ( p -> info_filename );       }
 
   return;
 }
@@ -183,7 +186,7 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
       char *fixpxml;
       char *z;
 
-      pnd_log ( PND_LOG_DEFAULT, "Setting up discovered app %u\n", ((pnd_pxml_t*) pxmlh) -> subapp_number );
+      //pnd_log ( PND_LOG_DEFAULT, "Setting up discovered app %u\n", ((pnd_pxml_t*) pxmlh) -> subapp_number );
 
       p = pnd_box_allocinsert ( disco_box, (char*) fpath, sizeof(pnd_disco_t) );
 
@@ -267,6 +270,16 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
       if ( pnd_pxml_get_mkdir ( pxmlh ) ) {
        p -> mkdir_sp = strdup ( pnd_pxml_get_mkdir ( pxmlh ) );
       }
+      // info
+      if ( pnd_pxml_get_info_src ( pxmlh ) ) {
+       p -> info_filename = strdup ( pnd_pxml_get_info_src ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_info_name ( pxmlh ) ) {
+       p -> info_name = strdup ( pnd_pxml_get_info_name ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_info_type ( pxmlh ) ) {
+       p -> info_type = strdup ( pnd_pxml_get_info_type ( pxmlh ) );
+      }
 
     } else {
       //printf ( "Invalid PXML; skipping.\n" );