Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

order last.fm tracks explicitly.

git-svn-id: https://jerakeen.org/svn/tomi/Projects/Shelf@3877 ab05c693-d3d1-0310-8e8b-e1346d90d6a5
  • Loading branch information...
commit 015b2169fe35dd0f5dadf6fd2574fdcfc8f20dc7 1 parent b2b684b
tomi authored
View
2  Cache.py
@@ -112,7 +112,7 @@ def start(self):
req.setValue_forHTTPHeaderField_("Basic %s"%base64string, "Authorization")
# Send the right User-Agent. TODO - get the bundle version properly, don't hard-code
- req.setValue_forHTTPHeaderField_("Shelf/0.0.13 +http://jerakeen.org/code/shelf/", "User-Agent")
+ req.setValue_forHTTPHeaderField_("Shelf/0.0.14 +http://jerakeen.org/code/shelf/", "User-Agent")
downloader = NSURLDownload.alloc().initWithRequest_delegate_( req, self )
downloader.setDestination_allowOverwrite_( filename, True )
View
5 ChangeLog
@@ -1,3 +1,8 @@
+### 0.0.14 (development)
+
+las.fm changed their XML order? Anyway, I now explicitly order the tracks
+in the client.
+
### 0.0.13 (released 2008-03-28)
All blocks are now sorted by date, rather than just Feed blocks. This means
View
2  TODO
@@ -17,3 +17,5 @@ it to the address book card.
Expanding links using the google social graph should be turnoffable. And add
a button to do it on demand.
+
+Display AIM and facebook statues somehow.
View
6 extractors/ComIconfactoryTwitterrific.py
@@ -9,7 +9,11 @@ def __init__(self):
self.twitterific = SBApplication.applicationWithBundleIdentifier_("com.iconfactory.Twitterrific")
def clues(self):
- if not self.twitterific.tweets().count(): return
+ try:
+ if not self.twitterific.tweets().count(): return
+ except AttributeError:
+ # old twitteriffic
+ return
url = self.twitterific.selection().userUrl()
self.clues_from_url( url )
View
11 providers/LastFmProvider.py
@@ -34,7 +34,16 @@ def gsv(node, val):
return node.getElementsByTagName(val)[0].childNodes[0].wholeText
except IndexError:
return None
- for track in dom.getElementsByTagName("track")[0:3]:
+ alltracks = dom.getElementsByTagName("track")
+
+ # sort tracks by order of last played
+ def byPlayed(a,b):
+ a_played = int(a.getElementsByTagName("date")[0].getAttribute('uts'))
+ b_played = int(b.getElementsByTagName("date")[0].getAttribute('uts'))
+ return a_played - b_played
+ alltracks.sort( byPlayed )
+
+ for track in alltracks[0:3]:
track.normalize()
played = int(track.getElementsByTagName("date")[0].getAttribute('uts'))
data = {
View
2  setup.py
@@ -9,7 +9,7 @@
import py2app
from glob import glob
-version = "0.0.13" # update in Cache.py as well, for the User-Agent string
+version = "0.0.14" # update in Cache.py as well, for the User-Agent string
plist = dict(
CFBundleName="Shelf",
Please sign in to comment.
Something went wrong with that request. Please try again.