Skip to content

Commit

Permalink
use channel last_modified field to store updated timestamp
Browse files Browse the repository at this point in the history
more appropriate than to store it in album date
  • Loading branch information
tardypad committed Oct 4, 2017
1 parent c7b13c3 commit f9f1d4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mopidy_somafm/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def lookup(self, uri):
# Build album (idem as playlist, but with more metada)
album = Album(
artists=[artist],
date=channel_data['updated'],
images=[channel_data['image']],
name=channel_data['title'],
uri='somafm:channel:/%s' % (channel_name))

track = Track(
artists=[artist],
album=album,
last_modified=channel_data['updated'],
comment=channel_data['description'],
genre=channel_data['genre'],
name=channel_data['title'],
Expand Down
4 changes: 1 addition & 3 deletions mopidy_somafm/somafm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import requests
import urlparse
import collections
from datetime import datetime

try:
import xml.etree.cElementTree as ET
Expand Down Expand Up @@ -76,8 +75,7 @@ def refresh(self, encoding, quality):
if key in ['title', 'image', 'dj', 'genre', 'description']:
channel_data[key] = val
elif key == 'updated':
channel_data['updated'] = datetime.fromtimestamp(
int(val)).strftime("%Y-%m-%d")
channel_data['updated'] = int(val)
elif 'pls' in key:
pls_quality = key[:-3]
pls_format = child_detail.attrib['format']
Expand Down

0 comments on commit f9f1d4a

Please sign in to comment.