Skip to content

Commit

Permalink
further improvements to suggestNextVideo looking through all other mo…
Browse files Browse the repository at this point in the history
…vies

otherwise genre was randomly picked at tomes
  • Loading branch information
dularion committed Nov 3, 2019
1 parent d1e13ce commit eea76d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions grails-app/domain/streama/Video.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ class Video implements SimpleInstance{

List<Movie> allOtherMovies = Movie.where{
id != this.id
genre{
id == firstGenre?.id
}
isNotEmpty("files")
deleted != true
}.list()

result = allOtherMovies.max{ it.genre*.id?.intersect(this.genre*.id)?.size()}
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
}

if (this instanceof Episode) {
Expand Down

0 comments on commit eea76d5

Please sign in to comment.