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

fixed difficulty for upload

parent eb8c3ac0
......@@ -92,23 +92,25 @@ class UploadController extends AbstractController
$song->setHasExtremeDifficulty(false);
$song->setHasXDDifficulty(false);
foreach($trackData as $oneData) {
switch($oneData->difficultyType) {
case 2:
$song->setHasEasyDifficulty(true);
break;
case 3:
$song->setHasNormalDifficulty(true);
break;
case 4:
$song->setHasHardDifficulty(true);
break;
case 5:
$song->setHasExtremeDifficulty(true);
break;
case 6:
$song->setHasXDDifficulty(true);
break;
foreach($trackInfo->difficulties as $oneData) {
if($oneData->_active) {
switch($oneData->_difficulty) {
case 2:
$song->setHasEasyDifficulty(true);
break;
case 3:
$song->setHasNormalDifficulty(true);
break;
case 4:
$song->setHasHardDifficulty(true);
break;
case 5:
$song->setHasExtremeDifficulty(true);
break;
case 6:
$song->setHasXDDifficulty(true);
break;
}
}
}
} catch(Exception $e) {
......
......@@ -53,18 +53,20 @@
</div>
</div>
</div>
<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>
<a href="spinshare-song://{{ song.id }}" class="button">Open in Client</a>
<a href="{{ path('report.song', {songId: song.id}) }}" class="button">Report</a>
{% if uploader.id == app.user.id %}
<a href="{{ path('song.update', {songId: song.id}) }}" class="button button-icon"><i class="mdi mdi-pencil"></i></a>
<a href="{{ path('song.delete', {songId: song.id}) }}" class="button button-icon"><i class="mdi mdi-delete"></i></a>
{% elseif is_granted('ROLE_MODERATOR') %}
<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>
{% 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>
<a href="spinshare-song://{{ song.id }}" class="button">Open in Client</a>
<a href="{{ path('report.song', {songId: song.id}) }}" class="button">Report</a>
{% if uploader.id == app.user.id %}
<a href="{{ path('song.update', {songId: song.id}) }}" class="button button-icon"><i class="mdi mdi-pencil"></i></a>
<a href="{{ path('song.delete', {songId: song.id}) }}" class="button button-icon"><i class="mdi mdi-delete"></i></a>
{% elseif is_granted('ROLE_MODERATOR') %}
<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