예제 #1
0
 def config(self):
   config = { 
         "http_host" : headphones.HTTP_HOST,
         "http_user" : headphones.HTTP_USERNAME,
         "http_port" : headphones.HTTP_PORT,
         "http_pass" : headphones.HTTP_PASSWORD,
         "launch_browser" : checked(headphones.LAUNCH_BROWSER),
         "sab_host" : headphones.SAB_HOST,
         "sab_user" : headphones.SAB_USERNAME,
         "sab_api" : headphones.SAB_APIKEY,
         "sab_pass" : headphones.SAB_PASSWORD,
         "sab_cat" : headphones.SAB_CATEGORY,
         "download_dir" : headphones.DOWNLOAD_DIR,
         "use_blackhole" : checked(headphones.BLACKHOLE),
         "blackhole_dir" : headphones.BLACKHOLE_DIR,
         "usenet_retention" : headphones.USENET_RETENTION,
         "use_nzbmatrix" : checked(headphones.NZBMATRIX),
         "nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
         "nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
         "use_newznab" : checked(headphones.NEWZNAB),
         "newznab_host" : headphones.NEWZNAB_HOST,
         "newznab_api" : headphones.NEWZNAB_APIKEY,
         "use_nzbsorg" : checked(headphones.NZBSORG),
         "nzbsorg_uid" : headphones.NZBSORG_UID,
         "nzbsorg_hash" : headphones.NZBSORG_HASH,
         "use_newzbin" : checked(headphones.NEWZBIN),
         "newzbin_uid" : headphones.NEWZBIN_UID,
         "newzbin_pass" : headphones.NEWZBIN_PASSWORD,
         "pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
         "pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
         "pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
         "pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
         "pref_bitrate" : headphones.PREFERRED_BITRATE,
         "detect_bitrate" : checked(headphones.DETECT_BITRATE),
         "move_files" : checked(headphones.MOVE_FILES),
         "rename_files" : checked(headphones.RENAME_FILES),
         "correct_metadata" : checked(headphones.CORRECT_METADATA),
         "cleanup_files" : checked(headphones.CLEANUP_FILES),
         "add_album_art" : checked(headphones.ADD_ALBUM_ART),
         "embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
         "embed_lyrics" : checked(headphones.EMBED_LYRICS),
         "dest_dir" : headphones.DESTINATION_DIR,
         "folder_format" : headphones.FOLDER_FORMAT,
         "file_format" : headphones.FILE_FORMAT,
         "include_extras" : checked(headphones.INCLUDE_EXTRAS),
         "log_dir" : headphones.LOG_DIR,
         "encode":   checked(headphones.ENCODE),
         "encoder":    headphones.ENCODER,
         "bitrate":    int(headphones.BITRATE),
         "encoderfolder":  headphones.ENCODERFOLDER,
         "advancedencoder":  headphones.ADVANCEDENCODER,
         "encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
         "samplingfrequency": headphones.SAMPLINGFREQUENCY,
         "encodervbrcbr": headphones.ENCODERVBRCBR,
         "encoderquality": headphones.ENCODERQUALITY,
         "encoderlossless": checked(headphones.ENCODERLOSSLESS)
       }
   return serve_template(templatename="config.html", title="Settings", config=config)
예제 #2
0
	def config(self):
	
		interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
		interface_list = [ name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name)) ]

		config = { 
					"http_host" : headphones.HTTP_HOST,
					"http_user" : headphones.HTTP_USERNAME,
		 			"http_port" : headphones.HTTP_PORT,
				 	"http_pass" : headphones.HTTP_PASSWORD,
					"launch_browser" : checked(headphones.LAUNCH_BROWSER),
					"sab_host" : headphones.SAB_HOST,
					"sab_user" : headphones.SAB_USERNAME,
					"sab_api" : headphones.SAB_APIKEY,
					"sab_pass" : headphones.SAB_PASSWORD,
					"sab_cat" : headphones.SAB_CATEGORY,
					"download_dir" : headphones.DOWNLOAD_DIR,
					"use_blackhole" : checked(headphones.BLACKHOLE),
					"blackhole_dir" : headphones.BLACKHOLE_DIR,
					"usenet_retention" : headphones.USENET_RETENTION,
					"use_nzbmatrix" : checked(headphones.NZBMATRIX),
					"nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
					"nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
					"use_newznab" : checked(headphones.NEWZNAB),
					"newznab_host" : headphones.NEWZNAB_HOST,
					"newznab_api" : headphones.NEWZNAB_APIKEY,
					"use_nzbsorg" : checked(headphones.NZBSORG),
					"nzbsorg_uid" : headphones.NZBSORG_UID,
					"nzbsorg_hash" : headphones.NZBSORG_HASH,
					"use_newzbin" : checked(headphones.NEWZBIN),
					"newzbin_uid" : headphones.NEWZBIN_UID,
					"newzbin_pass" : headphones.NEWZBIN_PASSWORD,
					"pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
					"pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
					"pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
					"pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
					"pref_bitrate" : headphones.PREFERRED_BITRATE,
					"detect_bitrate" : checked(headphones.DETECT_BITRATE),
					"move_files" : checked(headphones.MOVE_FILES),
					"rename_files" : checked(headphones.RENAME_FILES),
					"correct_metadata" : checked(headphones.CORRECT_METADATA),
					"cleanup_files" : checked(headphones.CLEANUP_FILES),
					"add_album_art" : checked(headphones.ADD_ALBUM_ART),
					"embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
					"dest_dir" : headphones.DESTINATION_DIR,
					"folder_format" : headphones.FOLDER_FORMAT,
					"file_format" : headphones.FILE_FORMAT,
					"include_extras" : checked(headphones.INCLUDE_EXTRAS),
					"log_dir" : headphones.LOG_DIR,
					"interface_list" : interface_list,
					"encode":		checked(headphones.ENCODE),
					"encoder":		headphones.ENCODER,
					"bitrate":		headphones.BITRATE,
					"encoderfolder":	headphones.ENCODERFOLDER,
					"advancedencoder":	headphones.ADVANCEDENCODER
				}
		return serve_template(templatename="config.html", title="Settings", config=config)	
