diff --git a/backend/apps/archive/management/commands/import_data.py b/backend/apps/archive/management/commands/import_data.py index 9841a14..b4da2b4 100644 --- a/backend/apps/archive/management/commands/import_data.py +++ b/backend/apps/archive/management/commands/import_data.py @@ -406,8 +406,10 @@ class TwitterImporter(BaseImporter): post_instance.category.add(category_instance) + # Link creator if creator_instance: post_instance.creator = creator_instance + post_instance.save() post_instance.date_created = timezone.make_aware( datetime.strptime(data["date"], "%Y-%m-%d %H:%M:%S") @@ -486,14 +488,20 @@ class FurAffinityImporter(BaseImporter): def _process_creator(self, data, source_site_instance): """Process creator data for FurAffinity.""" + # Use artist if available, otherwise fall back to user field artist = data.get("artist", "") artist_url = data.get("artist_url", artist.lower()) + if not artist_url and "user" in data: + artist_url = data.get("user", "") creator_instance, _ = CreatorModel.objects.get_or_create( slug=artist_url, source_site=source_site_instance ) - creator_instance.name = artist + if artist: + creator_instance.name = artist + else: + creator_instance.name = artist_url creator_instance.creator_id = artist_url # We don't have creator creation date in FurAffinity data @@ -558,6 +566,7 @@ class FurAffinityImporter(BaseImporter): # Link creator if creator_instance: post_instance.creator = creator_instance + post_instance.save() # Set creation date if "date" in data: