The Doctor, without an apprentice after Clara went on her own time and space adventures with Ashildr lands on Mendorax Dellora, a snowy planet in the year 5343. He encounters Nardole (played by Matt Lucas) where The Doctor is mistaken for being a surgeon and is taken to King Hydroflax (played by Greg Davies) who is in need of emergency treatment. The King apparently has a diamond in his head and The Doctor need to remove it.
King Hydroflax is married to River Song, the space and time archaeologist although river reveals she only married the diamond in his head not the King. The Doctor is warned if he doesn't operate and save the Kings life then he will be executed. His four billion subjects are watching and are expecting him to succeed. River Song doesn't recognise the Doctor which Doctor can't understand. River Song has a photo album of all the doctors face but none of the current incarnation. It transpires that River has set up a trap for the Doctor but doesn't know he's who he is.
The King is able to remove his head from his armoured body when the Doctor needs to operate but the two of them manage to teleport off the spaceship that they are on and run to the Tardis. There the Doctor is introduced to another of the husbands of River Song. River tries to fly the Tardis but she can't because the Head and Body of the King are not inside the Tardis. When the body arrives with a new head, that of River's other husband, the Tardis is able to take off and land on a space cruiser, Harmony and Redemption.
Onboard the spaceship, River and the Doctor have a meal with King Hydroflax's head in a bag. They meet the person who is to buy the diamond that is stuck in the head who in the course of the meeting reveals that King Hydroflax is their leader. In the ensuing chaos, the King's head is destroyed by the armoured body and diamond, the most valuable ever is taken as River and the Doctor make a run for it using a meteor strike as cover. The Doctor tries to save the space cruiser but River has other ideas and rescues the Doctor.
The space cruiser crash lands on Darillium, a planet that was once mentioned by River Song when the Doctor first met her as being a place they both had dinner before the end. They are greated by a rescuer where the Doctor gives the rescuer a diamond and tells him to build a restaurant at this location as the singing mountains make a lovely romantic spot.
The Doctor and River Song depart and return a couple of years later but the restaurant is not yet built and then returns again when the restaurant is built. River and the Doctor enjoy a meal where one of the waiters has the armoured body of King Hydroflax but a head of one of River Songs husbands. The Doctor gives River Song a sonic screwdriver that he happened to pick up along the way.