~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to api/src/Module/Movies.php

  • Committer: Keith Hughitt
  • Date: 2011-04-25 19:26:03 UTC
  • mto: This revision was merged to the branch mainline in revision 567.
  • Revision ID: keith.hughitt@nasa.gov-20110425192603-25zf9j8ne9212sqx
Reimplemented getMovie using new scheme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        include_once 'src/Movie/HelioviewerMovie.php';
104
104
        
105
105
        // Process request
106
 
        $movie = new Movie_HelioviewerMovie($this->_params['id'], $this->_options['format']);
 
106
        $movie = new Movie_HelioviewerMovie($this->_params['id'], $this->_params['format']);
 
107
        
 
108
        header('Content-type: application/json');
 
109
        
 
110
        // If the movie is finished return movie info
 
111
        if ($movie->status == "FINISHED") {            
 
112
            print json_encode($movie->getCompletedMovieInformation());
 
113
        } else {
 
114
            // Otherwise have the client try again in 30s
 
115
            // TODO 2011/04/25: Once HQ has been ported to PHP, eta should be estimated
 
116
            // instead of returning a static eta each time.
 
117
            print json_encode(array(
 
118
                "status" => $movie->status,
 
119
                "eta"    => 30
 
120
            ));            
 
121
        }
107
122
    }
108
123
    
109
124
    /**