diff --git a/workflow/directory-structure.md b/workflow/directory-structure.md index 609b3a7..068a924 100644 --- a/workflow/directory-structure.md +++ b/workflow/directory-structure.md @@ -42,9 +42,167 @@ It renames the directory structure based on a combination of fields separated by ``` Reserve shows are downloaded and submitted by the Janitors on behalf of the host. This follows the normal posting process where the host and Janitors are cc'd on the notification emails. The only difference is that the audio is edited to include a notification that the show is from the reserve queue, and that it is the Janitors that upload the show via the supplied link. +## Show Processing + +### Adding the host to the `hosts` table + +This is currently added manually by the Janitors, as the text to speech tools often requires manipulation to get it sounding correct. + +``` +-- +-- Table structure for table `hosts` +-- + +DROP TABLE IF EXISTS `hosts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `hosts` ( + `hostid` int(10) NOT NULL AUTO_INCREMENT, + `host` text NOT NULL, + `email` text NOT NULL, + `profile` text NOT NULL, + `license` varchar(11) NOT NULL DEFAULT 'CC-BY-SA', + `local_image` int(2) NOT NULL DEFAULT 0, + `gpg` text NOT NULL, + `valid` int(1) NOT NULL DEFAULT 1, + `espeak_name` text DEFAULT NULL COMMENT 'Version of the host name for use with espeak', + PRIMARY KEY (`hostid`) +) ENGINE=MyISAM AUTO_INCREMENT=437 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +``` + + + + + + + + + + + + +The hosts email address with the `@` replaced with `.nospam@nospam.` as an antispam measure + + + + + + + +
FieldDescriptionExample
hostidAutomatically generated incrementing number.987
hostThe name or handle of the host.Emperor Ming
emailEmperor.Ming.nospam@nospam.example.com
profileA html host profile<p>Follow me Mastodon: <a rel="me" href="https://mastodon.example.org/@Emperor.Ming">@Emperor.Ming@mastodon.example.org</a></p>
licenseOne of the allowed licensesCC-BY-SA
local_imageIf a avatar is available directly from the host.1
gpgWe can verify the hosts emails, with [thought to automatically verify](https://repo.anhonesthost.net/HPR/hpr-tools/issues/4).1C7398B00F0239E8
validAllows temporary de-listing of host0
espeak_nameThe text to speech version of the name or handle.Fifty One Fifty
+ +Host Images/Avatars, can either be: + +Local Images uploaded when the host submits or edits their profile. + +Gravatar Images downloaded periodically by the Janitors. + +[Default Images](https://repo.anhonesthost.net/HPR/hpr_generator/src/branch/main/public_html/images/hpr_logo.png) added by [hpr_generator](https://repo.anhonesthost.net/HPR/hpr_generator/src/branch/main/templates/shared-avatar.tpl.html) when the host has no other image. + +All the images are [currently](https://repo.anhonesthost.net/HPR/hpr_generator/issues/234) stored in the [hpr_generator](https://repo.anhonesthost.net/HPR/hpr_generator/src/branch/main/public_html/images/hosts) repository, and get transferred to the server using [hpr-publish.bash](https://repo.anhonesthost.net/HPR/hpr-tools/src/branch/main/workflow/hpr-publish.bash). + +### Adding the episode to the `eps` table + +The script [postshow.bash](https://repo.anhonesthost.net/HPR/hpr-tools/src/branch/main/workflow/postshow.bash) is run locally on the Janitors computer. +It calls the HPR CMS script [status.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/cms/status.php) to return a tab separated list of the shows in the queue. + +``` +timestamp_epoc ep_num ep_date key status email +2339594445 9278 2044-02-24 aeb0579fcac318005d7550a60fd60403676c24d94148b SHOW_SUBMITTED joe.blogg.nospam@nospam.example.com +2339680845 9999 1970-01-01 4bd713699e5bc0978d5fef85a60f09bc7f70ef3488624 RESERVE_SHOW_SUBMITTED Emperor.Ming.nospam@nospam.example.com +``` +It selects the first show with a status of `SHOW_SUBMITTED` and uses `rsync` to clone the directory locally. It then parses the `shownotes.json` file and extracts the shownotes object to a new file `shownotes.html`. + +All embedded images are saved as local image files, with the format `hpr${ep_num}_${image_count}` based on "episode number", a underscore as delimiter, and then a sequential number of the image in the notes. eg `hpr9876_1.jpg`. + +Where they are images larger than 400 pixels wide, a thumbnail is created with the same image name but suffixed with `_tn`. eg `hpr9876_1_tn.jpg`. + +The Janitors then review the shownotes for issues. + +The duration will be extracted from the media, and the other metadata from the `shownotes.json` file. After some checks it will be [URL encoded](https://en.wikipedia.org/wiki/Percent-encoding). + +The script allows overwriting of any value in the json file from the command line, and also prevents posting from a new host that has not yet been assigned a entry in the `hosts` table. + +Once all the checks are done the script will `rsync` the formatted json, the shownotes html file, and any images back to the upload directory. + +Then it will use the `curl` command to POST the show to [add_show_json.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/cms/add_show_json.php). + +--- + +The HPR CMS script [add_show_json.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/cms/add_show_json.php) will validate the input, and add an entry into the `eps` table of the database. + +``` +-- +-- Table structure for table `eps` +-- + +DROP TABLE IF EXISTS `eps`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `eps` ( + `id` int(5) NOT NULL, + `date` date NOT NULL, + `title` varchar(100) NOT NULL, + `duration` int(5) NOT NULL, + `summary` varchar(100) NOT NULL, + `notes` text NOT NULL, + `hostid` int(10) NOT NULL, + `series` int(10) NOT NULL, + `explicit` tinyint(1) NOT NULL DEFAULT 1, + `license` varchar(11) NOT NULL DEFAULT 'CC-BY-SA', + `tags` varchar(200) NOT NULL, + `version` int(5) NOT NULL DEFAULT 0, + `downloads` int(11) NOT NULL, + `valid` int(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=1275 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +``` + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescriptionExample
idThis is the Episode Number that will uniquely identify the show.9278
dateThe date the show air, namely when it gets put in the main feed.2044-02-24
titleThis will be a short descriptive title and will be used to describe the show.
durationThe length of the submitted show without branding in seconds.2850
summaryThis is a short 100 character summary of what the show is about. Used on the main page, on the mobile site, on printed brochures, on text to speech announcements, Mastodon etc.
notesAdditional descriptions and images in html format.
hostidThe hosts.hostid of the host.789
seriesThe miniseries.id that the show belongs to.
explicitFlags the show as [explicit](https://web.archive.org/web/20150326185817/http://www.apple.com/uk/itunes/podcasts/specs.html).Clean or Yes
licenseWhich licenses.short_name the show is released under.CC-BY-SA
tagsAdd a list of comma separated tags that represent the essence of the show.
versionDeprecated.
downloadsDeprecated.
validAllows temporary de-listing of host.0
+ + + + + + + + + + + + + + ## Output Directory Structure -It should be possible to ship the entire backlog on physical media to someone, and have them plug it in and for any media player be able to play it. Each episode has it's own "album" which corresponds to a directory. The directory structure is kept as flat as possible with everything related to show eg: 9876 in a single directory `hpr9876`. This is the least common denominator, and in no way precludes web services, or other applications. +It should be possible to ship the entire backlog on physical media to someone, and have them plug it in and for any media player be able to play it. Each episode has it's own "album" which corresponds to a directory. The directory structure is kept as flat as possible with everything related to show eg: 9278 in a single directory `hpr9278`. This is the least common denominator, and in no way precludes web services, or other applications. We do however need to support other functionality so the _Episodes_ are kept inside of the `eps` directory, the _Hosts_ are in `hosts/`, and _Series_ are in `series/`. @@ -94,7 +252,7 @@ We need to base our requirements on our own requirements and not those imposed b It should be possible for someone to `rsync` the entire site and store it locally for use with a file manager/or media player. -To make file management clear all files must begin with the episode number `hpr9876`. +To make file management clear all files must begin with the episode number `hpr9278`. Supplemental files should be p