def __load_last_book(self): """ Loads the last book into the player """ player.load_last_book() if player.get_current_track(): self.titlebar.load_last_book()
def __load_last_book(self): """ Loads the last book into the player """ player.load_last_book() if db.Settings.get().last_played_book is not None: self.__update_track_ui() self.__update_ui_time(self.progress_scale) cur_m, cur_s = player.get_current_duration_ui() self.progress_scale.set_value(cur_m * 60 + cur_s) pos = int(player.get_current_track().position) if self.settings.get_boolean("replay"): log.info("Replaying the previous 30 seconds.") amount = 30 * 1000000000 if (pos < amount): pos = 0 else: pos = pos - amount self.progress_scale.set_value(int(pos / 1000000000))