@@ -112,7 +112,7 @@ |
||
112 | 112 | * @NoAdminRequired |
113 | 113 | * |
114 | 114 | * @param int $id |
115 | - * @param string $name |
|
115 | + * @param string $newName |
|
116 | 116 | */ |
117 | 117 | public function updateName ($id, $newName) { |
118 | 118 | $face = $this->faceMapper->find($id, $this->userId); |
@@ -5,11 +5,8 @@ |
||
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 | 11 | |
15 | 12 | class FaceController extends Controller { |
@@ -50,7 +50,6 @@ |
||
50 | 50 | /** |
51 | 51 | * @NoAdminRequired |
52 | 52 | * |
53 | - * @param string $oldName |
|
54 | 53 | * @param string $newName |
55 | 54 | */ |
56 | 55 | public function updateName($name, $newName) { |
@@ -3,13 +3,8 @@ |
||
3 | 3 | |
4 | 4 | use OCP\IRequest; |
5 | 5 | use OCP\Files\IRootFolder; |
6 | -use OCP\AppFramework\Http; |
|
7 | 6 | use OCP\AppFramework\Http\DataResponse; |
8 | -use OCP\AppFramework\Http\JSONResponse; |
|
9 | -use OCP\AppFramework\Http\DataDisplayResponse; |
|
10 | 7 | use OCP\AppFramework\Controller; |
11 | - |
|
12 | -use OCA\FaceRecognition\Db\Face; |
|
13 | 8 | use OCA\FaceRecognition\Db\FaceMapper; |
14 | 9 | |
15 | 10 | class PersonController extends Controller { |
@@ -22,6 +22,10 @@ discard block |
||
22 | 22 | return $this->findEntities($sql, [$userId]); |
23 | 23 | } |
24 | 24 | |
25 | + /** |
|
26 | + * @param integer $limit |
|
27 | + * @param integer $offset |
|
28 | + */ |
|
25 | 29 | public function findAllQueued($userId, $limit = null, $offset = null) { |
26 | 30 | $sql = 'SELECT * FROM *PREFIX*face_recognition WHERE uid = ? AND distance = -1 AND encoding IS NULL'; |
27 | 31 | return $this->findEntities($sql, [$userId], $limit, $offset); |
@@ -42,6 +46,9 @@ discard block |
||
42 | 46 | return $this->findEntities($sql, [$userId]); |
43 | 47 | } |
44 | 48 | |
49 | + /** |
|
50 | + * @param integer $limit |
|
51 | + */ |
|
45 | 52 | public function findAllNamed($userId, $query, $limit = null, $offset = null) { |
46 | 53 | $sql = 'SELECT id, name, distance FROM *PREFIX*face_recognition WHERE uid = ? AND encoding IS NOT NULL AND LOWER(name) LIKE LOWER(?)'; |
47 | 54 | return $this->findEntities($sql, [$userId, $query], $limit, $offset); |
@@ -3,8 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use OCP\IDBConnection; |
5 | 5 | use OCP\AppFramework\Db\Mapper; |
6 | -use OCP\AppFramework\Db\DoesNotExistException; |
|
7 | -use OCP\DB\QueryBuilder\IQueryBuilder; |
|
8 | 6 | |
9 | 7 | class FaceMapper extends Mapper { |
10 | 8 |
@@ -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 | /** |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | parent::__construct($db, 'face_recognition_faces', '\OCA\FaceRecognition\Db\FaceNew'); |
12 | 12 | } |
13 | 13 | |
14 | + /** |
|
15 | + * @param integer $model |
|
16 | + */ |
|
14 | 17 | public function countFaces(string $userId, $model): int { |
15 | 18 | $qb = $this->db->getQueryBuilder(); |
16 | 19 | $query = $qb |
@@ -28,6 +31,9 @@ discard block |
||
28 | 31 | return (int)$data[0]; |
29 | 32 | } |
30 | 33 | |
34 | + /** |
|
35 | + * @param integer $model |
|
36 | + */ |
|
31 | 37 | public function getFaces(string $userId, $model): array { |
32 | 38 | $qb = $this->db->getQueryBuilder(); |
33 | 39 | $query = $qb |
@@ -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 { |
@@ -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; |
@@ -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; |
@@ -24,7 +24,6 @@ |
||
24 | 24 | namespace OCA\FaceRecognition\BackgroundJob\Tasks; |
25 | 25 | |
26 | 26 | use OCP\IDBConnection; |
27 | - |
|
28 | 27 | use OCA\FaceRecognition\Db\Image; |
29 | 28 | use OCA\FaceRecognition\Db\ImageMapper; |
30 | 29 | use OCA\FaceRecognition\BackgroundJob\FaceRecognitionBackgroundTask; |