Commit 01495213 authored by SpinShare's avatar SpinShare

thumbnail search fix

parent b8d024f5
...@@ -76,12 +76,17 @@ class SystemController extends AbstractController ...@@ -76,12 +76,17 @@ class SystemController extends AbstractController
$allSongs = $em->getRepository(Song::class)->findAll(); $allSongs = $em->getRepository(Song::class)->findAll();
foreach($allSongs as $oneSong) { try {
$filePath = glob($this->getParameter('cover_path').DIRECTORY_SEPARATOR.$oneSong->getFileReference().".png"); foreach($allSongs as $oneSong) {
if(count($filePath) > 0) { $filePath = glob($this->getParameter('cover_path').DIRECTORY_SEPARATOR.$oneSong->getFileReference().".png");
$hf = new HelperFunctions(); if(count($filePath) > 0) {
$hf->generateThumbnail($filePath[0], $this->getParameter('thumbnail_path').DIRECTORY_SEPARATOR.$oneSong->getFileReference().".jpg", 300); $hf = new HelperFunctions();
$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'); return $this->redirectToRoute('moderation.system.index');
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<div class="song-list"> <div class="song-list">
{% for song in results.songs %} {% for song in results.songs %}
<a class="song-item" href="{{ path('song.detail', {songId: song.id}) }}"> <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-info">
<div class="song-charter"><i class="mdi mdi-account-circle"></i><span>{{ song.charter|default('Unknown') }}</span></div> <div class="song-charter"><i class="mdi mdi-account-circle"></i><span>{{ song.charter|default('Unknown') }}</span></div>
</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