| 218 | | && !strcmp( psz_elname, "itunes:category" ) ) |
|---|
| 219 | | { |
|---|
| 220 | | psz_item_category = strdup( psz_text ); |
|---|
| 221 | | } |
|---|
| 222 | | else if( b_item == VLC_TRUE |
|---|
| 223 | | && !strcmp( psz_elname, "itunes:duration" ) ) |
|---|
| 224 | | { |
|---|
| 225 | | psz_item_duration = strdup( psz_text ); |
|---|
| 226 | | } |
|---|
| 227 | | else if( b_item == VLC_TRUE |
|---|
| 228 | | && !strcmp( psz_elname, "itunes:keywords" ) ) |
|---|
| 229 | | { |
|---|
| 230 | | psz_item_keywords = strdup( psz_text ); |
|---|
| 231 | | } |
|---|
| 232 | | else if( b_item == VLC_TRUE |
|---|
| 233 | | && !strcmp( psz_elname, "itunes:subtitle" ) ) |
|---|
| 234 | | { |
|---|
| 235 | | psz_item_subtitle = strdup( psz_text ); |
|---|
| 236 | | } |
|---|
| 237 | | else if( b_item == VLC_TRUE |
|---|
| 249 | | else if( b_item == VLC_FALSE && b_image == VLC_FALSE |
|---|
| 250 | | && !strcmp( psz_elname, "link" ) ) |
|---|
| 251 | | { |
|---|
| 252 | | vlc_input_item_AddInfo( p_current->p_input, |
|---|
| 253 | | _( "Podcast Info" ), |
|---|
| 254 | | _( "Podcast Link" ), |
|---|
| 255 | | "%s", |
|---|
| 256 | | psz_text ); |
|---|
| 257 | | } |
|---|
| 258 | | else if( b_item == VLC_FALSE && b_image == VLC_FALSE |
|---|
| 259 | | && !strcmp( psz_elname, "copyright" ) ) |
|---|
| 260 | | { |
|---|
| 261 | | vlc_input_item_AddInfo( p_current->p_input, |
|---|
| 262 | | _( "Podcast Info" ), |
|---|
| 263 | | _( "Podcast Copyright" ), |
|---|
| 264 | | "%s", |
|---|
| 265 | | psz_text ); |
|---|
| 266 | | } |
|---|
| 267 | | else if( b_item == VLC_FALSE && b_image == VLC_FALSE |
|---|
| 268 | | && !strcmp( psz_elname, "itunes:category" ) ) |
|---|
| 269 | | { |
|---|
| 270 | | vlc_input_item_AddInfo( p_current->p_input, |
|---|
| 271 | | _( "Podcast Info" ), |
|---|
| 272 | | _( "Podcast Category" ), |
|---|
| 273 | | "%s", |
|---|
| 274 | | psz_text ); |
|---|
| 275 | | } |
|---|
| 276 | | else if( b_item == VLC_FALSE && b_image == VLC_FALSE |
|---|
| 277 | | && !strcmp( psz_elname, "itunes:keywords" ) ) |
|---|
| 278 | | { |
|---|
| 279 | | vlc_input_item_AddInfo( p_current->p_input, |
|---|
| 280 | | _( "Podcast Info" ), |
|---|
| 281 | | _( "Podcast Keywords" ), |
|---|
| 282 | | "%s", |
|---|
| 283 | | psz_text ); |
|---|
| 284 | | } |
|---|
| 285 | | else if( b_item == VLC_FALSE && b_image == VLC_FALSE |
|---|
| 286 | | && !strcmp( psz_elname, "itunes:subtitle" ) ) |
|---|
| 287 | | { |
|---|
| 288 | | vlc_input_item_AddInfo( p_current->p_input, |
|---|
| 289 | | _( "Podcast Info" ), |
|---|
| 290 | | _( "Podcast Subtitle" ), |
|---|
| 291 | | "%s", |
|---|
| 292 | | psz_text ); |
|---|
| 293 | | } |
|---|
| | 234 | #define ADD_GINFO( info, name ) \ |
|---|
| | 235 | else if( !b_item && !b_image && !strcmp( psz_elname, name ) ) \ |
|---|
| | 236 | { \ |
|---|
| | 237 | vlc_input_item_AddInfo( p_current->p_input, _("Podcast Info"), \ |
|---|
| | 238 | _( info ), "%s", psz_text ); \ |
|---|
| | 239 | } |
|---|
| | 240 | ADD_GINFO( "Podcast Link", "link" ) |
|---|
| | 241 | ADD_GINFO( "Podcast Copyright", "copyright" ) |
|---|
| | 242 | ADD_GINFO( "Podcast Category", "itunes:category" ) |
|---|
| | 243 | ADD_GINFO( "Podcast Keywords", "itunes:keywords" ) |
|---|
| | 244 | ADD_GINFO( "Podcast Subtitle", "itunes:subtitle" ) |
|---|
| | 245 | #undef ADD_GINFO |
|---|
| 324 | | if( psz_item_date ) |
|---|
| 325 | | { |
|---|
| 326 | | vlc_input_item_AddInfo( p_input, |
|---|
| 327 | | _( "Podcast Info" ), |
|---|
| 328 | | _( "Podcast Publication Date" ), |
|---|
| 329 | | "%s", |
|---|
| 330 | | psz_item_date ); |
|---|
| 331 | | } |
|---|
| 332 | | if( psz_item_author ) |
|---|
| 333 | | { |
|---|
| 334 | | vlc_input_item_AddInfo( p_input, |
|---|
| 335 | | _( "Podcast Info" ), |
|---|
| 336 | | _( "Podcast Author" ), |
|---|
| 337 | | "%s", |
|---|
| 338 | | psz_item_author ); |
|---|
| 339 | | } |
|---|
| 340 | | if( psz_item_category ) |
|---|
| 341 | | { |
|---|
| 342 | | vlc_input_item_AddInfo( p_input, |
|---|
| 343 | | _( "Podcast Info" ), |
|---|
| 344 | | _( "Podcast Subcategory" ), |
|---|
| 345 | | "%s", |
|---|
| 346 | | psz_item_category ); |
|---|
| 347 | | } |
|---|
| 348 | | if( psz_item_duration ) |
|---|
| 349 | | { |
|---|
| 350 | | vlc_input_item_AddInfo( p_input, |
|---|
| 351 | | _( "Podcast Info" ), |
|---|
| 352 | | _( "Podcast Duration" ), |
|---|
| 353 | | "%s", |
|---|
| 354 | | psz_item_duration ); |
|---|
| 355 | | } |
|---|
| 356 | | if( psz_item_keywords ) |
|---|
| 357 | | { |
|---|
| 358 | | vlc_input_item_AddInfo( p_input, |
|---|
| 359 | | _( "Podcast Info" ), |
|---|
| 360 | | _( "Podcast Keywords" ), |
|---|
| 361 | | "%s", |
|---|
| 362 | | psz_item_keywords ); |
|---|
| 363 | | } |
|---|
| 364 | | if( psz_item_subtitle ) |
|---|
| 365 | | { |
|---|
| 366 | | vlc_input_item_AddInfo( p_input, |
|---|
| 367 | | _( "Podcast Info" ), |
|---|
| 368 | | _( "Podcast Subtitle" ), |
|---|
| 369 | | "%s", |
|---|
| 370 | | psz_item_subtitle ); |
|---|
| 371 | | } |
|---|
| 372 | | if( psz_item_summary ) |
|---|
| 373 | | { |
|---|
| 374 | | vlc_input_item_AddInfo( p_input, |
|---|
| 375 | | _( "Podcast Info" ), |
|---|
| 376 | | _( "Podcast Summary" ), |
|---|
| 377 | | "%s", |
|---|
| 378 | | psz_item_summary ); |
|---|
| 379 | | } |
|---|
| | 274 | #define ADD_INFO( info, field ) \ |
|---|
| | 275 | if( field ) { vlc_input_item_AddInfo( p_input, \ |
|---|
| | 276 | _( "Podcast Info" ), _( info ), "%s", field ); } |
|---|
| | 277 | ADD_INFO( "Podcast Publication Date", psz_item_date ); |
|---|
| | 278 | ADD_INFO( "Podcast Author", psz_item_author ); |
|---|
| | 279 | ADD_INFO( "Podcast Subcategory", psz_item_category ); |
|---|
| | 280 | ADD_INFO( "Podcast Duration", psz_item_duration ); |
|---|
| | 281 | ADD_INFO( "Podcast Keywords", psz_item_keywords ); |
|---|
| | 282 | ADD_INFO( "Podcast Subtitle", psz_item_subtitle ); |
|---|
| | 283 | ADD_INFO( "Podcast Summary", psz_item_summary ); |
|---|
| | 284 | ADD_INFO( "Podcast Type", psz_item_type ); |
|---|
| 401 | | #define FREE(a) if( a ) free( a ); a = NULL; |
|---|
| 402 | | FREE( psz_item_name ); |
|---|
| 403 | | FREE( psz_item_mrl ); |
|---|
| 404 | | FREE( psz_item_size ); |
|---|
| 405 | | FREE( psz_item_type ); |
|---|
| 406 | | FREE( psz_item_date ); |
|---|
| 407 | | FREE( psz_item_author ); |
|---|
| 408 | | FREE( psz_item_category ); |
|---|
| 409 | | FREE( psz_item_duration ); |
|---|
| 410 | | FREE( psz_item_keywords ); |
|---|
| 411 | | FREE( psz_item_subtitle ); |
|---|
| 412 | | FREE( psz_item_summary ); |
|---|
| 413 | | #undef FREE |
|---|
| 414 | | |
|---|
| | 296 | FREENULL( psz_item_name ); |
|---|
| | 297 | FREENULL( psz_item_mrl ); |
|---|
| | 298 | FREENULL( psz_item_size ); |
|---|
| | 299 | FREENULL( psz_item_type ); |
|---|
| | 300 | FREENULL( psz_item_date ); |
|---|
| | 301 | FREENULL( psz_item_author ); |
|---|
| | 302 | FREENULL( psz_item_category ); |
|---|
| | 303 | FREENULL( psz_item_duration ); |
|---|
| | 304 | FREENULL( psz_item_keywords ); |
|---|
| | 305 | FREENULL( psz_item_subtitle ); |
|---|
| | 306 | FREENULL( psz_item_summary ); |
|---|