Fixed youtube thumbnails
This commit is contained in:
parent
7806333b24
commit
6defeb0da4
1 changed files with 3 additions and 7 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue