diff --git a/addon/__init__.py b/addon/__init__.py index 188448f..8e7cbe7 100644 --- a/addon/__init__.py +++ b/addon/__init__.py @@ -5,7 +5,6 @@ import aqt import anki.consts import anki.sync -ORIG_SYNC_BASE = anki.consts.SYNC_BASE DEFAULT_ADDR = "http://localhost:27701/" config = aqt.mw.addonManager.getConfig(__name__) @@ -44,9 +43,9 @@ def updateserver(self, text): if config['enabled']: addr = text or self.customServerAddr.placeholderText() config['addr'] = addr - anki.consts.SYNC_BASE = addr + "%s" + anki.sync.SYNC_BASE = addr + "%s" else: - anki.consts.SYNC_BASE = ORIG_SYNC_BASE + anki.sync.SYNC_BASE = anki.consts.SYNC_BASE aqt.mw.addonManager.writeConfig(__name__, config) def updateui(self, state): @@ -54,5 +53,5 @@ def updateui(self, state): self.customServerAddr.setEnabled(state == Qt.Checked) if config['enabled']: - anki.consts.SYNC_BASE = config['addr'] + "%s" + anki.sync.SYNC_BASE = config['addr'] + "%s" aqt.preferences.Preferences.__init__ = wrap(aqt.preferences.Preferences.__init__, addui, "after") diff --git a/ankisyncd.conf b/ankisyncd.conf index e0c35ed..31c4ee0 100644 --- a/ankisyncd.conf +++ b/ankisyncd.conf @@ -1,10 +1,10 @@ [sync_app] # change to 127.0.0.1 if you don't want the server to be accessible from the internet -host = 0.0.0.0 +host = 127.0.0.1 port = 27701 -data_root = ./collections +data_root = /home/flan/.local/share/ankisyncd/ base_url = /sync/ base_media_url = /msync/ -auth_db_path = ./auth.db +auth_db_path = /home/flan/.local/share/ankisyncd/auth.db # optional, for session persistence between restarts -session_db_path = ./session.db +session_db_path = /home/flan/.local/share/ankisyncd/session.db