<html>
<head>
<title>Items laden</title>
</head>
<body>
<a href="list_pods.php">Zur Liste</a>
<?php
require_once("../config.php");
require_once("lib/transcode_utils.php");
$sql = "select item.id from item, podcast where item.podcast_id = podcast.id ";
if (!empty($argv[1])) {
$arr = split(":", $argv[1]);
if ($arr[0] == "item") {
$_REQUEST["item_id"] = $arr[1];
} else {
$_REQUEST["podcast_id"] = $arr[1];
}
}
if (!empty($argv[2])) {
$_REQUEST["all"] = $argv[2];
}
//$time1 = time() - 60 * 60 * 24 * 7 * 6;// 6 Wochen
//$time = time() - 60 * 60 * 24 * 7;// 1 Woche
$time = time() - 60 * 60 * 24 * 7 * 3;// 3 Woche
//$time = time() - 60 * 60 * 24 * 7 * 6;
//$time = time() - 60 * 60 * 24 * 7 * 3;
if (!empty($_REQUEST["podcast_id"])) {
$sql .= " and item.podcast_id='".$_REQUEST["podcast_id"]."'";
if (empty($_REQUEST["all"])) {
$sql .= " and item.deleted != 1 and item.ingested = 0";
} else {
$sql .= " and item.deleted != 1 and item.pubdate > '".get_db_datetime($time)."'";
}
} else if (!empty($_REQUEST["item_id"])) {
$sql .= " and item.id ='".$_REQUEST["item_id"]."'";
} else {
$sql .= " and item.deleted != 1 and podcast.deleted != 1 and item.ingested = 0 and item.pubdate > '".get_db_datetime($time)."'";
}
$sql .= " order by item.pubdate desc";
echo $sql."<br/>\n";
$items = array();
$rs = db_query($sql);
while ($row = db_next_row($rs)) {
$items[] = get_item($row["id"]);
}
$i = 0;
foreach ($items as $item) {
$i++;
echo ("handling item ".$i." von ".count($items)." - ".$item["title"]."<br/>\n");
do_item_transcode($item["id"], true);
$item = get_item($item["id"]);
print_r($item);
flush();
}
?>
</body>
</html>