Giter Site home page Giter Site logo

nextcloud / cookbook Goto Github PK

View Code? Open in Web Editor NEW
492.0 21.0 85.0 47.94 MB

🍲 A library for all your recipes

Home Page: https://apps.nextcloud.com/apps/cookbook

License: GNU Affero General Public License v3.0

Makefile 0.21% PHP 16.45% JavaScript 26.89% Shell 0.34% Vue 8.76% Hack 0.01% HTML 46.83% TypeScript 0.52%
nextcloud recipe recipes recipes-app

cookbook's People

Contributors

christianlupus avatar danielroehrig avatar dependabot[bot] avatar dmbreakey avatar eothred avatar j0hannesr0th avatar leptopoda avatar lneugebauer avatar marcelrobitaille avatar maxammann avatar mcorteel avatar mcorteel-harel avatar miles170 avatar mrzapp avatar nextcloud-bot avatar okcomputerik avatar pfischbeck avatar przemyso avatar rakekniven avatar sam-19 avatar sephrat avatar sethfalco avatar seyfeb avatar sir-indy avatar skjnldsv avatar teifun2 avatar thembeat avatar timvde avatar valdnet avatar zorglubu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookbook's Issues

Shared recipes are stopped being shared, once the file is edited

Description: Once a shared recipe is edited by the original creator, the share is lost. If someone the recipe is shared with edits the file, the share is lost, too, but a new file is created instead. Two instances of the same recipe exist now. I think this might partly coincide with #33 as files are not edited for nextcloud but rather deleted and recreated.
Maybe related to issues #54 and #50, too.

Solution ideas: Maybe this behaves as wanted, once #33 is implemented, maybe an additional share button from inside the cookbook app might work, so that cookbook works the shares and keeps them alive.

Error in info.xml

The link to the bug tracker goes to gitlab.com instead of guthub.com

Local image support

We should restructure the storage so that every recipe gets its own folder where the JSON file and image assets will be stored.

This will allow us to enable picking image files from the NextCloud file browser.

When importing a recipe, any found images should be downloaded into the recipe folder.

Features wanted: Wider recipe pane, edit button on each recipe & reset search filter

You've done a fantastic work with this app, and I'm truly grateful!

That said, I can think of three UI/UX enhancements that would make my life easier, and hopefully others too? Nothing urgent or important, but nice to have. (Do let me know if I should open a separate issue for each of them.)

  1. I would like the recipe title pane on the left side to be wider or for the text to wrap around, so that similar (and long) recipe names are easier to distinguish from one another. Currently, the text seems to be limited to 24 characters, so maybe it could be extended to 40-50 characters?

  2. I sometimes have trouble finding the name of the recipe I'm currently reading on the left pane when I want to edit it, scrolling across dozens or hundreds of recipes, so it would be very helpful to have an "Edit" button on each recipe page (on the image, top-right corner, or next to the title, for instance), to access the edit page directly.

  3. A button to reset the search filter.

Cheers!

Add images to recipe steps

I really like this app! Is it possible to add support for Markdown? I'd like to format the recipe a bit as well as reference multiple image files within the recipe itself.


Depends on #1133
Depends on #340

Error in Recipedb.php

Hello,

i got these error, cookbooks works well but ite showing in the log file
Array to string conversion at /var/www/ubuntuone.ddns.net/html/nextcloud/apps/cookbook/lib/Db/RecipeDb.php#77

How can i fix it?

Thanks

Greetings

Olaf

Undefined variable: result at /var/www/nextcloud/apps/cookbook/lib/Service/RecipeService.php#102

I get a lot of error messages when adding recipes from https://www.chefkoch.de/

The error: Undefined variable: result at /var/www/nextcloud/apps/cookbook/lib/Service/RecipeService.php#102

