Commit 4b238895 authored by Leigh Stoller's avatar Leigh Stoller

Merge branch 'mymaster'

parents 8a583ae9 e0b5257a
......@@ -57,6 +57,8 @@ use Data::Dumper;
use Date::Parse;
use POSIX qw(strftime);
use Time::Local;
use URI;
use URI::QueryParam;
use Project;
# Configure variables
......@@ -606,6 +608,30 @@ sub GetImageInfo($)
"left join images as i on ".
" i.image_uuid=v.image_uuid ".
"where v.metadata_url=$safe_url");
if (defined($query_result) && !$query_result->numrows()) {
#
# See if the url is for the image instead of a specific
# version.
#
my $uri = URI->new($url);
my $uuid = $uri->query_param("uuid");
if ($uuid) {
$query_result =
$DB->QueryWarn("select i.*,v.* ".
" from image_versions as v ".
" inner join ".
" (select image_uuid, ".
" max(version) as version ".
" from image_versions ".
" where image_uuid='$uuid' ".
" group by image_uuid) as ij ".
" on v.image_uuid=ij.image_uuid and ".
" v.version=ij.version ".
"left join images as i on ".
" i.image_uuid=v.image_uuid");
}
}
}
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED)
if (!defined($query_result) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment