Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gate check, remove date constraint #607

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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