Skip to content

Commit 83a9cf4

Browse files
author
dularion
committed
fix broken images in several places
1 parent 9c97665 commit 83a9cf4

26 files changed

+65
-34
lines changed

grails-app/assets/javascripts/streama/templates/admin-fileManager.tpl.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="row">
44
<div class="col-md-6">
55
<h1>
6-
File Manager
6+
File Manager <span class="text-muted text-xs">({{filesCount}} items)</span>
77
</h1>
88
</div>
99
</div>
@@ -68,7 +68,7 @@ <h1>
6868
<td>{{file.contentType}}</td>
6969
<td>{{file.fileExists}}</td>
7070
<td>
71-
<div ng-repeat="video in file.videos"><img width="40px" ng-src="https://image.tmdb.org/t/p/w92/{{video.poster_path}}"/></div>
71+
<div ng-repeat="video in file.videos"><img width="40px" ng-src="{{video.poster_path}}"/></div>
7272
<div class="fade-50" ng-if="!file.videos.length">
7373
None
7474
</div>

grails-app/assets/javascripts/streama/templates/admin-genres.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<div class="row">
33
<div class="col-xs-8">
4-
<h1>Genre</h1>
4+
<h1>Genre <span class="text-muted text-xs">({{vm.genres.length}} items)</span></h1>
55
<p>Here you can manage the genres for Videos / TvShows.</p>
66
<p>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.</p>
77
</div>

grails-app/assets/javascripts/streama/templates/admin-movie.tpl.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h1>
113113

114114
<div class="col-sm-4 col-lg-3" >
115115
<img ng-if="!movie.poster_path && !movie.poster_image_src" ng-src="{{basePath}}assets/poster-not-found.png"/>
116-
<img ng-if="movie.poster_path" ng-src="https://image.tmdb.org/t/p/w500/{{movie.poster_path}}"/>
116+
<img ng-if="movie.poster_path" ng-src="{{movie.poster_path}}"/>
117117
<img ng-if="movie.poster_image_src" ng-src="{{movie.poster_image_src}}"/>
118118
</div>
119119
</div>
@@ -146,7 +146,7 @@ <h5>Suggested by TheMovieDb.org</h5>
146146
</div>
147147
</div>
148148
<div class="media-item" >
149-
<img ng-src="https://image.tmdb.org/t/p/w300/{{movie.poster_path}}"/>
149+
<img ng-src="{{movie.poster_path}}"/>
150150
</div>
151151
<div class="media-meta">Release: {{movie.release_date.substring(0, 4)}} | <i class="ion-ios-star"></i> {{movie.vote_average}}</div>
152152
</div>

grails-app/assets/javascripts/streama/templates/admin-movies.tpl.htm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<div class="row">
22
<div class="col-md-6">
33
<h1>
4-
Movies <video-sort-order-dropdown ng-model="vm.movie.sorter" ng-model-options="{getterSetter: true}" dropdown-type="'movie'"/>
4+
Movies <span class="text-muted text-xs">({{vm.movie.total}} items)</span>
5+
<video-sort-order-dropdown ng-model="vm.movie.sorter" ng-model-options="{getterSetter: true}" dropdown-type="'movie'"/>
56
</h1>
67

78
<input placeholder="{{vm.searchText}}" type="text" ng-model="vm.movie.filter.title" ng-change="vm.doSearch(vm.movie.filter.title)"
@@ -64,7 +65,7 @@ <h3>Want to add a new Movie?</h3>
6465
</div>
6566
</div>
6667
<div class="media-item" >
67-
<img ng-src="https://image.tmdb.org/t/p/w300/{{movie.poster_path}}"/>
68+
<img ng-src="{{movie.poster_path}}"/>
6869
</div>
6970
<div class="media-meta">Release: {{::movie.release_date.substring(0, 4)}} | <i class="ion-ios-star"></i> {{::movie.vote_average}}</div>
7071
</div>

