series work

if there is more than one season of a series homeflix should manage that too
This commit is contained in:
Jannik
2018-04-15 21:30:26 +02:00
parent 94e32b938a
commit 0c1b21ac05
3 changed files with 35 additions and 14 deletions

View File

@ -143,12 +143,13 @@ public class PlayerController {
public void changed(ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) {
currentTime = newValue.toMillis(); // set the current time
int episode = !film.getEpisode().isEmpty() ? Integer.parseInt(film.getEpisode()) : 0;
int season = !film.getSeason().isEmpty() ? Integer.parseInt(film.getSeason()) : 0;
// if we are end time -10 seconds, do autoplay, if activated
if ((duration - currentTime) < 10000 && episode != 0 && autoplay) {
autoplay = false;
mainWCon.getDbController().setCurrentTime(film.getStreamUrl(), 0); // reset old video start time
FilmTabelDataType nextFilm = mainWCon.getDbController().getNextEpisode(film.getTitle(), (episode + 1));
FilmTabelDataType nextFilm = mainWCon.getDbController().getNextEpisode(film.getTitle(), (episode + 1), season);
if (nextFilm != null) {
mediaPlayer.stop();
init(mainWCon, player, nextFilm);