cloud-py-api / mediadc

Nextcloud Media Duplicate Collector application
https://apps.nextcloud.com/apps/mediadc
GNU Affero General Public License v3.0
95 stars 8 forks source link

Bulk actions not working (delet and resolve without delete) #125

Closed HerrFrutti closed 1 year ago

HerrFrutti commented 1 year ago

Describe the bug I've got MediaDC running and it found some images. Now I had the two cases, that one time I did not want to delete any of the images and selected all the images and clicked on the remove items without deleting them -> server error. Same behavior if I want to delete multiple files.

Added the error log from Nextcloud below.

To Reproduce Steps to reproduce the behavior:

  1. Have multiple images that get recognized as identical
  2. select all or one (makes no difference, important is, that you check the select box)
  3. Choose delete or remove option
  4. See the server error pop up

Expected behavior That the marked images all get deleted, or resoved without deleting.

Screenshots grafik

Additional context System information:

{
  "nextcloud-version": "25.0.4.1",
  "app-versions": {
    "cloud_py_api-version": "0.1.5",
    "mediadc-version": "0.3.4"
  },
  "is-videos-supported": true,
  "is-snap": false,
  "arch": "amd64",
  "webserver": "Apache/2.4.54 (Debian)",
  "database": {
    "type": "pgsql",
    "version": "PostgreSQL 14.7 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit",
    "size": "205841187"
  },
  "php-version": "8.1.16",
  "php-interpreter": "php",
  "python-interpreter-setting": "/usr/bin/python3",
  "os": "Linux",
  "os-release": "5.10.0-21-amd64",
  "machine-type": "x86_64"
}

Log Error:

[index] Fehler: Exception: OCA\MediaDC\Service\CollectorService::markResolvedPhoto(): Argument #1 ($fileid) must be of type int, null given, called in /var/www/html/custom_apps/mediadc/lib/Service/CollectorService.php on line 840 in file '/var/www/html/custom_apps/mediadc/lib/Service/CollectorService.php' line 998 at <<closure>>

0. /var/www/html/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\MediaDC\\ ... "], "deleteTaskDetailFiles")
1. /var/www/html/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main("OCA\\MediaDC\\C ... r", "deleteTaskDetailFiles", ["OC\\AppFramewo ... "], ["1","27","media ... "])
5. /var/www/html/lib/base.php line 1047
   OC\Route\Router->match("/apps/mediadc/a ... e")
6. /var/www/html/index.php line 36
   OC::handleRequest()

POST /index.php/apps/mediadc/api/v1/tasks/1/files/27/delete
from 172.18.0.12 by michael.weissmare at 2023-03-18T21:32:16+01:00
HerrFrutti commented 1 year ago

Okay, I've found a fix. If you select all this causes an error! You need to select all-1 to make it work! I think I could be nice to add an option to delete all found files. For example I have a ton of screenshots that get detected, that all can be deleted!

HerrFrutti commented 1 year ago

Oh and the images get deleted! The error pops up, I need to reload, the group is gone and the images are in my trash bin.

bigcat88 commented 1 year ago

@HerrFrutti thanks for pointing, we were able to reproduce it and will fix.