grails-app/assets/javascripts/streama/templates/admin-new-releases.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h1>Dashboard Highlights</h1>
2424
<tr ng-repeat="notification in notifications | orderBy: '-dateCreated'">
2525
<td>{{notification.dateCreated | date:'short'}}</td>
2626
<td>
27-
<img ng-if="notification.media.poster_path" ng-src="https://image.tmdb.org/t/p/w92/{{notification.media.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
27+
<img ng-if="notification.media.poster_path" ng-src="{{notification.media.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
2828
{{notification.media.title || notification.media.name}} <span ng-if="notification.media.release_date">({{notification.media.release_date.substring(0,4)}})</span>
2929
</td>
3030
<td>

grails-app/assets/javascripts/streama/templates/admin-notifications.tpl.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ <h1>Notification Queue</h1>
3030
<tr ng-repeat="notification in notifications | orderBy: '-dateCreated'" ng-class="{'fade-50': notification.isCompleted}">
3131
<td>{{notification.dateCreated | date:'short'}}</td>
3232
<td ng-if="notification.movie">
33-
<img ng-if="notification.movie.poster_path" ng-src="https://image.tmdb.org/t/p/w92/{{notification.movie.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
33+
<img ng-if="notification.movie.poster_path" ng-src="{{notification.movie.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
3434
{{notification.movie.title}} ({{notification.movie.release_date.substring(0,4)}})
3535
</td>
3636
<td ng-if="notification.tvShow">
37-
<img ng-if="notification.tvShow.poster_path" ng-src="https://image.tmdb.org/t/p/w92/{{notification.tvShow.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
37+
<img ng-if="notification.tvShow.poster_path" ng-src="{{notification.tvShow.poster_path}}" style="max-width: 50px; margin-right: 10px;"/>
3838
{{notification.tvShow.name}} ({{notification.tvShow.first_air_date.substring(0,4)}})
3939
</td>
4040
<td>{{notification.description}}</td>

grails-app/assets/javascripts/streama/templates/admin-show.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h1>
8484

8585
<div class="col-sm-4">
8686
<div ng-if="!show.manualInput">
87-
<img ng-show="show.poster_path" ng-src="https://image.tmdb.org/t/p/w500/{{show.poster_path}}"/>
87+
<img ng-show="show.poster_path" ng-src="{{show.poster_path}}"/>
8888
<img ng-show="!show.poster_path" ng-src="{{basePath}}assets/poster-not-found.png"/>
8989
</div>
9090

grails-app/assets/javascripts/streama/templates/admin-shows.tpl.htm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="row">
22
<div class="col-md-6">
33
<h1>
4-
Shows
4+
Shows <span class="text-muted text-xs">({{tvShow.total}} items)</span>
55
<video-sort-order-dropdown ng-model="tvShow.sorter" ng-model-options="{getterSetter: true}" dropdown-type="'tvShow'"/>
66
</h1>
77
</div>
@@ -36,7 +36,7 @@ <h1>
3636
ng-repeat="show in tvShow.list"
3737
ui-sref="admin.show({showId: show.id})">
3838
<div class="media-item" >
39-
<img ng-if="show.poster_path" ng-src="https://image.tmdb.org/t/p/w300/{{show.poster_path}}"/>
39+
<img ng-if="show.poster_path" ng-src="{{show.poster_path}}"/>
4040
<img ng-if="!show.poster_path && !show.manualInput" ng-src="{{basePath}}assets/poster-not-found.png"/>
4141

4242
<img ng-show="show.manualInput && show.poster_image_src" ng-src="{{show.poster_image_src}}">
@@ -69,7 +69,7 @@ <h3>Want to add a new Show?</h3>
6969
</div>
7070
</div>
7171
<div class="media-item" >
72-
<img ng-src="https://image.tmdb.org/t/p/w300/{{show.poster_path}}"/>
72+
<img ng-src="{{show.poster_path}}"/>
7373
</div>
7474
<div class="media-meta">Release: {{::show.release_date.substring(0, 4)}} | <i class="ion-ios-star"></i> {{::show.vote_average}}</div>
7575
</div>

grails-app/assets/javascripts/streama/templates/admin-videos.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<button class="btn btn-primary pull-right btn-lg" ng-click="openGenericVideoModal()">Create generic video</button>
22

