зеркало из https://github.com/nextcloud/cookbook.git
More housekeeping
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Родитель
652e8c3105
Коммит
8297fba099
1
TODO.md
1
TODO.md
|
@ -15,6 +15,7 @@
|
|||
- Abort Search for JSON after fixed numer/time to avoid timeout
|
||||
- Make a single Service rule all the others (adding/removing/changing causes JSON + DB be updated)
|
||||
- Refactor database: Why mutiple rows for different users of the very same file?
|
||||
- Use of table names from constants in DB table
|
||||
|
||||
# Bugs found
|
||||
- When no category is given for one recipe, the total number of recipes is falsely calculated
|
||||
|
|
|
@ -129,9 +129,9 @@ class DbCacheService
|
|||
/**
|
||||
* @param File $jsonFile
|
||||
* @throws InvalidJSONFileException
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
private function parseJSONFile(File $jsonFile) : string
|
||||
private function parseJSONFile(File $jsonFile) : array
|
||||
{
|
||||
// XXX Export of file reading into library/service?
|
||||
$json = json_decode($jsonFile->getContent(), true);
|
||||
|
|
|
@ -602,6 +602,7 @@ class RecipeService
|
|||
public function addRecipe($json)
|
||||
{
|
||||
if (!$json || !isset($json['name']) || !$json['name']) {
|
||||
// XXX More specific Exception better?
|
||||
throw new Exception('Recipe name not found');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче