mirror of
https://github.com/krateng/maloja.git
synced 2025-04-16 16:52:18 +03:00
Added featured module to startpage
This commit is contained in:
parent
6ff7aa2ee0
commit
9afcf403ad
@ -574,6 +574,18 @@ def album_info(dbconn=None,**keys):
|
||||
}
|
||||
|
||||
|
||||
|
||||
### TODO: FIND COOL ALGORITHM TO SELECT FEATURED STUFF
|
||||
@waitfordb
|
||||
def get_featured(dbconn=None):
|
||||
# temporary stand-in
|
||||
result = {
|
||||
"artist": get_charts_artists(timerange=alltime())[0]['artist'],
|
||||
"album": get_charts_albums(timerange=alltime())[0]['album'],
|
||||
"track": get_charts_tracks(timerange=alltime())[0]['track']
|
||||
}
|
||||
return result
|
||||
|
||||
def get_predefined_rulesets(dbconn=None):
|
||||
validchars = "-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
<!-- TODO: THIS IS PRELIMINARY. not sure if i want to keep this, but for now let's fill up that empty slot on the start page -->
|
||||
|
||||
<h1>Featured</h1>
|
||||
|
||||
{% set featured = dbc.get_featured() %}
|
||||
|
||||
{% set entitytypes = [
|
||||
{'identifier':'artist','localisation':"Artist", 'template':"info_artist.jinja", 'filterkeys':{"artist":"Blackpink"} },
|
||||
{'identifier':'track','localisation':"Track", 'template':"info_track.jinja", 'filterkeys':{"track": {"artists": ["Red Velvet"], "title": "Russian Roulette"}} },
|
||||
{'identifier':'album','localisation':"Album", 'template':"info_album.jinja", 'filterkeys':{"album": {"artists": ["TWICE"], "albumtitle": "The Story Begins"}} }
|
||||
{'identifier':'artist','localisation':"Artist", 'template':"info_artist.jinja", 'filterkeys':{"artist": featured.artist } },
|
||||
{'identifier':'track','localisation':"Track", 'template':"info_track.jinja", 'filterkeys':{"track": featured.track } },
|
||||
{'identifier':'album','localisation':"Album", 'template':"info_album.jinja", 'filterkeys':{"album": featured.album } }
|
||||
] %}
|
||||
|
||||
|
||||
@ -21,6 +24,7 @@
|
||||
{% for t in entitytypes -%}
|
||||
<section class="stat_module_featured featured_{{ t.identifier }}" style="display:none;">
|
||||
{%- with filterkeys = t.filterkeys -%}
|
||||
|
||||
{% include 'partials/' + t.template %}
|
||||
{%- endwith -%}
|
||||
</section>
|
||||
|
Loading…
x
Reference in New Issue
Block a user