from django.core.management.base import BaseCommand

from podcast.models import PodcastEpisode


EPISODES = [
    {
        'slug': 'ep-24-zambia-salary-landscape',
        'title': 'The State of Salaries in Zambia — 2025 Deep Dive',
        'episode_number': 24,
        'guest_name': 'Dr. Mwansa Banda',
        'description': 'We unpack compensation trends across banking, mining, and tech with economist Dr. Mwansa Banda.',
        'duration_display': '52 min',
        'cover_image_url': 'https://images.unsplash.com/photo-1478737270239-2f02b77fc618?w=800&q=70',
        'is_featured': True,
    },
    {
        'slug': 'ep-23-interview-mastery',
        'title': 'Interview Mastery: Stories That Win Offers',
        'episode_number': 23,
        'guest_name': 'Chisomo Lungu',
        'description': 'A practical episode on storytelling, body language, and follow-up strategies that convert interviews into offers.',
        'duration_display': '41 min',
        'cover_image_url': 'https://images.unsplash.com/photo-1590602847861-f357a9332bbc?w=800&q=70',
    },
    {
        'slug': 'ep-22-tech-careers-zambia',
        'title': 'Breaking Into Tech in Zambia',
        'episode_number': 22,
        'guest_name': 'Tendai Ncube',
        'description': 'Developers and data professionals share how they broke into Zambia\'s fastest-growing sector.',
        'duration_display': '38 min',
        'cover_image_url': 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=800&q=70',
    },
]


class Command(BaseCommand):
    help = 'Seed podcast episodes'

    def handle(self, *args, **options):
        for data in EPISODES:
            PodcastEpisode.objects.update_or_create(slug=data['slug'], defaults={**data, 'is_published': True})
        self.stdout.write(self.style.SUCCESS(f'Seeded {PodcastEpisode.objects.count()} podcast episodes'))