예제 #3
0
	def config(self):
		page = [templates._header]
		page.append(templates._logobar)
		page.append(templates._nav)
		page.append(templates.configform % (
		headphones.HTTP_HOST,
		headphones.HTTP_USERNAME,
		headphones.HTTP_PORT,
		headphones.HTTP_PASSWORD,
		checked(headphones.LAUNCH_BROWSER),
		headphones.SAB_HOST,
		headphones.SAB_USERNAME,
		headphones.SAB_APIKEY,
		headphones.SAB_PASSWORD,
		headphones.SAB_CATEGORY,
		headphones.DOWNLOAD_DIR,
		checked(headphones.BLACKHOLE),
		headphones.BLACKHOLE_DIR,
		headphones.USENET_RETENTION,
		checked(headphones.NZBMATRIX),
		headphones.NZBMATRIX_USERNAME,
		headphones.NZBMATRIX_APIKEY,
		checked(headphones.NEWZNAB),
		headphones.NEWZNAB_HOST,
		headphones.NEWZNAB_APIKEY,
		checked(headphones.NZBSORG),
		headphones.NZBSORG_UID,
		headphones.NZBSORG_HASH,
		checked(headphones.NEWZBIN),
		headphones.NEWZBIN_UID,
		headphones.NEWZBIN_PASSWORD,
		radio(headphones.PREFERRED_QUALITY, 0),
		radio(headphones.PREFERRED_QUALITY, 1),
		radio(headphones.PREFERRED_QUALITY, 3),
		radio(headphones.PREFERRED_QUALITY, 2),
		headphones.PREFERRED_BITRATE,
		checked(headphones.DETECT_BITRATE),
		checked(headphones.MOVE_FILES),
		checked(headphones.RENAME_FILES),
		checked(headphones.CORRECT_METADATA),
		checked(headphones.CLEANUP_FILES),
		checked(headphones.ADD_ALBUM_ART),
		checked(headphones.EMBED_ALBUM_ART),
		headphones.DESTINATION_DIR,
		headphones.FOLDER_FORMAT,
		headphones.FILE_FORMAT,
		checked(headphones.INCLUDE_EXTRAS),
		headphones.LOG_DIR
		))
		page.append(templates._footer % headphones.CURRENT_VERSION)
		return page
