On my seedbox I have installed the remove and delete addon but some times people sharing the box just delete the torrent leaving random files just eating up hard drive space.
This Addon will create a new tab showing what files are in the Complete directory but no longer on the seedbox torrents list
First Create a folder in addons called nonremoved
now in that folder add these files
Init.js
Code:
var frame = null;
plugin.addNewTabWithURL = function( tabName, tabURL )
{
frame = document.createElement("IFRAME");
frame.name = "NonRemoved";
frame.src = tabURL;
frame.id = "NonRemoved";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
this.attachPageToTabs(frame,tabName);
}
theTabs.onShow = function(id)
{
if(id=="NonRemoved")
{
frame.src = "plugins/nonremoved/nonremoved.php";
}
}
plugin.addNewTabWithURL( "NonRemoved", "plugins/nonremoved/nonremoved.php" );
nonremoved.php
Code:
<?
require_once( '../../php/xmlrpc.php' );
require_once( '../../php/util.php' );
function getTorrentsname()
{
$req = new rXMLRPCRequest(new rXMLRPCCommand( "d.multicall", array( "", getCmd("d.get_name=")))
);
if($req->success())
{
$ret = array();
for($i=0; $i<count($req->val); $i+=1)
{
$ret[] =$req->val[$i];
}
return($ret);
}
return(false);
}
$directory="../../../Files"; // put your path to your complete download directory here or creat a smy link if path is out side your paths
$dirhandler = opendir($directory);
$nofiles=0;
while ($file = readdir($dirhandler)) {
if ($file != '.' && $file != '..' && $file != ".profile" && $file != ".bashrc" && $file != ".bash_logout")
{
$nofiles++;
$files[$nofiles]=$file;
}
}
closedir($dirhandler);
$result=getTorrentsname();
$available = array_diff($files, $result);
echo '' . implode('</br> ', $available);
?>
plugin.info
Code:
description: UnRemoved
author: Sponge
runlevel: 6
version: 1.0
remote: error
Now edit
Code:
$directory="../../../Files"; // put your path to your complete download directory here or creat a smy link if path is out side your pathsin the nonremoved.php
Now if all done right and you have the path to where your complete torrents are you should be a ok
(Note this may still show up torrents downloading to your server as well as they will not be in the complete directory)
Hope this helps someone else out certainly saves me lots of times manually searching
Sponge
Edited to fix relative paths