- p_item = playlist_ItemNew( p_playlist, psz_item_mrl,
- psz_item_name );
- if( p_item == NULL ) break;
- playlist_NodeAddItem( p_playlist, p_item,
- p_current->pp_parents[0]->i_view,
- p_current, PLAYLIST_APPEND,
- PLAYLIST_END );
-
- /* We need to declare the parents of the node as the
- * * same of the parent's ones */
- playlist_CopyParents( p_current, p_item );
-
- if( psz_item_date )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Publication Date" ),
- "%s",
- psz_item_date );
- }
- if( psz_item_author )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Author" ),
- "%s",
- psz_item_author );
- }
- if( psz_item_category )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Subcategory" ),
- "%s",
- psz_item_category );
- }
- if( psz_item_duration )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Duration" ),
- "%s",
- psz_item_duration );
- }
- if( psz_item_keywords )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Keywords" ),
- "%s",
- psz_item_keywords );
- }
- if( psz_item_subtitle )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Subtitle" ),
- "%s",
- psz_item_subtitle );
- }
- if( psz_item_summary )
- {
- vlc_input_item_AddInfo( &p_item->input,
- _("Meta-information"),
- _( "Podcast Summary" ),
- "%s",
- psz_item_summary );
- }
+ p_input = input_ItemNewExt( p_playlist, psz_item_mrl,
+ psz_item_name, 0, NULL, -1 );
+ if( p_input == NULL ) break;
+#define ADD_INFO( info, field ) \
+ if( field ) { input_ItemAddInfo( p_input, \
+ _( "Podcast Info" ), _( info ), "%s", field ); }
+ ADD_INFO( "Podcast Publication Date", psz_item_date );
+ ADD_INFO( "Podcast Author", psz_item_author );
+ ADD_INFO( "Podcast Subcategory", psz_item_category );
+ ADD_INFO( "Podcast Duration", psz_item_duration );
+ ADD_INFO( "Podcast Keywords", psz_item_keywords );
+ ADD_INFO( "Podcast Subtitle", psz_item_subtitle );
+ ADD_INFO( "Podcast Summary", psz_item_summary );
+ ADD_INFO( "Podcast Type", psz_item_type );