<?php
if (!defined('ABSPATH')) {
    exit;
}

use BLR\Backline\Core\PublicApi;

if (!function_exists('blr_backline_get_events')) {
    /**
     * Return normalized Backline event arrays for front-end themes.
     */
    function blr_backline_get_events(array $args = []): array {
        return PublicApi::events($args);
    }
}

if (!function_exists('blr_backline_query_events')) {
    /**
     * Return a WP_Query for Backline events.
     */
    function blr_backline_query_events(array $args = []): WP_Query {
        return PublicApi::event_query($args);
    }
}

if (!function_exists('blr_backline_get_event')) {
    /**
     * Return one normalized Backline event array for front-end themes.
     */
    function blr_backline_get_event(int $event_id, array $args = []): array {
        return PublicApi::event($event_id, $args);
    }
}

if (!function_exists('blr_backline_get_albums')) {
    /**
     * Return normalized Backline album arrays for front-end themes.
     */
    function blr_backline_get_albums(array $args = []): array {
        return PublicApi::albums($args);
    }
}

if (!function_exists('blr_backline_query_albums')) {
    /**
     * Return a WP_Query for Backline albums.
     */
    function blr_backline_query_albums(array $args = []): WP_Query {
        return PublicApi::album_query($args);
    }
}

if (!function_exists('blr_backline_get_album')) {
    /**
     * Return one normalized Backline album array for front-end themes.
     */
    function blr_backline_get_album(int $album_id, array $args = []): array {
        return PublicApi::album($album_id, $args);
    }
}

if (!function_exists('blr_backline_get_releases')) {
    /**
     * Return normalized Backline release arrays for front-end themes.
     */
    function blr_backline_get_releases(array $args = []): array {
        return PublicApi::releases($args);
    }
}

if (!function_exists('blr_backline_query_releases')) {
    /**
     * Return a WP_Query for Backline releases.
     */
    function blr_backline_query_releases(array $args = []): WP_Query {
        return PublicApi::release_query($args);
    }
}

if (!function_exists('blr_backline_get_release')) {
    /**
     * Return one normalized Backline release array for front-end themes.
     */
    function blr_backline_get_release(int $release_id, array $args = []): array {
        return PublicApi::release($release_id, $args);
    }
}

if (!function_exists('blr_backline_get_tracks')) {
    /**
     * Return normalized Backline track arrays for front-end themes and custom players.
     */
    function blr_backline_get_tracks(array $args = []): array {
        return PublicApi::tracks($args);
    }
}

if (!function_exists('blr_backline_query_tracks')) {
    /**
     * Return a WP_Query for Backline tracks.
     */
    function blr_backline_query_tracks(array $args = []): WP_Query {
        return PublicApi::track_query($args);
    }
}

if (!function_exists('blr_backline_get_track')) {
    /**
     * Return one normalized Backline track array for front-end themes.
     */
    function blr_backline_get_track(int $track_id, array $args = []): array {
        return PublicApi::track($track_id, $args);
    }
}

if (!function_exists('blr_backline_get_release_tracks')) {
    /**
     * Return normalized track arrays attached to a release, preserving release order.
     */
    function blr_backline_get_release_tracks(int $release_id, array $args = []): array {
        return PublicApi::release_tracks($release_id, $args);
    }
}

if (!function_exists('blr_backline_get_playlist')) {
    /**
     * Return tracks with audio URLs by default for feeding a custom theme player.
     */
    function blr_backline_get_playlist(array $args = []): array {
        return PublicApi::playlist($args);
    }
}
