From 36ed30cc2bad5c244c72f3f6391dbde0289c9d7a Mon Sep 17 00:00:00 2001 From: Philip Trauner Date: Thu, 2 Nov 2017 18:41:15 +0100 Subject: [PATCH 1/2] Return unix timestamp as int --- pylast/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index fc49fbc..de89377 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -2288,8 +2288,8 @@ class User(_BaseObject, _Chartable): doc = self._request(self.ws_prefix + ".getInfo", True) - return doc.getElementsByTagName( - "registered")[0].getAttribute("unixtime") + return int(doc.getElementsByTagName( + "registered")[0].getAttribute("unixtime")) def get_tagged_albums(self, tag, limit=None, cacheable=True): """Returns the albums tagged by a user.""" From 8f515d87795bf2c2c8399ee5dbbc37b696eebf93 Mon Sep 17 00:00:00 2001 From: Philip Trauner Date: Thu, 2 Nov 2017 19:24:45 +0100 Subject: [PATCH 2/2] Fixed test in accordance to 36ed30cc2bad5c244c72f3f6391dbde0289c9d7a --- tests/test_pylast_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pylast_user.py b/tests/test_pylast_user.py index 1169f41..40be3b8 100755 --- a/tests/test_pylast_user.py +++ b/tests/test_pylast_user.py @@ -87,7 +87,7 @@ class TestPyLastUser(PyLastTestCase): # Assert # Just check date because of timezones - self.assertEqual(unixtime_registered, u"1037793040") + self.assertEqual(unixtime_registered, 1037793040) def test_get_countryless_user(self): # Arrange