예제 #4
0
    def config(self):
    
        interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
        interface_list = [ name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name)) ]

        config = { 
                    "http_host" : headphones.HTTP_HOST,
                    "http_user" : headphones.HTTP_USERNAME,
                    "http_port" : headphones.HTTP_PORT,
                    "http_pass" : headphones.HTTP_PASSWORD,
                    "launch_browser" : checked(headphones.LAUNCH_BROWSER),
                    "api_enabled" : checked(headphones.API_ENABLED),
                    "api_key" : headphones.API_KEY,
                    "download_scan_interval" : headphones.DOWNLOAD_SCAN_INTERVAL,
                    "nzb_search_interval" : headphones.SEARCH_INTERVAL,
                    "libraryscan_interval" : headphones.LIBRARYSCAN_INTERVAL,
                    "sab_host" : headphones.SAB_HOST,
                    "sab_user" : headphones.SAB_USERNAME,
                    "sab_api" : headphones.SAB_APIKEY,
                    "sab_pass" : headphones.SAB_PASSWORD,
                    "sab_cat" : headphones.SAB_CATEGORY,
                    "download_dir" : headphones.DOWNLOAD_DIR,
                    "use_blackhole" : checked(headphones.BLACKHOLE),
                    "blackhole_dir" : headphones.BLACKHOLE_DIR,
                    "usenet_retention" : headphones.USENET_RETENTION,
                    "use_nzbmatrix" : checked(headphones.NZBMATRIX),
                    "nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
                    "nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
                    "use_newznab" : checked(headphones.NEWZNAB),
                    "newznab_host" : headphones.NEWZNAB_HOST,
                    "newznab_api" : headphones.NEWZNAB_APIKEY,
                    "use_nzbsorg" : checked(headphones.NZBSORG),
                    "nzbsorg_uid" : headphones.NZBSORG_UID,
                    "nzbsorg_hash" : headphones.NZBSORG_HASH,
                    "use_newzbin" : checked(headphones.NEWZBIN),
                    "newzbin_uid" : headphones.NEWZBIN_UID,
                    "newzbin_pass" : headphones.NEWZBIN_PASSWORD,
                    "torrentblackhole_dir" : headphones.TORRENTBLACKHOLE_DIR,
                    "download_torrent_dir" : headphones.DOWNLOAD_TORRENT_DIR,
                    "numberofseeders" : headphones.NUMBEROFSEEDERS,
                    "use_isohunt" : checked(headphones.ISOHUNT),
                    "use_kat" : checked(headphones.KAT),
                    "use_mininova" : checked(headphones.MININOVA),
                    "pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
                    "pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
                    "pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
                    "pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
                    "pref_bitrate" : headphones.PREFERRED_BITRATE,
                    "detect_bitrate" : checked(headphones.DETECT_BITRATE),
                    "move_files" : checked(headphones.MOVE_FILES),
                    "rename_files" : checked(headphones.RENAME_FILES),
                    "correct_metadata" : checked(headphones.CORRECT_METADATA),
                    "cleanup_files" : checked(headphones.CLEANUP_FILES),
                    "add_album_art" : checked(headphones.ADD_ALBUM_ART),
                    "embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
                    "embed_lyrics" : checked(headphones.EMBED_LYRICS),
                    "dest_dir" : headphones.DESTINATION_DIR,
                    "folder_format" : headphones.FOLDER_FORMAT,
                    "file_format" : headphones.FILE_FORMAT,
                    "include_extras" : checked(headphones.INCLUDE_EXTRAS),
                    "autowant_upcoming" : checked(headphones.AUTOWANT_UPCOMING),
                    "autowant_all" : checked(headphones.AUTOWANT_ALL),
                    "log_dir" : headphones.LOG_DIR,
                    "interface_list" : interface_list,
                    "music_encoder":        checked(headphones.MUSIC_ENCODER),
                    "encoder":      headphones.ENCODER,
                    "bitrate":      int(headphones.BITRATE),
                    "encoderfolder":    headphones.ENCODERFOLDER,
                    "advancedencoder":  headphones.ADVANCEDENCODER,
                    "encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
                    "samplingfrequency": headphones.SAMPLINGFREQUENCY,
                    "encodervbrcbr": headphones.ENCODERVBRCBR,
                    "encoderquality": headphones.ENCODERQUALITY,
                    "encoderlossless": checked(headphones.ENCODERLOSSLESS),
                    "prowl_enabled": checked(headphones.PROWL_ENABLED),
                    "prowl_onsnatch": checked(headphones.PROWL_ONSNATCH),
                    "prowl_keys": headphones.PROWL_KEYS,
                    "prowl_priority": headphones.PROWL_PRIORITY,
                    "xbmc_enabled": checked(headphones.XBMC_ENABLED),
                    "xbmc_host": headphones.XBMC_HOST,
                    "xbmc_username": headphones.XBMC_USERNAME,
                    "xbmc_password": headphones.XBMC_PASSWORD,
                    "xbmc_update": checked(headphones.XBMC_UPDATE),
                    "xbmc_notify": checked(headphones.XBMC_NOTIFY),
                    "nma_enabled": checked(headphones.NMA_ENABLED),
                    "nma_apikey": headphones.NMA_APIKEY,
                    "nma_priority": int(headphones.NMA_PRIORITY),
                    "mirror_list": headphones.MIRRORLIST,
                    "mirror": headphones.MIRROR,
                    "customhost": headphones.CUSTOMHOST,
                    "customport": headphones.CUSTOMPORT,
                    "customsleep": headphones.CUSTOMSLEEP,
                    "hpuser": headphones.HPUSER,
                    "hppass": headphones.HPPASS
                }
        return serve_template(templatename="config.html", title="Settings", config=config)  
