public function runRules()
 {
     $AC = new anyC();
     $AC->setCollectionOf("IncomingPrettify");
     $AC->addAssocV3("IncomingPrettifyIsActive", "=", "1");
     $I = new mIncoming();
     $files = $I->getNewFiles();
     echo "<div style=\"max-height:400px;overflow:auto;font-size:10px;padding:5px;\">";
     $run = mUserdata::getUDValueS("trinityDBPrettifyExecute", "0") == "1";
     if (!$run) {
         echo "<p style=\"color:red;margin-bottom:10px;\">The following operations are NOT executed, this is only a preview!<br />To execute the operations, you'll have to enable it in the options.</p>";
     }
     foreach ($files as $path) {
         $newName = basename($path);
         if (strpos(strtolower($newName), ".part") == strlen($newName) - 5) {
             continue;
         }
         if (strpos(strtolower($newName), ".mkv") != strlen($newName) - 4 and strpos(strtolower($newName), ".mp4") != strlen($newName) - 4) {
             continue;
         }
         while ($P = $AC->getNextEntry()) {
             $newName = preg_replace("/" . str_replace(".", "\\.", $P->A("IncomingPrettifyFind")) . "/e" . ($P->A("IncomingPrettifyCaseSensitive") == "1" ? "" : "i"), str_replace(array("//", "."), array("\\", "\\."), $P->A("IncomingPrettifyReplace")), $newName);
         }
         $newName = str_replace("\\", "", $newName);
         $AC->resetPointer();
         if ($newName != basename($path)) {
             $color = "";
             if ($run) {
                 $renamed = str_replace(basename($path), $newName, $path);
                 if (file_exists($renamed)) {
                     $color = "color:red;";
                 } else {
                     if (rename($path, $renamed)) {
                         $color = "color:green;";
                     } else {
                         $color = "color:red;";
                     }
                 }
             }
             echo "<span style=\"{$color}\">" . basename($path) . " -><br />" . basename($newName) . "</span><br /><br />";
         }
     }
     echo "</div>";
 }
Esempio n. 2
0
echo $link . "/trinityDB/Serien/trinityDB.png";
?>
</url>
			<title>trinityDB filtered feed</title>
			<link><?php 
echo $link;
?>
</link>
		</image>

 
<?php 
if ($tvdbUnavailable !== false) {
    echo "\n\t\t<item>\n\t\t\t<title>The TV DB is currently unavailable</title>\n\t\t\t<description><![CDATA[{$tvdbUnavailable}]]></description>\n\t\t\t<link>{$link}</link>\n\t\t</item>";
}
$Incoming = new mIncoming();
$Incoming->renameDownloaded();
$newFiles = $Incoming->getNewFiles();
$ac = new anyC();
$ac->setCollectionOf("Serie");
$ac->addAssocV3("RSSFilterID", "=", $_GET["RSSFilterID"]);
$ac->addAssocV3("status", "=", "Continuing");
$series = "";
while ($S = $ac->getNextEntry()) {
    try {
        $C = $S->checkRSS($newFiles);
        foreach ($C as $En) {
            if ($series != $S->A("name") and $series != "") {
                echo "\n\t\t\t<item>\n\t\t\t\t<title>-----------------------------------</title>\n\t\t\t\t<link>{$link}/trinityDB/RSSFilter/FilteredFeed.php?RSSFilterID={$_GET['RSSFilterID']}</link>\n\t\t\t</item>";
            }
            $series = $S->A("name");