Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change download_url format #254

Open
lorddaedra opened this issue Jan 13, 2025 · 0 comments
Open

Change download_url format #254

lorddaedra opened this issue Jan 13, 2025 · 0 comments

Comments

@lorddaedra
Copy link

lorddaedra commented Jan 13, 2025

My MEDIA_URL is /media/ (default). I'm going to change it to https://media.domain.com/ in future. Wagtail used as a headless CMS (only for APIs and media files) and lives in https://cms.domain.com/admin.

Current url format for uploaded to Wagtail videos is:

{
    "meta": {
        "download_url": "https://cms.domain.com/media/media/my-video.mp4"
    }
}

expected url format:

{
    "meta": {
        "download_url": "/media/media/my-video.mp4"
    }
}

IMHO wagtailmedia should follow images format used in APIs https://cms.domain.com/api/v2/images/ by default...

So I suggest a change: use MEDIA_URL + "media/" + video_file_name

https://github.com/torchbox/wagtailmedia/blob/main/src/wagtailmedia/api/serializers.py#L20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant