From 83a9cf47ad96da6a16bc0bc2c9773ed4b4f1982d Mon Sep 17 00:00:00 2001 From: dularion Date: Sun, 28 Feb 2021 16:32:06 +0100 Subject: [PATCH] fix broken images in several places --- .../streama/templates/admin-fileManager.tpl.htm | 4 ++-- .../streama/templates/admin-genres.tpl.htm | 2 +- .../streama/templates/admin-movie.tpl.htm | 4 ++-- .../streama/templates/admin-movies.tpl.htm | 5 +++-- .../streama/templates/admin-new-releases.tpl.htm | 2 +- .../streama/templates/admin-notifications.tpl.htm | 4 ++-- .../streama/templates/admin-show.tpl.htm | 2 +- .../streama/templates/admin-shows.tpl.htm | 6 +++--- .../streama/templates/admin-videos.tpl.htm | 2 +- .../streama/templates/modal--media-detail.tpl.htm | 4 ++-- .../templates/modal--notification-add.tpl.htm | 2 +- .../templates/settings-user-activity.tpl.htm | 2 +- grails-app/assets/stylesheets/_util.scss | 3 +++ .../streama/GenericVideoController.groovy | 2 +- grails-app/domain/streama/TvShow.groovy | 13 +++++++++++-- grails-app/domain/streama/Video.groovy | 12 ++++++++++-- .../marshallers/MediaDetailMarshallerService.groovy | 4 ++-- .../marshallers/PlayerMarshallerService.groovy | 2 +- grails-app/views/episode/show.gson | 2 ++ grails-app/views/mail/notification.gsp | 4 ++-- grails-app/views/movie/_movie.gson | 1 + .../views/notificationQueue/_notificationQueue.gson | 4 ++-- grails-app/views/tvShow/_tvShow.gson | 1 + grails-app/views/userActivity/_userActivity.gson | 4 ++-- grails-app/views/video/show.gson | 2 ++ .../views/watchlistEntry/_watchlistEntry.gson | 6 +++++- 26 files changed, 65 insertions(+), 34 deletions(-) diff --git a/grails-app/assets/javascripts/streama/templates/admin-fileManager.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-fileManager.tpl.htm index 6965ba48f..708538886 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-fileManager.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-fileManager.tpl.htm @@ -3,7 +3,7 @@

- File Manager + File Manager ({{filesCount}} items)

@@ -68,7 +68,7 @@

{{file.contentType}} {{file.fileExists}} -
+
None
diff --git a/grails-app/assets/javascripts/streama/templates/admin-genres.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-genres.tpl.htm index 6e217c42f..a5fc1e8aa 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-genres.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-genres.tpl.htm @@ -1,7 +1,7 @@
-

Genre

+

Genre ({{vm.genres.length}} items)

Here you can manage the genres for Videos / TvShows.

Usually, Genre are automatically added alongside TMDb-videos & shows. But if TMDb isn't enabled or you want to add your own custom Genres, you can do so here.

diff --git a/grails-app/assets/javascripts/streama/templates/admin-movie.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-movie.tpl.htm index 5fad70a53..b7cf57780 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-movie.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-movie.tpl.htm @@ -113,7 +113,7 @@

- +

@@ -146,7 +146,7 @@

Suggested by TheMovieDb.org
- +
Release: {{movie.release_date.substring(0, 4)}} | {{movie.vote_average}}
diff --git a/grails-app/assets/javascripts/streama/templates/admin-movies.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-movies.tpl.htm index ac59e8791..30b56c5a2 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-movies.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-movies.tpl.htm @@ -1,7 +1,8 @@

- Movies + Movies ({{vm.movie.total}} items) +

Want to add a new Movie?
- +
Release: {{::movie.release_date.substring(0, 4)}} | {{::movie.vote_average}}
diff --git a/grails-app/assets/javascripts/streama/templates/admin-new-releases.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-new-releases.tpl.htm index dcc90458a..c543c538a 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-new-releases.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-new-releases.tpl.htm @@ -24,7 +24,7 @@

Dashboard Highlights

{{notification.dateCreated | date:'short'}} - + {{notification.media.title || notification.media.name}} ({{notification.media.release_date.substring(0,4)}}) diff --git a/grails-app/assets/javascripts/streama/templates/admin-notifications.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-notifications.tpl.htm index 87f8b1611..a7d3638a0 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-notifications.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-notifications.tpl.htm @@ -30,11 +30,11 @@

Notification Queue

{{notification.dateCreated | date:'short'}} - + {{notification.movie.title}} ({{notification.movie.release_date.substring(0,4)}}) - + {{notification.tvShow.name}} ({{notification.tvShow.first_air_date.substring(0,4)}}) {{notification.description}} diff --git a/grails-app/assets/javascripts/streama/templates/admin-show.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-show.tpl.htm index 7d9bcf693..58a87dbb0 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-show.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-show.tpl.htm @@ -84,7 +84,7 @@

