Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListAttachments action.GTSAction = func(ctx context.Context) error { list, err := setupList(ctx) if err != nil { return err } defer func() { if err := list.shutdown(); err != nil { log.Error(ctx, err) } }() var ( mediaPath = config.GetStorageLocalBasePath() filter func(*gtsmodel.MediaAttachment) string ) switch { case list.localOnly: filter = func(m *gtsmodel.MediaAttachment) string { if m.RemoteURL != "" { return "" } return path.Join(mediaPath, m.File.Path) } case list.remoteOnly: filter = func(m *gtsmodel.MediaAttachment) string { if m.RemoteURL == "" { return "" } return path.Join(mediaPath, m.File.Path) } default: filter = func(m *gtsmodel.MediaAttachment) string { return path.Join(mediaPath, m.File.Path) } } attachments, err := list.GetAllAttachmentPaths(ctx, filter) if err != nil { return err } for _, a := range attachments { _, _ = list.out.WriteString(a + "\n") } return nil }
ListAttachments lists local, remote, or all attachment paths.
View Source
var ListEmojis action.GTSAction = func(ctx context.Context) error { list, err := setupList(ctx) if err != nil { return err } defer func() { if err := list.shutdown(); err != nil { log.Error(ctx, err) } }() var ( mediaPath = config.GetStorageLocalBasePath() filter func(*gtsmodel.Emoji) string ) switch { case list.localOnly: filter = func(e *gtsmodel.Emoji) string { if e.ImageRemoteURL != "" { return "" } return path.Join(mediaPath, e.ImagePath) } case list.remoteOnly: filter = func(e *gtsmodel.Emoji) string { if e.ImageRemoteURL == "" { return "" } return path.Join(mediaPath, e.ImagePath) } default: filter = func(e *gtsmodel.Emoji) string { return path.Join(mediaPath, e.ImagePath) } } emojis, err := list.GetAllEmojisPaths(ctx, filter) if err != nil { return err } for _, e := range emojis { _, _ = list.out.WriteString(e + "\n") } return nil }
ListEmojis lists local, remote, or all emoji filepaths.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.