예제 #5
0
    def config(self):
    
        interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
        interface_list = [ name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name)) ]

        config = { 
                    "http_host" : headphones.HTTP_HOST,
                    "http_user" : headphones.HTTP_USERNAME,
                    "http_port" : headphones.HTTP_PORT,
                    "http_pass" : headphones.HTTP_PASSWORD,
                    "launch_browser" : checked(headphones.LAUNCH_BROWSER),
                    "api_enabled" : checked(headphones.API_ENABLED),
                    "api_key" : headphones.API_KEY,
                    "download_scan_interval" : headphones.DOWNLOAD_SCAN_INTERVAL,
                    "nzb_search_interval" : headphones.SEARCH_INTERVAL,
                    "libraryscan_interval" : headphones.LIBRARYSCAN_INTERVAL,
                    "sab_host" : headphones.SAB_HOST,
                    "sab_user" : headphones.SAB_USERNAME,
                    "sab_api" : headphones.SAB_APIKEY,
                    "sab_pass" : headphones.SAB_PASSWORD,
                    "sab_cat" : headphones.SAB_CATEGORY,
                    "download_dir" : headphones.DOWNLOAD_DIR,
                    "use_blackhole" : checked(headphones.BLACKHOLE),
                    "blackhole_dir" : headphones.BLACKHOLE_DIR,
                    "usenet_retention" : headphones.USENET_RETENTION,
                    "use_nzbmatrix" : checked(headphones.NZBMATRIX),
                    "nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
                    "nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
                    "use_newznab" : checked(headphones.NEWZNAB),
                    "newznab_host" : headphones.NEWZNAB_HOST,
                    "newznab_api" : headphones.NEWZNAB_APIKEY,
                    "newznab_enabled" : checked(headphones.NEWZNAB_ENABLED),
                    "extra_newznabs" : headphones.EXTRA_NEWZNABS,
                    "use_nzbsorg" : checked(headphones.NZBSORG),
                    "nzbsorg_uid" : headphones.NZBSORG_UID,
                    "nzbsorg_hash" : headphones.NZBSORG_HASH,
                    "use_newzbin" : checked(headphones.NEWZBIN),
                    "newzbin_uid" : headphones.NEWZBIN_UID,
                    "newzbin_pass" : headphones.NEWZBIN_PASSWORD,
                    "torrentblackhole_dir" : headphones.TORRENTBLACKHOLE_DIR,
                    "download_torrent_dir" : headphones.DOWNLOAD_TORRENT_DIR,
                    "numberofseeders" : headphones.NUMBEROFSEEDERS,
                    "use_isohunt" : checked(headphones.ISOHUNT),
                    "use_kat" : checked(headphones.KAT),
                    "use_mininova" : checked(headphones.MININOVA),
                    "use_waffles" : checked(headphones.WAFFLES),
                    "waffles_uid" : headphones.WAFFLES_UID,
                    "waffles_passkey": headphones.WAFFLES_PASSKEY,
                    "use_rutracker" : checked(headphones.RUTRACKER),
                    "rutracker_user" : headphones.RUTRACKER_USER,
                    "rutracker_password": headphones.RUTRACKER_PASSWORD,
                    "use_whatcd" : checked(headphones.WHATCD),
                    "whatcd_username" : headphones.WHATCD_USERNAME,
                    "whatcd_password": headphones.WHATCD_PASSWORD,
                    "pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
                    "pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
                    "pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
                    "pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
                    "pref_bitrate" : headphones.PREFERRED_BITRATE,
                    "pref_bitrate_high" : headphones.PREFERRED_BITRATE_HIGH_BUFFER,
                    "pref_bitrate_low" : headphones.PREFERRED_BITRATE_LOW_BUFFER,
                    "detect_bitrate" : checked(headphones.DETECT_BITRATE),
                    "move_files" : checked(headphones.MOVE_FILES),
                    "rename_files" : checked(headphones.RENAME_FILES),
                    "correct_metadata" : checked(headphones.CORRECT_METADATA),
                    "cleanup_files" : checked(headphones.CLEANUP_FILES),
                    "add_album_art" : checked(headphones.ADD_ALBUM_ART),
                    "embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
                    "embed_lyrics" : checked(headphones.EMBED_LYRICS),
                    "dest_dir" : headphones.DESTINATION_DIR,
                    "lossless_dest_dir" : headphones.LOSSLESS_DESTINATION_DIR,
                    "folder_format" : headphones.FOLDER_FORMAT,
                    "file_format" : headphones.FILE_FORMAT,
                    "include_extras" : checked(headphones.INCLUDE_EXTRAS),
                    "autowant_upcoming" : checked(headphones.AUTOWANT_UPCOMING),
                    "autowant_all" : checked(headphones.AUTOWANT_ALL),
                    "log_dir" : headphones.LOG_DIR,
                    "cache_dir" : headphones.CACHE_DIR,
                    "interface_list" : interface_list,
                    "music_encoder":        checked(headphones.MUSIC_ENCODER),
                    "encoder":      headphones.ENCODER,
                    "bitrate":      int(headphones.BITRATE),
                    "encoderfolder":    headphones.ENCODERFOLDER,
                    "advancedencoder":  headphones.ADVANCEDENCODER,
                    "encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
                    "samplingfrequency": headphones.SAMPLINGFREQUENCY,
                    "encodervbrcbr": headphones.ENCODERVBRCBR,
                    "encoderquality": headphones.ENCODERQUALITY,
                    "encoderlossless": checked(headphones.ENCODERLOSSLESS),
                    "delete_lossless_files": checked(headphones.DELETE_LOSSLESS_FILES),
                    "prowl_enabled": checked(headphones.PROWL_ENABLED),
                    "prowl_onsnatch": checked(headphones.PROWL_ONSNATCH),
                    "prowl_keys": headphones.PROWL_KEYS,
                    "prowl_priority": headphones.PROWL_PRIORITY,
                    "xbmc_enabled": checked(headphones.XBMC_ENABLED),
                    "xbmc_host": headphones.XBMC_HOST,
                    "xbmc_username": headphones.XBMC_USERNAME,
                    "xbmc_password": headphones.XBMC_PASSWORD,
                    "xbmc_update": checked(headphones.XBMC_UPDATE),
                    "xbmc_notify": checked(headphones.XBMC_NOTIFY),
                    "nma_enabled": checked(headphones.NMA_ENABLED),
                    "nma_apikey": headphones.NMA_APIKEY,
                    "nma_priority": int(headphones.NMA_PRIORITY),
                    "nma_onsnatch": checked(headphones.NMA_ONSNATCH),
                    "synoindex_enabled": checked(headphones.SYNOINDEX_ENABLED),
                    "mirror_list": headphones.MIRRORLIST,
                    "mirror": headphones.MIRROR,
                    "customhost": headphones.CUSTOMHOST,
                    "customport": headphones.CUSTOMPORT,
                    "customsleep": headphones.CUSTOMSLEEP,
                    "hpuser": headphones.HPUSER,
                    "hppass": headphones.HPPASS,
                    "cache_sizemb":headphones.CACHE_SIZEMB,
                }
            
        # Need to convert EXTRAS to a dictionary we can pass to the config: it'll come in as a string like 2,5,6,8
        extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook"]
        extras_dict = {}
        
        i = 1
        for extra in extras_list:
            if str(i) in headphones.EXTRAS:
                extras_dict[extra] = "checked"
            else:
                extras_dict[extra] = ""
            i+=1
                
        config["extras"] = extras_dict
        
        return serve_template(templatename="config.html", title="Settings", config=config)  