Here are three recipes for testing:
https://www.chefkoch.de/rezepte/1844061298739441/Mozzarella-Haehnchen-in-Basilikum-Sahnesauce.html
https://www.chefkoch.de/rezepte/454281138117689/Penne-mit-Haehnchen-und-Champignons.html
https://www.chefkoch.de/rezepte/541521151483685/Super-schnelle-Himbeertorte.html

Symfony\Component\Routing\Exception\RouteNotFoundException

Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "cookbook.page.index" as such route does not exist.

/var/www/nextcloud/lib/private/Route/Router.php - line 337:

Symfony\Component\Routing\Generator\UrlGenerator->generate("cookbook.page.index", [], 1)

/var/www/nextcloud/lib/private/Route/CachingRouter.php - line 60:

OC\Route\Router->generate("cookbook.page.index", [], false)

/var/www/nextcloud/lib/private/URLGenerator.php - line 79:

OC\Route\CachingRouter->generate("cookbook.page.index", [])

/var/www/nextcloud/lib/private/NavigationManager.php - line 292:

OC\URLGenerator->linkToRoute("cookbook.page.index")

/var/www/nextcloud/lib/private/NavigationManager.php - line 113:

OC\NavigationManager->init()

/var/www/nextcloud/apps/theming/lib/ThemingDefaults.php - line 179:

OC\NavigationManager->getAll("guest")

/var/www/nextcloud/lib/private/legacy/defaults.php - line 259:

OCA\Theming\ThemingDefaults->getShortFooter()

/var/www/nextcloud/lib/public/Defaults.php - line 167:

OC_Defaults->getLongFooter()

/var/www/nextcloud/core/templates/layout.guest.php - line 55:

OCP\Defaults->getLongFooter()

/var/www/nextcloud/lib/private/Template/Base.php - line 178:

include("/var/www/ne ... p")

/var/www/nextcloud/lib/private/Template/Base.php - line 150:

OC\Template\Base->load("/var/www/ne ... p", null)

/var/www/nextcloud/lib/private/legacy/template.php - line 180:

OC\Template\Base->fetchPage(null)

/var/www/nextcloud/lib/private/legacy/template.php - line 211:

OC_Template->fetchPage(null)

/var/www/nextcloud/lib/private/Template/Base.php - line 131:

OC_Template->fetchPage()

/var/www/nextcloud/lib/private/legacy/template.php - line 299:

OC\Template\Base->printPage()

/var/www/nextcloud/remote.php - line 80:

OC_Template::printErrorPage("App not installed: ", "", 0)

/var/www/nextcloud/remote.php - line 166:

handleException(RemoteException {})

Unable to fetch data from websites with valid schema due to User Agent

I attempted to add a recipe by URL, but the download method recipe failed as it was unable to get valid HTML from the website. When I checked the Nextcloud logs, I found this error message (with identifying information removed).

{
  "reqId": "someRequestID",
  "level": 3,
  "time": "2019-08-08T03:59:47+00:00",
  "remoteAddr": "00.000.00.00",
  "user": "someUser",
  "app": "PHP",
  "method": "POST",
  "url": "\/apps\/cookbook\/add",
  "message": "file_get_contents(recipeUrl): failed to open stream: HTTP request failed! HTTP\/1.1 403 Forbidden\r\n at nextcloudDirectory\/apps\/cookbook\/lib\/Service\/RecipeService.php#406",
  "userAgent": "Chrome User-Agent String",
  "version": "16.0.3.0"
}

The server at the given recipe URL returns 403 Forbidden most likely due to the lack of User-Agent header present with the file_get_contents method. When I used a request client for the recipe URL, I found that the website had the Cloudflare protection on it which explains why it would reject requests without a User Agent.

Adding the a User-Agent header would make it possible to scrape all sites with valid schema behind reverse proxies designed to protect against DoS attacks. If you're too busy, I do not mind submitting a pull request!

Add user Comments

Hi,
comment like stars or Like, or better you can write something "worst ever" "love" "you could add ... to ... make it better

Feature wanted: Export to pdf

