Change music directory without initiating a scan

This commit is contained in:
rembo10
2012-10-20 17:35:06 -03:00
parent 6b1978857a
commit f09b0425c6
2 changed files with 10 additions and 1 deletions

View File

@@ -62,7 +62,8 @@
</div>
</fieldset>
<input type="button" value="Save Changes" onclick="doAjaxCall('musicScan',$(this),'tabs',true);return false;" data-success="Library will be scanned">
<input type="button" value="Save Changes" onclick="doAjaxCall('musicSave',$(this),'tabs',true);return false;" data-success="Changes have been saved">
<input type="button" value="Save Changes + Scan" onclick="doAjaxCall('musicScan',$(this),'tabs',true);return false;" data-success="Changes saved. Library will be scanned">
</form>
</div>

View File

@@ -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