Move URL etag from permalinks to media subdef urls

This commit is contained in:
Romain Neutron
2013-04-02 15:46:15 +02:00
parent 22919fd8ac
commit d5c97082d6
4 changed files with 21 additions and 7 deletions

View File

@@ -146,15 +146,14 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
{
$registry = registry::get_instance();
return sprintf('%spermalink/v1/%d/%d/%s/%s.%s?token=%s&etag=%s',
return sprintf('%spermalink/v1/%d/%d/%s/%s.%s?token=%s',
$registry->get('GV_ServerName'),
$this->media_subdef->get_sbas_id(),
$this->media_subdef->get_record_id(),
$this->media_subdef->get_name(),
$this->get_label(),
pathinfo($this->media_subdef->get_file(), PATHINFO_EXTENSION),
$this->get_token(),
$this->media_subdef->getEtag()
$this->get_token()
);
}

View File

@@ -364,6 +364,14 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return $this;
}
public function get_url()
{
$url = parent::get_url();
$etag = $this->getEtag();
return $url . ($etag ? '?etag=' . $etag : '');
}
/**
*
* @return int