From aeeb3008afb2b16cf2e33977d017cdc982ad9e4b Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Sat, 6 Oct 2018 14:28:24 +0200 Subject: [PATCH] Implement suggestions. --- clay/gp.py | 13 +------------ clay/player.py | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/clay/gp.py b/clay/gp.py index 445c3df..1a80277 100644 --- a/clay/gp.py +++ b/clay/gp.py @@ -206,18 +206,7 @@ class Track(object): "callback" is called with "(track_id, error)" args after the placount is incremented. (Optional) """ - if gp.is_subscribed: - track_id = self.store_id - else: - track_id = self.library_id - - def on_playcount_incremented(track_id, error): - if callback: - callback(track_id, error) - else: - pass - - gp.increment_song_playcount_async(track_id, callback=on_playcount_incremented) + gp.increment_song_playcount_async(self.id, callback=lambda id_, error: callback(id_, error) if callback else None) def get_url(self, callback): """ diff --git a/clay/player.py b/clay/player.py index 9c6f516..d57ec92 100644 --- a/clay/player.py +++ b/clay/player.py @@ -254,7 +254,7 @@ class _Player(object): Increments the play count and advances to the next track. """ assert event - self.queue.get_current_track().increment_playcount_async() + self.queue.get_current_track().increment_playcount() self.next() def _media_position_changed(self, event):