- +
diff --git a/grails-app/assets/javascripts/streama/templates/admin-shows.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-shows.tpl.htm index 77d4fcc6b..95c775a98 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-shows.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-shows.tpl.htm @@ -1,7 +1,7 @@

- Shows + Shows ({{tvShow.total}} items)

@@ -36,7 +36,7 @@

ng-repeat="show in tvShow.list" ui-sref="admin.show({showId: show.id})">
- + @@ -69,7 +69,7 @@

Want to add a new Show?

- +
Release: {{::show.release_date.substring(0, 4)}} | {{::show.vote_average}}
diff --git a/grails-app/assets/javascripts/streama/templates/admin-videos.tpl.htm b/grails-app/assets/javascripts/streama/templates/admin-videos.tpl.htm index 95b86660b..e63d85f00 100644 --- a/grails-app/assets/javascripts/streama/templates/admin-videos.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/admin-videos.tpl.htm @@ -1,7 +1,7 @@

- Other Videos + Other Videos ({{videos.length}} items)

diff --git a/grails-app/assets/javascripts/streama/templates/modal--media-detail.tpl.htm b/grails-app/assets/javascripts/streama/templates/modal--media-detail.tpl.htm index 003d163ad..d5e5ca78b 100644 --- a/grails-app/assets/javascripts/streama/templates/modal--media-detail.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/modal--media-detail.tpl.htm @@ -96,7 +96,7 @@

{{'VIDEO.GENRE' | translate}}

- +

{{'VIDEO.TRAILER' | translate}}

@@ -105,7 +105,7 @@

{{'VIDEO.TRAILER' | translate}}

- +
diff --git a/grails-app/assets/javascripts/streama/templates/modal--notification-add.tpl.htm b/grails-app/assets/javascripts/streama/templates/modal--notification-add.tpl.htm index 9592a0ae8..8b5ba211f 100644 --- a/grails-app/assets/javascripts/streama/templates/modal--notification-add.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/modal--notification-add.tpl.htm @@ -34,7 +34,7 @@

{{selectedItem.name}}

- +

{{selectedItem.title}}

diff --git a/grails-app/assets/javascripts/streama/templates/settings-user-activity.tpl.htm b/grails-app/assets/javascripts/streama/templates/settings-user-activity.tpl.htm index 77cd24ccf..2ab38c18e 100644 --- a/grails-app/assets/javascripts/streama/templates/settings-user-activity.tpl.htm +++ b/grails-app/assets/javascripts/streama/templates/settings-user-activity.tpl.htm @@ -78,7 +78,7 @@

Sort

