Skip to content

feat(cms): add video-subtitle content type schema#486

Open
lumberman wants to merge 1 commit intomainfrom
cursor/feat/464-video-subtitle-content-type
Open

feat(cms): add video-subtitle content type schema#486
lumberman wants to merge 1 commit intomainfrom
cursor/feat/464-video-subtitle-content-type

Conversation

@lumberman
Copy link
Collaborator

@lumberman lumberman commented Mar 16, 2026

Summary

Describe the bounded change and reason. PR title must use type(scope): description (e.g. feat(web): add validation).

Contracts Changed

  • yes
  • no

Regeneration Required

  • yes
  • no

Validation

  • Contracts validated
  • Generated code verified (no manual edits)
  • Tests and build passed

Summary by CodeRabbit

  • New Features
    • Added video subtitle management capabilities with support for multiple languages and editions
    • Enable tracking of subtitle versions and source attribution (AI or human-generated)
    • Support for marking primary subtitles and managing different subtitle variants

@lumberman lumberman requested a review from a team as a code owner March 16, 2026 20:05
@railway-app
Copy link

railway-app bot commented Mar 16, 2026

This PR was not deployed automatically as @lumberman does not have access to the Railway project.

In order to get automatic PR deploys, please add @lumberman to your workspace on Railway.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Walkthrough

A new Strapi content-type schema file is added to define a "video-subtitle" collection type with fields for video ID, language ID, edition, VTT source content, version number, primary status, and source type (AI or human-generated).

Changes

Cohort / File(s) Summary
Video Subtitle Schema
apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json
Adds new collectionType "video-subtitle" with required videoId and languageId fields, configurable edition and source type, and subtitle versioning; no draft/publish workflow enabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cms): add video-subtitle content type schema' directly and specifically describes the main change: adding a new video-subtitle content type schema to the CMS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/feat/464-video-subtitle-content-type
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (4)
apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json (4)

36-40: Align enum order with existing CREATED_BY_TYPES constant.

The source enum uses ["ai", "human"] while packages/content-models/src/index.ts defines CREATED_BY_TYPES = ["human", "ai"]. Consider aligning the order for consistency across the codebase.

📝 Suggested change
     "source": {
       "type": "enumeration",
-      "enum": ["ai", "human"],
+      "enum": ["human", "ai"],
       "default": "ai"
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json`
around lines 36 - 40, The enum order for the "source" field in the
video-subtitle schema is reversed compared to the CREATED_BY_TYPES constant;
update the "source" enumeration in
apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json to
match the order used by CREATED_BY_TYPES (i.e., ["human", "ai"]) so they are
consistent across the codebase, keeping the same default value unless
intentional otherwise; look for the "source" field in that schema and align its
enum order with CREATED_BY_TYPES in packages/content-models/src/index.ts.

4-8: Consider adding a description field for consistency.

The info block is missing a description field that the video schema includes. Adding a description improves documentation and admin UI clarity.

📝 Suggested addition
   "info": {
     "singularName": "video-subtitle",
     "pluralName": "video-subtitles",
-    "displayName": "Video Subtitle"
+    "displayName": "Video Subtitle",
+    "description": "Subtitle tracks for videos with language and edition variants"
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json`
around lines 4 - 8, Add a description property to the info object in the
video-subtitle schema to match the video schema and improve admin UI clarity:
update the "info" block for the content type with a "description" string that
succinctly describes the content type (e.g., purpose of "video-subtitle" for
storing subtitle tracks or captions), ensuring it sits alongside "singularName",
"pluralName", and "displayName" in the schema.json so tools consuming the "info"
object (video-subtitle) display consistent metadata.

9-11: Add pluginOptions for consistency with other schemas.

The video schema includes "pluginOptions": {} even when empty. Adding this ensures consistency and provides a placeholder for future plugin configuration.

📝 Suggested addition
   "options": {
     "draftAndPublish": false
   },
+  "pluginOptions": {},
   "attributes": {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json`
around lines 9 - 11, The schema is missing the top-level "pluginOptions" key for
consistency; add a "pluginOptions": {} object next to the existing "options"
block (the same place where "options": { "draftAndPublish": false } is defined)
so the video-subtitle content type matches other schemas and provides a
placeholder for future plugin configuration.

13-24: Consider adding a unique constraint to prevent duplicate subtitle entries.

Without a uniqueness constraint on the combination of videoId, languageId, and edition, the system could allow duplicate subtitle records for the same video/language/edition combination. This may cause ambiguity when querying which subtitle to use.

Strapi supports the "unique": true field in schema attributes. You could add this directly to the individual fields if each should be unique, or implement validation in a lifecycle hook to enforce composite uniqueness on the three-field combination. Alternatively, create a synthetic unique field combining the three values.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json`
around lines 13 - 24, Add enforcement to prevent duplicate subtitles for the
same video/language/edition by either marking individual fields as unique or
implementing composite uniqueness: update the schema attributes for videoId,
languageId, and edition (symbols: "videoId", "languageId", "edition") to include
"unique": true if they must be standalone-unique, or create a synthetic field
(e.g., concat of videoId|languageId|edition) and mark that synthetic field
unique in the schema, or implement a lifecycle hook (e.g.,
beforeCreate/beforeUpdate in the video-subtitle model) that checks for an
existing record with the same videoId, languageId, and edition and throws a
validation error to enforce composite uniqueness.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json`:
- Around line 36-40: The enum order for the "source" field in the video-subtitle
schema is reversed compared to the CREATED_BY_TYPES constant; update the
"source" enumeration in
apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json to
match the order used by CREATED_BY_TYPES (i.e., ["human", "ai"]) so they are
consistent across the codebase, keeping the same default value unless
intentional otherwise; look for the "source" field in that schema and align its
enum order with CREATED_BY_TYPES in packages/content-models/src/index.ts.
- Around line 4-8: Add a description property to the info object in the
video-subtitle schema to match the video schema and improve admin UI clarity:
update the "info" block for the content type with a "description" string that
succinctly describes the content type (e.g., purpose of "video-subtitle" for
storing subtitle tracks or captions), ensuring it sits alongside "singularName",
"pluralName", and "displayName" in the schema.json so tools consuming the "info"
object (video-subtitle) display consistent metadata.
- Around line 9-11: The schema is missing the top-level "pluginOptions" key for
consistency; add a "pluginOptions": {} object next to the existing "options"
block (the same place where "options": { "draftAndPublish": false } is defined)
so the video-subtitle content type matches other schemas and provides a
placeholder for future plugin configuration.
- Around line 13-24: Add enforcement to prevent duplicate subtitles for the same
video/language/edition by either marking individual fields as unique or
implementing composite uniqueness: update the schema attributes for videoId,
languageId, and edition (symbols: "videoId", "languageId", "edition") to include
"unique": true if they must be standalone-unique, or create a synthetic field
(e.g., concat of videoId|languageId|edition) and mark that synthetic field
unique in the schema, or implement a lifecycle hook (e.g.,
beforeCreate/beforeUpdate in the video-subtitle model) that checks for an
existing record with the same videoId, languageId, and edition and throws a
validation error to enforce composite uniqueness.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7f55d33-7ce1-4207-9126-6a8dfdd0b9c8

📥 Commits

Reviewing files that changed from the base of the PR and between 13afa57 and 3042fd6.

📒 Files selected for processing (1)
  • apps/cms/src/api/video-subtitle/content-types/video-subtitle/schema.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant