Commit 5c3daae2 authored by SpinShare's avatar SpinShare

switching thumbnail generation before renaming

parent 01495213
......@@ -293,12 +293,12 @@ class SongController extends AbstractController
$fileType = explode(".", $coverFiles[0])[count(explode(".", $coverFiles[0])) - 1];
if(in_array($fileType, array('jpg', 'png'))) {
$trackInfo->albumArtReference->assetName = $song->getFileReference();
rename($coverFiles[0], $this->getParameter('cover_path').DIRECTORY_SEPARATOR.$song->getFileReference().".png");
// Generate Thumbnail
$hf = new HelperFunctions();
$hf->generateThumbnail($coverFiles[0], $this->getParameter('thumbnail_path').DIRECTORY_SEPARATOR.$song->getFileReference().".jpg", 300);
$trackInfo->albumArtReference->assetName = $song->getFileReference();
rename($coverFiles[0], $this->getParameter('cover_path').DIRECTORY_SEPARATOR.$song->getFileReference().".png");
}
}
} catch(Exception $e) {
......
......@@ -123,6 +123,9 @@ class UploadController extends AbstractController
// clean up temp files
$hf = new HelperFunctions();
$hf->delTree($extractionPath);
var_dump($e);
exit;
}
try {
......@@ -132,12 +135,12 @@ class UploadController extends AbstractController
$fileType = explode(".", $coverFiles[0])[count(explode(".", $coverFiles[0])) - 1];
if(in_array($fileType, array('jpg', 'png'))) {
$trackInfo->albumArtReference->assetName = $song->getFileReference();
rename($coverFiles[0], $this->getParameter('cover_path').DIRECTORY_SEPARATOR.$song->getFileReference().".png");
// Generate Thumbnail
$hf = new HelperFunctions();
$hf->generateThumbnail($coverFiles[0], $this->getParameter('thumbnail_path').DIRECTORY_SEPARATOR.$song->getFileReference().".jpg", 300);
$trackInfo->albumArtReference->assetName = $song->getFileReference();
rename($coverFiles[0], $this->getParameter('cover_path').DIRECTORY_SEPARATOR.$song->getFileReference().".png");
}
}
} catch(Exception $e) {
......@@ -146,6 +149,9 @@ class UploadController extends AbstractController
// clean up temp files
$hf = new HelperFunctions();
$hf->delTree($extractionPath);
var_dump($e);
exit;
}
try {
......@@ -165,6 +171,9 @@ class UploadController extends AbstractController
// clean up temp files
$hf = new HelperFunctions();
$hf->delTree($extractionPath);
var_dump($e);
exit;
}
// write new track/clip info
......@@ -197,9 +206,15 @@ class UploadController extends AbstractController
return $this->redirectToRoute('song.detail', ['songId' => $song->getId()]);
} catch(\Exception $e) {
$this->addFlash('error', 'Uploading failed. Please report back to our development team!');
var_dump($e);
exit;
}
} catch(\Exception $e) {
$this->addFlash('error', 'Uploading failed. Please report back to our development team!');
var_dump($e);
exit;
}
} else {
$this->addFlash('error', 'Uploading failed. Please report back to our development team!');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment