use warnings;
use parent qw/Class::Accessor::Fast/;
-our $VERSION = '0.001001';
+our $VERSION = '0.002';
use Date::Parse qw/str2time/;
use JSON::MaybeXS qw/decode_json/;
my ($self, @args) = @_;
$self = $self->SUPER::new(@args);
$self->{torrent_hash} = uc $self->hash;
- $self->{upload_date} = str2time $self->date;
- $self->{file_names} = $self->file_info->[0]->{file_names};
- $self->{file_lengths} = $self->file_info->[0]->{file_lengths};
+ $self->{upload_date} = str2time $self->date, 'UTC';
+ if ($self->file_info) {
+ $self->{file_names} = $self->file_info->[0]->{file_names};
+ $self->{file_lengths} = $self->file_info->[0]->{file_lengths};
+ }
$self
}
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