From 727c09057177d0cf0fc39745e8d1a34adf6ab15e Mon Sep 17 00:00:00 2001 From: ed-thuando Date: Tue, 14 Apr 2026 12:54:03 +0700 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20resolve=20#588=20=E2=80=94=20Related?= =?UTF-8?q?=20actors=20in=20"user=20view"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #588 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com> --- .../streama/MovieShowController.groovy | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 grails-app/controllers/streama/MovieShowController.groovy diff --git a/grails-app/controllers/streama/MovieShowController.groovy b/grails-app/controllers/streama/MovieShowController.groovy new file mode 100644 index 00000000..ac8bc17e --- /dev/null +++ b/grails-app/controllers/streama/MovieShowController.groovy @@ -0,0 +1,68 @@ +package streama + +import grails.converters.JSON +import grails.transaction.Transactional +import static org.springframework.http.HttpStatus.* + +@Transactional(readOnly = true) +class MovieShowController { + + def theMovieDbService + def taggingService + def videoService + static responseFormats = ['json', 'xml'] + + def show(MovieShow movieShowInstance) { + if(movieShowInstance == null){ + render status: NOT_FOUND + return + } + + def apiResponse = [ + id: movieShowInstance.id, + title: movieShowInstance.title, + original_title: movieShowInstance.originalTitle, + overview: movieShowInstance.overview, + tagline: movieShowInstance.tagline, + release_date: movieShowInstance.releaseDate, + backdrop_path: movieShowInstance.backdropPath, + poster_path: movieShowInstance.posterPath, + vote_average: movieShowInstance.voteAverage, + genre: movieShowInstance.genre, + type: movieShowInstance.type, + currentVolume: movieShowInstance.currentVolume, + apiId: movieShowInstance.apiId, + imdb_id: movieShowInstance.imdbId, + status: movieShowInstance.status, + percentage_complete: movieShowInstance.percentageComplete, + firstAired: movieShowInstance.firstAired, + language: movieShowInstance.language, + addedBy: movieShowInstance.addedBy, + apiBackdrop16x9: movieShowInstance.apiBackdrop16x9, + apiPosterThumb: movieShowInstance.apiPosterThumb, + ] + + def actorMapping = movieShowInstance.actorMappings + def actors = actorMapping.collect { actorMappingInstance -> + def actor = actorMappingInstance.actor + def character = actorMappingInstance.character + def profilePath = actor.profilePath + def tmdbId = actor.tmdbId + return [ + id: actor.id, + name: actor.name, + character: character, + profile_path: profilePath, + tmdb_id: tmdbId + ] + } + apiResponse.actors = actors + + if(params.get('flat') == 'true'){ + params.remove('flat') + render apiResponse as JSON + return + } + respond apiResponse + } +} From 6379f27786b49d38124397cd597eb8e9a9c11e39 Mon Sep 17 00:00:00 2001 From: ed-thuando Date: Tue, 14 Apr 2026 12:54:06 +0700 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20resolve=20#588=20=E2=80=94=20Related?= =?UTF-8?q?=20actors=20in=20"user=20view"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #588 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com> --- grails-app/domain/streama/Movie.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/domain/streama/Movie.groovy b/grails-app/domain/streama/Movie.groovy index 19eff755..5642d808 100644 --- a/grails-app/domain/streama/Movie.groovy +++ b/grails-app/domain/streama/Movie.groovy @@ -15,7 +15,7 @@ class Movie extends Video{ File backdrop_image - static hasMany = [tags: Tag, genre: Genre] + static hasMany = [tags: Tag, genre: Genre, actors: Actor] static constraints = { } From 712cff2686cd39d0f9303f8255e554b21f198368 Mon Sep 17 00:00:00 2001 From: ed-thuando Date: Tue, 14 Apr 2026 12:54:06 +0700 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20resolve=20#588=20=E2=80=94=20Related?= =?UTF-8?q?=20actors=20in=20"user=20view"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #588 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com> --- grails-app/domain/streama/Actor.groovy | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 grails-app/domain/streama/Actor.groovy diff --git a/grails-app/domain/streama/Actor.groovy b/grails-app/domain/streama/Actor.groovy new file mode 100644 index 00000000..9b892b72 --- /dev/null +++ b/grails-app/domain/streama/Actor.groovy @@ -0,0 +1,18 @@ +package streama + +class Actor { + + String name + String imdbId + String bio + Date dateCreated + Date lastUpdated + + static hasMany = [movies: ActorMapping] + + static constraints = { + name blank: false + imdbId nullable: true + bio nullable: true, maxSize: 2000 + } +} From dfa190010c4f77aed317cbd953706cc0f4409964 Mon Sep 17 00:00:00 2001 From: ed-thuando Date: Tue, 14 Apr 2026 12:54:07 +0700 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20resolve=20#588=20=E2=80=94=20Related?= =?UTF-8?q?=20actors=20in=20"user=20view"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #588 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com> --- .../assets/javascripts/streama/controllers.js | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 grails-app/assets/javascripts/streama/controllers.js diff --git a/grails-app/assets/javascripts/streama/controllers.js b/grails-app/assets/javascripts/streama/controllers.js new file mode 100644 index 00000000..8bc8405f --- /dev/null +++ b/grails-app/assets/javascripts/streama/controllers.js @@ -0,0 +1,50 @@ +'use strict'; + +angular.module('streama').controller('MovieDetailCtrl', [ + '$scope', + '$state', + '$rootScope', + '$stateParams', + 'apiService', + function ($scope, $state, $rootScope, $stateParams, apiService) { + + $scope.currentMovie = null; + $scope.relatedActors = []; + $scope.loading = false; + + $scope.init = function () { + if ($stateParams.id) { + $scope.loading = true; + apiService.movie.getMovie($stateParams.id).then(function (response) { + $scope.currentMovie = response.data; + $scope.fetchRelatedActors($stateParams.id); + $scope.loading = false; + }, function (error) { + $scope.loading = false; + console.error('Error loading movie:', error); + }); + } + }; + + $scope.fetchRelatedActors = function (movieId) { + apiService.movie.getRelatedActors(movieId).then(function (response) { + $scope.relatedActors = response.data || []; + }, function (error) { + console.error('Error fetching related actors:', error); + $scope.relatedActors = []; + }); + }; + + $scope.playMovie = function (movie) { + $state.go('player', { videoId: movie.id }); + }; + + $scope.markWatched = function (movie) { + apiService.video.markWatched(movie.id).then(function () { + movie.watched = true; + }); + }; + + $scope.init(); + } +]);