From f09b0425c6e24fcf0a3a91e4ab75caedc94a7ec5 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Sat, 20 Oct 2012 17:35:06 -0300 Subject: [PATCH] Change music directory without initiating a scan --- data/interfaces/default/manage.html | 3 ++- headphones/webserve.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/manage.html b/data/interfaces/default/manage.html index 7a7fb14a..eaa71963 100644 --- a/data/interfaces/default/manage.html +++ b/data/interfaces/default/manage.html @@ -62,7 +62,8 @@ - + + diff --git a/headphones/webserve.py b/headphones/webserve.py index 01eb83f0..61c252a9 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -370,6 +370,14 @@ class WebInterface(object): raise cherrypy.HTTPRedirect("home") importItunes.exposed = True + def musicSave(self, path, redirect=None, autoadd=0): + headphones.ADD_ARTISTS = autoadd + headphones.MUSIC_DIR = path + headphones.config_write() + if redirect: + raise cherrypy.HTTPRedirect(redirect) + musicSave.exposed = True + def musicScan(self, path, redirect=None, autoadd=0): headphones.ADD_ARTISTS = autoadd headphones.MUSIC_DIR = path