33
<h1>
4-
Other Videos
4+
Other Videos <span class="text-muted text-xs">({{videos.length}} items)</span>
55
<video-sort-order-dropdown ng-model="currentSort" dropdown-type="'movie'"/>
66
</h1>
77

grails-app/assets/javascripts/streama/templates/modal--media-detail.tpl.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ <h4>{{'VIDEO.GENRE' | translate}}</h4>
9696
</ul>
9797
</div>
9898

99-
<img ng-if="media.still_path" ng-src="https://image.tmdb.org/t/p/w300/{{media.still_path}}"/>
99+
<img ng-if="media.still_path" ng-src="{{media.still_path}}"/>
100100

101101
<div ng-if="media.trailerKey">
102102
<h4>{{'VIDEO.TRAILER' | translate}}</h4>
@@ -105,7 +105,7 @@ <h4>{{'VIDEO.TRAILER' | translate}}</h4>
105105
</div>
106106
</div>
107107
<div class="col-sm-4">
108-
<img ng-if="media.poster_path && !media.poster_image_src" ng-src="https://image.tmdb.org/t/p/w300/{{media.poster_path}}"/>
108+
<img ng-if="media.poster_path && !media.poster_image_src" ng-src="{{media.poster_path}}"/>
109109
<img ng-if="media.poster_image_src" ng-src="{{media.poster_image_src}}"/>
110110
</div>
111111
</div>

grails-app/assets/javascripts/streama/templates/modal--notification-add.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>{{selectedItem.name}}</h2>
3434

3535
<div ng-switch-when="movie">
3636
<div class="col-md-4" ng-if="selectedItem.poster_path">
37-
<img ng-src="https://image.tmdb.org/t/p/w300/{{selectedItem.poster_path}}"/>
37+
<img ng-src="{{selectedItem.poster_path}}"/>
3838
</div>
3939
<div class="col-md-8">
4040
<h2>{{selectedItem.title}}</h2>

grails-app/assets/javascripts/streama/templates/settings-user-activity.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h4>Sort</h4>
7878
<td>{{(activity.lastUpdated || activity.dateCreated) | date:'short'}}</td>
7979
<td style="width: 185px;">
8080
<img ng-if="activity.video.poster_path || activity.video.show.poster_path"
81-
ng-src="https://image.tmdb.org/t/p/w92/{{activity.video.show.poster_path || activity.video.poster_path}}"
81+
ng-src="{{activity.video.show.poster_path || activity.video.poster_path}}"
8282
style="max-width: 50px; margin-right: 10px; float: left;"/>
8383
<div>{{activity.video.title || activity.video.name}}</div>
8484
<div class="text-muted" ng-if="activity.video.canonicalName === 'streama.Episode'">s{{activity.video.season_number| padnumber:2}}e{{activity.video.episode_number | padnumber:2}}</div>

