| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/local/plugin/group_delete/ |
Upload File : |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2000 - present Synology Inc. All rights reserved.
from os import environ
from importlib.util import spec_from_file_location, module_from_spec
module_name = "common"
module_path = "/var/packages/SynologyPhotos/target/sdk-plugin/common.py"
spec = spec_from_file_location(module_name, module_path)
common = module_from_spec(spec)
spec.loader.exec_module(common)
class GroupDelete(common.PluginRunner):
# @override
def post(self):
if "0" != environ.get("RESULT"):
return None
delete_group_names = []
n_items = int(environ.get("NITEMS"))
for i in range(1, n_items + 1):
group_name = environ.get("GROUP_NAME_{}".format(i))
group_op_result = environ.get("GROUP_OP_RESULT_{}".format(i))
delete_group_names.append(group_name)
if len(delete_group_names) > 0:
self.send_command("group-delete", {"group_name": delete_group_names})
common.MainBody(GroupDelete())