From 0dc9f38b0ea7e3906130d050757bfd2276cb4a28 Mon Sep 17 00:00:00 2001 From: darkArp Date: Sat, 30 Oct 2021 18:28:26 +0100 Subject: [PATCH 1/2] Fixing error adding tv shows to watchlist TV shows have a `null` video, so when explicitly trying to get properties from it there will be an error accessing that property. --- .../services/streama/marshallers/MarshallerService.groovy | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/grails-app/services/streama/marshallers/MarshallerService.groovy b/grails-app/services/streama/marshallers/MarshallerService.groovy index e89e37f72..7f3fedb8b 100644 --- a/grails-app/services/streama/marshallers/MarshallerService.groovy +++ b/grails-app/services/streama/marshallers/MarshallerService.groovy @@ -486,13 +486,7 @@ class MarshallerService { response['lastUpdated'] = watchlistEntry.lastUpdated response['tvShow'] = watchlistEntry.tvShow - response['video'] = [ - id: watchlistEntry.video.id, - mediaType: watchlistEntry.video.getType(), - poster_path: watchlistEntry.video.getPosterPath(), - inWatchlist: watchlistEntry.video.inWatchlist(), - release_date: watchlistEntry.video.getReleaseDate() - ] + response['video'] = watchlistEntry.video return response } From 0e4b3e8ce849ca005f6574dacae61827c2806f50 Mon Sep 17 00:00:00 2001 From: darkArp Date: Sat, 30 Oct 2021 18:31:28 +0100 Subject: [PATCH 2/2] Fix shows not showing in watchlist TV shows have a `null` video property so they wouldn't appear. It was changed so that it checks if it has a `tvShow` or a `video` --- grails-app/controllers/streama/WatchlistEntryController.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/controllers/streama/WatchlistEntryController.groovy b/grails-app/controllers/streama/WatchlistEntryController.groovy index fa8a2babb..3b1e6082e 100644 --- a/grails-app/controllers/streama/WatchlistEntryController.groovy +++ b/grails-app/controllers/streama/WatchlistEntryController.groovy @@ -101,7 +101,7 @@ class WatchlistEntryController { user == currentUser profile == currentProfile isDeleted == false - video != null + video != null || tvShow != null }.list(sort: sortingColumn, order: sortingOrder) if(!watchlistEntries){ render status: NO_CONTENT