Exemplo n.º 1
0
def deletetorrent():

    rawdata = Webpost.get_json()
    torrentid = rawdata['deleteinstruction']
    if torrentmanager.validatetorrentid(torrentid) == True:
        torrentmanager.processonetorrent(torrentid, "Delete")
    else:
        print("Deleting unknown torrent ", torrentid)
    return Jsondata(deletedata="Done")
Exemplo n.º 2
0
def edittorrentconfiguration():

    rawdata = Webpost.get_json()
    torrentid = rawdata['torrentid']
    if torrentmanager.validatetorrentid(torrentid) == True:
        wastetime()
        torrentdata = torrentmanager.gettorrentdata(torrentid, "prepareedit")
        return Jsondata(selectedtorrent=torrentdata,
                        listitems=librarymanager.getdropdownlists(
                            torrentdata['tvshowname']))
    else:
        print("Edit unknown torrent ", torrentid)
Exemplo n.º 3
0
def reconfiguretorrentconfiguration():

    rawdata = Webpost.get_json()
    torrentid = rawdata['torrentid']
    wastetime()
    if torrentmanager.validatetorrentid(torrentid) == True:
        torrentmanager.reconfiguretorrent(torrentid,
                                          rawdata['newconfiguration'])
        FileManager.saveconfigs(torrentmanager.getconfigs())
        return Jsondata(selectedtorrent=torrentmanager.gettorrentdata(
            torrentid, "reconfigure"))
    else:
        print("Reconfiguring unknown torrent ", torrentid)
Exemplo n.º 4
0
def updatelistpage():

    rawdata = Webpost.get_json()
    bulkaction = rawdata["bulkaction"]
    if (bulkaction == "Start") or (bulkaction == "Stop"):
        torrentmanager.bulkprocessalltorrents(bulkaction)
    elif bulkaction == "RescanFileServer":
        print("Rescanning File-Server for TV Shows & Seasons")
        librarymanager.discovertvshows()
    elif bulkaction != "Refresh":
        print("Unknown Torrents List Update Action ", bulkaction)
    torrentmanager.refreshtorrentlist()
    return Jsondata(torrents=torrentmanager.gettorrentlistdata("refresh"),
                    stats=torrentmanager.getstats())
Exemplo n.º 5
0
def updatetorrentpage():

    rawdata = Webpost.get_json()
    torrentid = rawdata['torrentid']
    if torrentmanager.validatetorrentid(torrentid) == True:
        torrentaction = rawdata['torrentaction']
        if (torrentaction == "Start") or (torrentaction == "Stop"):
            torrentmanager.processonetorrent(torrentid, torrentaction)
        elif torrentaction != "Refresh":
            print("Unknown Torrent Update Action ", torrentaction)
        torrentmanager.refreshtorrentdata(torrentid)
        return Jsondata(selectedtorrent=torrentmanager.gettorrentdata(
            torrentid, "refresh"))
    else:
        print("Updating unknown torrent ", torrentid)
Exemplo n.º 6
0
def copytorrent():

    rawdata = Webpost.get_json()
    torrentid = rawdata['copyinstruction']
    if torrentid != "!!! CONTINUE EXISTING COPY PROCESS !!!":
        if torrentmanager.validatetorrentid(torrentid) == True:
            librarymanager.queuefilecopy(
                torrentmanager.getcopyactions(torrentid))
        else:
            print("Copying unknown torrent ", torrentid)
        refreshmode = False
    else:
        wastetime()
        refreshmode = librarymanager.processfilecopylist()
    return Jsondata(copydata=librarymanager.getcopyprocessinfo(),
                    refreshmode=refreshmode)
Exemplo n.º 7
0
def updatetvshowseasonslist():

    rawdata = Webpost.get_json()
    wastetime()
    return Jsondata(seasons=librarymanager.gettvshowseasons(rawdata['tvshow']))