sync 2.0.9.2 - #4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fe229fbbf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final file = await CacheManager.manager.getSingleFile( | ||
| url.http2https, | ||
| ))?.file; | ||
|
|
||
| if (file == null) { | ||
| final String filePath = '$tmpDirPath/$name'; | ||
| final response = await Request().downloadFile( | ||
| url.http2https, | ||
| filePath, | ||
| cancelToken: cancelToken, | ||
| ); | ||
| return ( | ||
| filePath: filePath, | ||
| name: name, | ||
| statusCode: response.statusCode, | ||
| del: true, | ||
| ); | ||
| } else { | ||
| return ( | ||
| filePath: file.path, | ||
| name: name, | ||
| statusCode: 200, | ||
| del: false, | ||
| ); | ||
| } | ||
| ); |
There was a problem hiding this comment.
Wire the cancel token into downloads
When the user dismisses the “正在下载原图” loading dialog, only cancelToken.cancel is called, but the actual fetch now uses CacheManager.manager.getSingleFile(...) without any cancellation path. For large or multiple images the downloads continue and may still be saved before the later isCancelled check, so the cancel action no longer stops network or storage work.
Useful? React with 👍 / 👎.
| res = await SaverGallery.saveFile( | ||
| filePath: filePath, | ||
| fileName: fileName, | ||
| androidRelativePath: _androidRelativePath, | ||
| albumPath: _albumPath, | ||
| skipIfExists: false, |
There was a problem hiding this comment.
Delete temporary sources after saving
When this helper saves a file that was just created under tmpDirPath (for example live-photo videos or the long-press WebP conversion), the source is now saved/copied but never removed because the old del cleanup was removed. Repeated saves can leave large temporary media files behind until the OS happens to clear the temp directory.
Useful? React with 👍 / 👎.
Accept PR gucooing#4 package-name fix: use com.gucooing.piliplus for AndroidHelper/MediaHelper, jnigen, and JNI bindings. Also move sources under matching package directories. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No description provided.