From db3d4ed97bfbeb56da5de13c8437259e725c0f59 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Thu, 14 Nov 2019 22:29:24 +0000 Subject: [PATCH] return scrobbles in sorted order --- my/lastfm/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/my/lastfm/__init__.py b/my/lastfm/__init__.py index cee03dc..443bdb8 100755 --- a/my/lastfm/__init__.py +++ b/my/lastfm/__init__.py @@ -53,8 +53,7 @@ def _iter_scrobbles(): @lru_cache(1) def get_scrobbles(): - # TODO assert sorted? - return list(_iter_scrobbles()) + return list(sorted(_iter_scrobbles(), key=lambda s: s.dt)) def test():