* Get the IMDB data through file downloading and extraction. * * If the files already exist on the local file system, the download and/or * extraction steps will be skipped.
()
| 194 | * extraction steps will be skipped. |
| 195 | */ |
| 196 | async function maybeDownloadAndExtract() { |
| 197 | const zipDownloadDest = path.join(os.tmpdir(), path.basename(DATA_ZIP_URL)); |
| 198 | await maybeDownload(DATA_ZIP_URL, zipDownloadDest); |
| 199 | |
| 200 | const zipExtractDir = |
| 201 | zipDownloadDest.slice(0, zipDownloadDest.length - ZIP_SUFFIX.length); |
| 202 | await maybeExtract(zipDownloadDest, zipExtractDir); |
| 203 | return zipExtractDir; |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Load data by downloading and extracting files if necessary. |
no test coverage detected