mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-06 20:00:48 +00:00
Merge pull request #5664 from hnrd/fix-migrate2cloud
Skip thumbnail cloud upload if no thumbnail exists
This commit is contained in:
commit
92ce41ce18
1 changed files with 4 additions and 2 deletions
|
@ -85,7 +85,9 @@ class MediaStorageService
|
||||||
protected function localToCloud($media)
|
protected function localToCloud($media)
|
||||||
{
|
{
|
||||||
$path = storage_path('app/'.$media->media_path);
|
$path = storage_path('app/'.$media->media_path);
|
||||||
$thumb = storage_path('app/'.$media->thumbnail_path);
|
if ($media->thumbnail_path) {
|
||||||
|
$thumb = storage_path('app/'.$media->thumbnail_path);
|
||||||
|
}
|
||||||
|
|
||||||
$p = explode('/', $media->media_path);
|
$p = explode('/', $media->media_path);
|
||||||
$name = array_pop($p);
|
$name = array_pop($p);
|
||||||
|
@ -94,7 +96,7 @@ class MediaStorageService
|
||||||
$storagePath = implode('/', $p);
|
$storagePath = implode('/', $p);
|
||||||
|
|
||||||
$url = ResilientMediaStorageService::store($storagePath, $path, $name);
|
$url = ResilientMediaStorageService::store($storagePath, $path, $name);
|
||||||
if ($thumb) {
|
if ($media->thumbnail_path) {
|
||||||
$thumbUrl = ResilientMediaStorageService::store($storagePath, $thumb, $thumbname);
|
$thumbUrl = ResilientMediaStorageService::store($storagePath, $thumb, $thumbname);
|
||||||
$media->thumbnail_url = $thumbUrl;
|
$media->thumbnail_url = $thumbUrl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue