# Generated by Django 5.1.2 on 2024-10-10 21:38

import django.db.models.deletion
import podcast_analyzer.models
import tagulous.models.fields
import tagulous.models.models
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AnalysisGroup",
            fields=[
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "name",
                    models.CharField(help_text="Identifier for group.", max_length=250),
                ),
            ],
            options={
                "ordering": ["name", "created"],
            },
        ),
        migrations.CreateModel(
            name="Person",
            fields=[
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("name", models.CharField(max_length=250)),
                ("url", models.URLField(blank=True, null=True)),
                ("img_url", models.URLField(blank=True, null=True)),
            ],
            options={
                "verbose_name_plural": "People",
                "ordering": ["name"],
            },
        ),
        migrations.CreateModel(
            name="ItunesCategory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                ("name", models.CharField(max_length=250)),
                (
                    "parent_category",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="podcast_analyzer.itunescategory",
                    ),
                ),
            ],
            options={
                "verbose_name": "iTunes Category",
                "verbose_name_plural": "iTunes Categories",
                "ordering": ["parent_category__name", "name"],
            },
        ),
        migrations.CreateModel(
            name="Podcast",
            fields=[
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "title",
                    models.CharField(
                        db_index=True, help_text="Title of podcast", max_length=250
                    ),
                ),
                (
                    "rss_feed",
                    models.URLField(
                        db_index=True, help_text="URL of podcast feed.", unique=True
                    ),
                ),
                (
                    "podcast_cover_art_url",
                    models.URLField(
                        blank=True,
                        help_text="Link to cover art for podcast.",
                        max_length=500,
                        null=True,
                    ),
                ),
                (
                    "podcast_cached_cover_art",
                    models.ImageField(
                        blank=True,
                        null=True,
                        upload_to=podcast_analyzer.models.podcast_art_directory_path,
                    ),
                ),
                ("podcast_art_cache_update_needed", models.BooleanField(default=False)),
                (
                    "last_feed_update",
                    models.DateTimeField(
                        blank=True, help_text="Last publish date per feed.", null=True
                    ),
                ),
                (
                    "dormant",
                    models.BooleanField(
                        default=False, help_text="Is this podcast dormant?"
                    ),
                ),
                (
                    "last_checked",
                    models.DateTimeField(
                        blank=True,
                        help_text="Last scan of feed completed at.",
                        null=True,
                    ),
                ),
                (
                    "author",
                    models.CharField(
                        blank=True,
                        help_text="Identfied feed author",
                        max_length=250,
                        null=True,
                    ),
                ),
                (
                    "language",
                    models.CharField(
                        blank=True,
                        help_text="Language of podcast",
                        max_length=10,
                        null=True,
                    ),
                ),
                (
                    "generator",
                    models.CharField(
                        blank=True,
                        help_text="Identified generator for feed.",
                        max_length=250,
                        null=True,
                    ),
                ),
                ("email", models.EmailField(blank=True, max_length=254, null=True)),
                ("site_url", models.URLField(blank=True, null=True)),
                ("itunes_explicit", models.BooleanField(default=False)),
                (
                    "itunes_feed_type",
                    models.CharField(blank=True, max_length=25, null=True),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="Description of podcast", null=True
                    ),
                ),
                (
                    "release_frequency",
                    models.CharField(
                        choices=[
                            ("daily", "Daily"),
                            ("often", "Mulitple times per week."),
                            ("weekly", "Weekly"),
                            ("biweekly", "Biweekly"),
                            ("monthly", "Monthly"),
                            ("adhoc", "Occasionally"),
                            ("pending", "Not Known Yet"),
                        ],
                        db_index=True,
                        default="pending",
                        help_text="How often this podcast releases, on average,not including trailers and bonus episodes.",
                        max_length=20,
                    ),
                ),
                ("feed_contains_itunes_data", models.BooleanField(default=False)),
                (
                    "feed_contains_podcast_index_data",
                    models.BooleanField(default=False),
                ),
                ("feed_contains_tracking_data", models.BooleanField(default=False)),
                (
                    "feed_contains_structured_donation_data",
                    models.BooleanField(default=False),
                ),
                ("funding_url", models.URLField(blank=True, null=True)),
                (
                    "probable_feed_host",
                    models.CharField(blank=True, max_length=250, null=True),
                ),
                (
                    "analysis_group",
                    models.ManyToManyField(
                        blank=True,
                        related_name="podcasts",
                        to="podcast_analyzer.analysisgroup",
                    ),
                ),
                (
                    "itunes_categories",
                    models.ManyToManyField(
                        blank=True, to="podcast_analyzer.itunescategory"
                    ),
                ),
            ],
            options={
                "ordering": ["title"],
            },
        ),
        migrations.CreateModel(
            name="ArtUpdate",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                (
                    "reported_mime_type",
                    models.CharField(
                        blank=True,
                        help_text="What the server said the mime type was.",
                        max_length=50,
                        null=True,
                    ),
                ),
                (
                    "actual_mime_type",
                    models.CharField(
                        blank=True,
                        help_text="The actual mime type",
                        max_length=50,
                        null=True,
                    ),
                ),
                (
                    "valid_file",
                    models.BooleanField(
                        default=False,
                        help_text="Was this a valid art file or corrupt/unsupported?",
                    ),
                ),
                (
                    "podcast",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="art_updates",
                        to="podcast_analyzer.podcast",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Season",
            fields=[
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("season_number", models.PositiveIntegerField()),
                (
                    "analysis_group",
                    models.ManyToManyField(
                        blank=True,
                        related_name="seasons",
                        to="podcast_analyzer.analysisgroup",
                    ),
                ),
                (
                    "podcast",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="seasons",
                        to="podcast_analyzer.podcast",
                    ),
                ),
            ],
            options={
                "ordering": ["podcast__title", "season_number"],
            },
        ),
        migrations.CreateModel(
            name="Tagulous_Episode_tags",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                ("slug", models.SlugField()),
                (
                    "count",
                    models.IntegerField(
                        default=0,
                        help_text="Internal counter of how many times this tag is in use",
                    ),
                ),
                (
                    "protected",
                    models.BooleanField(
                        default=False,
                        help_text="Will not be deleted when the count reaches 0",
                    ),
                ),
            ],
            options={
                "ordering": ("name",),
                "abstract": False,
                "unique_together": {("slug",)},
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.CreateModel(
            name="Episode",
            fields=[
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="Time this object was created."
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, help_text="Time of last modification"
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("guid", models.CharField(db_index=True, max_length=250)),
                (
                    "title",
                    models.CharField(
                        blank=True,
                        help_text="Title of episode",
                        max_length=250,
                        null=True,
                    ),
                ),
                (
                    "ep_type",
                    models.CharField(
                        default="full",
                        help_text="Episode type per itunes tag if available. Assumes full if not available.",
                        max_length=15,
                    ),
                ),
                (
                    "ep_num",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="iTunes specified episode number, if any.",
                        null=True,
                    ),
                ),
                (
                    "release_datetime",
                    models.DateTimeField(
                        blank=True, help_text="When episode was released.", null=True
                    ),
                ),
                (
                    "episode_url",
                    models.URLField(
                        blank=True, help_text="URL for episode page.", null=True
                    ),
                ),
                (
                    "mime_type",
                    models.CharField(
                        blank=True,
                        help_text="Mime type of enclosure as reported by feed.",
                        max_length=50,
                        null=True,
                    ),
                ),
                (
                    "download_url",
                    models.URLField(
                        blank=True,
                        help_text="URL for episode download.",
                        max_length=400,
                        null=True,
                    ),
                ),
                (
                    "itunes_duration",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Duration in seconds per itunes attributes if available.",
                        null=True,
                    ),
                ),
                (
                    "file_size",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Size of file based on enclosure `length` attribute.",
                        null=True,
                    ),
                ),
                (
                    "itunes_explicit",
                    models.BooleanField(
                        default=False, help_text="iTunes explicit tag."
                    ),
                ),
                ("show_notes", models.TextField(blank=True, null=True)),
                (
                    "cw_present",
                    models.BooleanField(
                        default=False, help_text="Any detection of CWs in show notes?"
                    ),
                ),
                (
                    "transcript_detected",
                    models.BooleanField(
                        default=False, help_text="Any transcript link detected?"
                    ),
                ),
                (
                    "analysis_group",
                    models.ManyToManyField(
                        blank=True,
                        related_name="episodes",
                        to="podcast_analyzer.analysisgroup",
                    ),
                ),
                (
                    "guests_detected_from_feed",
                    models.ManyToManyField(
                        blank=True,
                        related_name="guest_appearances",
                        to="podcast_analyzer.person",
                    ),
                ),
                (
                    "hosts_detected_from_feed",
                    models.ManyToManyField(
                        blank=True,
                        related_name="hosted_episodes",
                        to="podcast_analyzer.person",
                    ),
                ),
                (
                    "podcast",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="episodes",
                        to="podcast_analyzer.podcast",
                    ),
                ),
                (
                    "season",
                    models.ForeignKey(
                        blank=True,
                        help_text="iTunes season, if specified.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="episodes",
                        to="podcast_analyzer.season",
                    ),
                ),
                (
                    "tags",
                    tagulous.models.fields.TagField(
                        _set_tag_meta=True,
                        blank=True,
                        help_text="Enter a comma-separated tag string",
                        to="podcast_analyzer.tagulous_episode_tags",
                    ),
                ),
            ],
            options={
                "ordering": ["-release_datetime"],
            },
        ),
        migrations.CreateModel(
            name="Tagulous_Podcast_tags",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                ("slug", models.SlugField()),
                (
                    "count",
                    models.IntegerField(
                        default=0,
                        help_text="Internal counter of how many times this tag is in use",
                    ),
                ),
                (
                    "protected",
                    models.BooleanField(
                        default=False,
                        help_text="Will not be deleted when the count reaches 0",
                    ),
                ),
            ],
            options={
                "ordering": ("name",),
                "abstract": False,
                "unique_together": {("slug",)},
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.AddField(
            model_name="podcast",
            name="tags",
            field=tagulous.models.fields.TagField(
                _set_tag_meta=True,
                blank=True,
                help_text="Enter a comma-separated tag string",
                to="podcast_analyzer.tagulous_podcast_tags",
            ),
        ),
    ]
