From 705f4b4252133a836d1c0812d53f6c839b5d4ed1 Mon Sep 17 00:00:00 2001 From: badlandspray <92253501+badlandspray@users.noreply.github.com> Date: Sun, 8 May 2022 13:26:42 +0000 Subject: [PATCH 1/2] Track album name and track length --- maloja/apis/audioscrobbler_legacy.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/maloja/apis/audioscrobbler_legacy.py b/maloja/apis/audioscrobbler_legacy.py index 2a3ac33..675ef08 100644 --- a/maloja/apis/audioscrobbler_legacy.py +++ b/maloja/apis/audioscrobbler_legacy.py @@ -73,6 +73,8 @@ class AudioscrobblerLegacy(APIHandler): client = self.mobile_sessions.get(key) for count in range(50): artist_key = f"a[{count}]" + album_key = f"b[{count}]" + length_key = f"l[{count}]" track_key = f"t[{count}]" time_key = f"i[{count}]" if artist_key not in keys or track_key not in keys: @@ -82,12 +84,19 @@ class AudioscrobblerLegacy(APIHandler): timestamp = int(keys[time_key]) except Exception: timestamp = None - #database.createScrobble(artists,title,timestamp) - self.scrobble({ + + scrobble = { 'track_artists':[artiststr], 'track_title':titlestr, - 'scrobble_time':timestamp - },client=client) + 'scrobble_time':timestamp, + } + if album_key in keys: + scrobble['album_name'] = keys[album_key] + if length_key in keys: + scrobble['track_length'] = keys[length_key] + + #database.createScrobble(artists,title,timestamp) + self.scrobble(scrobble, client=client) return 200,"OK\n" From 515fa69fceeeeaf9c0175f8c7c704932a12a7541 Mon Sep 17 00:00:00 2001 From: krateng Date: Sun, 15 May 2022 21:04:50 +0200 Subject: [PATCH 2/2] Fixed Readme links --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 80c329d..7e8f83b 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,13 @@ You can check [my own Maloja page](https://maloja.krateng.ch) as an example inst * [Requirements](#requirements) * [PyPI](#pypi) * [From Source](#from-source) - * [Docker / Podman](#docker-podman) + * [Docker / Podman](#docker--podman) * [Extras](#extras) * [How to use](#how-to-use) * [Basic control](#basic-control) * [Data](#data) * [Customization](#customization) * [How to scrobble](#how-to-scrobble) - * [Native support](#native-support) - * [Native API](#native-api) - * [Standard-compliant API](#standard-compliant-api) - * [Manual](#manual) * [How to extend](#how-to-extend) ## Features