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

fixed difficulty for upload

parent eb8c3ac0
...@@ -92,8 +92,9 @@ class UploadController extends AbstractController ...@@ -92,8 +92,9 @@ class UploadController extends AbstractController
$song->setHasExtremeDifficulty(false); $song->setHasExtremeDifficulty(false);
$song->setHasXDDifficulty(false); $song->setHasXDDifficulty(false);
foreach($trackData as $oneData) { foreach($trackInfo->difficulties as $oneData) {
switch($oneData->difficultyType) { if($oneData->_active) {
switch($oneData->_difficulty) {
case 2: case 2:
$song->setHasEasyDifficulty(true); $song->setHasEasyDifficulty(true);
break; break;
...@@ -111,6 +112,7 @@ class UploadController extends AbstractController ...@@ -111,6 +112,7 @@ class UploadController extends AbstractController
break; break;
} }
} }
}
} catch(Exception $e) { } catch(Exception $e) {
$this->addFlash('error', 'Uploading failed. Please report back to our development team!'); $this->addFlash('error', 'Uploading failed. Please report back to our development team!');
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</div> </div>
</div> </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" }}"> <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> <a href="{{ path('song.download', {songId: song.id}) }}" class="button button-primary">Download</a>
<button class="button-preview button">PLAY PREVIEW</button> <button class="button-preview button">PLAY PREVIEW</button>
...@@ -65,6 +66,7 @@ ...@@ -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> <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 %} {% endif %}
</div> </div>
{% endif %}
</section> </section>
{% endblock %} {% 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