Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Importer - RecetteTek #578

Merged
merged 6 commits into from
May 18, 2021

Conversation

itsmegb
Copy link

@itsmegb itsmegb commented Apr 26, 2021

This PR adds an importer for RecetteTek - https://www.recettetek.com/en/

It is currently possible to import either a single recipe or import all exported recipes at once.

RecetteTek allows a user to export their recipes as either an '.RTK' file or an '.HTML' file, this importer supports only the RTK format.

It will also attempt to download the original image that RecetteTek initially imported, but if that fails it will not import any image. The recipe export from RecetteTek does include the original images locally, but I have yet to look at the best way to import those.

A lot of the fields that RecetteTek have are free-form, so things like serving size, prep time, cooking time etc will fail to import if there is anything other than an integer in the field. (Maybe a parser could be built for this for use by all importers, similar to the ingredient parser?)

Unlike some of the other importers, I've split out a lot of the value parsing into their own try/catch blocks to get as much info as possible, I'm sure there is probably a better way to do this though :)

RecetteTek also allows videos to be inserted as a recipes instructions, in this case there will be no ingredients or description.

@vabene1111
Copy link
Collaborator

thanks for the PR, sounds really good from the description. i will give it a test and try to get it into the next release

@itsmegb itsmegb force-pushed the importer-recetteke branch from dfcace5 to 1bc5af1 Compare April 28, 2021 12:52
@itsmegb
Copy link
Author

itsmegb commented Apr 28, 2021

I've updated the image importing, it will now retrieve the image that is in the export file first and if that fails it will then attempt to download the image from the original location.
I found that this works better, as some of the original image URLs no longer exist or are unreachable for some reason.

@itsmegb
Copy link
Author

itsmegb commented Apr 28, 2021

As an additional question, is there a recommended location to store the original source url of the recipe?

For now i've just copied what other importers have done and placed it at the bottom of a step, however, I noticed that the recipe DB object contains two fields: Link and Cors Link
What is the purpose of these fields? Should/Could i store the original URL in one of those?

@vabene1111
Copy link
Collaborator

You have done it correctly, i have no special field for "source URL" like many other recipe managers have as i do not really think that this is very useful.

The link and cors link fields are leftovers of the old external recipe system that just produced links to external recipes.

@itsmegb
Copy link
Author

itsmegb commented Apr 28, 2021

i made the decision to append the url to the end of the description field, i feel that makes more sense than having it added to the first step in the recipe.

Is there a way to add the ingredients directly to the recipe rather than one of the steps?

@vabene1111
Copy link
Collaborator

No ingredients are always linked to a step. Also all instructions are so you will need to add at least one step to the imported recipe.

I recommend adding the source URL to the text as the description will be shown on the search page from the next update on which will probably not look good. Also it will be consistent with all other importers

@vabene1111 vabene1111 added this to the 0.16.0 milestone Apr 29, 2021
@itsmegb
Copy link
Author

itsmegb commented Apr 30, 2021

No problem, i've moved the source URL out of the description and back into the step.

@vabene1111 vabene1111 merged commit 35338e2 into TandoorRecipes:develop May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants