Skip to content

tasks

async_refresh_feed

async_refresh_feed(podcast_id: str) -> None

Given a podcast object, call it's refresh feed function.

Parameters:

Name Type Description Default
podcast_id str

The podcast ID.

required
Source code in src/podcast_analyzer/tasks.py
def async_refresh_feed(podcast_id: str) -> None:
    """
    Given a podcast object, call it's refresh feed function.

    Args:
        podcast_id (str): The podcast ID.
    """
    podcast = Podcast.objects.get(id=podcast_id)
    podcast.refresh_feed()

fetch_avatar_for_person

fetch_avatar_for_person(person: Person) -> None

Triggers the remote fetch of the person's avatar.

Parameters:

Name Type Description Default
person Person

The person record to populate with the avatar.

required
Source code in src/podcast_analyzer/tasks.py
def fetch_avatar_for_person(person: Person) -> None:
    """
    Triggers the remote fetch of the person's avatar.

    Args:
        person (Person): The person record to populate with the avatar.
    """
    logger.debug(
        f"Task 'fetch_avatar_for_person' called for {person.name} ({person.id})"
    )
    asyncio.run(person.afetch_avatar())

fetch_podcast_cover_art

fetch_podcast_cover_art(podcast: Podcast) -> None

Wraps around the remote fetch functions for cover art.

Parameters:

Name Type Description Default
podcast Podcast

Podcast object to get cover art for.

required
Source code in src/podcast_analyzer/tasks.py
def fetch_podcast_cover_art(podcast: Podcast) -> None:
    """
    Wraps around the remote fetch functions for cover art.

    Args:
        podcast (Podcast): Podcast object to get cover art for.
    """
    logger.debug(f"Task 'fetch_podcast_cover_art' called for {podcast.title}!")
    asyncio.run(podcast.afetch_podcast_cover_art())

run_feed_analysis

run_feed_analysis(podcast: Podcast) -> None

Wraps around the instance's feed analysis function.

Parameters:

Name Type Description Default
podcast Podcast

Podcast object to analyze.

required
Source code in src/podcast_analyzer/tasks.py
def run_feed_analysis(podcast: Podcast) -> None:
    """
    Wraps around the instance's feed analysis function.

    Args:
        podcast (Podcast): Podcast object to analyze.
    """
    logger.debug("Task 'run_feed_analysis' called!")
    asyncio.run(podcast.analyze_feed())
    podcast.schedule_next_refresh()