import connexion
import six

from src.rest.models.play_log import PlayLog  # noqa: E501
from src.rest import util

from flask import current_app

def current_track():  # noqa: E501
    """Get current track

    Retrieves the currently playing track.  # noqa: E501


    :rtype: PlayLog
    """
    service = current_app.config['SERVICE']
    return service.current_track()


def list_tracks(page=None, limit=None):  # noqa: E501
    """List recent tracks in the play-log

    Lists the track-service entries for a given page.  # noqa: E501

    :param page: The number of items to skip before starting to collect the result set
    :type page: int
    :param limit: The numbers of items to return per page
    :type limit: int

    :rtype: List[PlayLog]
    """
    service = current_app.config['SERVICE']
    return service.list_tracks(page, limit)