fix json download link

This commit is contained in:
hay-kot 2021-06-07 16:24:00 -08:00
commit 4efbb1a864
2 changed files with 4 additions and 5 deletions

View file

@ -179,7 +179,8 @@
}, },
"new-recipe": { "new-recipe": {
"bulk-add": "Bulk Add", "bulk-add": "Bulk Add",
"error-message": "Looks like there was an error parsing the URL. Check the log and debug/last_recipe.json to see what went wrong.", "error-title": "Looks We Couldn't Find Anything",
"error-details": "Only websites containing ld+json or microdata can be imported imported by Mealie. Most major recipe websites support this data structure. If your site cannot be imported but there is json data in the log, please submit a github issue with the URL and data.",
"from-url": "Import a Recipe", "from-url": "Import a Recipe",
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list", "paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list",
"recipe-url": "Recipe URL", "recipe-url": "Recipe URL",
@ -251,7 +252,6 @@
"total-time": "Total Time", "total-time": "Total Time",
"unable-to-delete-recipe": "Unable to Delete Recipe", "unable-to-delete-recipe": "Unable to Delete Recipe",
"view-recipe": "View Recipe" "view-recipe": "View Recipe"
}, },
"search": { "search": {
"and": "and", "and": "and",

View file

@ -1,15 +1,14 @@
from pathlib import Path from pathlib import Path
from typing import Optional from typing import Optional
from fastapi import APIRouter, Depends from fastapi import APIRouter, Depends, HTTPException, status
from mealie.routes.deps import validate_file_token from mealie.routes.deps import validate_file_token
from starlette.responses import FileResponse from starlette.responses import FileResponse
from fastapi import HTTPException, status
router = APIRouter(prefix="/api/utils", tags=["Utils"], include_in_schema=True) router = APIRouter(prefix="/api/utils", tags=["Utils"], include_in_schema=True)
@router.get("/download/{token}") @router.get("/download")
async def download_file(file_path: Optional[Path] = Depends(validate_file_token)): async def download_file(file_path: Optional[Path] = Depends(validate_file_token)):
"""Uses a file token obtained by an active user to retrieve a file from the operating """Uses a file token obtained by an active user to retrieve a file from the operating
system.""" system."""