Skip to content

Change download_url format #254

@lorddaedra

Description

@lorddaedra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions