Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change primetime to left edge #561

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/python/Components/EpgListGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ def applySkin(self, desktop, screen):
self.skinAttributes = attribs
return EPGListBase.applySkin(self, desktop, screen)

def setTimeFocus(self, timeFocus):
def setTimeFocus(self, timeFocus, center=True):
# prefer time being aligned in the middle of the EPG, but clip to the maximum EPG data history
self.timeBase = int(timeFocus) - self.timeEpochSecs // 2
self.timeBase = int(timeFocus)
if center:
self.timeBase -= self.timeEpochSecs // 2
abs0 = int(time()) - self.epgHistorySecs
if self.timeBase < abs0:
# we're viewing close to the start of EPG data
Expand Down
4 changes: 3 additions & 1 deletion lib/python/Screens/EpgSelectionGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ def goToPrimeTime(self):
primetime = mktime(basetime)
if primetime + 3600 < time():
primetime += 86400
self.goToTime(primetime)
self["list"].setTimeFocus(primetime, False)
self["list"].fillEPG()
self.moveTimeLines(True)

def goToCurrentTimeAndTop(self):
self.toTop()
Expand Down