From 68b75fa891253719a4065da1c826c023c76724a4 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Tue, 22 Sep 2020 21:29:55 +1000 Subject: [PATCH] Add tags and video_tags database columns tags is a sheet input which provides a default list of tags for the editor. video_tags is set upon the video being edited and is used by the cutter to set video tags on supported upload locations. --- DATABASE.md | 2 ++ postgres/setup.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/DATABASE.md b/DATABASE.md index 01946c9..3007cf6 100644 --- a/DATABASE.md +++ b/DATABASE.md @@ -133,12 +133,14 @@ columns | type | role | `poster_moment` | `BOOLEAN NOT NULL DEFAULT FALSE` | sheet input | Whether or not the event was featured on the poster. Used for building the postermap and also displayed on the public sheet. `image_links` | `TEXT[] NOT NULL` | sheet input | Any additional gif or image links associated with the event. Displayed on the public sheet. `notes` | `TEXT NOT NULL DEFAULT ''` | sheet input | Private notes on this event, used eg. to leave messages or special instructions. Displayed to the editor during editing, but otherwise unused. +`tags` | `TEXT[] NOT NULL` | sheet input | Custom tags to annotate this event's video with. Provides the default tags that the editor can then adjust. `allow_holes` | `BOOLEAN NOT NULL DEFAULT FALSE` | edit input | If false, any missing segments encountered while cutting will cause the cut to fail. Setting this to true should be done by an operator to indicate that holes are expected in this range. It is also the operator's responsibility to ensure that all allowed cutters have all segments that they can get, since there is no guarentee that only the cutter with the least missing segments will get the cut job. `uploader_whitelist` | `TEXT[]` | edit input | List of uploaders which are allowed to cut this entry, or NULL to indicate no restriction. This is useful if you are allowing holes and the amount of missing data differs between nodes (this shouldn't happen - this would mean replication is also failing), or if an operator is investigating a problem with a specific node. `upload_location` | `TEXT` | edit input | The upload location to upload the cut video to. This is used by the cutter, and must match one of the cutter's configured upload locations. If it does not, the cutter will not claim the event. `video_start`, `video_end` | `TIMESTAMP` | edit input | Start and end time of the video to cut. If already set, used as the default trim times when editing. `video_title` | `TEXT` | edit input | The title of the video. If already set, used as the default title when editing instead of `description`. `video_description` | `TEXT` | edit input | The description field of the video. If already set, used as the default description when editing instead of `description`. +`video_tags` | `TEXT[]` | edit input | Custom tags to annotate the video with. If already set, used as the default when editing instead of `tags`. `video_channel` | `TEXT` | edit input | The twitch channel to cut the video from. If already set, used as the default channel selection when editing, instead of a pre-configured editor default. While this will almost always be the default value, it's a useful thing to be able to change should the need arise. `video_quality` | `TEXT NOT NULL DEFAULT 'source' | edit input | The stream quality to cut the video from. Used as the default quality selection when editing. While this will almost always be the default value, it's a useful thing to be able to change should the need arise. `state` | `ENUM NOT NULL DEFAULT 'UNEDITED'` | state | See "The state machine" above. diff --git a/postgres/setup.sh b/postgres/setup.sh index 4f63c7e..5f5d098 100644 --- a/postgres/setup.sh +++ b/postgres/setup.sh @@ -58,6 +58,7 @@ CREATE TABLE events ( poster_moment BOOLEAN NOT NULL DEFAULT FALSE, image_links TEXT[] NOT NULL DEFAULT '{}', -- default empty array notes TEXT NOT NULL DEFAULT '', + tags TEXT[] NOT NULL DEFAULT '{}', -- default empty array allow_holes BOOLEAN NOT NULL DEFAULT FALSE, uploader_whitelist TEXT[], upload_location TEXT CHECK (state = 'UNEDITED' OR upload_location IS NOT NULL), @@ -65,6 +66,7 @@ CREATE TABLE events ( video_end TIMESTAMP CHECK (state IN ('UNEDITED', 'DONE') OR video_end IS NOT NULL), video_title TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_title IS NOT NULL), video_description TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_description IS NOT NULL), + video_tags TEXT[] CHECK (state IN ('UNEDITED', 'DONE') OR video_tags IS NOT NULL), video_channel TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_channel IS NOT NULL), video_quality TEXT NOT NULL DEFAULT 'source', state event_state NOT NULL DEFAULT 'UNEDITED',