Skip to content

Commit

Permalink
Merge pull request #4071 from quadproduction/221-wizz_burn-ins-on-pub…
Browse files Browse the repository at this point in the history
…lished-videos-should-show-the-kitsu-user

Get kitsu login to fill username burnin
  • Loading branch information
iLLiCiTiT committed Nov 9, 2022
2 parents bf09157 + f90e9f6 commit 794127f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions openpype/modules/kitsu/plugins/publish/collect_kitsu_username.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
import os
import re

import pyblish.api


class CollectKitsuUsername(pyblish.api.ContextPlugin):
"""Collect Kitsu username from the kitsu login"""

order = pyblish.api.CollectorOrder + 0.499
label = "Kitsu username"

def process(self, context):
kitsu_login = os.environ.get('KITSU_LOGIN')

if not kitsu_login:
return

kitsu_username = kitsu_login.split("@")[0].replace('.', ' ')
new_username = re.sub('[^a-zA-Z]', ' ', kitsu_username).title()

for instance in context:
# Don't override customData if it already exists
if 'customData' not in instance.data:
instance.data['customData'] = {}

instance.data['customData']["kitsuUsername"] = new_username

0 comments on commit 794127f

Please sign in to comment.