Page 1 of 1

MoveToTrash doesn't work

Posted: 11 Jan 2023, 08:50
by FTW
Hi, the MoveToTrash cmd doesn't work for me even if AMC and GUI Rename work and delete file without issue

Thanks

Code: Select all

FileBot 4.9.6 (r9125)
JNA Native: 6.1.3
MediaInfo: 22.12
Tools: fpcalc/1.5.1 7z/17.04 unrar/6.12
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2022-08-15 (r836)
Groovy: 3.0.9
JRE: OpenJDK Runtime Environment 17.0.5
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 14 Core / 16 GB Max Memory / 56 MB Used Memory
OS: Linux (amd64)
HW: Linux a1f4cb0ae209 5.19.17-Unraid #2 SMP PREEMPT_DYNAMIC Wed Nov 2 11:54:15 PDT 2022 x86_64 GNU/Linux

Re: MoveToTrash doesn't work

Posted: 12 Jan 2023, 01:15
by rednoah
What is the MoveToTrash command? Can you provide context and details? (what are you trying to do, what is happening, what should happen instead)


:?: Are you using the GUI? Screenshot?
:?: Are you using the CLI? Console Output?


:idea: unRAID? If you are not using Desktop Linux, then I would not expect there to be a "trash bin" feature.

Re: MoveToTrash doesn't work

Posted: 13 Jan 2023, 09:46
by FTW

Code: Select all

What is the MoveToTrash command?
Well, you add it in the GUI few update back

Though it would be a Manual Delete file

Image

Code: Select all

:?: Are you using the GUI? Screenshot?
Yes, With the GUI when you Double Left Click on a movie/series

Code: Select all

:idea: unRAID? If you are not using Desktop Linux, then I would not expect there to be a "trash bin" feature.
Well than is it possible to create a Manual Delete command if that one isnt for that purpose??

Thanks
Best Regards

Re: MoveToTrash doesn't work

Posted: 13 Jan 2023, 11:10
by rednoah
:?: Does unRAID support running a standard Linux Desktop environment? AFAIK, unRAID just gives you a WebUI and then everything else runs in VMs or docker containers, no?

:?: Are you running FileBot inside a docker container with container-specific minimal Desktop environment?

:?: What would your custom trash command or "manual delete" command be?



:idea: Move to Trash will probably just delete the file, or maybe fail with an error message, when the underlying platform does not have a trash or recycle bin, i.e. it'll probably only work on typical Desktop platforms, Windows, macOS, and standard Desktop Linux.

:idea: FileBot uses the Desktop::moveToTrash Java API so the implementation details are platform-dependent. I'm not sure how trash / recycle bin works on Desktop Linux, especially not unRAID. I know that Synology and QNAP do their own thing and don't follow the XDG standard, so I would assume that unRAID does its own thing as well.



EDIT:

I checked the code and Move to Trash will just do nothing if it doesn't work, and silently print an error message to the log.

:?: What does the log say?

Re: MoveToTrash doesn't work

Posted: 14 Jan 2023, 14:02
by FTW
Does unRAID support running a standard Linux Desktop environment? AFAIK, unRAID just gives you a WebUI and then everything else runs in VMs or docker containers, no?
Yes running inside Docker container, Unraid its a Linux environment with a custom desktop
Are you running FileBot inside a docker container with container-specific minimal Desktop environment?
using Jlesage Docker -> there an issue opened about that cmd on his github https://github.com/jlesage/docker-filebot/issues/81
What would your custom trash command or "manual delete" command be?
Just delete the File/folder selected from the GUI
Move to Trash will probably just delete the file, or maybe fail with an error message, when the underlying platform does not have a trash or recycle bin, i.e. it'll probably only work on typical Desktop platforms, Windows, macOS, and standard Desktop Linux.
Nothing Happen when I click the command
What does the log say?
[app ] The MOVE_TO_TRASH action is not supported on the current platform!

Re: MoveToTrash doesn't work

Posted: 14 Jan 2023, 17:41
by rednoah
I see. If you're running FileBot inside a docker container, then "Move to Trash" can't possibly work in the context of the unRAID host platform.


:idea: Open / Reveal / Move to Trash all likely can't work in the docker context. We can make the error messages visible to the user instead of just printing it to the log to make this more clear.


:!: Making Move to Trash irrevocably delete files on non-standard Desktop platforms is feasible but might need a bit of consideration first. Moving files to some .Trash folder might make more sense, but also might not actually be what you want.



EDIT:

FileBot r9550 and higher will permanently delete files if the platform does not support "move to trash" operations.

Re: MoveToTrash doesn't work

Posted: 16 Jan 2023, 01:43
by Djoss
rednoah wrote: 14 Jan 2023, 17:41 I see. If you're running FileBot inside a docker container, then "Move to Trash" can't possibly work in the context of the unRAID host platform.
I just wanted to precise that the same behaviour (Move to trash not working) is also seen on a standard/normal Ubuntu 20.04 installation.

Re: MoveToTrash doesn't work

Posted: 16 Jan 2023, 03:31
by rednoah
FileBot r9558 and higher will support the trash <path> and gio trash <path> system command via the

Code: Select all

-Dnet.filebot.UserFiles.trash=XDG
system property.


EDIT:

:idea: The trash <path> and gio trash <path> system commands probably won't do anything in docker container though, so Move to Trash will try and fail and then delete permanently. It should work on a standard Ubuntu Linux Desktop though, if the JDK implementation somehow doesn't work. I don't know if the JDK implements this feature on Linux. Perhaps it's only implemented on Windows and macOS.