strapi-plugin-radiocult-uploader 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/admin/App-Cd-TZrqC.mjs +1179 -0
- package/dist/admin/App-DTOuR7aY.js +1199 -0
- package/dist/admin/Settings-B3cZR7VF.mjs +516 -0
- package/dist/admin/Settings-DHv9SmRU.js +534 -0
- package/dist/admin/en-CTCtUg23.mjs +8 -0
- package/dist/admin/en-D_61ojL7.js +8 -0
- package/dist/admin/index-BLAtUo_j.js +334 -0
- package/dist/admin/index-Dj3e3A79.mjs +318 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/api.d.ts +107 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/Panel.d.ts +18 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/index.d.ts +3 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +6 -0
- package/dist/admin/src/pages/Settings.d.ts +8 -0
- package/dist/admin/src/pages/Uploader.d.ts +10 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/theme/tokens.d.ts +96 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/tokens-ACCekCH6.mjs +161 -0
- package/dist/admin/tokens-CDeNcvZq.js +178 -0
- package/dist/server/index.js +1193 -0
- package/dist/server/index.mjs +1165 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +17 -0
- package/dist/server/src/content-types/index.d.ts +51 -0
- package/dist/server/src/content-types/track-record/schema.json.d.ts +29 -0
- package/dist/server/src/controllers/index.d.ts +21 -0
- package/dist/server/src/controllers/settings.d.ts +16 -0
- package/dist/server/src/controllers/uploader.d.ts +10 -0
- package/dist/server/src/controllers/utils.d.ts +16 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +267 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin/index.d.ts +22 -0
- package/dist/server/src/routes/index.d.ts +19 -0
- package/dist/server/src/services/id3.d.ts +18 -0
- package/dist/server/src/services/index.d.ts +156 -0
- package/dist/server/src/services/mapping.d.ts +47 -0
- package/dist/server/src/services/radiocult.d.ts +115 -0
- package/dist/server/src/services/records.d.ts +25 -0
- package/dist/server/src/services/settings.d.ts +103 -0
- package/dist/server/src/utils/errors.d.ts +5 -0
- package/dist/server/src/utils/plugin.d.ts +4 -0
- package/logo.png +0 -0
- package/package.json +98 -0
- package/scripts/migrate-from-fields.mjs +78 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tom Willis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./logo.png" alt="Strapi + Radio Cult" width="180">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Radio Cult Uploader for Strapi
|
|
6
|
+
|
|
7
|
+
Upload radio show episodes to [Radio Cult](https://www.radiocult.fm/) and publish them onward to **SoundCloud** and **Mixcloud** — straight from the Strapi admin.
|
|
8
|
+
|
|
9
|
+
Built by [Sister Midnight FM](https://radio.sistermidnight.org/), a community radio station in South East London, for our own episode workflow — and made generic so any Radio Cult station running Strapi can use it.
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
- **Uploader page** in the admin: pick an episode, drag in the audio file (`.mp3`/`.m4a`, up to Radio Cult's 750MB limit), watch a real progress bar, and the track lands in your Radio Cult media library — with the episode's artwork embedded in the mp3's ID3 tag (Radio Cult has no artwork API; embedded art is the only way).
|
|
14
|
+
- **One-click publish** to SoundCloud and Mixcloud through Radio Cult's Connect endpoints, with title, tags, description and artwork.
|
|
15
|
+
- **Automatic link write-back**: when Radio Cult finishes transferring, the resulting SoundCloud/Mixcloud URLs are saved onto your episode entry automatically (checked every 10 minutes by a cron sweep, on page polls, and on demand). Publishes done by hand in the Radio Cult dashboard are picked up too.
|
|
16
|
+
- **Edit-view side panel** on your episode content type showing upload/publish state, with a button to open the uploader.
|
|
17
|
+
- **Title sync**: renaming an episode in Strapi renames the Radio Cult track.
|
|
18
|
+
- **Works with *your* content model**: a settings page maps your own content type and field names — nothing is imposed on your schema, and the plugin keeps its bookkeeping in its own hidden content type.
|
|
19
|
+
- **Themeable**: colour presets, a handful of colour overrides, a font (system or Google Fonts) and your own logo on the uploader page.
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
- Strapi **v5**
|
|
24
|
+
- Node **20+** (uploads stream files with `fs.openAsBlob`)
|
|
25
|
+
- A Radio Cult station with API access; third-party publishing (SoundCloud/Mixcloud) needs a Radio Cult plan that includes the Connect endpoints (Premium/Business or the Connect add-on)
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install strapi-plugin-radiocult-uploader
|
|
31
|
+
# or: yarn add strapi-plugin-radiocult-uploader
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then **raise the request body limit** so full-size episodes can reach the plugin — Strapi's default is 200MB. In `config/middlewares.ts` (or `.js`), replace the `'strapi::body'` line with:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
{
|
|
38
|
+
name: 'strapi::body',
|
|
39
|
+
config: {
|
|
40
|
+
formidable: {
|
|
41
|
+
maxFileSize: 800 * 1024 * 1024, // Radio Cult accepts up to 750MB
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Rebuild the admin (`npm run build`) and restart Strapi.
|
|
48
|
+
|
|
49
|
+
## Setup
|
|
50
|
+
|
|
51
|
+
Open **Settings → Radio Cult Uploader → Configuration**:
|
|
52
|
+
|
|
53
|
+
1. **Credentials** — paste your Radio Cult **API key** and **station ID**, then hit **Test connection**.
|
|
54
|
+
Prefer environment variables in production: `RADIOCULT_API_KEY`, `RADIOCULT_STATION_ID` and `RADIOCULT_ENABLED` always override what's stored here (the fields grey out when the env vars are set).
|
|
55
|
+
2. **Field mapping** — pick the content type your episodes live in. The plugin auto-matches fields by name and type; check them:
|
|
56
|
+
|
|
57
|
+
| Mapping | Field type | Used for |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| Title *(required)* | string/text | Track title on Radio Cult |
|
|
60
|
+
| Artwork image | media | Embedded in mp3s, sent to publishes |
|
|
61
|
+
| Broadcast date | date/datetime | Default album name, e.g. "August 2026" |
|
|
62
|
+
| SoundCloud link | string/text | The published URL is written here |
|
|
63
|
+
| Mixcloud link | string/text | The published URL is written here |
|
|
64
|
+
| Tags/genres relation | relation | Entries become publish tags (pick the label field too) |
|
|
65
|
+
| Show relation | relation | Optional — names the uploader browser tab |
|
|
66
|
+
|
|
67
|
+
3. **Publish defaults** — default artist (your station name) and default publish description.
|
|
68
|
+
4. **Uploader theme** — pick a preset (Paper, Midnight, Slate), a font (the system font or one of the bundled Google Fonts), tweak the six main colours, and set a station name and a logo (upload the logo in the Media Library and paste its URL). The preview updates live.
|
|
69
|
+
Google Fonts are fetched from `fonts.googleapis.com` / `fonts.gstatic.com` when a Google font is selected. If you have tightened `strapi::security`'s CSP, add those hosts to `style-src` and `font-src`, or stay on **System default**.
|
|
70
|
+
5. Check **Diagnostics** at the bottom — it warns if your Node version or body-size limit will block uploads, or if cron is disabled.
|
|
71
|
+
|
|
72
|
+
### Permissions
|
|
73
|
+
|
|
74
|
+
Any admin with access to your episode content type can use the uploader. The settings page is guarded by a dedicated permission — grant **Radio Cult Uploader → Access the settings** to non-super-admin roles under *Settings → Roles → Plugins*.
|
|
75
|
+
|
|
76
|
+
## Using it
|
|
77
|
+
|
|
78
|
+
1. Open an episode in the Content Manager. The **Upload to Soundcloud/Mixcloud/Radio Cult** panel sits on the right (entries must be saved first).
|
|
79
|
+
2. **Open Episode Uploader** → a themed page opens with three steps:
|
|
80
|
+
1. **Track details** — prefilled from the entry (title, artist, album, tags, description, artwork preview); edit freely, your Strapi entry is never changed by this form.
|
|
81
|
+
2. **Upload to Radio Cult** — drop the audio file in. mp3s get the artwork embedded. Re-uploading asks before replacing the existing track.
|
|
82
|
+
3. **Publish** — one button per platform. Radio Cult transfers asynchronously; the page polls and the link is written to your mapped link fields automatically. "Check for links now" forces a fresh look.
|
|
83
|
+
3. The activity log at the bottom keeps a timestamped record of everything that happened.
|
|
84
|
+
|
|
85
|
+
## Notes & limitations
|
|
86
|
+
|
|
87
|
+
- **One station per Strapi instance.** The plugin talks to a single Radio Cult station.
|
|
88
|
+
- **Mixcloud publishes may 402.** Radio Cult's docs say 402 means "not on your plan", but their Mixcloud endpoint has been observed returning `402 Internal server error` for *every* request even on plans where SoundCloud publishing works — a fault on Radio Cult's side. If that happens: publish the track by hand in the Radio Cult dashboard (Media → the track → Actions → Upload to Mixcloud). The plugin still detects the finished publish and saves the link to your entry (it watches recently uploaded tracks for up to 7 days).
|
|
89
|
+
- **m4a artwork**: artwork can only be embedded into mp3 files; m4a uploads reach Radio Cult without an image.
|
|
90
|
+
- **Artwork formats**: jpeg/png only; ≤10MB for embedding, ≤2MB for SoundCloud/Mixcloud publish artwork (the plugin picks the largest fitting size Strapi has generated).
|
|
91
|
+
- **Rate limits**: Radio Cult 429s are respected with automatic backoff; the UI tells you when to retry.
|
|
92
|
+
- **Draft & Publish**: link write-back writes directly to the stored entry (no publish cycle is triggered, and no other fields are touched).
|
|
93
|
+
- The plugin registers a **cron job** (`*/10 * * * *`) for link syncing — make sure cron is enabled in `config/server.ts` (`cron: { enabled: true }`) if you want links to land while nobody has the page open.
|
|
94
|
+
|
|
95
|
+
## Migrating from a pre-plugin setup
|
|
96
|
+
|
|
97
|
+
If you previously wired Radio Cult uploads into your app with bookkeeping fields on your own content type (`RadioCultTrackId`, `RadioCultUploadedAt`, …), a migration script ships in the plugin repository:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
RCU_DRY_RUN=true node scripts/migrate-from-fields.mjs # from the plugin repo, run at your app root
|
|
101
|
+
node scripts/migrate-from-fields.mjs
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
It copies the old field values into the plugin's track-records (see the script header for the env vars that change the source content type/field names). Afterwards you can delete the old fields from your schema.
|
|
105
|
+
|
|
106
|
+
## Environment variables
|
|
107
|
+
|
|
108
|
+
| Variable | Effect |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `RADIOCULT_API_KEY` | Radio Cult API key (overrides the settings page) |
|
|
111
|
+
| `RADIOCULT_STATION_ID` | Radio Cult station ID (overrides the settings page) |
|
|
112
|
+
| `RADIOCULT_ENABLED` | `false` switches the whole integration off |
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install
|
|
118
|
+
npm run build # build admin + server bundles
|
|
119
|
+
npm run watch:link # develop against a local Strapi app via yalc
|
|
120
|
+
npm run verify # pre-publish checks
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
[MIT](./LICENSE)
|
|
126
|
+
|
|
127
|
+
## Issues
|
|
128
|
+
|
|
129
|
+
Bugs and feature requests: [GitHub issues](https://github.com/SisterMidnightFM/Strapi-to-Radio-Cult-Plugin/issues).
|