Replies: 1 comment
-
|
hi, thank you for your feedback. Tandoor already has a plugin architecture that could be used for this. You can refer to the open data plugin as an example https://github.com/TandoorRecipes/open_data_plugin I really like the idea of refactoring and cleaning up the whole importer workflow, it has grown and become messy over time and is a pain to maintain. I think I would implement most importers directly into tandoor, but I do have to check the legal side of things so allowing plugins for this would be nice. I do like the naming of "import" as we also have "integration" for the app importers and "connectors" for Homeassistant sync, so something around these lines. What I am not sure about is the "service" you suggest. what do you mean by this? I am very happy to receive some help on tandoor but as mentioned under your other comment it is a very big problem for me if people introduce complexity that I need to maintain later, so we need to keep this managable and integrate it nicely into the application. Please summarize your key changes before implementing, otherwise I might not be able to merge the PR later. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m looking into the recipe URL import endpoint and wanted to get some feedback before starting any implementation.
At the moment, a lot of source-specific logic (YouTube, Tandoor share links, generic scraping, etc.) lives directly in the API view and helper functions. From my perspective, this makes the flow harder to comprehend, extend and test.
Motivation
My concrete motivation is support for additional recipe sources that should not live in the core project (e.g. sources with restrictive ToS such as Instagram).
For those cases, a clean extension point would allow external plugins while keeping Tandoor itself on the safe side.
Idea
I'm considering to refactor the recipe import flow by introducting a small abstraction:
classDiagram direction LR class RecipeUrlImportView { +post() } class RecipeImportService { +importFromSource() } class ImporterRegistry { +register() +resolve() } class RecipeSourceImporter { <<interface>> +canHandle() +run() } class YouTubeImporter class TandoorShareImporter class GenericScraperImporter RecipeUrlImportView --> RecipeImportService RecipeImportService --> ImporterRegistry ImporterRegistry --> RecipeSourceImporter RecipeSourceImporter <|.. YouTubeImporter RecipeSourceImporter <|.. TandoorShareImporter RecipeSourceImporter <|.. GenericScraperImporterQuestions before I start
If this approach is okay, I’d prepare an PR.
Thanks for your feedback!
Beta Was this translation helpful? Give feedback.
All reactions