{% extends 'base.html' %} {% block scripts %}
<!-- <meta http-equiv="refresh" content="5" /> -->

<script>
  var queue = [];
  var previousQueue;
  var socket = io();

  function getQueue() {
    $.get('{{ url_for("queue.get_queue") }}', function (data) {
      newQueue =  JSON.parse(data);
      if (!_.isEqual(newQueue, previousQueue)) {
        queue = newQueue;
        $("#auto-refresh").html(generateQueueHTML());
        previousQueue = newQueue;
      }
    })
  }

  function generateQueueHTML() {
    