예제 #6
0
    def config(self):

        interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
        interface_list = [
            name for name in os.listdir(interface_dir)
            if os.path.isdir(os.path.join(interface_dir, name))
        ]

        config = {
            "http_host": headphones.HTTP_HOST,
            "http_user": headphones.HTTP_USERNAME,
            "http_port": headphones.HTTP_PORT,
            "http_pass": headphones.HTTP_PASSWORD,
            "launch_browser": checked(headphones.LAUNCH_BROWSER),
            "api_enabled": checked(headphones.API_ENABLED),
            "api_key": headphones.API_KEY,
            "download_scan_interval": headphones.DOWNLOAD_SCAN_INTERVAL,
            "nzb_search_interval": headphones.SEARCH_INTERVAL,
            "libraryscan_interval": headphones.LIBRARYSCAN_INTERVAL,
            "sab_host": headphones.SAB_HOST,
            "sab_user": headphones.SAB_USERNAME,
            "sab_api": headphones.SAB_APIKEY,
            "sab_pass": headphones.SAB_PASSWORD,
            "sab_cat": headphones.SAB_CATEGORY,
            "download_dir": headphones.DOWNLOAD_DIR,
            "use_blackhole": checked(headphones.BLACKHOLE),
            "blackhole_dir": headphones.BLACKHOLE_DIR,
            "usenet_retention": headphones.USENET_RETENTION,
            "use_nzbmatrix": checked(headphones.NZBMATRIX),
            "nzbmatrix_user": headphones.NZBMATRIX_USERNAME,
            "nzbmatrix_api": headphones.NZBMATRIX_APIKEY,
            "use_newznab": checked(headphones.NEWZNAB),
            "newznab_host": headphones.NEWZNAB_HOST,
            "newznab_api": headphones.NEWZNAB_APIKEY,
            "newznab_enabled": checked(headphones.NEWZNAB_ENABLED),
            "extra_newznabs": headphones.EXTRA_NEWZNABS,
            "use_nzbsorg": checked(headphones.NZBSORG),
            "nzbsorg_uid": headphones.NZBSORG_UID,
            "nzbsorg_hash": headphones.NZBSORG_HASH,
            "use_newzbin": checked(headphones.NEWZBIN),
            "newzbin_uid": headphones.NEWZBIN_UID,
            "newzbin_pass": headphones.NEWZBIN_PASSWORD,
            "torrentblackhole_dir": headphones.TORRENTBLACKHOLE_DIR,
            "download_torrent_dir": headphones.DOWNLOAD_TORRENT_DIR,
            "numberofseeders": headphones.NUMBEROFSEEDERS,
            "use_isohunt": checked(headphones.ISOHUNT),
            "use_kat": checked(headphones.KAT),
            "use_mininova": checked(headphones.MININOVA),
            "use_waffles": checked(headphones.WAFFLES),
            "waffles_uid": headphones.WAFFLES_UID,
            "waffles_passkey": headphones.WAFFLES_PASSKEY,
            "use_rutracker": checked(headphones.RUTRACKER),
            "rutracker_user": headphones.RUTRACKER_USER,
            "rutracker_password": headphones.RUTRACKER_PASSWORD,
            "use_whatcd": checked(headphones.WHATCD),
            "whatcd_username": headphones.WHATCD_USERNAME,
            "whatcd_password": headphones.WHATCD_PASSWORD,
            "pref_qual_0": radio(headphones.PREFERRED_QUALITY, 0),
            "pref_qual_1": radio(headphones.PREFERRED_QUALITY, 1),
            "pref_qual_3": radio(headphones.PREFERRED_QUALITY, 3),
            "pref_qual_2": radio(headphones.PREFERRED_QUALITY, 2),
            "pref_bitrate": headphones.PREFERRED_BITRATE,
            "pref_bitrate_high": headphones.PREFERRED_BITRATE_HIGH_BUFFER,
            "pref_bitrate_low": headphones.PREFERRED_BITRATE_LOW_BUFFER,
            "detect_bitrate": checked(headphones.DETECT_BITRATE),
            "move_files": checked(headphones.MOVE_FILES),
            "rename_files": checked(headphones.RENAME_FILES),
            "correct_metadata": checked(headphones.CORRECT_METADATA),
            "cleanup_files": checked(headphones.CLEANUP_FILES),
            "add_album_art": checked(headphones.ADD_ALBUM_ART),
            "embed_album_art": checked(headphones.EMBED_ALBUM_ART),
            "embed_lyrics": checked(headphones.EMBED_LYRICS),
            "dest_dir": headphones.DESTINATION_DIR,
            "lossless_dest_dir": headphones.LOSSLESS_DESTINATION_DIR,
            "folder_format": headphones.FOLDER_FORMAT,
            "file_format": headphones.FILE_FORMAT,
            "include_extras": checked(headphones.INCLUDE_EXTRAS),
            "autowant_upcoming": checked(headphones.AUTOWANT_UPCOMING),
            "autowant_all": checked(headphones.AUTOWANT_ALL),
            "log_dir": headphones.LOG_DIR,
            "cache_dir": headphones.CACHE_DIR,
            "interface_list": interface_list,
            "music_encoder": checked(headphones.MUSIC_ENCODER),
            "encoder": headphones.ENCODER,
            "xldprofile": headphones.XLDPROFILE,
            "bitrate": int(headphones.BITRATE),
            "encoderfolder": headphones.ENCODERFOLDER,
            "advancedencoder": headphones.ADVANCEDENCODER,
            "encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
            "samplingfrequency": headphones.SAMPLINGFREQUENCY,
            "encodervbrcbr": headphones.ENCODERVBRCBR,
            "encoderquality": headphones.ENCODERQUALITY,
            "encoderlossless": checked(headphones.ENCODERLOSSLESS),
            "delete_lossless_files": checked(headphones.DELETE_LOSSLESS_FILES),
            "prowl_enabled": checked(headphones.PROWL_ENABLED),
            "prowl_onsnatch": checked(headphones.PROWL_ONSNATCH),
            "prowl_keys": headphones.PROWL_KEYS,
            "prowl_priority": headphones.PROWL_PRIORITY,
            "xbmc_enabled": checked(headphones.XBMC_ENABLED),
            "xbmc_host": headphones.XBMC_HOST,
            "xbmc_username": headphones.XBMC_USERNAME,
            "xbmc_password": headphones.XBMC_PASSWORD,
            "xbmc_update": checked(headphones.XBMC_UPDATE),
            "xbmc_notify": checked(headphones.XBMC_NOTIFY),
            "nma_enabled": checked(headphones.NMA_ENABLED),
            "nma_apikey": headphones.NMA_APIKEY,
            "nma_priority": int(headphones.NMA_PRIORITY),
            "nma_onsnatch": checked(headphones.NMA_ONSNATCH),
            "synoindex_enabled": checked(headphones.SYNOINDEX_ENABLED),
            "mirror_list": headphones.MIRRORLIST,
            "mirror": headphones.MIRROR,
            "customhost": headphones.CUSTOMHOST,
            "customport": headphones.CUSTOMPORT,
            "customsleep": headphones.CUSTOMSLEEP,
            "hpuser": headphones.HPUSER,
            "hppass": headphones.HPPASS,
            "cache_sizemb": headphones.CACHE_SIZEMB,
        }

        # Need to convert EXTRAS to a dictionary we can pass to the config: it'll come in as a string like 2,5,6,8
        extras_list = [
            "single", "ep", "compilation", "soundtrack", "live", "remix",
            "spokenword", "audiobook"
        ]
        extras_dict = {}

        i = 1
        for extra in extras_list:
            if str(i) in headphones.EXTRAS:
                extras_dict[extra] = "checked"
            else:
                extras_dict[extra] = ""
            i += 1

        config["extras"] = extras_dict

        return serve_template(templatename="config.html",
                              title="Settings",
                              config=config)
