Merge pull request #496 from TooYoungTooSimp/patch-1

Use anki.consts.SYNC_BASE instead of hardcoded url
This commit is contained in:
Damien Elmes 2020-03-06 21:22:18 +10:00 committed by GitHub
commit 4290bc81eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -28,6 +28,7 @@ Ijgnd
Yoonchae Lee
Evandro Coan <github.com/evandrocoan>
Alan Du <alanhdu@gmail.com>
Yuchen Lei <lyc@xuming.studio>
********************

View file

@ -10,6 +10,7 @@ from typing import List, Union
import aqt
from anki import hooks
from anki.consts import SYNC_BASE
from anki.rsbackend import TR, Interrupted, MediaSyncProgress, Progress, ProgressKind
from anki.types import assert_impossible
from anki.utils import intTime
@ -76,7 +77,7 @@ class MediaSyncer:
shard_str = str(shard)
else:
shard_str = ""
return f"https://sync{shard_str}.ankiweb.net/msync/"
return f"{SYNC_BASE % shard_str}msync/"
def _log_and_notify(self, entry: LogEntry) -> None:
entry_with_time = LogEntryWithTime(time=intTime(), entry=entry)