def pokemon_media_path(pokemon_species, prefix, ext, form=None):
    """Returns a path to a Pokémon media file.

    form is not None if the form should be in the filename; it should be False
    if the form should be ignored, e.g. for footprints.
    """

    if form:
        form_identifier = form.form_identifier
    else:
        form_identifier = None

    if form_identifier:
        filename = '{id}-{form}.{ext}'
    else:
        filename = '{id}.{ext}'

    filename = filename.format(
        id=pokemon_species.id,
        form=form_identifier,
        ext=ext
    )

    return '/'.join(('pokemon', prefix, filename))