Merge branch 'saas-s3proxy' into saas

This commit is contained in:
Albert Santoni 2015-04-01 13:49:47 -04:00
commit 7fd58ac51b
12 changed files with 116 additions and 36 deletions

View file

@ -362,8 +362,9 @@ SQL;
{
$exists = false;
try {
$filePath = $this->getFilePath();
$exists = (file_exists($this->getFilePath()) && !is_dir($filePath));
$filePaths = $this->getFilePaths();
$filePath = $filePaths[0];
$exists = (file_exists($filePath) && !is_dir($filePath));
} catch (Exception $e) {
return false;
}
@ -444,8 +445,6 @@ SQL;
*/
public function deleteByMediaMonitor($deleteFromPlaylist=false)
{
$filepath = $this->getFilePath();
if ($deleteFromPlaylist) {
Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId());
}
@ -499,13 +498,13 @@ SQL;
/**
* Get the absolute filepath
*
* @return string
* @return array of strings
*/
public function getFilePath()
public function getFilePaths()
{
assert($this->_file);
return $this->_file->getURLForTrackPreviewOrDownload();
return $this->_file->getURLsForTrackPreviewOrDownload();
}
/**
@ -1243,9 +1242,11 @@ SQL;
$genre = $file->getDbGenre();
$release = $file->getDbUtime();
try {
$filePaths = $this->getFilePaths();
$filePath = $filePaths[0];
$soundcloud = new Application_Model_Soundcloud();
$soundcloud_res = $soundcloud->uploadTrack(
$this->getFilePath(), $this->getName(), $description,
$filePath, $this->getName(), $description,
$tag, $release, $genre);
$this->setSoundCloudFileId($soundcloud_res['id']);
$this->setSoundCloudLinkToFile($soundcloud_res['permalink_url']);