From 500abc2d92a29302769751c0f5cc216b44b16d9e Mon Sep 17 00:00:00 2001 From: DrMint Date: Mon, 14 Feb 2022 06:16:52 +0100 Subject: [PATCH] Added subtype for video and more langui --- .../content-types/video-subtype/schema.json | 26 +++++++++ .../controllers/video-subtype.js | 9 ++++ src/api/video-subtype/routes/video-subtype.js | 9 ++++ .../video-subtype/services/video-subtype.js | 9 ++++ .../website-interface/schema.json | 54 +++++++++++++++++++ src/components/metadata/audio.json | 5 -- src/components/metadata/video.json | 18 +------ 7 files changed, 109 insertions(+), 21 deletions(-) create mode 100644 src/api/video-subtype/content-types/video-subtype/schema.json create mode 100644 src/api/video-subtype/controllers/video-subtype.js create mode 100644 src/api/video-subtype/routes/video-subtype.js create mode 100644 src/api/video-subtype/services/video-subtype.js diff --git a/src/api/video-subtype/content-types/video-subtype/schema.json b/src/api/video-subtype/content-types/video-subtype/schema.json new file mode 100644 index 0000000..680ef66 --- /dev/null +++ b/src/api/video-subtype/content-types/video-subtype/schema.json @@ -0,0 +1,26 @@ +{ + "kind": "collectionType", + "collectionName": "video_subtypes", + "info": { + "singularName": "video-subtype", + "pluralName": "video-subtypes", + "displayName": "Video Subtypes", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "slug": { + "type": "string", + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "unique": true, + "required": true + }, + "titles": { + "type": "component", + "repeatable": true, + "component": "translations.simple-title" + } + } +} diff --git a/src/api/video-subtype/controllers/video-subtype.js b/src/api/video-subtype/controllers/video-subtype.js new file mode 100644 index 0000000..535e21c --- /dev/null +++ b/src/api/video-subtype/controllers/video-subtype.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-subtype controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::video-subtype.video-subtype'); diff --git a/src/api/video-subtype/routes/video-subtype.js b/src/api/video-subtype/routes/video-subtype.js new file mode 100644 index 0000000..29d01b6 --- /dev/null +++ b/src/api/video-subtype/routes/video-subtype.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-subtype router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::video-subtype.video-subtype'); diff --git a/src/api/video-subtype/services/video-subtype.js b/src/api/video-subtype/services/video-subtype.js new file mode 100644 index 0000000..a0515ff --- /dev/null +++ b/src/api/video-subtype/services/video-subtype.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * video-subtype service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::video-subtype.video-subtype'); diff --git a/src/api/website-interface/content-types/website-interface/schema.json b/src/api/website-interface/content-types/website-interface/schema.json index 5ef5127..157bdc1 100644 --- a/src/api/website-interface/content-types/website-interface/schema.json +++ b/src/api/website-interface/content-types/website-interface/schema.json @@ -147,6 +147,60 @@ }, "chronology_walkthrough_description": { "type": "string" + }, + "library_item_front_matter": { + "type": "string" + }, + "library_item_back_matter": { + "type": "string" + }, + "library_item_type_textual": { + "type": "string" + }, + "library_item_type_audio": { + "type": "string" + }, + "library_item_type_game": { + "type": "string" + }, + "library_item_type_video": { + "type": "string" + }, + "library_item_type_other": { + "type": "string" + }, + "library_item_open_content": { + "type": "string" + }, + "library_item_view_scans": { + "type": "string" + }, + "content_read_content": { + "type": "string" + }, + "content_watch_content": { + "type": "string" + }, + "content_listen_content": { + "type": "string" + }, + "global_category": { + "type": "string" + }, + "global_categories": { + "type": "string" + }, + "global_paperback": { + "type": "string" + }, + "global_hardcover": { + "type": "string" + }, + "global_left_to_right": { + "type": "string" + }, + "global_right_to_left": { + "type": "string" } } } diff --git a/src/components/metadata/audio.json b/src/components/metadata/audio.json index 7437316..9d9e22a 100644 --- a/src/components/metadata/audio.json +++ b/src/components/metadata/audio.json @@ -7,11 +7,6 @@ }, "options": {}, "attributes": { - "languages": { - "type": "relation", - "relation": "oneToMany", - "target": "api::language.language" - }, "subtype": { "type": "relation", "relation": "oneToOne", diff --git a/src/components/metadata/video.json b/src/components/metadata/video.json index 49da2c7..8fc473b 100644 --- a/src/components/metadata/video.json +++ b/src/components/metadata/video.json @@ -7,24 +7,10 @@ }, "options": {}, "attributes": { - "resolution": { - "type": "enumeration", - "enum": [ - "SD_480p", - "HD_720p", - "FullHD_1080p", - "QuadHD_2160p" - ] - }, - "audio_languages": { - "type": "relation", - "relation": "oneToMany", - "target": "api::language.language" - }, - "sub_languages": { + "subtype": { "type": "relation", "relation": "oneToOne", - "target": "api::language.language" + "target": "api::video-subtype.video-subtype" } } }