Couple of quick suggestions:
This makes the :9000 optional so only needs to be included if using
non-standard port
and --singleartist to enable hiding of duplicate artist names which I
think makes it a bit easier to scan quickly by eye
near the top ...
Code:
--------------------
parser = ArgumentParser(description="LMS Album Lister",
formatter_class=RawDescriptionHelpFormatter)
parser.add_argument('lmshost', action='store', help='LMS host name (with
optional port, e.g. lmssrv:9000)')
parser.add_argument('outfile', action='store', help='output file')
parser.add_argument('--singleartist', action='store_true', help='Do not print
repeated artist name')
args = parser.parse_args()
parsedlmshost = args.lmshost.partition(':')
if parsedlmshost[2] == '':
args.lmshost = parsedlmshost[0] + ':9000'
url = "http://{}/jsonrpc.js".format( args.lmshost)
--------------------
further down ...
Code:
--------------------
lastArtist = ''
for row in albums:
thisArtist = row['artist']
if args.singleartist:
if thisArtist == lastArtist:
thisArtist = ''
else:
lastArtist = thisArtist
albums_flat.append( table_tmpl.format( thisArtist,
row['album'], row['year']))
--------------------
Paul Webster
http://dabdig.blogspot.com
author of \"now playing\" plugins covering radio france (fip etc), kcrw,
supla finland, abc australia, cbc/radio-canada and rte ireland
------------------------------------------------------------------------
Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105
View this thread: http://forums.slimdevices.com/showthread.php?t=112602
_______________________________________________
Squeezecenter mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/squeezecenter