def screen_it(movie_id): movie_repo = MovieRepository(get_db()) movie = movie_repo.find_by_id(movie_id) if movie is None: flash('Requested movie not found') return redirect(request.url) return render_template('watch/index.html', movie=movie)
def hsl_fragment(movie_id, file_name): movie_repo = MovieRepository(get_db()) movie = movie_repo.find_by_id(movie_id) if movie is None: abort(404, "Movie could not be found") if movie.is_mp4: abort(404, "Could not find an HSL converted movie with the provided id") file_dir = os.path.join(current_app.config['HLS_DIR'], movie.blob_id) return send_from_directory(file_dir, file_name)
def mp4_video(movie_id): movie_repo = MovieRepository(get_db()) movie = movie_repo.find_by_id(movie_id) if movie is None: abort(404, "Movie could not be found") if not movie.is_mp4: abort(404, "Could not find an MP4 movie with the provided id") file_path = os.path.join(current_app.config['UPLOAD_FOLDER'], movie.blob_id) start, end = get_range(request) return partial_response(file_path, start, end)
def uploaded_movie(movie_id): movie_repo = MovieRepository(get_db()) movie = movie_repo.find_by_id(movie_id) return render_template('upload/movie_uploaded.html', movie=movie)