Skip to content

Commit eea76d5

Browse files
author
dularion
committed
further improvements to suggestNextVideo looking through all other movies
otherwise genre was randomly picked at tomes
1 parent d1e13ce commit eea76d5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

grails-app/domain/streama/Video.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,11 @@ class Video implements SimpleInstance{
132132

133133
List<Movie> allOtherMovies = Movie.where{
134134
id != this.id
135-
genre{
136-
id == firstGenre?.id
137-
}
135+
isNotEmpty("files")
138136
deleted != true
139137
}.list()
140138

141-
result = allOtherMovies.max{ it.genre*.id?.intersect(this.genre*.id)?.size()}
139+
result = allOtherMovies.max{ it.genre*.id?.intersect(this.genre*.id)?.size()} //TODO: how big of a performance impact does this have for a large DB? need to test
142140
}
143141

144142
if (this instanceof Episode) {

0 commit comments

Comments
 (0)