From 4722c4cfceb2a2dbf9c1b7bcd1aa38925c6a1a60 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 13 Aug 2011 16:23:34 +0200 Subject: Add all files to queue. --- directory.py | 2 +- static/index.html | 1 + static/player.js | 13 +++++++++++++ static/style.css | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/directory.py b/directory.py index 6b8eaaf..5a0c318 100644 --- a/directory.py +++ b/directory.py @@ -101,7 +101,7 @@ class File(DirectoryEntry): cache_path_dir = os.path.dirname(cache_path) # check and create cache directory if not os.path.exists(cache_path_dir): - os.mkdir(cache_path_dir) + os.makedirs(cache_path_dir) # check if file is cached if not os.path.exists(cache_path): events.event_pub.recoding(self.path) diff --git a/static/index.html b/static/index.html index 23e2db6..6f24aba 100644 --- a/static/index.html +++ b/static/index.html @@ -18,6 +18,7 @@
Browse directory + Add all diff --git a/static/player.js b/static/player.js index d10080b..ab583ee 100644 --- a/static/player.js +++ b/static/player.js @@ -18,6 +18,7 @@ function MusicListing(type, path, name, cached) { this.name = name ? name : path.split('/').pop(); this.a = document.createElement('a'); this.a.tag = path; + this.a.ml = this; this.play = function() { log('playing ' + path); @@ -117,6 +118,18 @@ function list(root) { xmlhttp.send(); } +function add_directory() { + var songs = document.getElementById('song-links').getElementsByTagName('a'); + for(var i = 0; i < songs.length; i++) { + var a = songs[i]; + log(a); + var ml = a.ml; + log(ml); + if(ml.type && ml.type == 'file') + playlist.add(ml); + } +} + var source = null; function get_a(path) { diff --git a/static/style.css b/static/style.css index 25bcc4b..35319c0 100644 --- a/static/style.css +++ b/static/style.css @@ -13,3 +13,4 @@ div#hpanel span ul { list-style-type: none; padding-left: 0; margin-top: .5em; v ul#playlist li a.playing { background-image: url('/static/icons/sound.png'); } span.list-header { font-size: large; } ul#song-links { width: 30em; overflow: auto; white-space: nowrap; resize: both; } +a#add-dir { font-size: small; } -- cgit v1.2.3