From ec704d6afe4514244ff41a04cd35f29672604ca6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 22 Jan 2023 22:43:55 +0000 Subject: [PATCH] Attach license to images --- media.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media.py b/media.py index 645701318..586f77930 100644 --- a/media.py +++ b/media.py @@ -599,6 +599,12 @@ def attach_media(base_dir: str, http_prefix: str, 'type': 'Document', 'url': http_prefix + '://' + domain + '/' + media_path } + if content_license_url: + attachment_json['@context'] = [ + 'https://www.w3.org/ns/activitystreams', + {'schema': 'https://schema.org#'} + ] + attachment_json['schema:license'] = content_license_url if media_type.startswith('image/'): attachment_json['blurhash'] = _get_blur_hash() # find the dimensions of the image and add them as metadata