diff options
author | 2023-08-23 18:01:16 +0200 | |
---|---|---|
committer | 2023-08-23 18:01:16 +0200 | |
commit | 7b48437f172e11daa77c842b18813d5654143cb0 (patch) | |
tree | 51076d12313718ca0e1b8ffe1dce37a2b866c97c /cmd/gotosocial/admin.go | |
parent | [feature] Add rate limit exceptions option, use ISO8601 for rate limit reset ... (diff) | |
download | gotosocial-7b48437f172e11daa77c842b18813d5654143cb0.tar.xz |
[feature] list commands for both attachment and emojis (#2121)
* [feature] list commands for both attachment and emojis
* use fewer commands, provide `local-only` and `remote-only` as filters
* envparsing
---------
Co-authored-by: Romain de Laage <romain.delaage@rdelaage.ovh>
Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
Diffstat (limited to 'cmd/gotosocial/admin.go')
-rw-r--r-- | cmd/gotosocial/admin.go | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cmd/gotosocial/admin.go b/cmd/gotosocial/admin.go index a8aab810e..3b2ea69e3 100644 --- a/cmd/gotosocial/admin.go +++ b/cmd/gotosocial/admin.go @@ -178,29 +178,31 @@ func adminCommands() *cobra.Command { ADMIN MEDIA LIST COMMANDS */ - adminMediaListLocalCmd := &cobra.Command{ - Use: "list-local", - Short: "admin command to list media on local storage", + adminMediaListAttachmentsCmd := &cobra.Command{ + Use: "list-attachments", + Short: "list local, remote, or all attachments", PreRunE: func(cmd *cobra.Command, args []string) error { return preRun(preRunArgs{cmd: cmd}) }, RunE: func(cmd *cobra.Command, args []string) error { - return run(cmd.Context(), media.ListLocal) + return run(cmd.Context(), media.ListAttachments) }, } + config.AddAdminMediaList(adminMediaListAttachmentsCmd) + adminMediaCmd.AddCommand(adminMediaListAttachmentsCmd) - adminMediaListRemoteCmd := &cobra.Command{ - Use: "list-remote", - Short: "admin command to list remote media cached on this instance", + adminMediaListEmojisLocalCmd := &cobra.Command{ + Use: "list-emojis", + Short: "list local, remote, or all emojis", PreRunE: func(cmd *cobra.Command, args []string) error { return preRun(preRunArgs{cmd: cmd}) }, RunE: func(cmd *cobra.Command, args []string) error { - return run(cmd.Context(), media.ListRemote) + return run(cmd.Context(), media.ListEmojis) }, } - - adminMediaCmd.AddCommand(adminMediaListLocalCmd, adminMediaListRemoteCmd) + config.AddAdminMediaList(adminMediaListEmojisLocalCmd) + adminMediaCmd.AddCommand(adminMediaListEmojisLocalCmd) /* ADMIN MEDIA PRUNE COMMANDS |