]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change available image subtraction
authorBastian Dehn <hhaalo@arcor.de>
Thu, 22 Feb 2024 19:10:12 +0000 (20:10 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 22 Feb 2024 19:10:12 +0000 (20:10 +0100)
src/kds_s2000w_handler.c

index 74186198cf4b092df31995e6624fd0ded8770b1b..b12e806b33953e6f2c0c2fb012e5ad382fd5e7a5 100644 (file)
@@ -106,6 +106,7 @@ void _delete_current_image(handler* h)
        kds_s2000w_client_delete_image(h->sessionid, h->current_scan_status->current_image_number, resp);
        kds_s2000w_client_response_free(resp);
        resp = NULL;
+       h->current_scan_status->available_images--;
        sleep(1);
 }
 
@@ -288,23 +289,18 @@ void kds_s2000w_handler_get_parameters(void* handle)
        debug_printf(ALL, "kds_s2000w_handler_get_parameters");
        handler* h = (handler*) handle;
        if (!h->current_scan_status->complete_scanned
-               && h->current_scan_status->downloaded_images == h->current_scan_status->available_images) {
+               && h->current_scan_status->available_images <= 0) {
                _get_current_scan_status(h);
        }
 
        if (h->current_scan_status->complete_scanned
-               && h->current_scan_status->downloaded_images == h->current_scan_status->available_images) {
+               & h->current_scan_status->available_images <= 0) {
                h->current_metadata->valid = 1;
                h->current_metadata->scanned_all_complete = 1;
                h->current_metadata->is_last = 1;
                return;
        }
 
-       if (h->current_scan_status->downloaded_images >= h->current_scan_status->available_images) {
-               h->current_metadata->valid = 0;
-               return;
-       }
-
        _download_current_image(h);
        _get_current_metadata(h);
        _delete_current_image(h);