Commit 01495213 authored by SpinShare's avatar SpinShare

thumbnail search fix

parent b8d024f5
......@@ -76,6 +76,7 @@ class SystemController extends AbstractController
$allSongs = $em->getRepository(Song::class)->findAll();
try {
foreach($allSongs as $oneSong) {
$filePath = glob($this->getParameter('cover_path').DIRECTORY_SEPARATOR.$oneSong->getFileReference().".png");
if(count($filePath) > 0) {
......@@ -83,6 +84,10 @@ class SystemController extends AbstractController
$hf->generateThumbnail($filePath[0], $this->getParameter('thumbnail_path').DIRECTORY_SEPARATOR.$oneSong->getFileReference().".jpg", 300);
}
}
} catch(\Exception $e) {
var_dump($e);
exit;
}
return $this->redirectToRoute('moderation.system.index');
}
......
......@@ -52,7 +52,7 @@
<div class="song-list">
{% for song in results.songs %}
<a class="song-item" href="{{ path('song.detail', {songId: song.id}) }}">
<div class="song-cover" style="background-image: url({{ asset("uploads/cover/" ~ song.fileReference ~ ".png?v=" ~ date().timestamp) }}), url({{ asset("assets/img/defaultAlbumArt.jpg") }});">
<div class="song-cover" style="background-image: url({{ asset("uploads/thumbnail/" ~ song.fileReference ~ ".jpg?v=" ~ date().timestamp) }}), url({{ asset("assets/img/defaultAlbumArt.jpg") }});">
<div class="song-charter-info">
<div class="song-charter"><i class="mdi mdi-account-circle"></i><span>{{ song.charter|default('Unknown') }}</span></div>
</div>
......
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