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