mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 04:22:21 +01:00
fixing arrows homescreen
This commit is contained in:
@ -197,15 +197,29 @@ function renderQueue(playNextAt, now)
|
||||
var canDeletePrevious = false;
|
||||
$.each(queue, function (id, song) {
|
||||
var requestedBy = song.requested_by;
|
||||
var requestCurr = requestedBy != 'Marietje';
|
||||
|
||||
//checks if id is the last item and returns false if the next song is Marietje, while the current song is not.
|
||||
if(id === queue.length-1){
|
||||
var requestNext = false
|
||||
} else {
|
||||
var requestNext = !((queue[id+1].requested_by === 'Marietje') && (requestedBy !== 'Marietje'))
|
||||
}
|
||||
//checks if id is the first item and returns false if the previous song is not Marietje, while the current song is.
|
||||
if(id === 0){
|
||||
var requestPrev = false
|
||||
//
|
||||
} else {
|
||||
var requestPrev = !((queue[id-1].requested_by !== 'Marietje') && (requestedBy === 'Marietje'))
|
||||
}
|
||||
|
||||
console.log(requestNext, requestPrev, requestCurr);
|
||||
var canDelete = song.can_move_down || canMoveSongs;
|
||||
var canMoveUp = canMoveSongs && id != queue.length -5 || canDeletePrevious && id < queue.length - 5;
|
||||
var canMoveDown = canDelete && id < queue.length - 6 || canMoveSongs && id < queue.length - 1 && id != queue.length - 6;
|
||||
var canMoveUp = canMoveSongs && requestPrev || canDeletePrevious && requestCurr && requestPrev;
|
||||
var canMoveDown = canMoveSongs && requestNext || canDelete && requestCurr && requestNext;
|
||||
var artist = song.song.artist.trim() === '' ? '?' : song.song.artist;
|
||||
var title = song.song.title.trim() === '' ? '?' : song.song.title;
|
||||
var prevId = song.id - 1;
|
||||
console.log(song.id, id);
|
||||
console.log(song);
|
||||
console.log(queue);
|
||||
|
||||
showTime = showTimeToPlay ? (timeToPlay < 0 ? '' : timeToPlay.secondsToMMSS()) : (playNextAt < now ? '' : playNextAt.timestampToHHMMSS())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user