From 6defeb0da4b16c1a9e8f9f2372eeee77427a92d3 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 18 Sep 2014 17:44:00 +0200 Subject: [PATCH] Fixed youtube thumbnails --- src/Services/PostService.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Services/PostService.php b/src/Services/PostService.php index ea198296..03f0d436 100644 --- a/src/Services/PostService.php +++ b/src/Services/PostService.php @@ -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();