Court makes final ruling in challenge to Brooklyn D.A. reality show