Skip to content

Commit

Permalink
Dates in models should be strings
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
jodal committed Apr 14, 2015
1 parent b92ca7b commit 392c570
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ v1.3.1 (UNRELEASED)

- Update to not use deprecated Mopidy audio APIs.

- Use strings and not ints for the model's date field. This is required for
compatibility with the model validation added in Mopidy 1.1. (Fixes: #52)

v1.3.0 (2015-03-25)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions mopidy_spotify/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def to_mopidy_album(spotify_album):
uri=uri,
name=spotify_album.name(),
artists=[to_mopidy_artist(spotify_album.artist())],
date=spotify_album.year())
date='%d' % spotify_album.year())
return album_cache[uri]


Expand Down Expand Up @@ -76,7 +76,7 @@ def to_mopidy_track(spotify_track, bitrate=None):
name = '[unplayable] %s' % name
spotify_album = spotify_track.album()
if spotify_album is not None and spotify_album.is_loaded():
date = spotify_album.year()
date = '%d' % spotify_album.year()
else:
date = None
track_cache[uri] = Track(
Expand Down

0 comments on commit 392c570

Please sign in to comment.