Hi, another wish - I know, I'm going to be impertinent...
I would like to make an export to pdf of a receipe and store that on my cloud
Thanks again for your work, the next wishes not before december :-)
Jürgen

Feature: Including own pictures, grouping and sorting

i would be great to upload own pictures of the Recipes, would be fine, too .. if you could make Directories .. where you could group the recipes .. an export/import function (including the pics) would be great. Thanks for your efforts .. do appreciate.

Add wildcats for Search

Thanks again for your great work.

Could you please add wildcats? I try to find a receipt, but only the full name will find one. But i try to find any Cake, nothing is shown.

Thanks..

Translate

I would like to translate the application into French how to do?

Can't edit instructions

Thank you for making this available. It looks cool and looks like it can have a lot of potential.

I tried downloading a recipe here:
https://www.verywellfit.com/spelt-bread-recipe-for-a-bread-machine-2506888
and it didn't import at all, but the page had a "print" option, so I tried that:
https://www.verywellfit.com/spelt-bread-recipe-for-a-bread-machine-2506888?print
and I was able to get the Ingredients in, but no Instructions showed up.

When I edited the recipe, I assume I should add the Instructions by clicking on the "+". But I don't seem to get an edit box or anything like that.

Clicking on "Save" also doesn't seem to do anything, but it did seem to do something since already filled in fields did save changes, but check boxes in the "Daily Dozen" didn't.

I should probably go back and read any release notes.

Manually add recipes

I do not see any way to manually add a recipe. Using Firefox and Chrome. NextCloud Version 16.0.1.
NextCloud-noaddbutton

After cheating by editing a file and changing the name, ingredients, and instructions a new .json file is created.

Images not shown

Hi there

For some reasons no images are shown above the recipes. When I right-click the area it says that there is an image there, but when I click on "View Image" it returns the following error message:

The requested URL /index.php/apps/cookbook/image was not found on this server.

Thanks the the great idea for this app and best regards!

Overview of recipes shows entries from any user

Hi,
I have noticed a behaviour, that as soon as you open the app "cookbook", you will always see all the recipes of the last user who refreshed his/her library. Every user has to rescan his recipes once he/she enters the app which then starts the cycle again.
This might have to do with caching or my server configuration, but I think the easiest way out would be an automated rescan with the start of the app. Either this, or a database which is user specific.

Let me know if you experience any similar behaviour.

Nextcloud Version 15.0.11
Cookbook Version 0.3.3
PHP 7.0.33-0+9deb9u3
Tested with Firefox 68.0.2 and Chromium 76.0.3809.100

Editing Recipe Name Instead Duplicates It

I confirmed this happens on both 0.1.7 and after upgrading to 0.1.8

  1. Click the pencil icon next to a recipe in the list.
  2. Change the name of the recipe (like just add a 2 at the end of the name).
  3. Save the recipe.
  4. Duplicate appears in the recipe list and the original is unchanged.

Wrong displaying of preparation and cook time

Hi there!

Seems to be just a little bug. If the preparation time is exactly 1h, then the last zero will be cut at the end. Maybe this happens also with the cook time. You can see the bug in the attached screenshot.

Kind regards!

2019-10-08 18_24_02-Window

Add fields - Description, URL, prepTime, cookTime

I really like your cookbook app, I currently have my recipes as markdown files but your interface and layout is better.

To get all the detail for a recipe though, it needs to use the "description" and "url" field. The app uses the url to grab the recipe in the first place, and I find it useful to be able to refer back since I often change the recipe.
The description is in the example given on the https://schema.org/Recipe page, and would also help with issue #8.
CookTime and prepTime are nice to have as a quick reference, but can be kept optional.

I've never tried coding PHP before but I'll have a go at making these changes if you like.

Failed test in travis

I just saw that my PRs cause travis CI to report errors. Are there no errors for your repo? I get even error when I simply fork your current master.

