Library viewer
This gives the web interface a list of artists and albums currently in the library.
This commit is contained in:
parent
ac8c4abd9e
commit
f0f6573d09
|
@ -0,0 +1,22 @@
|
||||||
|
# Bryan Schumaker
|
||||||
|
import libsaria
|
||||||
|
library = libsaria.sources.library
|
||||||
|
walk = library.walk
|
||||||
|
get_attrs = library.get_attrs
|
||||||
|
|
||||||
|
def header(wfile):
|
||||||
|
wfile.write("<html><body>")
|
||||||
|
|
||||||
|
def footer(wfile):
|
||||||
|
wfile.write("</body></html>")
|
||||||
|
|
||||||
|
def body(wfile):
|
||||||
|
for artist, ar_key in library.artists():
|
||||||
|
wfile.write("<h2>%s</h2>" % artist)
|
||||||
|
for album, al_key in library.albums(ar_key):
|
||||||
|
wfile.write("%s<br>" % album)
|
||||||
|
|
||||||
|
def to_html(wfile):
|
||||||
|
header(wfile)
|
||||||
|
body(wfile)
|
||||||
|
footer(wfile)
|
Loading…
Reference in New Issue