Skip to content

Instantly share code, notes, and snippets.

@N3MIS15
Created May 11, 2014 11:16
Show Gist options
  • Save N3MIS15/e0a46acece0b29ea5abf to your computer and use it in GitHub Desktop.
Save N3MIS15/e0a46acece0b29ea5abf to your computer and use it in GitHub Desktop.
remove from xbmc library
@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