@@ -67,6 +67,9 @@ |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + /** |
|
| 71 | + * @param Music $app |
|
| 72 | + */ |
|
| 70 | 73 | private static function handleUpdated($node, $app) { |
| 71 | 74 | // we are interested only about updates on files, not on folders |
| 72 | 75 | if ($node->getType() == FileInfo::TYPE_FILE) { |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | * user's data is not leaked to unauthorized users. |
| 74 | 74 | * @param integer[] $ids IDs of the entities to be found |
| 75 | 75 | * @param string|null $userId |
| 76 | - * @return Entity[] |
|
| 76 | + * @return \OCA\Music\Db\Entity[] |
|
| 77 | 77 | */ |
| 78 | 78 | public function findById($ids, $userId=null) { |
| 79 | 79 | return $this->mapper->findById($ids, $userId); |
@@ -119,6 +119,9 @@ discard block |
||
| 119 | 119 | return Util::startsWith($filePath, $musicPath); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $userId |
|
| 124 | + */ |
|
| 122 | 125 | private function updateImage($file, $userId) { |
| 123 | 126 | $coverFileId = $file->getId(); |
| 124 | 127 | $parentFolderId = $file->getParent()->getId(); |
@@ -128,6 +131,9 @@ discard block |
||
| 128 | 131 | } |
| 129 | 132 | } |
| 130 | 133 | |
| 134 | + /** |
|
| 135 | + * @param string $userId |
|
| 136 | + */ |
|
| 131 | 137 | private function updateAudio($file, $userId, $userHome, $filePath, $mimetype) { |
| 132 | 138 | if (\ini_get('allow_url_fopen')) { |
| 133 | 139 | $this->emit('\OCA\Music\Utility\Scanner', 'update', [$filePath]); |
@@ -491,6 +497,10 @@ discard block |
||
| 491 | 497 | return $info; |
| 492 | 498 | } |
| 493 | 499 | |
| 500 | + /** |
|
| 501 | + * @param string $fileId |
|
| 502 | + * @param string $userId |
|
| 503 | + */ |
|
| 494 | 504 | private function getIndexedFileInfo($fileId, $userId, $userFolder) { |
| 495 | 505 | $track = $this->trackBusinessLayer->findByFileId($fileId, $userId); |
| 496 | 506 | if ($track !== null) { |
@@ -505,6 +515,10 @@ discard block |
||
| 505 | 515 | return null; |
| 506 | 516 | } |
| 507 | 517 | |
| 518 | + /** |
|
| 519 | + * @param string $fileId |
|
| 520 | + * @param string $userId |
|
| 521 | + */ |
|
| 508 | 522 | private function getUnindexedFileInfo($fileId, $userId, $userFolder) { |
| 509 | 523 | $fileNodes = $userFolder->getById($fileId); |
| 510 | 524 | if (\count($fileNodes) > 0) { |
@@ -106,6 +106,9 @@ |
||
| 106 | 106 | return $json; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | + /** |
|
| 110 | + * @param string $json |
|
| 111 | + */ |
|
| 109 | 112 | private function addJsonToCache($json) { |
| 110 | 113 | $hash = \hash('md5', $json); |
| 111 | 114 | $this->dbCache->add($this->userId, 'collection', $hash); |
@@ -95,6 +95,9 @@ |
||
| 95 | 95 | ]; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + /** |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 98 | 101 | private function getPath() { |
| 99 | 102 | $path = $this->configManager->getUserValue($this->userId, $this->appname, 'path'); |
| 100 | 103 | return $path ?: '/'; |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * @param string $userId |
| 38 | 38 | * @throws DoesNotExistException if the entity does not exist |
| 39 | 39 | * @throws MultipleObjectsReturnedException if more than one entity exists |
| 40 | - * @return Entity |
|
| 40 | + * @return string |
|
| 41 | 41 | */ |
| 42 | 42 | public function find($id, $userId) { |
| 43 | 43 | $sql = 'SELECT * FROM `' . $this->getTableName() . '` WHERE `id` = ? AND `user_id` = ?'; |