Commit 8fae2c78 authored by Andreas Heimann's avatar Andreas Heimann

fixed difficulty for upload

parent eb8c3ac0
......@@ -92,8 +92,9 @@ class UploadController extends AbstractController
$song->setHasExtremeDifficulty(false);
$song->setHasXDDifficulty(false);
foreach($trackData as $oneData) {
switch($oneData->difficultyType) {
foreach($trackInfo->difficulties as $oneData) {
if($oneData->_active) {
switch($oneData->_difficulty) {
case 2:
$song->setHasEasyDifficulty(true);
break;
......@@ -111,6 +112,7 @@ class UploadController extends AbstractController
break;
}
}
}
} catch(Exception $e) {
$this->addFlash('error', 'Uploading failed. Please report back to our development team!');
......
......@@ -53,6 +53,7 @@
</div>
</div>
</div>
{% if is_granted("ROLE_USER") %}
<div class="{{ (uploader.id == app.user.id ) ? "song-detail-actions-owner" : is_granted('ROLE_MODERATOR') ? "song-detail-actions-moderator" : "song-detail-actions" }}">
<a href="{{ path('song.download', {songId: song.id}) }}" class="button button-primary">Download</a>
<button class="button-preview button">PLAY PREVIEW</button>
......@@ -65,6 +66,7 @@
<a href="{{ path('moderation.song.remove', {songId: song.id}) }}" onclick="return confirm('Are you sure? This action cannot be undone!')" class="button button-icon"><i class="mdi mdi-delete"></i></a>
{% endif %}
</div>
{% endif %}
</section>
{% endblock %}
......
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