fixed nextcloud importer ignoring certain recipes

This commit is contained in:
vabene1111 2021-05-20 11:17:45 +02:00
parent d67bb9de25
commit 9a8049f71b

View File

@ -11,7 +11,7 @@ from cookbook.models import Recipe, Step, Food, Unit, Ingredient
class NextcloudCookbook(Integration):
def import_file_name_filter(self, zip_info_object):
return re.match(r'^Recipes/([A-Za-z\d\s])+/recipe.json$', zip_info_object.filename)
return zip_info_object.filename.endswith('.json')
def get_recipe_from_file(self, file):
recipe_json = json.loads(file.getvalue().decode("utf-8"))