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

Fix to reflect Anki >2.1.20 changes #60

Closed
wants to merge 2 commits 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ and put it in the `ankisyncd` directory.

addr = "http://127.0.0.1:27701/" # put your server address here
anki.sync.SYNC_BASE = "%s" + addr
aqt.mediasync.SYNC_BASE = "%s" + addr
def resetHostNum():
aqt.mw.pm.profile['hostNum'] = None
anki.hooks.addHook("profileLoaded", resetHostNum)
Expand Down
8 changes: 7 additions & 1 deletion ankisyncd/sync_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _adopt_media_changes_from_zip(self, zip_file):
# Remove media files that were removed on the client.
media_to_remove = []
for normname, ordinal in meta:
if ordinal == '':
if not ordinal:
media_to_remove.append(self._normalize_filename(normname))

# Add media files that were added on the client.
Expand Down Expand Up @@ -499,6 +499,12 @@ def __call__(self, req):
except KeyError:
hkey = None

if hkey == None:
try:
hkey = req.GET['k']
except KeyError:
hkey = None

session = self.session_manager.load(hkey, self.create_session)

if session is None:
Expand Down