mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 11:05:32 +01:00
Initial code to get in preferred words, ignored words & required words when searching
This commit is contained in:
@@ -394,6 +394,31 @@
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend>Quality</legend>
|
||||
<div class="row radio clearfix">
|
||||
<input type="radio" name="preferred_quality" value="0" ${config['pref_qual_0']} /><label>Highest Quality excluding Lossless</label>
|
||||
<input type="radio" name="preferred_quality" value="1" ${config['pref_qual_1']} /><label>Highest Quality including Lossless</label>
|
||||
<input type="radio" name="preferred_quality" value="3" ${config['pref_qual_3']} /><label>Lossless Only</label>
|
||||
<input type="radio" id="preferred_bitrate" name="preferred_quality" value="2" ${config['pref_qual_2']} />Preferred Bitrate: <input type="text" class="override-float" name="preferred_bitrate" value="${config['pref_bitrate']}" size="3">kbps<br>
|
||||
<div id="preferred_bitrate_options">
|
||||
Reject if <strong>less than</strong> <input type="text" class="override-float" name="preferred_bitrate_low_buffer" value="${config['pref_bitrate_low']}" size="3">% or <strong>more than</strong> <input type="text" class="override-float" name="preferred_bitrate_high_buffer" value="${config['pref_bitrate_high']}" size="3">% of the target size (leave blank for no limit)<br><br>
|
||||
<div class="row checkbox left">
|
||||
<input type="checkbox" name="preferred_bitrate_allow_lossless" value="1" ${config['pref_bitrate_allow_lossless']} />
|
||||
<label>Allow lossless if no good lossy match found</label>
|
||||
</div>
|
||||
<div class="row checkbox left">
|
||||
<input type="checkbox" name="detect_bitrate" value="1" ${config['detect_bitrate']} />
|
||||
<label>Auto-Detect Preferred Bitrate</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="button" class="configsubmit" value="Save Changes" onclick="doAjaxCall('configUpdate',$(this),'tabs',true);return false;" data-success="Changes saved successfully">
|
||||
</div>
|
||||
|
||||
@@ -152,6 +152,10 @@ NZBSRUS_APIKEY = None
|
||||
|
||||
NZBX = False
|
||||
|
||||
PREFERRED_WORDS = None
|
||||
IGNORED_WORDS = None
|
||||
REQUIRED_WORDS = None
|
||||
|
||||
LASTFM_USERNAME = None
|
||||
|
||||
LOSSY_MEDIA_FORMATS = ["mp3", "aac", "ogg", "ape", "m4a"]
|
||||
@@ -281,6 +285,7 @@ def initialize():
|
||||
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, NZBSRUS, NZBSRUS_UID, NZBSRUS_APIKEY, NZBX, \
|
||||
PREFERRED_WORDS, REQUIRED_WORDS, IGNORED_WORDS, \
|
||||
LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS, ENCODERFOLDER, ENCODER_PATH, ENCODER, XLDPROFILE, BITRATE, SAMPLINGFREQUENCY, \
|
||||
MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, ENCODERVBRCBR, ENCODERLOSSLESS, DELETE_LOSSLESS_FILES, \
|
||||
PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, PUSHOVER_ENABLED, PUSHOVER_PRIORITY, PUSHOVER_KEYS, PUSHOVER_ONSNATCH, MIRRORLIST, \
|
||||
@@ -425,6 +430,10 @@ def initialize():
|
||||
NZBSRUS_APIKEY = check_setting_str(CFG, 'NZBsRus', 'nzbsrus_apikey', '')
|
||||
|
||||
NZBX = bool(check_setting_int(CFG, 'nzbX', 'nzbx', 0))
|
||||
|
||||
PREFERRED_WORDS = check_setting_str(CFG, 'General', 'preferred_words', '')
|
||||
IGNORED_WORDS = check_setting_str(CFG, 'General', 'ignored_words', '')
|
||||
REQUIRED_WORDS = check_setting_str(CFG, 'General', 'required_words', '')
|
||||
|
||||
LASTFM_USERNAME = check_setting_str(CFG, 'General', 'lastfm_username', '')
|
||||
|
||||
@@ -762,6 +771,10 @@ def config_write():
|
||||
|
||||
new_config['nzbX'] = {}
|
||||
new_config['nzbX']['nzbx'] = int(NZBX)
|
||||
|
||||
new_config['General']['preferred_words'] = PREFERRED_WORDS
|
||||
new_config['General']['ignored_words'] = IGNORED_WORDS
|
||||
new_config['General']['required_words'] = REQUIRED_WORDS
|
||||
|
||||
new_config['Prowl'] = {}
|
||||
new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED)
|
||||
|
||||
@@ -595,6 +595,9 @@ class WebInterface(object):
|
||||
"nzbsrus_uid" : headphones.NZBSRUS_UID,
|
||||
"nzbsrus_apikey" : headphones.NZBSRUS_APIKEY,
|
||||
"use_nzbx" : checked(headphones.NZBX),
|
||||
"preferred_words" : headphones.PREFERRED_WORDS,
|
||||
"ignored_words" : headphones.IGNORED_WORDS,
|
||||
"required_words" : headphones.REQUIRED_WORDS,
|
||||
"torrentblackhole_dir" : headphones.TORRENTBLACKHOLE_DIR,
|
||||
"download_torrent_dir" : headphones.DOWNLOAD_TORRENT_DIR,
|
||||
"numberofseeders" : headphones.NUMBEROFSEEDERS,
|
||||
@@ -700,8 +703,8 @@ class WebInterface(object):
|
||||
def configUpdate(self, http_host='0.0.0.0', http_username=None, http_port=8181, http_password=None, launch_browser=0, api_enabled=0, api_key=None,
|
||||
download_scan_interval=None, nzb_search_interval=None, libraryscan_interval=None, sab_host=None, sab_username=None, sab_apikey=None, sab_password=None,
|
||||
sab_category=None, download_dir=None, blackhole=0, blackhole_dir=None, usenet_retention=None, newznab=0, newznab_host=None, newznab_apikey=None,
|
||||
newznab_enabled=0, nzbsorg=0, nzbsorg_uid=None, nzbsorg_hash=None, nzbsrus=0, nzbsrus_uid=None, nzbsrus_apikey=None, nzbx=0, preferred_quality=0, preferred_bitrate=None,
|
||||
detect_bitrate=0, move_files=0, torrentblackhole_dir=None, download_torrent_dir=None,
|
||||
newznab_enabled=0, nzbsorg=0, nzbsorg_uid=None, nzbsorg_hash=None, nzbsrus=0, nzbsrus_uid=None, nzbsrus_apikey=None, nzbx=0, preferred_words=None, required_words=None, ignored_words=None,
|
||||
preferred_quality=0, preferred_bitrate=None, detect_bitrate=0, move_files=0, torrentblackhole_dir=None, download_torrent_dir=None,
|
||||
numberofseeders=10, use_isohunt=0, use_kat=0, use_mininova=0, waffles=0, waffles_uid=None, waffles_passkey=None, whatcd=0, whatcd_username=None, whatcd_password=None,
|
||||
rutracker=0, rutracker_user=None, rutracker_password=None, rename_files=0, correct_metadata=0, cleanup_files=0, add_album_art=0, album_art_format=None, embed_album_art=0, embed_lyrics=0,
|
||||
destination_dir=None, lossless_destination_dir=None, folder_format=None, file_format=None, include_extras=0, single=0, ep=0, compilation=0, soundtrack=0, live=0,
|
||||
@@ -748,6 +751,9 @@ class WebInterface(object):
|
||||
headphones.NZBSRUS_UID = nzbsrus_uid
|
||||
headphones.NZBSRUS_APIKEY = nzbsrus_apikey
|
||||
headphones.NZBX = nzbx
|
||||
headphones.PREFERRED_WORDS = preferred_words
|
||||
headphones.IGNORED_WORDS = ignored_words
|
||||
headphones.REQUIRED_WORDS = required_words
|
||||
headphones.TORRENTBLACKHOLE_DIR = torrentblackhole_dir
|
||||
headphones.NUMBEROFSEEDERS = numberofseeders
|
||||
headphones.DOWNLOAD_TORRENT_DIR = download_torrent_dir
|
||||
|
||||
Reference in New Issue
Block a user