From: Marius Gavrilescu Date: Sun, 15 Mar 2015 13:43:46 +0000 (+0200) Subject: Fix usage of Date::Parse X-Git-Tag: 0.001002~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=f447922de5bf33450e11b85a885e2cd9d70b9677;p=webservice-strike.git Fix usage of Date::Parse --- diff --git a/lib/WebService/Strike/Torrent.pm b/lib/WebService/Strike/Torrent.pm index 34502bd..391a3cb 100644 --- a/lib/WebService/Strike/Torrent.pm +++ b/lib/WebService/Strike/Torrent.pm @@ -29,7 +29,7 @@ sub new{ my ($self, @args) = @_; $self = $self->SUPER::new(@args); $self->{torrent_hash} = uc $self->hash; - $self->{upload_date} = str2time $self->date; + $self->{upload_date} = str2time $self->date, 'UTC'; $self->{file_names} = $self->file_info->[0]->{file_names}; $self->{file_lengths} = $self->file_info->[0]->{file_lengths}; $self @@ -79,7 +79,7 @@ WebService::Strike::Torrent - Class representing information about a torrent say $t->leeches; say $t->count; # 1 say $t->size; # 587 MB - say $t->date; # 1420495200 + say $t->date; # 1420502400 say $t->uploader; # The_Doctor- say @{$t->names}; # archlinux-2015.01.01-dual.iso say @{$t->lengths}; # 615514112 diff --git a/t/WebService-Strike-Torrent.t b/t/WebService-Strike-Torrent.t index 9787119..ce57b0b 100644 --- a/t/WebService-Strike-Torrent.t +++ b/t/WebService-Strike-Torrent.t @@ -32,7 +32,7 @@ is $t->seeds, 645, 'seeds'; is $t->leeches, 13, 'leeches'; is $t->count, 1, 'count'; is $t->size, '587 MB', 'size'; -is $t->date, 1420495200,'date'; +is $t->date, 1420502400,'date'; is $t->uploader, 'The_Doctor-', 'uploader'; is $t->names->[0], 'archlinux-2015.01.01-dual.iso', 'names'; is $t->lengths->[0], 615514112, 'lengths'; diff --git a/t/WebService-Strike.t b/t/WebService-Strike.t index ffd59ad..ce3c39e 100644 --- a/t/WebService-Strike.t +++ b/t/WebService-Strike.t @@ -16,7 +16,7 @@ subtest 'order' => sub { is $t3->hash, '85DF191A921C20B2DDAFF72368CAB93BA18C5ACE', 'hash #3' }; -is $t1->date, 1420495200, 'date'; +is $t1->date, 1420502400, 'date'; is $t2->title, 'FreeBSD 7.1 i386.DVD.iso', 'title'; like $t1->torrent, qr/^d/, 'torrent file starts with d';