Пример #1
0
def movieCard(movieId):
    movie = Movie.query.get(int(movieId))
    
    ffmpegData = ffmpeg.getMovieInfo(movie.getFullPath())
    data = imdb_utils.getMovieFullData(movie.imdbData.imdbId)
    
    return render_template('movieCard.html', imdb=data, ffmpeg=ffmpegData, movie=movie)
Пример #2
0
def associate_movie(movieId, imdbId):
    movie = Movie.query.get(int(movieId))
    imdbData = ImdbData.query.get(imdbId)
    
    if imdbData is None:
        data = imdb_utils.getMovieData(imdbId)
        
        imdbData = ImdbData(imdbId=data['id'], name=data['title'], 
            genres=', '.join(data['genres']), coverUrl=data['cover'], year=data['year'],
            runtime=data['runtime'])
        
        #DBSession.add(imdbData)
    
    movie.imdbData = imdbData
    ffmpeg.getMovieInfo(movie.getFullPath())
    
    return redirect(url_for('main'))
Пример #3
0
def movieCard(movieId):
    movie = Movie.query.get(int(movieId))

    ffmpegData = ffmpeg.getMovieInfo(movie.getFullPath())
    data = imdb_utils.getMovieFullData(movie.imdbData.imdbId)

    return render_template('movieCard.html',
                           imdb=data,
                           ffmpeg=ffmpegData,
                           movie=movie)
Пример #4
0
def associate_movie(movieId, imdbId):
    movie = Movie.query.get(int(movieId))
    imdbData = ImdbData.query.get(imdbId)

    if imdbData is None:
        data = imdb_utils.getMovieData(imdbId)

        imdbData = ImdbData(imdbId=data['id'],
                            name=data['title'],
                            genres=', '.join(data['genres']),
                            coverUrl=data['cover'],
                            year=data['year'],
                            runtime=data['runtime'])

        #DBSession.add(imdbData)

    movie.imdbData = imdbData
    ffmpeg.getMovieInfo(movie.getFullPath())

    return redirect(url_for('main'))