summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-08-22 20:10:44 +0200
committerRasmus Steinke <rasi@xssn.at>2015-08-22 20:10:44 +0200
commit43f365f0e75318aa04c97fb1a6dd2cd5d10dcd41 (patch)
tree1adf7113e8426cfa4146cf312379ab9087734317
parent7cff1262038294210c55fd3df159d0bffb075389 (diff)
downloadperl-app-clerk-43f365f0e75318aa04c97fb1a6dd2cd5d10dcd41.tar.gz
perl-app-clerk-43f365f0e75318aa04c97fb1a6dd2cd5d10dcd41.tar.xz
more list crappiness
-rwxr-xr-xclerk_helper12
1 files changed, 11 insertions, 1 deletions
diff --git a/clerk_helper b/clerk_helper
index 79040c5..dfed422 100755
--- a/clerk_helper
+++ b/clerk_helper
@@ -67,6 +67,7 @@ def update(args):
def reduceToFstElm(maybeList):
if isinstance(maybeList, list):
maybeList = maybeList[0]
+ print(maybeList)
# sort albums by mtime
# thanks to kuyatzu for this.
@@ -77,7 +78,6 @@ def createRecentList(allTracks):
for t in allTracks:
reduceToFstElm(t['date'])
reduceToFstElm(t['albumartist'])
- reduceToFstElm(t['album'])
t['cto'] = parseISO8601(t['last-modified']) # ct = comparable time object
accu = []
@@ -101,6 +101,8 @@ def createCache(args):
with open(os.getenv('HOME')+'/.config/clerk/latest.cache', "w") as cache_file:
for album in blist:
+ if isinstance(album['albumartist'], list):
+ album['albumartist'] = album['albumartist'][0]
cache_file.write(album['albumartist']+os.getenv('separator')+album['date']+os.getenv('separator')+album['album']+'\n')
temp_albums=[]
@@ -120,7 +122,14 @@ def createCache(args):
for track in tracklist:
if isinstance(track['artist'], list):
track['artist']=track['artist'][0]
+
+ if isinstance(track['albumartist'], list):
+ track['albumartist']=track['albumartist'][0]
+ if isinstance(track['track'], list):
+ track['track']=track['track'][0]
+ if isinstance(track['date'], list):
+ track['date']=track['date'][0]
temp_tracks.append(track['artist']+os.getenv('separator')+track['date']+os.getenv('separator')+track['album']+os.getenv('separator')+track['track']+os.getenv('separator')+track['title'])
#
final_tracklist=set(temp_tracks)
@@ -128,6 +137,7 @@ def createCache(args):
#
with open(os.getenv('HOME')+'/.config/clerk/tracks.cache', "w") as cache_file:
for track in blub:
+
cache_file.write(track+'\n')