def _detect_skipped_track(remaining_duration: float,
                          end_of_track_buffer: float, track: dict,
                          prev_track: dict) -> bool:
    """Performs the detection logic for whether a track was skipped

    Args:
        remaining_duration: The remaining duration of the track in milliseconds
        end_of_track_buffer: The buffer of time at the end of a song that, if skipped, will still be counted as fully
            listened
        track: The track retrieved directly from the spotify API.
        prev_track: The track that was detected to be playing on the previous frame.

    Returns:
        bool: Whether the track has been skipped or not.
    """

    if remaining_duration > end_of_track_buffer and prev_track["item"][
            "name"] != track["item"]["name"]:
        return True

    return False