So either there is something really weird going on here, you are nor using travis, or there are bugs in the code that should be removed.

If you do not use travis or the error is known I suggest that you update your test cases such that travis does not error but give a warning instead or so.

Can't Open Between Users?

I have added recipes using URLs under my admin account as well as a created user account. Both accounts can see all of the recipes but cannot open them from the opposite account. When attempting to edit, dialog is thrown stating recipe could not be opened.

Please let me know what information you might need on my end and I will do my best to provide it.

Harden the database queries

At the moment, the database entries seem not be quoted as far as I understand. So a normal user might use e.g. the search fields to do some SQL injection.

I saw this in when working on PR #12 for #5. Maybe I will find some time for a small PR but I wanted to keep this documented that there is a security vulerability.

It would be useful to be able to group multiple ingredients together under a common heading.

I currently just create dummy entries, usually in ALL CAPS to help it stand out, but https://stackoverflow.com/questions/46038625/schema-org-for-complex-or-multi-part-recipes suggests a method of structuring multiple recipes into one using the schema.org Recipe schema; could something similar be used?

I see this commonly used to group components of a more complex recipe together; for example Lemon Meringue Pie: Reloaded which is basically a collection of three "independent" recipes that combine to make a single final product.

He also uses the same structure to identify required/recommended hardware, which is convenient.

It's a pity the site doesn't appear to use the Schema.org markup themselves, as that would probably be a useful starting point for a possible structure.

Sure I can just create three separate recipes, but that's awkward and vaguely unsatisfying.

I might try to take a crack at this myself, but I'm minimally experienced with PHP and present coding standards.

BadMethodCallException: path needs to be relative to the system wide data folder and point to a user specific file

Saw the following exception in my logs after the upgrade to v0.4.0:

Error | index | BadMethodCallException: path needs to be relative to the system wide data folder and point to a user specific file/var/www/html/lib/private/Encryption/Keys/Storage.php - line 253:OC\Encryption\Util->getUidAndFilename("/cookbook/cache")/var/www/html/lib/private/Encryption/Keys/Storage.php - line 169:OC\Encryption\Keys\Storage->getFileKeyDir("", "/cookbook/cache")/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php - line 306:OC\Encryption\Keys\Storage->deleteAllFileKeys("/cookbook/cache")<>OC\Files\Storage\Wrapper\Encryption->rmdir("cookbook/cache")/var/www/html/apps/files_trashbin/lib/Storage.php - line 177:call_user_func([ OC\Files\S ... "], "cookbook/cache")/var/www/html/apps/files_trashbin/lib/Storage.php - line 117:OCA\Files_Trashbin\Storage->doDelete("cookbook/cache", "rmdir")/var/www/html/custom_apps/files_accesscontrol/lib/StorageWrapper.php - line 84:OCA\Files_Trashbin\Storage->rmdir("cookbook/cache")/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php - line 92:OCA\FilesAccessControl\StorageWrapper->rmdir("cookbook/cache")/var/www/html/lib/private/Files/View.php - line 1160:OC\Files\Storage\Wrapper\Wrapper->rmdir("cookbook/cache")/var/www/html/lib/private/Files/View.php - line 349:OC\Files\View->basicOperation("rmdir", "/cookbook/cache", [ "delete"])/var/www/html/lib/private/Files/Node/Folder.php - line 342:OC\Files\View->rmdir("/cookbook/cache")/var/www/html/custom_apps/cookbook/lib/Service/RecipeService.php - line 504:OC\Files\Node\Folder->delete()/var/www/html/custom_apps/cookbook/lib/Controller/RecipeController.php - line 141:OCA\Cookbook\Service\RecipeService->rebuildSearchIndex()/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 166:OCA\Cookbook\Controller\RecipeController->reindex()/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\Cookbook ... }}, "reindex")/var/www/html/lib/private/AppFramework/App.php - line 126:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Cookbook ... }}, "reindex")/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\Cookbo ... r", "reindex", OC\AppFramew ... {}, { _route: "c ... "})<>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "c ... "})/var/www/html/lib/private/Route/Router.php - line 297:call_user_func(OC\AppFramew ... {}, { _route: "c ... "})/var/www/html/lib/base.php - line 975:OC\Route\Router->match("/apps/cookbook/reindex")/var/www/html/index.php - line 42:OC::handleRequest()

