Fixed youtube thumbnails

This commit is contained in:
Marcin Kurczewski 2014-09-18 17:44:00 +02:00
parent 7806333b24
commit 6defeb0da4

View file

@ -175,7 +175,9 @@ class PostService
$post->setContentChecksum($youtubeId);
$this->assertNoPostWithThisContentChecksum($post);
$this->removeThumbnail($post);
$youtubeThumbnailUrl = 'http://img.youtube.com/vi/' . $youtubeId . '/mqdefault.jpg';
$youtubeThumbnail = $this->fileService->download($youtubeThumbnailUrl);
$this->fileService->save($this->getPostThumbnailSourcePath($post), $youtubeThumbnail);
}
else
{
@ -189,12 +191,6 @@ class PostService
$post->setTags($newTags);
}
private function removeThumbnail(\Szurubooru\Entities\Post $post)
{
//...
//todo: remove thumbnail on upload
}
private function assertNoPostWithThisContentChecksum(\Szurubooru\Entities\Post $parent)
{
$checksumToCheck = $parent->getContentChecksum();