grails-app/assets/stylesheets/_util.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ a{
269269
.text-sm{
270270
font-size: 0.75em;
271271
}
272+
.text-xs{
273+
font-size: 0.50em;
274+
}
272275

273276

274277

grails-app/controllers/streama/GenericVideoController.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GenericVideoController {
1414
def index(Integer max) {
1515
params.max = Math.min(max ?: 10, 100)
1616
JSON.use('admin') {
17-
respond GenericVideo.where{deleted != true}.list(), [status: OK]
17+
respond GenericVideo.where{deleted != true}.list(max: 9999), [status: OK]
1818
}
1919
}
2020

grails-app/domain/streama/TvShow.groovy

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,17 @@ class TvShow implements SimpleInstance {
9090
return listEpisodesWithFiles().min { it.seasonEpisodeMerged }
9191
}
9292

93-
def getPosterPath(){
94-
String TMDB_BASE_PATH = 'https://image.tmdb.org/t/p/w300/'
93+
def getPosterPath(Integer width = 300){
94+
if(this.poster_image){
95+
return this.poster_image.src
96+
}
97+
if(!this.poster_path){
98+
return
99+
}
100+
String TMDB_BASE_PATH = "https://image.tmdb.org/t/p/w${width}/"
101+
if(this.poster_path?.startsWith('http')){
102+
return this.poster_path
103+
}
95104
return TMDB_BASE_PATH + this.poster_path
96105
}
97106

grails-app/domain/streama/Video.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,21 @@ class Video implements SimpleInstance{
164164

165165
def getPosterPath(Integer width = 300){
166166
String TMDB_BASE_PATH = "https://image.tmdb.org/t/p/w${width}/"
167+
167168
if(this instanceof Episode){
169+
if(this.show.poster_path?.startsWith('http')){
170+
return this.show.poster_path
171+
}
168172
return TMDB_BASE_PATH + this.show.poster_path
169173
}else if(this instanceof GenericVideo){
170174
return this.poster_image?.getSrc()
171-
}else{
172-
return TMDB_BASE_PATH + this.poster_path
173175
}
176+
177+
if(this.poster_path?.startsWith('http')){
178+
return this.poster_path
179+
}
180+
181+
return TMDB_BASE_PATH + this.poster_path
174182
}
175183

176184

grails-app/services/streama/marshallers/MediaDetailMarshallerService.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MediaDetailMarshallerService {
2424
result['overview'] = tvShow.overview
2525
result['apiId'] = tvShow.apiId
2626
result['backdrop_path'] = tvShow.backdrop_path
27-
result['poster_path'] = tvShow.poster_path
27+
result['poster_path'] = tvShow.getPosterPath()
2828
result['first_air_date'] = tvShow.first_air_date
2929
result['original_language'] = tvShow.original_language
3030
result['vote_average'] = tvShow.vote_average
@@ -47,7 +47,7 @@ class MediaDetailMarshallerService {
4747
result['mediaType'] = 'movie'
4848
result['dateCreated'] = movie.dateCreated
4949
result['lastUpdated'] = movie.lastUpdated
50-
result['poster_path'] = movie.poster_path
50+
result['poster_path'] = movie.getPosterPath()
5151
result['release_date'] = movie.release_date
5252
result['title'] = movie.title
5353
result['overview'] = movie.overview

grails-app/services/streama/marshallers/PlayerMarshallerService.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PlayerMarshallerService {
7070
returnArray['title'] = video.title
7171
returnArray['release_date'] = video.release_date
7272
returnArray['backdrop_path'] = video.buildImagePath('backdrop_path', "w1280")
73-
returnArray['poster_path'] = video.poster_path
73+
returnArray['poster_path'] = video.getPosterPath()
7474
returnArray['trailerKey'] = video.trailerKey
7575
returnArray['nextVideo'] = video.suggestNextVideo()?.getSimpleInstance()
7676

grails-app/views/episode/show.gson

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ json g.render(episode, [deep:true, excludes: ['files']]){
1010
hasFiles episode.getVideoFiles() ? true : false
1111
nextEpisode {id {((Episode)episode.getNextEpisode())?.id}}
1212
viewedStatus episode.getViewingStatus()
13+
14+
poster_path episode.getPosterPath()
1315
}

grails-app/views/mail/notification.gsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
<g:each in="${notificationQueues.findAll{it.movie}}" var="notification">
213213
<tr>
214214
<td width="100px">
215-
<img src="https://image.tmdb.org/t/p/w92/${notification.movie.poster_path}"/>
215+
<img src="${notification.movie.getPosterPath(92)}"/>
216216
</td>
217217
<td>
218218
<p><strong>${notification.movie.title} (${notification.movie.release_date?.substring(0,4)})</strong></p>
@@ -231,7 +231,7 @@
231231
<g:each in="${notificationQueues.findAll{it.tvShow}}" var="notification">
232232
<tr>
233233
<td width="100px">
234-
<img src="https://image.tmdb.org/t/p/w92/${notification.tvShow.poster_path}"/>
234+
<img src="${notification.tvShow.getPosterPath(92)}"/>
235235
</td>
236236
<td>
237237
<p><strong>${notification.tvShow.name} (${notification.tvShow.first_air_date?.substring(0,4)})</strong></p>

grails-app/views/movie/_movie.gson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ json g.render(movie, [deep:true, excludes: ['poster_image']]){
1010
files movie.files?.collect{it.simpleInstance}
1111
videoFiles movie.getVideoFiles()*.getSimpleInstance()
1212
subtitles movie.getSubtitles()*.getSimpleInstance()
13+
poster_path movie.getPosterPath()
1314
poster_image_src movie.poster_image?.src
1415
inWatchlist movie.inWatchlist()
1516
status movie.getStatus()

grails-app/views/notificationQueue/_notificationQueue.gson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ model {
77
json g.render(notificationQueue){
88
if(notificationQueue.movie){
99
movie {
10-
poster_path notificationQueue.movie?.poster_image
10+
poster_path notificationQueue.movie?.getPosterPath()
1111
title notificationQueue.movie?.title
1212
release_date notificationQueue.movie?.release_date
1313
}
1414
}
1515

1616
if(notificationQueue.tvShow){
1717
tvShow {
18-
poster_path notificationQueue.tvShow?.poster_path
18+
poster_path notificationQueue.tvShow?.getPosterPath()
1919
name notificationQueue.tvShow?.name
2020
first_air_date notificationQueue.tvShow?.first_air_date
2121
}

grails-app/views/tvShow/_tvShow.gson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ json g.render(tvShow, [deep: true]){
1010
episodesWithFilesCount tvShow.getFilteredEpisodes().findAll{it.files}.size()
1111
episodesCount tvShow.getFilteredEpisodes().size()
1212
inWatchlist tvShow.inWatchlist()
13+
poster_path tvShow.getPosterPath()
1314
}

grails-app/views/userActivity/_userActivity.gson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ model {
88
json g.render(userActivity, [excludes: ['user']]){
99
userId userActivity.userId
1010
username userActivity.user.username
11-
def videoData = userActivity.video?.getSimpleInstance(['poster_path', 'release_date', 'episode_number', 'season_number'])
11+
def videoData = userActivity.video?.getSimpleInstance(['poster_path:getPosterPath()', 'release_date', 'episode_number', 'season_number'])
1212
if(userActivity.video instanceof Episode && userActivity.video.show){
13-
videoData.show = userActivity.video.show?.getSimpleInstance(['name', 'id', 'poster_path', 'first_air_date'])
13+
videoData.show = userActivity.video.show?.getSimpleInstance(['name', 'id', 'poster_path:getPosterPath()', 'first_air_date'])
1414
}
1515

1616
video videoData

grails-app/views/video/show.gson

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ json g.render(video, [deep:true, excludes: ['files']]){
1212
viewedStatus video.getViewingStatus()
1313
inWatchlist video.inWatchlist()
1414

15+
poster_path video.getPosterPath()
16+
1517
// if(video instanceof Episode){
1618
//// nextEpisode {
1719
//// id video.nextEpisode?.id

grails-app/views/watchlistEntry/_watchlistEntry.gson

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU
2121

2222
mediaType 'movie'
2323
release_date movie.release_date
24-
poster_path movie.poster_path
24+
poster_path movie.getPosterPath()
2525
backdrop_path movie.backdrop_path
2626
poster_image_src movie.poster_image?.src
2727
inWatchlist movie.inWatchlist()
@@ -31,13 +31,15 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU
3131

3232
mediaType 'genericVideo'
3333
release_date genericVideo.release_date
34+
poster_path genericVideo.getPosterPath()
3435
poster_image_src genericVideo.poster_image?.src
3536
inWatchlist genericVideo.inWatchlist()
3637
}
3738
if (watchlistEntry.video instanceof Episode) {
3839
Episode episode = watchlistEntry.video as Episode
3940

4041
mediaType 'episode'
42+
poster_path episode.getPosterPath()
4143
poster_image_src episode.getPosterPath()
4244
inWatchlist episode.inWatchlist()
4345
}
@@ -48,6 +50,8 @@ json g.render(watchlistEntry, [deep:true, includes: ['id', 'dateCreated', 'lastU
4850
TvShow tvShow = watchlistEntry.tvShow as TvShow
4951
id tvShow.id
5052
name tvShow.name
53+
54+
poster_path tvShow.getPosterPath()
5155
poster_image_src tvShow.poster_image?.src
5256
episodesWithFilesCount tvShow.getFilteredEpisodes().findAll{it.files}.size()
5357
episodesCount tvShow.getFilteredEpisodes().size()

0 commit comments

Comments
 (0)