Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jul 23, 2024
1 parent 631ea19 commit 7beaca6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions objects/playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,11 @@ public static function getAllFromUserVideo($userId, $videos_id, $publicOnly = tr
return $rows;
}

private static function removeCache($videos_id)
private static function removeCache($videos_id, $schedule=true)
{

$cacheHandler = new VideoCacheHandler($videos_id);
$cacheHandler->deleteCache();
$cacheHandler->deleteCache(false, $schedule);

$cacheName = "getAllFromUserVideo_{$videos_id}";
self::deleteCacheFromPattern($cacheName);
Expand Down Expand Up @@ -1017,22 +1017,22 @@ public function addVideo($videos_id, $add, $order = 0, $_deleteCache = true)
$result = sqlDAL::writeSql($sql, $formats, $values);
if ($_deleteCache === true) {
//_error_log('playlistSort addVideo line=' . __LINE__ .' '. json_encode(debug_backtrace()));
self::deleteCacheDir($this->id);
self::deleteCacheDir($this->id, true);
//_error_log('playlistSort addVideo line=' . __LINE__);
self::removeCache($videos_id);
}
//_error_log('playlistSort addVideo line=' . __LINE__);
return $result;
}

static function deleteCacheDir($playlists_id)
static function deleteCacheDir($playlists_id, $schedule=false)
{
$cacheHandler = new PlayListCacheHandler($playlists_id);
$cacheHandler->deleteCache(false, false);
$cacheHandler->deleteCache(false, $schedule);

$pl = new PlayList($playlists_id);
$cacheHandler = new PlayListUserCacheHandler($pl->getUsers_id());
$cacheHandler->deleteCache(false, false);
$cacheHandler->deleteCache(false, $schedule);
}

public function delete()
Expand Down

0 comments on commit 7beaca6

Please sign in to comment.