Created
May 11, 2014 11:16
-
-
Save N3MIS15/e0a46acece0b29ea5abf to your computer and use it in GitHub Desktop.
remove from xbmc library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/xhr/library_remove/<media>/<int:id>') | |
@requires_auth | |
def xhr_clear_playlist(media, id): | |
logger.log('CONTROLS :: Removing %s from XBMC library' % media, 'INFO') | |
xbmc = jsonrpclib.Server(server_api_address()) | |
try: | |
if media == 'movie': | |
xbmc.VideoLibrary.RemoveMovie(movieid=id) | |
elif media == 'tvshow': | |
xbmc.VideoLibrary.RemoveTVShow(tvshowid=id) | |
elif media == 'episode': | |
xbmc.VideoLibrary.RemoveEpisode(episodeid=id) | |
return jsonify({'success': True}) | |
except: | |
logger.log('CONTROLS :: %s' % xbmc_error, 'ERROR') | |
return jsonify({'failed': True}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment