Skip to content

Commit

Permalink
Add gate check, remove date constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Morris committed Aug 27, 2024
1 parent 18fa4ef commit 177ce88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/Controllers/Aggro.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,12 @@ public function getSweep()
*/
public function getYouTubeDuration()
{
helper('youtube');
helper(['aggro', 'youtube']);
$youtubeModel = new YoutubeModels();

if (! gate_check()) {
return false;
}
if ($youtubeModel->getDuration()) {
echo "\nDurations fetched.\n";
}
Expand Down
3 changes: 1 addition & 2 deletions app/Models/YoutubeModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ public function parseChannel($feed)
public function getDuration()
{
$utilityModel = new UtilityModels();
$now = date('Y-m-d H:i:s');
helper('youtube');

$sql = "SELECT * FROM aggro_videos WHERE video_date_uploaded <= DATE_SUB('" . $now . "',INTERVAL 31 DAY) AND flag_archive=0 AND flag_bad=0 AND video_duration=0 AND video_type='youtube' LIMIT 10";
$sql = "SELECT * FROM aggro_videos WHERE flag_archive=0 AND flag_bad=0 AND video_duration=0 AND video_type='youtube' LIMIT 10";
$query = $this->db->query($sql);
$update = count($query->getResultArray());

Expand Down

0 comments on commit 177ce88

Please sign in to comment.