Describe the bug
The function get_opf_path is designed to convert a pecha path to the corresponding OpenPecha Format (OPF) path. However, there is a bug in the function's implementation. Specifically, when the path parameter is not provided (None), the function is expected to download the pecha using the download_pecha function and then return the path to the downloaded OPF. But currently, the function returns immediately after calling download_pecha(pecha_id), without converting the downloaded pecha's path to the OPF path.
This premature return occurs at line 446 with return download_pecha(pecha_id). This line should instead set the path variable to the result of download_pecha(pecha_id) and then continue with the subsequent steps to convert this path to the OPF path.
In essence, the bug is that the function exits too early when the path argument is not provided, and it does not fulfill its intended purpose of always returning the OPF path.
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
Expected behavior
The get_opf_path function in Python, given a pecha_id and an optional path, either downloads the pecha (if the path is not provided) or uses the given path, then it transforms this path into an OpenPecha Format (OPF) path and verifies its existence before returning it. This function is designed to ensure that the returned path correctly points to the OPF directory of the specified pecha.
Screenshots
Desktop (please complete the following information):
OS: Ubuntu
Browser: chrome
Version
Additional context
Add any other context about the problem here.
Describe the bug The function get_opf_path is designed to convert a pecha path to the corresponding OpenPecha Format (OPF) path. However, there is a bug in the function's implementation. Specifically, when the path parameter is not provided (None), the function is expected to download the pecha using the download_pecha function and then return the path to the downloaded OPF. But currently, the function returns immediately after calling download_pecha(pecha_id), without converting the downloaded pecha's path to the OPF path.
This premature return occurs at line 446 with return download_pecha(pecha_id). This line should instead set the path variable to the result of download_pecha(pecha_id) and then continue with the subsequent steps to convert this path to the OPF path.
In essence, the bug is that the function exits too early when the path argument is not provided, and it does not fulfill its intended purpose of always returning the OPF path.
To Reproduce Steps to reproduce the behavior:
Expected behavior The get_opf_path function in Python, given a pecha_id and an optional path, either downloads the pecha (if the path is not provided) or uses the given path, then it transforms this path into an OpenPecha Format (OPF) path and verifies its existence before returning it. This function is designed to ensure that the returned path correctly points to the OPF directory of the specified pecha.
Screenshots
Desktop (please complete the following information):
Additional context Add any other context about the problem here.