Jacek Kowalski
4 hours ago 6b9278a5d57091fce636dbb640b380cfb990db6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
 
namespace App\LegacyImport;
 
class CoverImportReport {
    /** Books that got a photo of the copy itself, found by the book ID. */
    public int $ownById = 0;
 
    /** Books that got a photo of the copy itself, found by ISBN. */
    public int $ownByIsbn = 0;
 
    /** Books that got the publisher's cover, found by ISBN. */
    public int $byIsbn = 0;
 
    /** Books that already had a cover, which was kept. */
    public int $alreadyCovered = 0;
 
    /** @var list<string> Files whose name does not match a book. */
    public array $unmatched = [];
 
    /** @var list<string> Files that are neither an ISBN-13 nor a book ID. */
    public array $ignored = [];
 
    /** @var list<string> Files that could not be stored as covers, with the reason. */
    public array $failed = [];
 
    public function imported(): int {
        return $this->ownById + $this->ownByIsbn + $this->byIsbn;
    }
}