diff --git a/data/interfaces/brink/manage.html b/data/interfaces/brink/manage.html
index 3434e363..1b31bdf8 100644
--- a/data/interfaces/brink/manage.html
+++ b/data/interfaces/brink/manage.html
@@ -43,6 +43,11 @@
|
@@ -97,4 +102,4 @@
-->
-%def>
\ No newline at end of file
+%def>
diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html
index 39b689d3..a3f994cb 100644
--- a/data/interfaces/default/config.html
+++ b/data/interfaces/default/config.html
@@ -85,7 +85,6 @@
mins
-
mins
diff --git a/data/interfaces/default/manage.html b/data/interfaces/default/manage.html
index 1b833dfe..66405aab 100644
--- a/data/interfaces/default/manage.html
+++ b/data/interfaces/default/manage.html
@@ -58,10 +58,14 @@
%endif
-
+
+
+
+
+
diff --git a/headphones/__init__.py b/headphones/__init__.py
index c2c5ce37..3f27c709 100644
--- a/headphones/__init__.py
+++ b/headphones/__init__.py
@@ -112,6 +112,7 @@ AUTOWANT_UPCOMING = False
AUTOWANT_ALL = False
SEARCH_INTERVAL = 360
+LIBRARYSCAN = False
LIBRARYSCAN_INTERVAL = 300
DOWNLOAD_SCAN_INTERVAL = 5
@@ -260,7 +261,7 @@ def initialize():
ADD_ALBUM_ART, EMBED_ALBUM_ART, EMBED_LYRICS, DOWNLOAD_DIR, BLACKHOLE, BLACKHOLE_DIR, USENET_RETENTION, SEARCH_INTERVAL, \
TORRENTBLACKHOLE_DIR, NUMBEROFSEEDERS, ISOHUNT, KAT, MININOVA, WAFFLES, WAFFLES_UID, WAFFLES_PASSKEY, \
RUTRACKER, RUTRACKER_USER, RUTRACKER_PASSWORD, WHATCD, WHATCD_USERNAME, WHATCD_PASSWORD, DOWNLOAD_TORRENT_DIR, \
- LIBRARYSCAN_INTERVAL, DOWNLOAD_SCAN_INTERVAL, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \
+ LIBRARYSCAN, LIBRARYSCAN_INTERVAL, DOWNLOAD_SCAN_INTERVAL, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \
NZBMATRIX, NZBMATRIX_USERNAME, NZBMATRIX_APIKEY, NEWZNAB, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_ENABLED, EXTRA_NEWZNABS,\
NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS, \
ENCODERFOLDER, ENCODER, XLDPROFILE, BITRATE, SAMPLINGFREQUENCY, MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, \
@@ -343,6 +344,7 @@ def initialize():
AUTOWANT_ALL = bool(check_setting_int(CFG, 'General', 'autowant_all', 0))
SEARCH_INTERVAL = check_setting_int(CFG, 'General', 'search_interval', 360)
+ LIBRARYSCAN = bool(check_setting_int(CFG, 'General', 'libraryscan', 1))
LIBRARYSCAN_INTERVAL = check_setting_int(CFG, 'General', 'libraryscan_interval', 300)
DOWNLOAD_SCAN_INTERVAL = check_setting_int(CFG, 'General', 'download_scan_interval', 5)
@@ -659,6 +661,7 @@ def config_write():
new_config['What.cd']['whatcd_password'] = WHATCD_PASSWORD
new_config['General']['search_interval'] = SEARCH_INTERVAL
+ new_config['General']['libraryscan'] = int(LIBRARYSCAN)
new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL
new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL
@@ -762,7 +765,7 @@ def start():
SCHED.add_interval_job(updater.dbUpdate, hours=24)
SCHED.add_interval_job(searcher.searchforalbum, minutes=SEARCH_INTERVAL)
- SCHED.add_interval_job(librarysync.libraryScan, minutes=LIBRARYSCAN_INTERVAL)
+ SCHED.add_interval_job(librarysync.libraryScan, minutes=LIBRARYSCAN_INTERVAL, kwargs={'cron':True})
if CHECK_GITHUB:
SCHED.add_interval_job(versioncheck.checkGithub, minutes=CHECK_GITHUB_INTERVAL)
diff --git a/headphones/librarysync.py b/headphones/librarysync.py
index ea95efa6..05ff49a0 100644
--- a/headphones/librarysync.py
+++ b/headphones/librarysync.py
@@ -22,8 +22,11 @@ import headphones
from headphones import db, logger, helpers, importer
# You can scan a single directory and append it to the current library by specifying append=True, ArtistID & ArtistName
-def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None):
+def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None, cron=False):
+ if cron and not headphones.LIBRARYSCAN:
+ return
+
if not dir:
dir = headphones.MUSIC_DIR
diff --git a/headphones/webserve.py b/headphones/webserve.py
index a8dd11ae..08d1863f 100644
--- a/headphones/webserve.py
+++ b/headphones/webserve.py
@@ -368,7 +368,8 @@ class WebInterface(object):
raise cherrypy.HTTPRedirect("home")
importItunes.exposed = True
- def musicScan(self, path, scan=0, redirect=None, autoadd=0):
+ def musicScan(self, path, scan=0, redirect=None, autoadd=0, libraryscan=0):
+ headphones.LIBRARYSCAN = libraryscan
headphones.ADD_ARTISTS = autoadd
headphones.MUSIC_DIR = path
headphones.config_write()
@@ -688,7 +689,7 @@ class WebInterface(object):
bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0,
delete_lossless_files=0, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None,
xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, synoindex_enabled=False, mirror=None, customhost=None, customport=None,
- customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, cache_sizemb=0, **kwargs):
+ customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, cache_sizemb=None, **kwargs):
headphones.HTTP_HOST = http_host
headphones.HTTP_PORT = http_port
|