Merge pull request #263 from SirMartin/add_number_plays_to_tails

Add number plays to tails
This commit is contained in:
krateng 2023-11-04 14:03:17 +01:00 committed by GitHub
commit e328646104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 1 deletions

View File

@ -202,6 +202,7 @@ malojaconfig = Configuration(
"default_album_artist":(tp.String(), "Default Albumartist", "Various Artists"),
"use_album_artwork_for_tracks":(tp.Boolean(), "Use Album Artwork for tracks", True),
"fancy_placeholder_art":(tp.Boolean(), "Use fancy placeholder artwork",False),
"show_play_number_on_tiles":(tp.Boolean(), "Show amount of plays on tails", True),
"discourage_cpu_heavy_stats":(tp.Boolean(), "Discourage CPU-heavy stats", False, "Prevent visitors from mindlessly clicking on CPU-heavy options. Does not actually disable them for malicious actors!"),
"use_local_images":(tp.Boolean(), "Use Local Images", True),
#"local_image_rotate":(tp.Integer(), "Local Image Rotate", 3600),

View File

@ -16,10 +16,14 @@
{% if entry is not none %}
{% set album = entry.album %}
{% set rank = entry.rank %}
{% set scrobbles = entry.scrobbles %}
<div class="tile">
<a href="{{ links.url(album) }}">
<div class="lazy" data-bg="{{ images.get_album_image(album) }}"'>
<span class='stats'>#{{ rank }}</span> <span>{{ album.albumtitle }}</span>
{% if settings['SHOW_PLAY_NUMBER_ON_TILES'] %}
<p class="scrobbles"><span>{{ scrobbles }} {{ 'play' if scrobbles == 1 else 'plays' }}</span> </p>
{% endif %}
</div>
</a>
</div>

View File

@ -16,10 +16,14 @@
{% if entry is not none %}
{% set artist = entry.artist %}
{% set rank = entry.rank %}
{% set scrobbles = entry.scrobbles %}
<div class="tile">
<a href="{{ links.url(artist) }}">
<div class="lazy" data-bg="{{ images.get_artist_image(artist) }}"'>
<span class='stats'>#{{ rank }}</span> <span>{{ artist }}</span>
<span class='stats'>#{{ rank }}</span> <span>{{ artist }}</span>
{% if settings['SHOW_PLAY_NUMBER_ON_TILES'] %}
<p class="scrobbles"><span>{{ scrobbles }} {{ 'play' if scrobbles == 1 else 'plays' }}</span> </p>
{% endif %}
</div>
</a>
</div>

View File

@ -16,10 +16,14 @@
{% if entry is not none %}
{% set track = entry.track %}
{% set rank = entry.rank %}
{% set scrobbles = entry.scrobbles %}
<div class="tile">
<a href="{{ links.url(track) }}">
<div class="lazy" data-bg="{{ images.get_track_image(track) }}"'>
<span class='stats'>#{{ rank }}</span> <span>{{ track.title }}</span>
{% if settings['SHOW_PLAY_NUMBER_ON_TILES'] %}
<p class="scrobbles"><span>{{ scrobbles }} {{ 'play' if scrobbles == 1 else 'plays' }}</span> </p>
{% endif %}
</div>
</a>
</div>

View File

@ -1069,6 +1069,12 @@ div.tiles span {
overflow-wrap: anywhere;
}
div.tiles p.scrobbles {
margin: 0;
top:100%;
position: sticky;
}
div.tiles a:hover {
text-decoration: none;
}