Terminator: The Sarah Connor Chronicles' Brian Austin Green is starring in a new TBS show called Wedding Band — and last night's episode guest starred his real-life wife, Megan Fox, as the star of a long-running science fiction show called Nebutopia. And when the two of them hook up, Megan Fox accidentally reveals the secret ending to her show's sixth and final season.

Spoilers ahead...

In a nutshell, over the course of the episode you learn that the characters on Nebutopia have been searching for a secret utopia (in, I'm guessing, a nebula.) And Fox's character has a map on her inner thigh which is supposed to show the way. Except that during their torrid sex with Brian Austin Green, Fox blurts out that the map isn't real, and the ending of the show will be a huge metaphor for how we never really find what we're searching for. Cue a pretty hilarious rant by Green about how all of these science fiction shows paint themselves into a black hole, and invent these terrible cop-out endings, because the producers can't figure out how to end the thing.

Later, after Green accidentally lets slip the secret to one or two people, it finds its way onto the Internet, and the fans of Nebutopia come after him, getting his credit cards frozen and stuff. Because fans have that power. (Best not to overthink that subplot, really.) This is intercut with a storyline where Green and friends help two nerdy science fiction fans to lose their virginity, plus marital problems for one character who "wife-taps" his wife.

All of this leads to a scene where Megan Fox helps get BAG out of trouble with the highly stereotypical webmaster of the biggest Nebutopia fansite, before claiming her reward: she gets to "Kobayashi Maru" her man. Which apparently means that she gets access to his portals, including the fabled rear portal. This scene brings a whole new meaning to Captain Kirk's changing the simulation:

Wedding Band is on TBS on Saturday nights at 10 PM — it looks like a cute, fluffy show, based on last night's episode.