{{(activity.lastUpdated || activity.dateCreated) | date:'short'}}
{{activity.video.title || activity.video.name}}
s{{activity.video.season_number| padnumber:2}}e{{activity.video.episode_number | padnumber:2}}
diff --git a/grails-app/assets/stylesheets/_util.scss b/grails-app/assets/stylesheets/_util.scss index beb258c9f..fdc8cf7c4 100644 --- a/grails-app/assets/stylesheets/_util.scss +++ b/grails-app/assets/stylesheets/_util.scss @@ -269,6 +269,9 @@ a{ .text-sm{ font-size: 0.75em; } +.text-xs{ + font-size: 0.50em; +} diff --git a/grails-app/controllers/streama/GenericVideoController.groovy b/grails-app/controllers/streama/GenericVideoController.groovy index 75a5b633a..ac6c2dd40 100644 --- a/grails-app/controllers/streama/GenericVideoController.groovy +++ b/grails-app/controllers/streama/GenericVideoController.groovy @@ -14,7 +14,7 @@ class GenericVideoController { def index(Integer max) { params.max = Math.min(max ?: 10, 100) JSON.use('admin') { - respond GenericVideo.where{deleted != true}.list(), [status: OK] + respond GenericVideo.where{deleted != true}.list(max: 9999), [status: OK] } } diff --git a/grails-app/domain/streama/TvShow.groovy b/grails-app/domain/streama/TvShow.groovy index 499e569a2..d129bad95 100644 --- a/grails-app/domain/streama/TvShow.groovy +++ b/grails-app/domain/streama/TvShow.groovy @@ -90,8 +90,17 @@ class TvShow implements SimpleInstance { return listEpisodesWithFiles().min { it.seasonEpisodeMerged } } - def getPosterPath(){ - String TMDB_BASE_PATH = 'https://image.tmdb.org/t/p/w300/' + def getPosterPath(Integer width = 300){ + if(this.poster_image){ + return this.poster_image.src + } + if(!this.poster_path){ + return + } + String TMDB_BASE_PATH = "https://image.tmdb.org/t/p/w${width}/" + if(this.poster_path?.startsWith('http')){ + return this.poster_path + } return TMDB_BASE_PATH + this.poster_path } diff --git a/grails-app/domain/streama/Video.groovy b/grails-app/domain/streama/Video.groovy index b01c85011..070c5ed87 100644 --- a/grails-app/domain/streama/Video.groovy +++ b/grails-app/domain/streama/Video.groovy @@ -164,13 +164,21 @@ class Video implements SimpleInstance{ def getPosterPath(Integer width = 300){ String TMDB_BASE_PATH = "https://image.tmdb.org/t/p/w${width}/" + if(this instanceof Episode){ + if(this.show.poster_path?.startsWith('http')){ + return this.show.poster_path + } return TMDB_BASE_PATH + this.show.poster_path }else if(this instanceof GenericVideo){ return this.poster_image?.getSrc() - }else{ - return TMDB_BASE_PATH + this.poster_path } + + if(this.poster_path?.startsWith('http')){ + return this.poster_path + } + + return TMDB_BASE_PATH + this.poster_path } diff --git a/grails-app/services/streama/marshallers/MediaDetailMarshallerService.groovy b/grails-app/services/streama/marshallers/MediaDetailMarshallerService.groovy index 72c141cc2..3fc2986e9 100644 --- a/grails-app/services/streama/marshallers/MediaDetailMarshallerService.groovy +++ b/grails-app/services/streama/marshallers/MediaDetailMarshallerService.groovy @@ -24,7 +24,7 @@ class MediaDetailMarshallerService { result['overview'] = tvShow.overview result['apiId'] = tvShow.apiId result['backdrop_path'] = tvShow.backdrop_path - result['poster_path'] = tvShow.poster_path + result['poster_path'] = tvShow.getPosterPath() result['first_air_date'] = tvShow.first_air_date result['original_language'] = tvShow.original_language result['vote_average'] = tvShow.vote_average @@ -47,7 +47,7 @@ class MediaDetailMarshallerService { result['mediaType'] = 'movie' result['dateCreated'] = movie.dateCreated result['lastUpdated'] = movie.lastUpdated - result['poster_path'] = movie.poster_path + result['poster_path'] = movie.getPosterPath() result['release_date'] = movie.release_date result['title'] = movie.title result['overview'] = movie.overview diff --git a/grails-app/services/streama/marshallers/PlayerMarshallerService.groovy b/grails-app/services/streama/marshallers/PlayerMarshallerService.groovy index b85795f39..d4a246320 100644 --- a/grails-app/services/streama/marshallers/PlayerMarshallerService.groovy +++ b/grails-app/services/streama/marshallers/PlayerMarshallerService.groovy @@ -70,7 +70,7 @@ class PlayerMarshallerService { returnArray['title'] = video.title returnArray['release_date'] = video.release_date returnArray['backdrop_path'] = video.buildImagePath('backdrop_path', "w1280") - returnArray['poster_path'] = video.poster_path + returnArray['poster_path'] = video.getPosterPath() returnArray['trailerKey'] = video.trailerKey returnArray['nextVideo'] = video.suggestNextVideo()?.getSimpleInstance() diff --git a/grails-app/views/episode/show.gson b/grails-app/views/episode/show.gson index 290d05b79..c4943a0b1 100644 --- a/grails-app/views/episode/show.gson +++ b/grails-app/views/episode/show.gson @@ -10,4 +10,6 @@ json g.render(episode, [deep:true, excludes: ['files']]){ hasFiles episode.getVideoFiles() ? true : false nextEpisode {id {((Episode)episode.getNextEpisode())?.id}} viewedStatus episode.getViewingStatus() + + poster_path episode.getPosterPath() } diff --git a/grails-app/views/mail/notification.gsp b/grails-app/views/mail/notification.gsp index 52da74aa6..972157620 100644 --- a/grails-app/views/mail/notification.gsp +++ b/grails-app/views/mail/notification.gsp @@ -212,7 +212,7 @@ - +

${notification.movie.title} (${notification.movie.release_date?.substring(0,4)})

@@ -231,7 +231,7 @@ - +

${notification.tvShow.name} (${notification.tvShow.first_air_date?.substring(0,4)})

diff --git a/grails-app/views/movie/_movie.gson b/grails-app/views/movie/_movie.gson index 69818056b..98f0632cf 100644 --- a/grails-app/views/movie/_movie.gson +++ b/grails-app/views/movie/_movie.gson @@ -10,6 +10,7 @@ json g.render(movie, [deep:true, excludes: ['poster_image']]){ files movie.files?.collect{it.simpleInstance} videoFiles movie.getVideoFiles()*.getSimpleInstance() subtitles movie.getSubtitles()*.getSimpleInstance() + poster_path movie.getPosterPath() poster_image_src movie.poster_image?.src inWatchlist movie.inWatchlist() status movie.getStatus() diff --git a/grails-app/views/notificationQueue/_notificationQueue.gson b/grails-app/views/notificationQueue/_notificationQueue.gson index 1ab1e0077..810388fa3 100644 --- a/grails-app/views/notificationQueue/_notificationQueue.gson +++ b/grails-app/views/notificationQueue/_notificationQueue.gson @@ -7,7 +7,7 @@ model { json g.render(notificationQueue){ if(notificationQueue.movie){ movie { - poster_path notificationQueue.movie?.poster_image + poster_path notificationQueue.movie?.getPosterPath() title notificationQueue.movie?.title release_date notificationQueue.movie?.release_date } @@ -15,7 +15,7 @@ json g.render(notificationQueue){ if(notificationQueue.tvShow){ tvShow { - poster_path notificationQueue.tvShow?.poster_path + poster_path notificationQueue.tvShow?.getPosterPath() name notificationQueue.tvShow?.name first_air_date notificationQueue.tvShow?.first_air_date } diff --git a/grails-app/views/tvShow/_tvShow.gson b/grails-app/views/tvShow/_tvShow.gson index 0fe4c02a0..b47fa19ec 100644 --- a/grails-app/views/tvShow/_tvShow.gson +++ b/grails-app/views/tvShow/_tvShow.gson @@ -10,4 +10,5 @@ json g.render(tvShow, [deep: true]){ episodesWithFilesCount tvShow.getFilteredEpisodes().findAll{it.files}.size() episodesCount tvShow.getFilteredEpisodes().size() inWatchlist tvShow.inWatchlist() + poster_path tvShow.getPosterPath() } diff --git a/grails-app/views/userActivity/_userActivity.gson b/grails-app/views/userActivity/_userActivity.gson index a51041dfd..1f162de2b 100644 --- a/grails-app/views/userActivity/_userActivity.gson +++ b/grails-app/views/userActivity/_userActivity.gson @@ -8,9 +8,9 @@ model { json g.render(userActivity, [excludes: ['user']]){ userId userActivity.userId username userActivity.user.username - def videoData = userActivity.video?.getSimpleInstance(['poster_path', 'release_date', 'episode_number', 'season_number']) + def videoData = userActivity.video?.getSimpleInstance(['poster_path:getPosterPath()', 'release_date', 'episode_number', 'season_number']) if(userActivity.video instanceof Episode && userActivity.video.show){ - videoData.show = userActivity.video.show?.getSimpleInstance(['name', 'id', 'poster_path', 'first_air_date']) + videoData.show = userActivity.video.show?.getSimpleInstance(['name', 'id', 'poster_path:getPosterPath()', 'first_air_date']) } video videoData diff --git a/grails-app/views/video/show.gson b/grails-app/views/video/show.gson index 551d9eff6..a808bd251 100644 --- a/grails-app/views/video/show.gson +++ b/grails-app/views/video/show.gson @@ -12,6 +12,8 @@ json g.render(video, [deep:true, excludes: ['files']]){ viewedStatus video.getViewingStatus() inWatchlist video.inWatchlist() + poster_path video.getPosterPath() + // if(video instanceof Episode){ //// nextEpisode { //// id video.nextEpisode?.id diff --git a/grails-app/views/watchlistEntry/_watchlistEntry.gson b/grails-app/views/watchlistEntry/_watchlistEntry.gson index aefbf9a4e..d24d474ff 100644 --- a/grails-app/views/watchlistEntry/_watchlistEntry.gson +++ b/grails-app/views/watchlistEntry/_watchlistEntry.gson @@ -21,7 +21,7 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU mediaType 'movie' release_date movie.release_date - poster_path movie.poster_path + poster_path movie.getPosterPath() backdrop_path movie.backdrop_path poster_image_src movie.poster_image?.src inWatchlist movie.inWatchlist() @@ -31,6 +31,7 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU mediaType 'genericVideo' release_date genericVideo.release_date + poster_path genericVideo.getPosterPath() poster_image_src genericVideo.poster_image?.src inWatchlist genericVideo.inWatchlist() } @@ -38,6 +39,7 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU Episode episode = watchlistEntry.video as Episode mediaType 'episode' + poster_path episode.getPosterPath() poster_image_src episode.getPosterPath() inWatchlist episode.inWatchlist() } @@ -48,6 +50,8 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU TvShow tvShow = watchlistEntry.tvShow as TvShow id tvShow.id name tvShow.name + + poster_path tvShow.getPosterPath() poster_image_src tvShow.poster_image?.src episodesWithFilesCount tvShow.getFilteredEpisodes().findAll{it.files}.size() episodesCount tvShow.getFilteredEpisodes().size()