From 33cea26a791e224625aa9bc523e2cf90e39c8a50 Mon Sep 17 00:00:00 2001 From: Krateng Date: Mon, 30 Dec 2019 15:28:48 +0100 Subject: [PATCH] More PYHP conversion --- maloja/__init__.py | 3 +- maloja/web/artist.pyhp | 10 +-- maloja/web/charts_artists.pyhp | 4 +- maloja/web/charts_tracks.pyhp | 47 ++++++++++ maloja/web/partial/charts_artists.pyhp | 4 +- maloja/web/partial/charts_tracks.pyhp | 70 +++++++++++++++ maloja/web/partial/link_track_scrobbles.pyhp | 8 ++ maloja/web/partial/pagination.pyhp | 85 ++++++++++--------- maloja/web/partial/pulse.pyhp | 8 +- scrobblers/maloja-scrobbler.zip | Bin 28203 -> 29156 bytes 10 files changed, 185 insertions(+), 54 deletions(-) create mode 100644 maloja/web/charts_tracks.pyhp create mode 100644 maloja/web/partial/charts_tracks.pyhp create mode 100644 maloja/web/partial/link_track_scrobbles.pyhp diff --git a/maloja/__init__.py b/maloja/__init__.py index 758a375..3f393c1 100644 --- a/maloja/__init__.py +++ b/maloja/__init__.py @@ -25,8 +25,7 @@ resources = [ "web/*", "static/*/*", "data_files/*/*", - "data_files/*/*/*", - "data_files/.doreah" + "data_files/*/*/*" ] commands = { diff --git a/maloja/web/artist.pyhp b/maloja/web/artist.pyhp index 422c0aa..cab590b 100644 --- a/maloja/web/artist.pyhp +++ b/maloja/web/artist.pyhp @@ -112,9 +112,9 @@ - - - + + + @@ -133,9 +133,7 @@ - - - + diff --git a/maloja/web/charts_artists.pyhp b/maloja/web/charts_artists.pyhp index b79355e..4e85d87 100644 --- a/maloja/web/charts_artists.pyhp +++ b/maloja/web/charts_artists.pyhp @@ -36,7 +36,9 @@ - + + + diff --git a/maloja/web/charts_tracks.pyhp b/maloja/web/charts_tracks.pyhp new file mode 100644 index 0000000..84715a8 --- /dev/null +++ b/maloja/web/charts_tracks.pyhp @@ -0,0 +1,47 @@ + + + + + + Maloja - Track Charts + + + + + + + # this is temporary! all modules need to be converted into partials at some point + html_charts, rep = htmlmodules.module_trackcharts(**amountkeys,**limitkeys) + + + + + + + + +
+
+
+

Track Charts

View #1 Tracks
+ + by + + +

+ + +
+ + + + + + + + + + + + + diff --git a/maloja/web/partial/charts_artists.pyhp b/maloja/web/partial/charts_artists.pyhp index 7bb9582..5e02895 100644 --- a/maloja/web/partial/charts_artists.pyhp +++ b/maloja/web/partial/charts_artists.pyhp @@ -63,8 +63,8 @@ else: - - + + diff --git a/maloja/web/partial/charts_tracks.pyhp b/maloja/web/partial/charts_tracks.pyhp new file mode 100644 index 0000000..39c3232 --- /dev/null +++ b/maloja/web/partial/charts_tracks.pyhp @@ -0,0 +1,70 @@ + + + if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0 + firstindex = amountkeys["page"] * amountkeys["perpage"] + lastindex = firstindex + amountkeys["perpage"] + + + + + + + + + + try: + trackslast = db.get_charts_tracks(**kwargs_filter,timerange=kwargs_time["timerange"].next(step=-1)) + # create rank association + lastrank = {} + for tl in trackslast: + lastrank[(*tl["track"]["artists"],tl["track"]["title"])] = tl["rank"] + for t in tracks: + try: + t["delta"] = lastrank[(*t["track"]["artists"],t["track"]["title"])] - t["rank"] + except: + t["delta"] = math.inf + except: + pass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#🆕↗↘➡
+ + + + + diff --git a/maloja/web/partial/link_track_scrobbles.pyhp b/maloja/web/partial/link_track_scrobbles.pyhp new file mode 100644 index 0000000..e990796 --- /dev/null +++ b/maloja/web/partial/link_track_scrobbles.pyhp @@ -0,0 +1,8 @@ + + + + + +
+
+
diff --git a/maloja/web/partial/pagination.pyhp b/maloja/web/partial/pagination.pyhp index 2449a98..73d581b 100644 --- a/maloja/web/partial/pagination.pyhp +++ b/maloja/web/partial/pagination.pyhp @@ -1,5 +1,4 @@ - - + @@ -8,52 +7,54 @@
- - - - 1 - - - | - + + + + + 1 + + + | + - - ... | - + + ... | + - - - - - - - « - + + + + + + + « + - - - + + + - - » - - - - - - + + » + + + + + + - - | ... - + + | ... + - - | - - - - - + + | + + + + + +
diff --git a/maloja/web/partial/pulse.pyhp b/maloja/web/partial/pulse.pyhp index 778c645..7396ea4 100644 --- a/maloja/web/partial/pulse.pyhp +++ b/maloja/web/partial/pulse.pyhp @@ -1,5 +1,5 @@ - if amountkeys["max_"] is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0 + if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0 firstindex = amountkeys["page"] * amountkeys["perpage"] lastindex = firstindex + amountkeys["perpage"] @@ -23,3 +23,9 @@ + + + + + + diff --git a/scrobblers/maloja-scrobbler.zip b/scrobblers/maloja-scrobbler.zip index 709e32e514d6e2f81556ed4c62028bc1109c786f..c09068600d44e597f03c985763d577d4a574c4b8 100644 GIT binary patch delta 5598 zcmZ{o2Ut_t)`k;0p)-mEqjYHjf*@6@fb^yyy#$b6q&E#gdWV33bdX*{FDhL?P^9-> zrGs=7{%{?~nLGDSp7ZRS@IM=WN00O`dS8df9OWrdE z5CD)s7eg(8kPx~MnLUvkxMNOHlJ+*FHOUx9`Nu zS>otE!uGhQsCIHy^ZJN_=JG?x=#W3YzW|Qm{W;$q8D^jqv(B%DtpP`Ym(7lvm1Kj>?ZA~DNlZOdk)K-PvgCd0 zZ_ZV+-5u~628~IDxd@wopfc|!HX@RhcZ#6mWsYE%(JfqN-SbP-Z11FW3l)kvQHo?< zoX^lMuQ3|9E)XT&!$JcaaN9VHlAkp;+P`U%;tymC%+u4D5w3A(+tSCAAr{NmXK%`x zMeNM*XLz{Rb6gUJ{OBdo6Dbf%b^yCmkqdyy-Ks=7q^$U}zTBwfO$g&qcL{fXwjNi@ zpqrxAphT1uugTTR8r#Gbb37Vzy|PxI^F#JuZjP*F;JY=~;z{1C1^R?`d}1 z2TRQ%0m{SF8K#B3-l@KA(SJCrgE+kW5YNVQNWs;VoILY+Q@K3}yZ!qX-(?2in zx;bNYFa{)$d)d~Y{=tx?tLb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