diff options
| author | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
| commit | 836d21a7c43f4ce84dfa1ada0552989be4a43ca9 (patch) | |
| tree | fe6dc637c2c916e10b1beff31d687edf0f994503 /internal/entry/entry.go | |
| parent | 1550fbf9c2b0602c4675f25cd92e389593894e58 (diff) | |
use of platform aliases
Diffstat (limited to 'internal/entry/entry.go')
| -rw-r--r-- | internal/entry/entry.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/entry/entry.go b/internal/entry/entry.go index d289e83..e71f25b 100644 --- a/internal/entry/entry.go +++ b/internal/entry/entry.go @@ -11,6 +11,7 @@ import ( "codeberg.org/snonux/gos/internal/config" "codeberg.org/snonux/gos/internal/oi" + "codeberg.org/snonux/gos/internal/platforms" "codeberg.org/snonux/gos/internal/prompt" "codeberg.org/snonux/gos/internal/timestamp" ) @@ -155,10 +156,10 @@ func (en Entry) HasTag(tag string) bool { // Valid tags are: share:foo[,...] // whereas foo can be a supported plutform such as linkedin, mastodon, etc. // foo can also be prefixed with - to exclude it. See unit tests for examples. -func (en Entry) PlatformExcluded(args config.Args, platform string) (bool, error) { +func (en Entry) PlatformExcluded(args config.Args, platform platforms.Platform) (bool, error) { s, err := newShareTags(args, en.tags) - return slices.Contains(s.excludes, strings.ToLower(platform)) || - !slices.Contains(s.includes, strings.ToLower(platform)), err + return slices.Contains(s.excludes, platform.String()) || + !slices.Contains(s.includes, platform.String()), err } func (en Entry) Edit() error { |
