Skip to content
Snippets Groups Projects
Commit aba1e4de authored by llaffont's avatar llaffont
Browse files

Génération playlist album format Xspf

parent f50a0be2
Branches
Tags
No related merge requests found
......@@ -461,6 +461,9 @@ class Class_AlbumRessource extends Storm_Model_Abstract {
* @return string
*/
public function getThumbnailUrl() {
if ($this->hasVignette())
return $this->getThumbnailsUrl().$this->getVignette();
if ($this->isImage())
return $this->getLocatedFile($this->getThumbnailsUrl());
return $this->_getDefaultThumbnailUrl();
......
......@@ -40,7 +40,9 @@ class ZendAfi_View_Helper_Album_XspfPlaylistVisitor extends Zend_View_Helper_Ab
public function visitRessource($ressource, $index) {
$this->_tracks []= $this->_builder->track(
$this->_builder->title($ressource->getTitre())
$this->_builder->title($this->view->escape($ressource->getTitre()))
.$this->_builder->image('http://' . $_SERVER['SERVER_NAME'] . $ressource->getThumbnailUrl())
.$this->_builder->location('http://' . $_SERVER['SERVER_NAME'] . $ressource->getOriginalUrl())
);
}
}
......
......@@ -541,6 +541,30 @@ class BibNumeriqueControllerAlbumMultiMediasTest extends AbstractControllerTestC
'//xspf:playlist/xspf:trackList/xspf:track/xspf:title',
'Emilie jolie');
}
/** @test */
public function firstTrackImageShouldBeMimiJolieDotPng() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//xspf:playlist/xspf:trackList/xspf:track/xspf:image',
'http://localhost/afi-opac3/userfiles/album/999/thumbs/media/mimi_jolie.png');
}
/** @test */
public function firstTrackLocationShouldBeMimiJolieDotMp3() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//xspf:playlist/xspf:trackList/xspf:track/xspf:location',
'http://localhost/afi-opac3/userfiles/album/999/big/media/mimi_jolie.mp3');
}
/** @test */
public function secondTrackTitleShouldBeBatmanDarkKnight() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//xspf:playlist/xspf:trackList/xspf:track/xspf:title',
'Batman Dark Knight');
}
}
?>
\ No newline at end of file
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