{% extends "layout.html" %}

{% block title %}Musics{% endblock %}
{% block body %}
    <table class="table table-striped table-condensed">
      <thead class="thead-inverse">
        <tr>
          <th>Artist</th>
          <th>Genre</th>
          <th>Album</th>
          <th>Track</th>
          <th>Title</th>
          <th>Rating</th>
          <th>Keywords</th>
          <th>Folder</th>
          <th>Duration</th>
          <th>Size</th>
          <th>YouTube</th>
          <th>Actions</th>
        </tr>
      </thead>
      <tbody>
        {% for m in musics: %}
        <tr>
          <td>{{ m.artist }}</td>
          <td>{{ m.genre }}</td>
          <td>{{ m.album }}</td>
          <td>{{ m.number }}</td>
          <td>{{ m.title }}</td>
          <td>{{ m.rating }}</td>
          <td>{{ m.keywords}}</td>
          <td>{{ m.folder }}</td>
          <td>{{ seconds_to_human(m.duration) }}</td>
          <td>{{ bytes_to_human(m.size) }}</td>
          <td>{%if m.youtube != "not found" %}<a href="{{ m.youtube }}">{{ m.youtube }}</a>{%else%}Not found{% endif %}</td>
          <td>
            <a href="{{ url_for('collection.player', artists=m.artist, albums=m.album, titles=m.title, autoplay=1) }}">play</a> /
            <a href="{{ url_for('collection.download', artists=m.artist, albums=m.album, titles=m.title, name=download_title(m)) }}">download</a> /
            <a href="{{ url_for('collection.music', id=m.id) }}">show</a>
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
{% endblock %}
