diff --git a/docs/events/index.rst b/docs/events/index.rst index 2ef7d2d70..71c8dcc2b 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -246,6 +246,7 @@ FileAdded * ``name``: the file's name * ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or ``["model", "stl"]`` + * ``operation``: the operation that triggered the event, either ``add``, ``copy`` or ``move``. .. note:: @@ -263,6 +264,7 @@ FileRemoved * ``name``: the file's name * ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or ``["model", "stl"]`` + * ``operation``: the operation that triggered the event, either ``remove`` or ``move`` .. note:: diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index ba9e760d7..2fb8f31f4 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -769,6 +769,7 @@ class FileManager: "path": path, "name": name, "type": get_file_type(name), + "operation": "remove", }, ) eventManager().fire(Events.UPDATED_FILES, {"type": "printables"}) @@ -814,6 +815,7 @@ class FileManager: "path": source_path_in_storage, "name": source_name, "type": get_file_type(source_name), + "operation": "move", }, ) eventManager().fire(