Listing nach Titel sortieren

This commit is contained in:
Stefan Bethke 2014-07-05 15:19:39 +00:00
parent fcc1e14e04
commit 5df1180450

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/python #!/usr/local/bin/python
# $Schlepperbande: src/tivomirror/tivomirror,v 1.60 2014/07/02 09:54:33 stb Exp $ # $Schlepperbande: src/tivomirror/tivomirror,v 1.61 2014/07/05 15:07:25 stb Exp $
# #
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4 # Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
# zu transkodieren. # zu transkodieren.
@ -422,11 +422,17 @@ def download_episode(toc, downloaddb, episode):
def printtoc(toc, downloaddb): def printtoc(toc, downloaddb):
items = toc.toc.getElementsByTagName("Item") items = toc.toc.getElementsByTagName("Item")
print "*** %d shows listed" % (items.length) print "*** %d shows listed" % (items.length)
shows = {}
for node in items: for node in items:
item = TivoItem(node) item = TivoItem(node)
if item.title not in shows:
shows[item.title] = []
shows[item.title].append(item)
for title in sorted(shows):
for item in shows[title]:
reason = wantitem(item, downloaddb) reason = wantitem(item, downloaddb)
if (reason != ""): if (reason != ""):
print "--- %-11.11s: %s" % (reason, item.name) print "%-7.7s: %s" % (reason, item.name)
continue continue
print "*** downloading %s (%.3fGB)" % (item.name, item.sourcesize / 1e9) print "*** downloading %s (%.3fGB)" % (item.name, item.sourcesize / 1e9)