Browse Source

* fix LDV::Imgbin->view

master
Alex 'AdUser' Z 9 years ago
parent
commit
4b4d339c29
  1. 3
      lib/LDV/Imgbin.pm

3
lib/LDV/Imgbin.pm

@ -45,9 +45,8 @@ sub view {
eval { eval {
my $path = $self->_data_path($time); my $path = $self->_data_path($time);
my $data = Mojo::Asset::File->new(path => $path); my $data = Mojo::Asset::File->new(path => $path);
$data->cleanup(0);
my $json = decode_json($data->slurp); my $json = decode_json($data->slurp);
die("image expired\n") if (time() > $data->{expire}); die("image expired\n") if (time() > $json->{expire});
$json->{path} = $self->_image_path($time, $json->{format}); $json->{path} = $self->_image_path($time, $json->{format});
$self->stash(image => $json); 1; $self->stash(image => $json); 1;

Loading…
Cancel
Save