Replaced old camelCase functions

This commit is contained in:
krateng 2022-01-07 04:57:13 +01:00
parent 6611ca8705
commit 65a076c249
6 changed files with 10 additions and 10 deletions

View File

@ -177,16 +177,16 @@ def get_top_tracks_external(**keys):
@api.get("artistinfo")
def artistInfo_external(**keys):
def artist_info_external(**keys):
k_filter, _, _, _, _ = uri_to_internal(keys,forceArtist=True)
ckeys = {**k_filter}
return artistInfo(**ckeys)
return artist_info(**ckeys)
@api.get("trackinfo")
def trackInfo_external(artist:Multi[str],**keys):
def track_info_external(artist:Multi[str],**keys):
# transform into a multidict so we can use our nomral uri_to_internal function
keys = FormsDict(keys)
for a in artist:
@ -194,7 +194,7 @@ def trackInfo_external(artist:Multi[str],**keys):
k_filter, _, _, _, _ = uri_to_internal(keys,forceTrack=True)
ckeys = {**k_filter}
return trackInfo(**ckeys)
return track_info(**ckeys)
@api.get("compare")

View File

@ -226,7 +226,7 @@ def get_top_tracks(**keys):
return results
def artistInfo(artist):
def artist_info(artist):
charts = db_aggregate(by="ARTIST")
scrobbles = len(db_query(artists=[artist]))
@ -257,7 +257,7 @@ def artistInfo(artist):
def trackInfo(track):
def track_info(track):
charts = db_aggregate(by="TRACK")
#scrobbles = len(db_query(artists=artists,title=title)) #chart entry of track always has right scrobble number, no countas rules here
#c = [e for e in charts if set(e["track"]["artists"]) == set(artists) and e["track"]["title"] == title][0]

View File

@ -9,7 +9,7 @@
{% endblock %}
{% set artist = filterkeys.artist %}
{% set info = db.artistInfo(artist) %}
{% set info = db.artist_info(artist) %}
{% set credited = info.get('replace') %}
{% set included = info.get('associated') %}

View File

@ -56,7 +56,7 @@
<!-- CERTS -->
{% for track in db.get_tracks(artist=artist) -%}
{% set info = db.trackInfo(track) %}
{% set info = db.track_info(track) %}
{% if info.certification is not none -%}
<a href='{{ links.url(track) }}'><img class="certrecord_small"
src="/media/record_{{ info.certification }}.png"

View File

@ -53,7 +53,7 @@
<!-- CERTS -->
{% set info = db.trackInfo(track) %}
{% set info = db.track_info(track) %}
{% if info.certification is not none %}
<img class="certrecord"
src="/media/record_{{ info.certification }}.png"

View File

@ -13,7 +13,7 @@
{% endblock %}
{% set track = filterkeys.track %}
{% set info = db.trackInfo(track) %}
{% set info = db.track_info(track) %}
{% set initialrange ='month' %}