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

feat: Add new migration for DVO Cook'n #5085

Open
wants to merge 6 commits into
base: mealie-next
Choose a base branch
from

Conversation

keyofdminer
Copy link

@keyofdminer keyofdminer commented Feb 21, 2025

What this PR does / why we need it:

(REQUIRED)

This pull request adds the functionality of being able to import cookbooks from DVO Cook'n X3 (it might also work with newer or older version, but I am unable to test that).

File changes:

  • Updated docs with Cook'n as migration option
  • Updated frontend files with Cook'n options and text matching existing migrators
  • Added Cook'n to SupportedMigrations
  • Added actual cook'n migration code
  • Add test case (MigrationTestData)

Notes:
This directly supports ingredient amounts. To do this I have imported all ingredients and foods used from the Cook'n library (duplicates are hopefully mitigated by using the fuzzy matching in DataMatcher).

Special notes for your reviewer:

(fill-in or delete this section)

Focus should primarily be on mealie/services/migrations/cookn.py. As 95% of the changes are in that file. Functionally the code should be pretty good, but formatting, code consistency, and documentation might need some touch ups.

P.S. This is my first time working with strict typing, vue, and docker. So apologies up front if I am missing anything.

Testing

(fill-in or delete this section)

I have tested it with all my recipes from Cook'n (about 750). Doing a spot check everything seems to be in order. The included test only has 3 recipes, but I can update it with more if needed.

I also ran py:check with the following pytest results:

FAILED tests/integration_tests/admin_tests/test_admin_group_actions.py::test_admin_update_group - sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: groups.slug
1 failed, 1209 passed, 26 skipped, 161 warnings in 932.06s (0:15:32)

@keyofdminer keyofdminer force-pushed the feature/cookn-migration branch from 178c34a to 27aea1d Compare March 1, 2025 22:20
@michael-genson
Copy link
Collaborator

Hey there!

Haven't had the chance to give this a proper lookover yet, but FYI you only need to update en-US.json for new lang strings. The other languages will be added automatically through Crowdin

@keyofdminer
Copy link
Author

Good to know. I am not very familiar with i18n and just used the VSCode extension to generate everything. I can remove the other languages if that would be better.

@michael-genson
Copy link
Collaborator

Yes please, we'll need them reverted for the PR (otherwise Crowdin will overwrite them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants