Fix #1703 bridge is broken

This commit is contained in:
Nicolas Le Goff
2014-02-28 12:31:34 +01:00
parent 5adc7604bb
commit 491385cb06
5 changed files with 14 additions and 14 deletions

View File

@@ -278,7 +278,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
break; break;
} }
} }
@@ -378,7 +378,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
$result = $this->_api->call($url, $params, $this->oauth_token); $result = $this->_api->call($url, $params, $this->oauth_token);
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
break; break;
} }
@@ -402,7 +402,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
return $playlist["id"]; return $playlist["id"];
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type);
break; break;
} }
} }
@@ -437,7 +437,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id); return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id);
break; break;
default: default:
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container); throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $element_type);
break; break;
} }
break; break;
@@ -582,7 +582,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
{ {
switch ($record->get_type()) { switch ($record->get_type()) {
case self::ELEMENT_TYPE_VIDEO : case self::ELEMENT_TYPE_VIDEO :
$url_file = $this->_api->uploadFile($record->get_hd_file()->getRealPath(), $this->oauth_token); $url_file = $this->_api->sendFile($record->get_hd_file()->getRealPath(), $this->oauth_token);
$options = array_merge(array('url' => $url_file), $options); $options = array_merge(array('url' => $url_file), $options);
$video = $this->_api->call('POST /me/videos', $options, $this->oauth_token); $video = $this->_api->call('POST /me/videos', $options, $this->oauth_token);

View File

@@ -205,9 +205,9 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
throw new Bridge_Exception_ApiConnectorRequestFailed('Unable to retrieve photoset infos for ' . $object); throw new Bridge_Exception_ApiConnectorRequestFailed('Unable to retrieve photoset infos for ' . $object);
$xml = $response->getXml(); $xml = $response->getXml();
$primary_photo = $this->get_element_from_id((string) $child['primary'], self::ELEMENT_TYPE_PHOTO); $primary_photo = $this->get_element_from_id((string) $xml->photo['id'], self::ELEMENT_TYPE_PHOTO);
return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $type, $primary_photo->get_thumbnail()); return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $object, $primary_photo->get_thumbnail());
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
@@ -288,7 +288,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
break; break;
} }

View File

@@ -10,7 +10,7 @@
*/ */
use Symfony\Component\Routing\Generator\UrlGenerator; use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\HttpFoundation\Request;
/** /**
* *
* @package Bridge * @package Bridge

View File

@@ -327,7 +327,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
break; break;
} }
@@ -348,7 +348,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
$container_title = $request->get('f_container_title'); $container_title = $request->get('f_container_title');
$new_playlist = $this->_api->newPlaylistListEntry(); $new_playlist = $this->_api->newPlaylistListEntry();
if (trim($description) !== '') if (trim($container_desc) !== '')
$new_playlist->description = $this->_api->newDescription()->setText($container_desc); $new_playlist->description = $this->_api->newDescription()->setText($container_desc);
$new_playlist->title = $this->_api->newTitle()->setText($container_title); $new_playlist->title = $this->_api->newTitle()->setText($container_title);
@@ -359,7 +359,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type);
break; break;
} }
} }
@@ -389,7 +389,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
return new Bridge_Api_Youtube_Container($playlistEntry, $destination, null); return new Bridge_Api_Youtube_Container($playlistEntry, $destination, null);
break; break;
default: default:
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container); throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $destination);
break; break;
} }
break; break;

View File

@@ -75,7 +75,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
* *
* @return String the resulting URL * @return String the resulting URL
*/ */
public function uploadFile($filePath, $oauth_token) public function sendFile($filePath, $oauth_token)
{ {
$result = $this->call('file.upload', array(), $oauth_token); $result = $this->call('file.upload', array(), $oauth_token);
$timeout = $this->timeout; $timeout = $this->timeout;