$_SESSION['tmdb_language'] = $account['iso_3166_1'];
 }
 if (isset($_GET["action"])) {
     if ($_GET["action"] == 'updategenres') {
         $query = "SELECT * from movies";
         $result = mysql_query($query) or die('Query failed: ' . mysql_error());
         ob_flush();
         flush();
         while ($row = mysql_fetch_assoc($result)) {
             $movie = $tmdb->getMovie($row['tmdb_id']);
             updateMovieGenres($movie["genres"], $row['tmdb_id']);
             echo "movie " . $row['title'] . " has " . count($movie["genres"]) . " genres updated<br>";
         }
     } elseif ($_GET["action"] == 'importall') {
         ob_end_flush();
         $movies = $tmdb->getMoviesByGenre('28');
         echo "<pre>";
         var_dump($movies);
     } elseif ($_GET["action"] == 'sanatizeall') {
         $query = "SELECT * from movies";
         $result = mysql_query($query) or die('Query failed: ' . mysql_error());
         $i = 0;
         while ($row = mysql_fetch_assoc($result)) {
             $query = "\n\t\t\t\t\t\tUPDATE `flamestr`.`movies` \n\t\t\t\t\t\tSET\n\t\t\t\t\t\turl = '" . sanitize($row['title'] . "-" . $row['tmdb_id']) . "'\n\t\t\t\t\t\tWHERE id = '" . $row['id'] . "'";
             mysql_query($query) or die('Query failed: ' . mysql_error());
             $i++;
         }
         echo $i . " sanatized";
         echo "<a href='import.php' class='btn'>Ready, go back</a>";
     } elseif ($_GET["action"] == 'importarray') {
         ob_end_flush();