As tourists were scrambling to fight traffic and inch their way into Times Square on the morning of April 21, a handful of Viacom Inc.’s attorneys were putting the final touches on a multiyear contract renewal with Dish Network. While it isn’t uncommon for some of the company’s most senior attorneys to work on a big deal, this time they’d been in the room since the day before.

Viacom’s legal department spared no resource when it came to cementing the deal with Dish. Its contract had expired in January, and Dish had set a deadline—midnight on April 20—and even threatened a blackout of 18 Viacom channels, which jeopardized customers’ access to “Inside Amy Schumer” on Comedy Central or “Black Girls Rock!” on BET. There was no announcement at midnight, but by 11 the following morning, media outlets across the country were alerted that a deal had been reached.