diff --git a/library/Class/AlbumRessource.php b/library/Class/AlbumRessource.php index 76788fc1163e96765979d5e4b0d8efba1924c778..158c1d12a3193e06f2ff155149b0c398813de45a 100644 --- a/library/Class/AlbumRessource.php +++ b/library/Class/AlbumRessource.php @@ -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(); diff --git a/library/ZendAfi/View/Helper/Album/XspfPlaylistVisitor.php b/library/ZendAfi/View/Helper/Album/XspfPlaylistVisitor.php index d5e97c61c2c32957cccf91547762fe3891c28aa6..4d900515745e21c7bdb0e8a1b02e22d77d48201b 100644 --- a/library/ZendAfi/View/Helper/Album/XspfPlaylistVisitor.php +++ b/library/ZendAfi/View/Helper/Album/XspfPlaylistVisitor.php @@ -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()) ); } } diff --git a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php index 3f3b9daee67e293aa500f69668a961961101d710..b3fd6da7d5d9f134f91fdfcf869b162aace26971 100644 --- a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php +++ b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php @@ -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