Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add option to dump simplified artists list

  • Loading branch information...
commit cbe4785783ffe19c8aad314ba2ae4ffbce08140d 1 parent 7121517
@palfrey authored
Showing with 19 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +18 −0 missing_albums.py
View
1  .gitignore
@@ -1,3 +1,4 @@
songs.db
.amazonkey
output
+artists.txt
View
18 missing_albums.py
@@ -29,6 +29,7 @@
from time import sleep, strptime, struct_time, localtime
from types import IntType
import math
+import codecs
from genshi.template import NewTextTemplate
from os import mkdir
@@ -42,6 +43,7 @@
parser.add_option("-d","--database",dest="db", default="songs.db",help="Songs database file")
parser.add_option("--overrides", dest="overrides", default=None, help="Overrides info file")
parser.add_option("--no-walk",dest="walk",default="True",action="store_false",help="Don't re-read music directory")
+parser.add_option("--artists-only", dest="artistsOnly", default="False", action="store_true", help="Write out simplified artists list")
(opts,args) = parser.parse_args()
overrides = {"artist": {}, "ignore": {}}
@@ -361,6 +363,22 @@ def realNone(x):
#raise Exception,albums[a]
#break
+artists = {}
+
+if opts.artistsOnly:
+ for when in sorted(missing, reverse = True):
+ for m in missing[when]:
+ if m["artist"] not in artists:
+ artists[m["artist"]] = []
+ artists[m["artist"]].append(m["title"])
+
+ f = codecs.open("artists.txt", "wb", "utf-8")
+ for a in sorted(artists):
+ f.write(u"%s - %s\n"%(a, ", ".join(artists[a])))
+ f.close()
+
+ sys.exit(0)
+
folder = "output"
if not exists(folder):
Please sign in to comment.
Something went wrong with that request. Please try again.