Example #1
0
def handle_start(message):
    info_hash = message.get('info_hash', [])
    try:
        client.get().torrent_start(info_hash)
    except ClientNotAvailable as exc:
        api.error_handler(exc, api.EVENT_TORRENT_START_RESPONSE)
    else:
        api.emit(api.EVENT_TORRENT_START_RESPONSE, dict(info_hash=info_hash))
        api.flash("Started successfully")
Example #2
0
def handle_stop(message):
    info_hash = message.get('info_hash', [])
    try:
        torrent_client.torrent_stop(info_hash)
    except ClientNotAvailable as exc:
        api.error_handler(exc, events.EVENT_TORRENT_SPEED_RESPONSE)
    else:
        api.emit(events.EVENT_TORRENT_SPEED_RESPONSE, dict(info_hash=info_hash))
        api.flash("Stopped successfully")
Example #3
0
def handle_start(message):
    info_hash = message.get('info_hash', [])
    try:
        torrent_client.torrent_start(info_hash)
    except ClientNotAvailable as exc:
        api.error_handler(exc, events.EVENT_TORRENT_START_RESPONSE)
    else:
        api.emit(events.EVENT_TORRENT_START_RESPONSE,
                 dict(info_hash=info_hash))
        api.flash("Started successfully")
Example #4
0
def handle_recheck(message):
    info_hash = message.get('info_hash', [])
    resp = torrent_client.torrent_recheck(info_hash)
    api.emit(events.EVENT_TORRENT_RECHECK_RESPONSE, resp)
    api.flash("Rechecking..!")
Example #5
0
def handle_recheck(message):
    info_hash = message.get('info_hash', [])
    resp = client.get().torrent_recheck(info_hash)
    api.emit(api.EVENT_TORRENT_RECHECK_RESPONSE, resp)
    api.flash("Rechecking..!")