mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-09 21:29:27 +01:00
Change music directory without initiating a scan
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user