Exemplo n.º 1
0
def postLibraryMovieAsSibbling(movieId):
	movieTitle = request.json['title']
	movieYear = request.json['year']

	linkedMovie = movie.getByMovieId(movieId)
	linkedMediaFile = mediaFile.getByMediaFileId(linkedMovie.associatedMediaFileId)
	newMovie = movie.create(movieTitle, movieYear).save()
	mediaLinker.associateMovieWithMediaFile(newMovie, linkedMediaFile)
	return newMovie.asJson()
Exemplo n.º 2
0
def postLibraryMovie():
	movieTitle = request.json['title']
	movieYear = request.json['year']
	linkedMediaFileId = request.json['associatedMediaFileId']

	linkedMediaFile = mediaFile.getByMediaFileId(linkedMediaFileId)
	newMovie = movie.create(movieTitle, movieYear).save()
	mediaLinker.associateMovieWithMediaFile(newMovie, linkedMediaFile)

	if 'active' in request.json and request.json['active'] == 1:
		mediaLinker.linkMediaFileToMovie(linkedMediaFile, newMovie)
	return newMovie.asJson()