X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveUnusedAvatars.php;h=da9ca7b04e48298b937d9f9708a4a239e38bc107;hb=7921766c59c1050737ff7fed7c242257e866d149;hp=58670c87350a45bc928e06a79aadb608d4427b0c;hpb=bedc8e1427ee6388e496781207c2b5cd4a01ac66;p=friendica.git diff --git a/src/Worker/RemoveUnusedAvatars.php b/src/Worker/RemoveUnusedAvatars.php index 58670c8735..da9ca7b04e 100644 --- a/src/Worker/RemoveUnusedAvatars.php +++ b/src/Worker/RemoveUnusedAvatars.php @@ -1,6 +1,6 @@ $total]); $count = 0; - $contacts = DBA::select('contact', ['id'], $condition); + $contacts = DBA::p("SELECT `contact`.`id` " . $sql, 0, '', '', '', 0); while ($contact = DBA::fetch($contacts)) { - DBA::update('contact', ['photo' => '', 'thumb' => '', 'micro' => ''], ['id' => $contact['id']]); - Photo::delete(['contact-id' => $contact['id'], 'album' => Photo::CONTACT_PHOTOS]); + Contact::update(['photo' => '', 'thumb' => '', 'micro' => ''], ['id' => $contact['id']]); + Photo::delete(['contact-id' => $contact['id'], 'photo-type' => [Photo::CONTACT_AVATAR, Photo::CONTACT_BANNER]]); if ((++$count % 1000) == 0) { if (!Worker::isInMaintenanceWindow()) { Logger::notice('We are outside of the maintenance window, quitting');