예제 #7
0
	def config(self):
	
		interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
		interface_list = [ name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name)) ]

		config = { 
					"http_host" : headphones.HTTP_HOST,
					"http_user" : headphones.HTTP_USERNAME,
		 			"http_port" : headphones.HTTP_PORT,
				 	"http_pass" : headphones.HTTP_PASSWORD,
					"launch_browser" : checked(headphones.LAUNCH_BROWSER),
					"api_enabled" : checked(headphones.API_ENABLED),
					"api_key" : headphones.API_KEY,
					"download_scan_interval" : headphones.DOWNLOAD_SCAN_INTERVAL,
					"nzb_search_interval" : headphones.SEARCH_INTERVAL,
					"libraryscan_interval" : headphones.LIBRARYSCAN_INTERVAL,
					"sab_host" : headphones.SAB_HOST,
					"sab_user" : headphones.SAB_USERNAME,
					"sab_api" : headphones.SAB_APIKEY,
					"sab_pass" : headphones.SAB_PASSWORD,
					"sab_cat" : headphones.SAB_CATEGORY,
					"download_dir" : headphones.DOWNLOAD_DIR,
					"use_blackhole" : checked(headphones.BLACKHOLE),
					"blackhole_dir" : headphones.BLACKHOLE_DIR,
					"usenet_retention" : headphones.USENET_RETENTION,
					"use_nzbmatrix" : checked(headphones.NZBMATRIX),
					"nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
					"nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
					"use_newznab" : checked(headphones.NEWZNAB),
					"newznab_host" : headphones.NEWZNAB_HOST,
					"newznab_api" : headphones.NEWZNAB_APIKEY,
					"use_nzbsorg" : checked(headphones.NZBSORG),
					"nzbsorg_uid" : headphones.NZBSORG_UID,
					"nzbsorg_hash" : headphones.NZBSORG_HASH,
					"use_newzbin" : checked(headphones.NEWZBIN),
					"newzbin_uid" : headphones.NEWZBIN_UID,
					"newzbin_pass" : headphones.NEWZBIN_PASSWORD,
					"torrentblackhole_dir" : headphones.TORRENTBLACKHOLE_DIR,
					"download_torrent_dir" : headphones.DOWNLOAD_TORRENT_DIR,
					"numberofseeders" : headphones.NUMBEROFSEEDERS,
					"use_isohunt" : checked(headphones.ISOHUNT),
					"use_kat" : checked(headphones.KAT),
					"use_mininova" : checked(headphones.MININOVA),
					"pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
					"pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
					"pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
					"pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
					"pref_bitrate" : headphones.PREFERRED_BITRATE,
					"detect_bitrate" : checked(headphones.DETECT_BITRATE),
					"move_files" : checked(headphones.MOVE_FILES),
					"rename_files" : checked(headphones.RENAME_FILES),
					"correct_metadata" : checked(headphones.CORRECT_METADATA),
					"cleanup_files" : checked(headphones.CLEANUP_FILES),
					"add_album_art" : checked(headphones.ADD_ALBUM_ART),
					"embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
					"embed_lyrics" : checked(headphones.EMBED_LYRICS),
					"dest_dir" : headphones.DESTINATION_DIR,
					"folder_format" : headphones.FOLDER_FORMAT,
					"file_format" : headphones.FILE_FORMAT,
					"include_extras" : checked(headphones.INCLUDE_EXTRAS),
					"autowant_upcoming" : checked(headphones.AUTOWANT_UPCOMING),
					"autowant_all" : checked(headphones.AUTOWANT_ALL),
					"log_dir" : headphones.LOG_DIR,
					"interface_list" : interface_list,
					"music_encoder":		checked(headphones.MUSIC_ENCODER),
					"encoder":		headphones.ENCODER,
					"bitrate":		int(headphones.BITRATE),
					"encoderfolder":	headphones.ENCODERFOLDER,
					"advancedencoder":	headphones.ADVANCEDENCODER,
					"encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
					"samplingfrequency": headphones.SAMPLINGFREQUENCY,
					"encodervbrcbr": headphones.ENCODERVBRCBR,
					"encoderquality": headphones.ENCODERQUALITY,
					"encoderlossless": checked(headphones.ENCODERLOSSLESS),
					"prowl_enabled": checked(headphones.PROWL_ENABLED),
					"prowl_onsnatch": checked(headphones.PROWL_ONSNATCH),
					"prowl_keys": headphones.PROWL_KEYS,
					"prowl_priority": headphones.PROWL_PRIORITY,
					"xbmc_enabled": checked(headphones.XBMC_ENABLED),
					"xbmc_host": headphones.XBMC_HOST,
					"xbmc_username": headphones.XBMC_USERNAME,
					"xbmc_password": headphones.XBMC_PASSWORD,
					"xbmc_update": checked(headphones.XBMC_UPDATE),
					"xbmc_notify": checked(headphones.XBMC_NOTIFY),
					"nma_enabled": checked(headphones.NMA_ENABLED),
					"nma_apikey": headphones.NMA_APIKEY,
					"nma_priority": int(headphones.NMA_PRIORITY),
					"mirror_list": headphones.MIRRORLIST,
					"mirror": headphones.MIRROR,
					"customhost": headphones.CUSTOMHOST,
					"customport": headphones.CUSTOMPORT,
					"customsleep": headphones.CUSTOMSLEEP,
					"hpuser": headphones.HPUSER,
					"hppass": headphones.HPPASS
				}
		return serve_template(templatename="config.html", title="Settings", config=config)	
