Skip to content

Commit a833b60

Browse files
authored
feat: Video Trimmer and more
1 parent ab4d9d6 commit a833b60

102 files changed

Lines changed: 13265 additions & 522 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ static/drf-yasg
1818
cms/local_settings.py
1919
deploy/docker/local_settings.py
2020
yt.readme.md
21+
/frontend-tools/video-editor/node_modules
22+
/frontend-tools/video-editor/client/node_modules
23+
/static_collected
24+
/frontend-tools/video-editor-v1

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

cms/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@
496496
USE_IDENTITY_PROVIDERS = False
497497
JAZZMIN_UI_TWEAKS = {"theme": "flatly"}
498498

499+
USE_ROUNDED_CORNERS = True
499500

500501
try:
501502
# keep a local_settings.py file for local overrides

deploy/scripts/build_and_deploy.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Exit on any error
4+
set -e
5+
6+
echo "Starting build process..."
7+
8+
# Build video editor package
9+
echo "Building video editor package..."
10+
cd frontend-tools/video-editor
11+
yarn build:django
12+
cd ../../
13+
14+
# Run npm build in the frontend container
15+
echo "Building frontend assets..."
16+
docker compose -f docker-compose/docker-compose-dev-updated.yaml exec frontend npm run dist
17+
18+
# Copy static assets to the static directory
19+
echo "Copying static assets..."
20+
cp -r frontend/dist/static/* static/
21+
22+
# Restart the web service
23+
echo "Restarting web service..."
24+
docker compose -f docker-compose/docker-compose-dev-updated.yaml restart web
25+
26+
echo "Build and deployment completed successfully!"

docker-compose/docker-compose-dev-updated.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
name: mediacms-dev
12
services:
23
migrations:
34
platform: linux/amd64
45
build:
5-
context: .
6-
dockerfile: ./Dockerfile
6+
context: ..
7+
dockerfile: Dockerfile
78
args:
89
- DEVELOPMENT_MODE=True
910
image: mediacms/mediacms:latest
1011
volumes:
11-
- ./:/home/mediacms.io/mediacms/
12-
command: "./deploy/docker/prestart.sh"
12+
- ../:/home/mediacms.io/mediacms/
13+
command: "/home/mediacms.io/mediacms/deploy/docker/prestart.sh"
1314
environment:
1415
DEVELOPMENT_MODE: True
1516
ENABLE_UWSGI: 'no'
@@ -95,13 +96,13 @@ services:
9596
ports:
9697
- "80:80"
9798
volumes:
98-
- ./:/home/mediacms.io/mediacms/
99+
- ../:/home/mediacms.io/mediacms/
99100
depends_on:
100101
- migrations
101102
db:
102103
image: postgres:17.2-alpine
103104
volumes:
104-
- ./postgres_data:/var/lib/postgresql/data/
105+
- ../postgres_data:/var/lib/postgresql/data/
105106
restart: always
106107
environment:
107108
POSTGRES_USER: mediacms
@@ -127,7 +128,7 @@ services:
127128
deploy:
128129
replicas: 1
129130
volumes:
130-
- ./:/home/mediacms.io/mediacms/
131+
- ../:/home/mediacms.io/mediacms/
131132
environment:
132133
ENABLE_UWSGI: 'no'
133134
ENABLE_NGINX: 'no'

docs/admins_docs.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,8 @@ This will disable the transcoding process and only the original file will be sho
809809

810810
## 19. Rounded corners on videos
811811

812-
By default the video player and media items are now having rounded corners, on larger screens (not in mobile). If you don't like this change, remove the `border-radius` added on the following files:
812+
By default the video player and media items are now having rounded corners, on larger screens (not in mobile). If you don't like this change, set `USE_ROUNDED_CORNERS = False` in `local_settings.py`.
813813

814-
```
815-
frontend/src/static/css/_extra.css
816-
frontend/src/static/js/components/list-item/Item.scss
817-
frontend/src/static/js/components/media-page/MediaPage.scss
818-
```
819-
you now have to re-run the frontend build in order to see the changes (check docs/dev_exp.md)
820814

821815

822816
## 20. Translations
@@ -879,7 +873,7 @@ By default there are 3 statuses for any Media that lives on the system, public,
879873

880874
Now user can view the Media even if it is in private state. User also sees all media in Category page
881875

882-
When user is added to group, they can be set as Member, Contributor, Manager.
876+
When user is added to group, they can be set as Member, Contributor, Manager.
883877

884878
- Member: user can view media that are published on one or more categories that this group is associated with
885879
- Contributor: besides viewing, user can also edit the Media in a category associated with this Group. They can also publish Media to this category
@@ -891,17 +885,17 @@ Use cases facilitated with RBAC:
891885
- viewing all media of a category: if RBAC is enabled, and user visits a Category, they are able to see the listing of all media that are published in this category, independent of their state, provided that the category is associated with a group that the user is member of
892886
- viewing all categories associated with groups the user is member of: if RBAC is enabled, and user visits the listing of categories, they can view all categories that are associated with a group the user is member
893887

894-
How to enable RBAC support:
888+
How to enable RBAC support:
895889

896890
```
897891
USE_RBAC = True
898892
```
899893

900-
on `local_settings.py` and restart the instance.
894+
on `local_settings.py` and restart the instance.
901895

902896

903897
## 23. SAML setup
904-
SAML authentication is supported along with the option to utilize the SAML response and do useful things as setting up the user role in MediaCMS or participation in groups.
898+
SAML authentication is supported along with the option to utilize the SAML response and do useful things as setting up the user role in MediaCMS or participation in groups.
905899

906900
To enable SAML support, edit local_settings.py and set the following options:
907901

@@ -942,8 +936,8 @@ Select the SAML Configurations tab, create a new one and set:
942936

943937
1. **IDP ID**: Must be a URL
944938
2. **IDP Certificate**: x509cert from your SAML provider
945-
3. **SSO URL**:
946-
4. **SLO URL**:
939+
3. **SSO URL**:
940+
4. **SLO URL**:
947941
5. **SP Metadata URL**: The metadata URL that the IDP will utilize. This can be https://{portal}/saml/metadata and is autogenerated by MediaCMS
948942

949943
- Step 3: Set other Options
@@ -971,5 +965,5 @@ to enable the identity providers, set the following setting on `local_settings.p
971965
USE_IDENTITY_PROVIDERS = True
972966
```
973967

974-
Visiting the admin, you will see the Identity Providers tab and you can add one.
968+
Visiting the admin, you will see the Identity Providers tab and you can add one.
975969

files/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Encoding,
1414
Language,
1515
Media,
16+
VideoTrimRequest,
1617
Subtitle,
1718
Tag,
1819
)
@@ -198,6 +199,9 @@ class LanguageAdmin(admin.ModelAdmin):
198199
class SubtitleAdmin(admin.ModelAdmin):
199200
pass
200201

202+
class VideoTrimRequestAdmin(admin.ModelAdmin):
203+
pass
204+
201205

202206
class EncodingAdmin(admin.ModelAdmin):
203207
list_display = ["get_title", "chunk", "profile", "progress", "status", "has_file"]
@@ -222,5 +226,6 @@ def has_file(self, obj):
222226
admin.site.register(Tag, TagAdmin)
223227
admin.site.register(Subtitle, SubtitleAdmin)
224228
admin.site.register(Language, LanguageAdmin)
229+
admin.site.register(VideoTrimRequest, VideoTrimRequestAdmin)
225230

226231
Media._meta.app_config.verbose_name = "Media"

files/context_processors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def stuff(request):
3535
ret["TRANSLATION"] = get_translation(request.LANGUAGE_CODE)
3636
ret["REPLACEMENTS"] = get_translation_strings(request.LANGUAGE_CODE)
3737
ret["USE_SAML"] = settings.USE_SAML
38+
ret["USE_RBAC"] = settings.USE_RBAC
39+
ret["USE_ROUNDED_CORNERS"] = settings.USE_ROUNDED_CORNERS
40+
3841
if request.user.is_superuser:
3942
ret["DJANGO_ADMIN_URL"] = settings.DJANGO_ADMIN_URL
4043

0 commit comments

Comments
 (0)