| @@ 122-132 (lines=11) @@ | ||
| 119 | /** |
|
| 120 | * {@inheritdoc} |
|
| 121 | */ |
|
| 122 | public function update(Asset $asset) |
|
| 123 | { |
|
| 124 | if (!$id = $this->retrieve($asset)) { |
|
| 125 | throw new \Exception('Asset is unknown to Dailymotion'); |
|
| 126 | } |
|
| 127 | ||
| 128 | $dailymotion = $this->getClient(); |
|
| 129 | ||
| 130 | // Update video |
|
| 131 | $dailymotion->post("/video/$id", $this->getResource($asset)); |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * {@inheritdoc} |
|
| @@ 137-149 (lines=13) @@ | ||
| 134 | /** |
|
| 135 | * {@inheritdoc} |
|
| 136 | */ |
|
| 137 | public function remove(Asset $asset) |
|
| 138 | { |
|
| 139 | if (!$id = $this->retrieve($asset)) { |
|
| 140 | throw new \Exception('Asset is unknown to Dailymotion'); |
|
| 141 | } |
|
| 142 | ||
| 143 | $dailymotion = $this->getClient(); |
|
| 144 | ||
| 145 | // Delete video |
|
| 146 | $dailymotion->delete("/video/$id"); |
|
| 147 | ||
| 148 | $this->forget($asset); |
|
| 149 | } |
|
| 150 | ||
| 151 | /** |
|
| 152 | * |
|
| @@ 200-210 (lines=11) @@ | ||
| 197 | /** |
|
| 198 | * {@inheritdoc} |
|
| 199 | */ |
|
| 200 | public function remove(Asset $asset) |
|
| 201 | { |
|
| 202 | if (!$video_id = $this->retrieve($asset)) { |
|
| 203 | throw new \Exception('Asset is unknown to YouTube'); |
|
| 204 | } |
|
| 205 | ||
| 206 | $youtube = $this->getClient(); |
|
| 207 | $youtube->videos->delete($video_id); |
|
| 208 | ||
| 209 | $this->forget($asset); |
|
| 210 | } |
|
| 211 | ||
| 212 | /** |
|
| 213 | * {@inheritdoc} |
|