예제 #8
0
    def config(self):

        interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
        interface_list = [
            name for name in os.listdir(interface_dir)
            if os.path.isdir(os.path.join(interface_dir, name))
        ]

        config = {
            "http_host": headphones.HTTP_HOST,
            "http_user": headphones.HTTP_USERNAME,
            "http_port": headphones.HTTP_PORT,
            "http_pass": headphones.HTTP_PASSWORD,
            "launch_browser": checked(headphones.LAUNCH_BROWSER),
            "sab_host": headphones.SAB_HOST,
            "sab_user": headphones.SAB_USERNAME,
            "sab_api": headphones.SAB_APIKEY,
            "sab_pass": headphones.SAB_PASSWORD,
            "sab_cat": headphones.SAB_CATEGORY,
            "download_dir": headphones.DOWNLOAD_DIR,
            "use_blackhole": checked(headphones.BLACKHOLE),
            "blackhole_dir": headphones.BLACKHOLE_DIR,
            "usenet_retention": headphones.USENET_RETENTION,
            "use_nzbmatrix": checked(headphones.NZBMATRIX),
            "nzbmatrix_user": headphones.NZBMATRIX_USERNAME,
            "nzbmatrix_api": headphones.NZBMATRIX_APIKEY,
            "use_newznab": checked(headphones.NEWZNAB),
            "newznab_host": headphones.NEWZNAB_HOST,
            "newznab_api": headphones.NEWZNAB_APIKEY,
            "use_nzbsorg": checked(headphones.NZBSORG),
            "nzbsorg_uid": headphones.NZBSORG_UID,
            "nzbsorg_hash": headphones.NZBSORG_HASH,
            "use_newzbin": checked(headphones.NEWZBIN),
            "newzbin_uid": headphones.NEWZBIN_UID,
            "newzbin_pass": headphones.NEWZBIN_PASSWORD,
            "torrentblackhole_dir": headphones.TORRENTBLACKHOLE_DIR,
            "download_torrent_dir": headphones.DOWNLOAD_TORRENT_DIR,
            "numberofseeders": headphones.NUMBEROFSEEDERS,
            "use_isohunt": checked(headphones.ISOHUNT),
            "use_kat": checked(headphones.KAT),
            "use_mininova": checked(headphones.MININOVA),
            "pref_qual_0": radio(headphones.PREFERRED_QUALITY, 0),
            "pref_qual_1": radio(headphones.PREFERRED_QUALITY, 1),
            "pref_qual_3": radio(headphones.PREFERRED_QUALITY, 3),
            "pref_qual_2": radio(headphones.PREFERRED_QUALITY, 2),
            "pref_bitrate": headphones.PREFERRED_BITRATE,
            "detect_bitrate": checked(headphones.DETECT_BITRATE),
            "move_files": checked(headphones.MOVE_FILES),
            "rename_files": checked(headphones.RENAME_FILES),
            "correct_metadata": checked(headphones.CORRECT_METADATA),
            "cleanup_files": checked(headphones.CLEANUP_FILES),
            "add_album_art": checked(headphones.ADD_ALBUM_ART),
            "embed_album_art": checked(headphones.EMBED_ALBUM_ART),
            "embed_lyrics": checked(headphones.EMBED_LYRICS),
            "dest_dir": headphones.DESTINATION_DIR,
            "folder_format": headphones.FOLDER_FORMAT,
            "file_format": headphones.FILE_FORMAT,
            "include_extras": checked(headphones.INCLUDE_EXTRAS),
            "log_dir": headphones.LOG_DIR,
            "interface_list": interface_list,
            "encode": checked(headphones.ENCODE),
            "encoder": headphones.ENCODER,
            "bitrate": int(headphones.BITRATE),
            "encoderfolder": headphones.ENCODERFOLDER,
            "advancedencoder": headphones.ADVANCEDENCODER,
            "encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
            "samplingfrequency": headphones.SAMPLINGFREQUENCY,
            "encodervbrcbr": headphones.ENCODERVBRCBR,
            "encoderquality": headphones.ENCODERQUALITY,
            "encoderlossless": checked(headphones.ENCODERLOSSLESS)
        }
        return serve_template(templatename="config.html",
                              title="Settings",
                              config=config)
