summaryrefslogtreecommitdiff
path: root/internal/app/view_helpers.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-10-03 19:53:04 +0300
committerPaul Buetow <paul@buetow.org>2025-10-03 19:53:04 +0300
commitdba07073652cb1bbad58d2e82329d07eefe3c12d (patch)
tree79df1afd3837b5efc46880eab9adf58381293dfc /internal/app/view_helpers.go
parent0ae149babf5ddf5eda22778b9e5e81567a180561 (diff)
Add tag editing UI and responsive layoutv0.2.2
Diffstat (limited to 'internal/app/view_helpers.go')
-rw-r--r--internal/app/view_helpers.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/app/view_helpers.go b/internal/app/view_helpers.go
index b023d62..9613d63 100644
--- a/internal/app/view_helpers.go
+++ b/internal/app/view_helpers.go
@@ -15,11 +15,11 @@ func videoRow(v video) table.Row {
duration = formatDuration(v.Duration)
}
age := humanizeAge(v.ModTime)
- path := trimPath(v.Path)
+ tags := formatTags(v.Tags)
if v.Err != nil {
duration = "!" + v.Err.Error()
}
- return table.Row{v.Name, duration, age, path}
+ return table.Row{v.Name, duration, age, tags}
}
func renderProgressBar(done, total, width int) string {
@@ -78,3 +78,10 @@ func trimPath(path string) string {
}
return path
}
+
+func formatTags(tags []string) string {
+ if len(tags) == 0 {
+ return "--"
+ }
+ return strings.Join(tags, ", ")
+}