...the app seems to be working, however.

Feature wanted: multiple ingredient lists

The ability to have multiple ingredient lists and maybe instructions for more advanced recipes.
In example a recipe for a pie, where the dough has one ingredient list, the filling one and the sauce a third.

Manual Recipe Entry Formatting

When manually entering recipe instructions, the JSON encoder seems to ignore LF/CR when the recipe is saved. It'd be nice to be able to keep the formatting entered in each text box.

For example entering:
Screenshot 2019-08-19 at 7 12 07 PM

Results in
Screenshot 2019-08-19 at 7 12 57 PM

Instructions not shown and can not add by hand

Instructions from german online recipes not shown and i can not add them by myself. The + is not working.

But i like the idea very much!! And it looks great. So i would be happy the project will go ahead!

Good luck

Feature wanted: Edit Image

The section that is chosen for pictures and displayed in the app is not always good. For example, with this recipe:

https://www.chefkoch.de/rezepte/541521151483685/Super-schnelle-Himbeertorte.html

It would be nice if you could move the section or has significantly more influence on the pictures.

Are actually local images from the Nextcloud supported? This would also be desirable.

Are the pictures retrieved from the website again and again? I only found the link to the image in the json file. So the recipe would break if the original image / recipe would be deleted once? The storage of all recipe data in own Nextcloud would be useful.

Cookbook updates should trigger file revision creation

So what I'm trying to do is combine your cookbook app with the group folders app to create a central cookbook that everyone on the nextcloud server can contribute to. Unfortunately if I give everyone write but deny delete there's still the possibility of vandalizing or accidentally messing up a recipe. What would mitigate this is if the file revisions were triggered when changes were made to the cookbook entry through the app. This doesn't seem to be the case right now as I made a change, adding a new instruction to an entry and then went and inspected the .json file for it and observed that it had no revision history, even though a change was made.

Missing files in tar files release v0.3.2

I wanted to install version v0.3.2 to have the French translation but it does not work.
After searching, the release v0.3.2 in version tar.gz does not contain the translation files. It misses the translationsfiles directory.
In the zip version of release 0.3.2 these files are present.
I tried to manually install the zip version but it does not work

Shared Cookbook not possible

Hi there,

I just tried the cookbook extension and it's absolutely awesome! Unfortunately I tried to share the recipes with my wife, but it's not possible to share the files for 2 ppl.

The error message is:

Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO "oc_cookbook_recipes" ("recipe_id", "name", "user_id") VALUES(?, ?, ?)' with params [430, "15-Minuten-Pfanne", "yael"]: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "oc_cookbook_recipes_pkey" DETAIL: Key (recipe_id)=(430) already exists.

As I'm not a php developer but a dev myself, I tried to understand where the issue is. It looks like the indexer function in

https://github.com/mrzapp/nextcloud-cookbook/blob/master/lib/Db/RecipeDb.php

Line 159

retrieves the file id and tries to store the file afterwards using this id. However, as the id has a primary_key constraint on it which doesn't include the user name, and the first user already reserved this id, the db complains about it.

The Database I used is PostgreSQL.

As I said, I'm not a PHP dev so unfortunately I can't create a PR, but maybe this information helps a bit to solve this issue.

Cheers
Marcel

EDIT: It looks like when the constraint is dropped, everything works out just fine, so this might be a PostgreSQL specific problem.

possible vandalism

Maybe I'm just a little too paranoid here, but my test user was allowed to delete recipes it did not create.

Should cookbook work this way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.