Capstone — Player Engine
Definition
The player engine combines a linked list for the playlist, a queue for up-next and a stack for history, each used where it is cheapest to touch, so one function can replay button presses and report the player's state.
In plain words
A music player is three small tools working together: a chain of songs you can splice into, a waiting line that cuts in front, and a pile of what you just heard so back works. Each tool fits the way it is used.
In short: every button on Tunebox's player ends up here. The playlist is
a linked chain you can splice while it plays, the up-next queue cuts
in ahead of it, and the history stack remembers where you've been so
back works. Each structure was picked for where it gets touched: the
playlist at a node you hold, the queue at both ends, the history only at its
top. This capstone connects all three in one engine, run_player, which
replays a list of button presses and reports the player's state.

What you're building
run_player(playlist, commands)playlist is the starting list of tracks, and commands is a list of button
presses applied in order. The function returns a dict:
{
"now": "X", # the track playing, or None
"history": ["A"], # the back stack, oldest first
"up_next": ["B"], # the queue, front first
"playlist": ["A", "B", "C"], # the linked playlist, in order
}