예제 #9
0
	def config(self):
	
		interface_dir = os.path.join(headphones.PROG_DIR, 'data/interfaces/')
		interface_list = [ name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name)) ]

		config = { 
					"http_host" : headphones.HTTP_HOST,
					"http_user" : headphones.HTTP_USERNAME,
		 			"http_port" : headphones.HTTP_PORT,
				 	"http_pass" : headphones.HTTP_PASSWORD,
					"launch_browser" : checked(headphones.LAUNCH_BROWSER),
					"sab_host" : headphones.SAB_HOST,
					"sab_user" : headphones.SAB_USERNAME,
					"sab_api" : headphones.SAB_APIKEY,
					"sab_pass" : headphones.SAB_PASSWORD,
					"sab_cat" : headphones.SAB_CATEGORY,
					"download_dir" : headphones.DOWNLOAD_DIR,
					"use_blackhole" : checked(headphones.BLACKHOLE),
					"blackhole_dir" : headphones.BLACKHOLE_DIR,
					"usenet_retention" : headphones.USENET_RETENTION,
					"use_nzbmatrix" : checked(headphones.NZBMATRIX),
					"nzbmatrix_user" : headphones.NZBMATRIX_USERNAME,
					"nzbmatrix_api" : headphones.NZBMATRIX_APIKEY,
					"use_newznab" : checked(headphones.NEWZNAB),
					"newznab_host" : headphones.NEWZNAB_HOST,
					"newznab_api" : headphones.NEWZNAB_APIKEY,
					"use_nzbsorg" : checked(headphones.NZBSORG),
					"nzbsorg_uid" : headphones.NZBSORG_UID,
					"nzbsorg_hash" : headphones.NZBSORG_HASH,
					"use_newzbin" : checked(headphones.NEWZBIN),
					"newzbin_uid" : headphones.NEWZBIN_UID,
					"newzbin_pass" : headphones.NEWZBIN_PASSWORD,
					"torrentblackhole_dir" : headphones.TORRENTBLACKHOLE_DIR,
					"download_torrent_dir" : headphones.DOWNLOAD_TORRENT_DIR,
					"numberofseeders" : headphones.NUMBEROFSEEDERS,
					"use_isohunt" : checked(headphones.ISOHUNT),
					"use_kat" : checked(headphones.KAT),
					"use_mininova" : checked(headphones.MININOVA),
					"pref_qual_0" : radio(headphones.PREFERRED_QUALITY, 0),
					"pref_qual_1" : radio(headphones.PREFERRED_QUALITY, 1),
					"pref_qual_3" : radio(headphones.PREFERRED_QUALITY, 3),
					"pref_qual_2" : radio(headphones.PREFERRED_QUALITY, 2),
					"pref_bitrate" : headphones.PREFERRED_BITRATE,
					"detect_bitrate" : checked(headphones.DETECT_BITRATE),
					"move_files" : checked(headphones.MOVE_FILES),
					"rename_files" : checked(headphones.RENAME_FILES),
					"correct_metadata" : checked(headphones.CORRECT_METADATA),
					"cleanup_files" : checked(headphones.CLEANUP_FILES),
					"add_album_art" : checked(headphones.ADD_ALBUM_ART),
					"embed_album_art" : checked(headphones.EMBED_ALBUM_ART),
					"embed_lyrics" : checked(headphones.EMBED_LYRICS),
					"dest_dir" : headphones.DESTINATION_DIR,
					"folder_format" : headphones.FOLDER_FORMAT,
					"file_format" : headphones.FILE_FORMAT,
					"include_extras" : checked(headphones.INCLUDE_EXTRAS),
					"log_dir" : headphones.LOG_DIR,
					"interface_list" : interface_list,
					"encode":		checked(headphones.ENCODE),
					"encoder":		headphones.ENCODER,
					"bitrate":		int(headphones.BITRATE),
					"encoderfolder":	headphones.ENCODERFOLDER,
					"advancedencoder":	headphones.ADVANCEDENCODER,
					"encoderoutputformat": headphones.ENCODEROUTPUTFORMAT,
					"samplingfrequency": headphones.SAMPLINGFREQUENCY,
					"encodervbrcbr": headphones.ENCODERVBRCBR,
					"encoderquality": headphones.ENCODERQUALITY,
					"encoderlossless": checked(headphones.ENCODERLOSSLESS)
					"autowant_album" : checked(headphones.AUTOWANT_ALBUM),
					"autowant_single" : checked(headphones.AUTOWANT_SINGLE),
					"autowant_compilation" : checked(headphones.AUTOWANT_COMPILATION),
					"autowant_remix" : checked(headphones.AUTOWANT_REMIX),
					"autowant_ep" : checked(headphones.AUTOWANT_EP),
					"autowant_live" : checked(headphones.AUTOWANT_LIVE),
					"autowant_soundtrack" : checked(headphones.AUTOWANT_SOUNDTRACK)
				}
		return serve_template(templatename="config.html", title="Settings", config=config)