summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-07-30 11:59:31 +0200
committerRasmus Steinke <rasi@xssn.at>2015-07-30 11:59:31 +0200
commit73a5066cd5898dd822f9ce5bbbb99649eba1e7d8 (patch)
tree68e9e029e382022b449afc4cca87202d29528109
parent5e409ddf196171ecf2e1cd15c7729c37e44442f0 (diff)
downloadperl-app-clerk-73a5066cd5898dd822f9ce5bbbb99649eba1e7d8.tar.gz
perl-app-clerk-73a5066cd5898dd822f9ce5bbbb99649eba1e7d8.tar.xz
ugly hack to fix latest sorting
-rwxr-xr-xclerk_helper8
1 files changed, 5 insertions, 3 deletions
diff --git a/clerk_helper b/clerk_helper
index 4e0041f..c28eefc 100755
--- a/clerk_helper
+++ b/clerk_helper
@@ -67,8 +67,8 @@ def createCache(args):
latest=[]
for i in alist:
- date_time=i['last-modified']
- mtime=date_time[:10]
+ mtime=i['last-modified']
+# mtime=date_time[:10]
if 'albumartist' in i:
if isinstance(i['albumartist'], list):
@@ -124,7 +124,9 @@ def createCache(args):
output=set(latest)
with open(os.getenv('HOME')+'/.config/clerk/latest.cache', "w") as cache_file:
for album in sorted(output, reverse=True):
- cache_file.write(album[13:]+'\n')
+ cache_file.write(album[23:]+'\n')
+ os.system("cat "+os.getenv('HOME')+'/.config/clerk/latest.cache'+" | uniq > /tmp/latest.cache")
+ os.system("mv /tmp/latest.cache "+os.getenv('HOME')+'/.config/clerk/latest.cache')
os.system("mpc --format \'%artist%"+os.getenv('separator')+"%date%"+os.getenv('separator')+"%album%"+os.getenv('separator')+"%track%"+os.getenv('separator')+"%title%\' search filename \' \' >"+os.getenv('HOME')+"/.config/clerk/tracks.cache")
os.system("mpc --format \'%artist%"+os.getenv('separator')+"%date%"+os.getenv('separator')+"%album%\' search filename \' \' | uniq >"+os.getenv('HOME')+"/.config/clerk/albums.cache")