commit 30bb8f45dce5e0a57205a677a2b7b28996140e15 Author: Heinrich Langos Date: Sat Apr 12 02:29:13 2008 +0200 Added release date to podcasts extracted from the pubDate element. diff --git a/src/gnupod_addsong.pl b/src/gnupod_addsong.pl index 0f861fe..a21ac2d 100644 --- a/src/gnupod_addsong.pl +++ b/src/gnupod_addsong.pl @@ -29,6 +29,7 @@ use GNUpod::ArtworkDB; use Getopt::Long; use File::Copy; use File::Glob ':glob'; +use Date::Parse; use constant MEDIATYPE_PODCAST_AUDIO => 4; use constant MEDIATYPE_PODCAST_VIDEO => 6; @@ -487,6 +488,7 @@ sub resolve_podcasts { my $c_title = $podcast_item->{title}->{"\0"}; my $c_author = $podcast_item->{author}->{"\0"}; my $c_desc = $podcast_item->{description}->{"\0"}; + my $c_rdate = $podcast_item->{pubDate}->{"\0"}; my $c_url = $podcast_item->{enclosure}->{url}; #We use the URL as GUID if there isn't one... my $c_guid = $podcast_item->{guid}->{"\0"} || $c_url; @@ -517,6 +519,7 @@ sub resolve_podcasts { $per_file_info{$rssmedia->{file}}->{title} = $c_title if $c_title; $per_file_info{$rssmedia->{file}}->{artist} = $c_author if $c_author; $per_file_info{$rssmedia->{file}}->{desc} = $c_desc if $c_desc; + $per_file_info{$rssmedia->{file}}->{releasedate} = int(Date::Parse::str2time($c_rdate))+MACTIME if $c_rdate; push(@files,$rssmedia->{file}); }