⚡ Use analyze now for images
This commit is contained in:
parent
d4fbdd397e
commit
e503c3f02f
@ -247,6 +247,7 @@ class PostWriteController extends ChangeNotifier {
|
||||
media.toFile()!,
|
||||
place.$1,
|
||||
place.$2,
|
||||
analyzeNow: media.type == SnMediaType.image,
|
||||
onProgress: (value) {
|
||||
progress = value;
|
||||
notifyListeners();
|
||||
|
@ -154,10 +154,12 @@ class SnAttachmentProvider {
|
||||
String rid,
|
||||
String cid, {
|
||||
Function(double progress)? onProgress,
|
||||
bool analyzeNow = false,
|
||||
}) async {
|
||||
final resp = await _sn.client.post(
|
||||
'/cgi/uc/fragments/$rid/$cid',
|
||||
data: data,
|
||||
queryParameters: {'analyzeNow': analyzeNow},
|
||||
options: Options(headers: {'Content-Type': 'application/octet-stream'}),
|
||||
onSendProgress: (count, total) {
|
||||
if (onProgress != null) {
|
||||
@ -178,6 +180,7 @@ class SnAttachmentProvider {
|
||||
SnAttachmentFragment place,
|
||||
int chunkSize, {
|
||||
Function(double progress)? onProgress,
|
||||
bool analyzeNow = false,
|
||||
}) async {
|
||||
final Map<String, dynamic> chunks = place.fileChunks;
|
||||
var completedTasks = 0;
|
||||
@ -200,6 +203,7 @@ class SnAttachmentProvider {
|
||||
data,
|
||||
place.rid,
|
||||
entry.key,
|
||||
analyzeNow: analyzeNow,
|
||||
onProgress: (progress) {
|
||||
final overallProgress = (completedTasks + progress) / chunks.length;
|
||||
onProgress?.call(overallProgress);
|
||||
|
@ -83,6 +83,7 @@ class ChatMessageInputState extends State<ChatMessageInput> {
|
||||
media.toFile()!,
|
||||
place.$1,
|
||||
place.$2,
|
||||
analyzeNow: media.type == SnMediaType.image,
|
||||
onProgress: (progress) {
|
||||
// Calculate overall progress for attachments
|
||||
setState(() {
|
||||
|
Loading…
Reference in New Issue
Block a user