fix v2 timing being returned for v1 users

This commit is contained in:
Damien Elmes 2020-03-23 13:18:48 +10:00
parent 4e2e0d1b84
commit 966eb666f0
2 changed files with 6 additions and 1 deletions

View file

@ -1385,11 +1385,14 @@ where id = ?
return self.col.conf.get("rollover", 4) return self.col.conf.get("rollover", 4)
def _timing_today(self) -> SchedTimingToday: def _timing_today(self) -> SchedTimingToday:
roll: Optional[int] = None
if self.col.schedVer() > 1:
roll = self._rolloverHour()
return self.col.backend.sched_timing_today( return self.col.backend.sched_timing_today(
self.col.crt, self.col.crt,
self._creation_timezone_offset(), self._creation_timezone_offset(),
self._current_timezone_offset(), self._current_timezone_offset(),
self._rolloverHour(), roll,
) )
def _current_timezone_offset(self) -> Optional[int]: def _current_timezone_offset(self) -> Optional[int]:

View file

@ -5,6 +5,7 @@ import copy
import json import json
import os import os
import weakref import weakref
from dataclasses import dataclass
from typing import Any, Dict, Optional, Tuple from typing import Any, Dict, Optional, Tuple
from anki.collection import _Collection from anki.collection import _Collection
@ -23,6 +24,7 @@ from anki.stdmodels import (
from anki.utils import intTime from anki.utils import intTime
@dataclass
class ServerData: class ServerData:
minutes_west: Optional[int] = None minutes_west: Optional[int] = None