diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 54f513f7..3d63b8b6 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -816,6 +816,14 @@ +
+

MPC

+
+ +
+
+ +
diff --git a/headphones/__init__.py b/headphones/__init__.py index 2d4e9290..380a31bf 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -285,6 +285,7 @@ SONGKICK_ENABLED = False SONGKICK_APIKEY = None SONGKICK_LOCATION = None SONGKICK_FILTER_ENABLED = False +MPC_ENABLED = False CACHE_SIZEMB = 32 JOURNAL_MODE = None diff --git a/headphones/notifiers.py b/headphones/notifiers.py index 1287cb01..f5e4ff12 100644 --- a/headphones/notifiers.py +++ b/headphones/notifiers.py @@ -169,6 +169,17 @@ class PROWL: self.notify('ZOMG Lazors Pewpewpew!', 'Test Message') +class MPC: + + def __init__(self): + + pass + + def notify( self ): + + subprocess.call( ["mpc", "update"] ) + + class XBMC: def __init__(self): diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 8bec9830..92ea249a 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -490,6 +490,10 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list, boxcar = notifiers.BOXCAR() boxcar.notify('Headphones processed: ' + pushmessage, "Download and Postprocessing completed", release['AlbumID']) + if headphones.MPC_ENABLED: + mpc = notifiers.MPC() + mpc.notify() + def embedAlbumArt(artwork, downloaded_track_list): logger.info('Embedding album art') diff --git a/headphones/webserve.py b/headphones/webserve.py index 9a9af5f8..39ddb88f 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -1090,7 +1090,8 @@ class WebInterface(object): "songkick_filter_enabled": checked(headphones.SONGKICK_FILTER_ENABLED), "cache_sizemb": headphones.CACHE_SIZEMB, "file_permissions": headphones.FILE_PERMISSIONS, - "folder_permissions": headphones.FOLDER_PERMISSIONS + "folder_permissions": headphones.FOLDER_PERMISSIONS, + "mpc_enabled": checked(headphones.MPC_ENABLED) } # 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 @@ -1127,7 +1128,7 @@ class WebInterface(object): osx_notify_enabled=0, osx_notify_onsnatch=0, osx_notify_app=None, boxcar_enabled=0, boxcar_onsnatch=0, boxcar_token=None, mirror=None, customhost=None, customport=None, customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, preferred_bitrate_allow_lossless=0, cache_sizemb=None, enable_https=0, https_cert=None, https_key=None, file_permissions=None, folder_permissions=None, plex_enabled=0, plex_server_host=None, plex_client_host=None, plex_username=None, plex_password=None, plex_update=0, plex_notify=0, - songkick_enabled=0, songkick_apikey=None, songkick_location=None, songkick_filter_enabled=0, encoder_multicore=False, encoder_multicore_count=0, **kwargs): + songkick_enabled=0, songkick_apikey=None, songkick_location=None, songkick_filter_enabled=0, encoder_multicore=False, encoder_multicore_count=0, mpc_enabled=False, **kwargs ): headphones.HTTP_HOST = http_host headphones.HTTP_PORT = http_port @@ -1297,6 +1298,8 @@ class WebInterface(object): headphones.BOXCAR_ONSNATCH = boxcar_onsnatch headphones.BOXCAR_TOKEN = boxcar_token + headphones.MPC_ENABLED = mpc_enabled + headphones.MIRROR = mirror headphones.CUSTOMHOST = customhost headphones.CUSTOMPORT = customport