@@ -24,7 +24,6 @@ |
||
24 | 24 | namespace OCA\FaceRecognition\Db; |
25 | 25 | |
26 | 26 | use JsonSerializable; |
27 | - |
|
28 | 27 | use OCP\AppFramework\Db\Entity; |
29 | 28 | |
30 | 29 | /** |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use OCP\IDBConnection; |
5 | 5 | use OCP\AppFramework\Db\Mapper; |
6 | -use OCP\AppFramework\Db\DoesNotExistException; |
|
7 | 6 | use OCP\DB\QueryBuilder\IQueryBuilder; |
8 | 7 | |
9 | 8 | class FaceNewMapper extends Mapper { |
@@ -22,6 +22,9 @@ discard block |
||
22 | 22 | return $faces; |
23 | 23 | } |
24 | 24 | |
25 | + /** |
|
26 | + * @param integer $model |
|
27 | + */ |
|
25 | 28 | public function countFaces(string $userId, $model): int { |
26 | 29 | $qb = $this->db->getQueryBuilder(); |
27 | 30 | $query = $qb |
@@ -39,6 +42,9 @@ discard block |
||
39 | 42 | return (int)$data[0]; |
40 | 43 | } |
41 | 44 | |
45 | + /** |
|
46 | + * @param integer $model |
|
47 | + */ |
|
42 | 48 | public function getFaces(string $userId, $model): array { |
43 | 49 | $qb = $this->db->getQueryBuilder(); |
44 | 50 | $query = $qb |
@@ -53,6 +53,9 @@ discard block |
||
53 | 53 | return $row ? (int)$row['id'] : null; |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @param integer $model |
|
58 | + */ |
|
56 | 59 | public function countUserImages(string $userId, $model): int { |
57 | 60 | $qb = $this->db->getQueryBuilder(); |
58 | 61 | $query = $qb |
@@ -69,6 +72,9 @@ discard block |
||
69 | 72 | return (int)$data[0]; |
70 | 73 | } |
71 | 74 | |
75 | + /** |
|
76 | + * @param integer $model |
|
77 | + */ |
|
72 | 78 | public function countUserProcessedImages(string $userId, $model): int { |
73 | 79 | $qb = $this->db->getQueryBuilder(); |
74 | 80 | $query = $qb |
@@ -25,9 +25,7 @@ |
||
25 | 25 | |
26 | 26 | use OCP\IDBConnection; |
27 | 27 | use OCP\IUser; |
28 | - |
|
29 | 28 | use OCP\AppFramework\Db\Mapper; |
30 | -use OCP\AppFramework\Db\DoesNotExistException; |
|
31 | 29 | use OCP\DB\QueryBuilder\IQueryBuilder; |
32 | 30 | |
33 | 31 | class ImageMapper extends Mapper { |
@@ -11,6 +11,11 @@ discard block |
||
11 | 11 | protected $model; |
12 | 12 | protected $fileList; |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $command |
|
16 | + * @param string $predictor |
|
17 | + * @param string $model |
|
18 | + */ |
|
14 | 19 | function __construct($command, $predictor, $model) { |
15 | 20 | $this->command = $command; |
16 | 21 | $this->predictor = $predictor; |
@@ -18,6 +23,9 @@ discard block |
||
18 | 23 | $this->fileList = ""; |
19 | 24 | } |
20 | 25 | |
26 | + /** |
|
27 | + * @param string $filename |
|
28 | + */ |
|
21 | 29 | public function appendFile ($filename) |
22 | 30 | { |
23 | 31 | $this->fileList .= " ".escapeshellarg($filename); |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace OCA\FaceRecognition\Helper; |
4 | 4 | |
5 | -use OCP\App\IAppManager; |
|
6 | - |
|
7 | 5 | class PythonAnalyzer |
8 | 6 | { |
9 | 7 | protected $command; |
@@ -124,7 +124,7 @@ |
||
124 | 124 | * Based on that and the fact that Nextcloud is superset of these, these are supported image types. |
125 | 125 | * |
126 | 126 | * @param string $mimeType MIME type to check if it supported |
127 | - * @return true if MIME type is supported, false otherwise |
|
127 | + * @return boolean if MIME type is supported, false otherwise |
|
128 | 128 | */ |
129 | 129 | public static function isImageTypeSupported(string $mimeType): bool { |
130 | 130 | if ( |
@@ -31,7 +31,6 @@ |
||
31 | 31 | use OCP\IDBConnection; |
32 | 32 | use OCP\ILogger; |
33 | 33 | use OCP\IUserManager; |
34 | - |
|
35 | 34 | use OCA\FaceRecognition\BackgroundJob\Tasks\AddMissingImagesTask; |
36 | 35 | use OCA\FaceRecognition\Db\Face; |
37 | 36 | use OCA\FaceRecognition\Db\Image; |
@@ -5,17 +5,10 @@ |
||
5 | 5 | use OCP\Files\IRootFolder; |
6 | 6 | use OCP\AppFramework\Http; |
7 | 7 | use OCP\AppFramework\Http\DataResponse; |
8 | -use OCP\AppFramework\Http\JSONResponse; |
|
9 | 8 | use OCP\AppFramework\Http\DataDisplayResponse; |
10 | 9 | use OCP\AppFramework\Controller; |
11 | - |
|
12 | -use OCA\FaceRecognition\Db\Face; |
|
13 | 10 | use OCA\FaceRecognition\Db\FaceMapper; |
14 | - |
|
15 | -use OCA\FaceRecognition\Db\FaceNew; |
|
16 | 11 | use OCA\FaceRecognition\Db\FaceNewMapper; |
17 | - |
|
18 | -use OCA\FaceRecognition\Db\Image; |
|
19 | 12 | use OCA\FaceRecognition\Db\ImageMapper; |
20 | 13 | |
21 | 14 | class FaceController extends Controller { |
@@ -82,6 +82,9 @@ |
||
82 | 82 | return $this->getFaceThumb ($fileId, $face); |
83 | 83 | } |
84 | 84 | |
85 | + /** |
|
86 | + * @param \OCP\AppFramework\Db\Entity $face |
|
87 | + */ |
|
85 | 88 | private function getFaceThumb ($fileId, $face) { |
86 | 89 | $userFolder = $this->rootFolder->getUserFolder($this->userId); |
87 | 90 | $nodes = $userFolder->getById($fileId); |
@@ -24,12 +24,8 @@ |
||
24 | 24 | namespace OCA\FaceRecognition\Db; |
25 | 25 | |
26 | 26 | use OC\DB\QueryBuilder\Literal; |
27 | - |
|
28 | 27 | use OCP\IDBConnection; |
29 | -use OCP\IUser; |
|
30 | - |
|
31 | 28 | use OCP\AppFramework\Db\Mapper; |
32 | -use OCP\AppFramework\Db\DoesNotExistException; |
|
33 | 29 | use OCP\DB\QueryBuilder\IQueryBuilder; |
34 | 30 | |
35 | 31 | class PersonMapper extends Mapper { |