Preparing search index...

    Function saveRecipeImage

    • Saves a recipe image from cache to permanent storage

      Moves a temporary image file to permanent storage with a unique filename. The recipe name is sanitized and combined with a UUID for the filename, preserving the original file extension.

      Parameters

      • cacheFileUri: string

        URI of the temporary image file to move

      • recName: string

        Recipe name used to generate the filename

      Returns string

      Promise resolving to the permanent image URI, or empty string on failure

      const tempImageUri = "file:///cache/temp-image.jpg";
      const savedUri = await saveRecipeImage(tempImageUri, "Chocolate Cake");
      // Returns: "file:///documents/Recipedia/chocolate_cake_<uuid>.jpg"