Implemented filefix %SCAN/%RESCAN, and some cosmetic cleanup

This commit is contained in:
2024-11-28 22:07:39 +11:00
parent 0e1086c99f
commit ce19985c2d
13 changed files with 216 additions and 55 deletions

View File

@@ -84,18 +84,18 @@ class FilefixRescan implements ShouldQueue
$earliest = NULL;
$latest = NULL;
foreach (File::select(['id','datetime'])
->where('filearea_id',$this->fao->id)
->where('datetime','>=',
Carbon::now()
->subDays($this->days)
->startOfDay()
)
->orderBy('datetime')
->cursor() as $fo) {
foreach (File::select(['id','datetime','name'])
->where('filearea_id',$this->fao->id)
->where('datetime','>=',
Carbon::now()
->subDays($this->days)
->startOfDay()
)
->orderBy('datetime')
->cursor() as $fo)
{
// File hasnt been exported before
if (! $fo->seenby->count()) {
if (! $fo->seenby->where('address_id',$this->ao->id)->count()) {
$fo->seenby()->attach($this->ao->id,['export_at'=>Carbon::now()]);
$c++;
@@ -131,7 +131,7 @@ class FilefixRescan implements ShouldQueue
} else {
$s++;
Log::debug(sprintf('Not resending previously sent message [%d], FILE (%s) - sent on [%s]',
Log::debug(sprintf('Not resending previously sent file [%d], FILE (%s) - sent on [%s]',
$fo->id,
$fo->name,
$export->pivot->sent_at ?: '-',