REFACTOR: ITEM REVOLUTION #91

This commit is contained in:
Terry Geng
2020-03-05 16:28:08 +08:00
parent c32c6c5d9b
commit 6ab8a7958a
15 changed files with 1079 additions and 899 deletions

View File

@ -11,32 +11,34 @@
<th scope="row">{{ index + 1 }}</th>
<td>
<div class="playlist-title">
{% if 'thumbnail' in m %}
<img width="80" src="data:image/PNG;base64,{{ m['thumbnail'] }}"/>
{% if m.type != 'radio' and m.thumbnail %}
<img width="80" src="data:image/PNG;base64,{{ m.thumbnail }}"/>
{% else %}
<img width="80" src="static/image/unknown-album.png"/>
{% endif %}
</div>
<div class="playlist-artwork">
{% if 'title' in m and m['title'].strip() %}
<b>{{ m['title']|truncate(45) }}</b>
{% elif 'url' in m %}
<b>{{ m['url']|truncate(45) }}</b>
{% if m.title.strip() %}
<b>{{ m.title|truncate(45) }}</b>
{% elif m.url %}
<b>{{ m.url|truncate(45) }}</b>
{% endif %}
<span class="badge badge-secondary">{{ m['type'].capitalize() }}</span>
<span class="badge badge-secondary">{{ m.display_type() }}</span>
<br>
{% if 'artist' in m %}
{{ m['artist'] }}
{% if m.type == 'file' %}
{{ m.artist }}
{% elif m.type == 'url_from_playlist' %}
<a href="{{ m.playlist_url }}"><i>{{ m.playlist_title|truncate(50) }}</i></a>
{% else %}
Unknown Artist
{% endif %}
</div>
</td>
<td>
{% if 'url' in m %}
<small><a href="{{ m['url'] }}"><i>{{ m['url']|truncate(50) }}</i></a></small>
{% elif 'path' in m %}
<small>{{ m['path']|truncate(50) }}</small>
{% if m.type == 'url' or m.type == 'radio' or m.type == 'url_from_playlist' %}
<small><a href="{{ m.url }}"><i>{{ m.url|truncate(50) }}</i></a></small>
{% elif m.type == 'file' %}
<small>{{ m.path|truncate(50) }}</small>
{% endif %}
</td>
<td>