Skip to content

Commit

Permalink
add license string to youtube and voctoweb description
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Sep 20, 2024
1 parent 21be6a1 commit 8f3da0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions voctopublish/api_client/voctoweb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ def create_or_update_event(self):
[description, '<a href="' + link + '">' + link + "</a>"]
)

if self.t.license:
# FIXME <https://github.com/emfcamp/Website/issues/1780>
description += f"\n\n{self.t.license}"

# API code https://github.com/voc/voctoweb/blob/master/app/controllers/api/events_controller.rb
headers = {
"Authorization": f"Token {self.api_key}",
Expand Down
10 changes: 5 additions & 5 deletions voctopublish/api_client/youtube_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ def upload(self, file, lang):
+ description
)

license = self.t._get_str("Meta.License", optional=True)
if license and "https://creativecommons.org/licenses/by" in license:
license = "creativeCommon"
else:
license = "youtube"
license = "youtube"
if self.t.license:
if "https://creativecommons.org/licenses/by" in self.t.license:
license = "creativeCommon"
description += f"\n\n{self.t.license}"

metadata = {
"snippet": {
Expand Down
1 change: 1 addition & 0 deletions voctopublish/model/ticket_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def __init__(self, ticket, ticket_id, config):
self.date.split("-")[0],
*self._get_list("Publishing.Tags", optional=True),
]
self.license = self._get_str("Meta.License", optional=True, try_default=True)

# youtube properties
if self._get_bool(
Expand Down

0 comments on commit 8f3da0f

Please sign in to comment.