@@ -30,7 +30,7 @@ class RedisListenStore(ListenStore):
         if not data:
             return None
         data = ujson.loads(data)
-        data.update({'listened_at': MIN_ID+1})
+        data.update({'listened_at': None})
         return Listen.from_json(data)
 
     def check_connection(self):
# coding=utf-8


import ujson

import redis
from redis import Redis

from listenbrainz.listen import Listen
from listenbrainz.listenstore import ListenStore, MIN_ID


class RedisListenStore(ListenStore):
    def __init__(self, log, conf):
        super(RedisListenStore, self).__init__(log)
        self.log.info('Connecting to redis: %s:%s', conf['REDIS_HOST'], conf['REDIS_PORT'])
        self.redis = Redis(host=conf['REDIS_HOST'], port=conf['REDIS_PORT'], decode_responses=True)

    def get_playing_now(self, user_id):
        """ Return the current playing song of the user

            Arguments:
                user_id (int): the id of the user in the db

            Returns:
                Listen object which is the currently playing song of the user

        """
        data = self.redis.get('playing_now:{}'.format(user_id))
        if not data:
            return None
        data = ujson.loads(data)
        data.update({'listened_at': MIN_ID+1})
        return Listen.from_json(data)

    def check_connection(self):
        """ Pings the redis server to check if the connection works or not """
        try:
            self.redis.ping()
        except redis.exceptions.ConnectionError as e:
            self.log.error("Redis ping didn't work: {}".format(str(e)))
            raise

Instead of directly putting None here, I would prefer it if we added a `playing_now` key to the data and then set the timestamp attribute in the from_json function there accordingly.