import uuid


def channels_logo_upload_path(instance, filename, folder_name='channels'):
    """
    Define the dynamic upload path for the logo.

    Args:
        instance (Channel): The Channel instance.
        filename (str): The original filename of the uploaded file.
        folder_name (str, optional): The name of the folder where the file should be stored.  Defaults to 'channels'.

    Returns:
        str: The dynamic upload path for the logo.
    """  
    # Build the dynamic path: folder_name/channel_name/uuid[8].png where uuid[8] is a generated identifier (first 8 characters of the UUID).
    return f"{folder_name}/{instance.name}/{str(uuid.uuid4())[:8]}.png"

def networks_logo_upload_path(instance, filename, folder_name='networks'):
    """
    Define the dynamic upload path for the logo.

    Args:
        instance (Channel): The Channel instance.
        filename (str): The original filename of the uploaded file.
        folder_name (str, optional): The name of the folder where the file should be stored.  Defaults to 'channels'.

    Returns:
        str: The dynamic upload path for the logo.
    """  
    # Build the dynamic path: folder_name/channel_name/uuid[8].png where uuid[8] is a generated identifier (first 8 characters of the UUID).
    return f"{folder_name}/{instance.name}/{str(uuid.uuid4())[:8]}.png"
