def getLibraryMovieById(movieId): requestedMovie = movie.getByMovieId(movieId) jsonReturn = {} moviesArray = [] moviesArray.append(requestedMovie.asJson()) jsonReturn['movies'] = moviesArray return jsonReturn
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()
def deleteLibraryMovie(movieId): linkedMovie = movie.getByMovieId(movieId) linkedMediaFile = mediaFile.getByMediaFileId(linkedMovie.associatedMediaFileId) mediaLinker.removeHardLinkForMediaFile(linkedMediaFile) return "Successfully Deleted Movie"
def getLibraryMovieCreateLink(movieId): linkedMovie = movie.getByMovieId(movieId) linkedMediaFile = mediaFile.getByMediaFileId(linkedMovie.associatedMediaFileId) mediaLinker.linkMediaFileToMovie(linkedMediaFile, linkedMovie) return linkedMovie.asJson()