Commit Graph

5434 Commits

Author SHA1 Message Date
abdo
d5b3927d0b Allow copying of images using context menu 2020-09-22 06:32:37 +03:00
Damien Elmes
fee9b199d5 allow dragging of images in review screen again
when we were using webkit+file URLs, this deleted files from the
media folder! But we're behind a HTTP server now, so this should
be safe.

https://forums.ankiweb.net/t/no-longer-able-to-copy-latex-output/3128/5

originally disabled in
dd4bae6e8d
2020-09-22 10:29:53 +10:00
Damien Elmes
76acf04dc0 update schema to fix default initial ease in deck configs
Closes #766

- changes the on-disk representation from % to a multiplier,
eg 250 -> 2.5, as this is consistent with the other options
- resets deck configs at or below 1.3 to 2.5
- for any cards that were using a reset deck config, reset their
current factor if it's at or below 2.0x. The cutoff is arbitrary,
and just intended to make sure we catch cards the user has rated
Easy on multiple times. The existing due dates are left alone.
2020-09-22 08:16:39 +10:00
Damien Elmes
133fe8518b
Merge pull request #765 from Arthur-Milchior/ignoreGuids
NF: remove _changedGuids
2020-09-21 14:35:44 +10:00
Arthur Milchior
51ba2b5870 NF: remove _changedGuids
Nothing is ever added to the map.
That was a bug detected by lint in ankidroid
2020-09-21 06:02:10 +02:00
Damien Elmes
d74cc2e9b0 stop is:due gathering learning cards that are not due yet
https://forums.ankiweb.net/t/how-to-avoid-rebuilding-filtered-decks-to-skip-learning-cards-steps/3551/
2020-09-21 11:41:54 +10:00
Damien Elmes
fe36fa5fd9 fix average added
https://forums.ankiweb.net/t/statistics-bug-cards-added-average/3556
2020-09-21 11:31:27 +10:00
Damien Elmes
a3609153cc
Merge pull request #764 from abdnh/back-side-only
'Show Both Sides' -> 'Back Side Only'
2020-09-21 10:47:52 +10:00
abdo
b22b104119 'Show Both Sides' -> 'Back Side Only' 2020-09-20 19:31:00 +03:00
Damien Elmes
45724a0474 small learning steps were being stored as a float
https://forums.ankiweb.net/t/bug-with-fractional-learning-intervals/3524/5
2020-09-20 10:29:39 +10:00
Damien Elmes
755a58b96c fix incorrect SQL in previous change 2020-09-19 12:27:00 +10:00
Damien Elmes
91759694a1 congrats_info() failed if learning card had negative due
https://forums.ankiweb.net/t/integralvalueoutofrange-for-filtered-deck/3353
2020-09-18 20:14:35 +10:00
Damien Elmes
8bde6749b1 sched_timing_today() needs a default rollover hour
When unset it was reverting to the V1 code.

https://forums.ankiweb.net/t/daily-counts-are-reset-on-sync/3441/16
2020-09-18 19:13:47 +10:00
Damien Elmes
caa703126c check original due in card stats
https://forums.ankiweb.net/t/how-come-some-of-my-cards-are-showing-retrospective-due-dates/3434/6
2020-09-17 14:36:18 +10:00
Damien Elmes
dd835e692d
Merge pull request #761 from kelciour/linux-audio-stops-working
Revert mpv back to listening for idle callback
2020-09-17 14:15:11 +10:00
kelciour
72ea605050 Revert back to listening for idle callback
https://forums.ankiweb.net/t/anki-2-1-33-linux-audio-stops-working/3023
2020-09-16 09:25:18 +03:00
Damien Elmes
a8eba9d341
Merge pull request #758 from hgiesel/synchook
Add sync_will_start and sync_did_finish hook
2020-09-15 21:20:46 +10:00
Henrik Giesel
f147e90146 Move sync_did_finish before reset 2020-09-15 13:06:11 +02:00
Damien Elmes
dd1e19d5af
Merge pull request #760 from abdnh/extended-drop
Support extended drag & drop
2020-09-15 20:31:43 +10:00
abdo
151f854fa2 Support extended drag & drop 2020-09-14 17:07:31 +03:00
Henrik Giesel
0c7caa1644 Add some documentation to sync_did_finish hook 2020-09-14 13:18:16 +02:00
Henrik Giesel
6e5a826993 Put sync_did_finish hook before after_sync because it might unload collection 2020-09-14 13:06:20 +02:00
Henrik Giesel
8dcd84e7c0 Add sync_will_start and sync_did_finish hook 2020-09-14 12:22:01 +02:00
Damien Elmes
340c749d4c add pointers to other README files 2020-09-09 10:01:42 +10:00
Damien Elmes
8accd96823
Merge pull request #753 from kaczmarj/add/dockerfile
add Dockerfile
2020-09-09 09:49:13 +10:00
Damien Elmes
061d89bbda fix padding in RTL langs
closes #757
2020-09-09 09:44:15 +10:00
Jakub Kaczmarzyk
d808415a9e
Merge branch 'master' into add/dockerfile 2020-09-08 14:59:32 -04:00
Jakub Kaczmarzyk
d07185693c
Update Dockerfile and add README.docker
- Fix permissions in `/opt` to allow non-root user to compile Anki (which requires reading and/or creating files below `/opt`).
- Create `pythonbuilder` stage, which runs only `make build`. The wheels from this stage are copied into the final stage.
- Add README.docker
2020-09-08 14:58:25 -04:00
Damien Elmes
4faaeb492f typo 2020-09-07 16:09:52 +10:00
Damien Elmes
d4edbd5b11 doc updates
thanks to Robert: https://github.com/ankitects/anki/pull/756

closes #756
2020-09-07 16:03:48 +10:00
Damien Elmes
0f1e277c59
Merge pull request #752 from cyphar/rust-deps
rust: switch to stable compilers
2020-09-07 15:25:38 +10:00
Aleksa Sarai
16864e616f
rust: switch to stable compilers
The only dependency which required nightly compilers was pyo3, which
supports stable Rust (1.39.0 and later) since version 0.11.0. Supporting
stable Rust makes it easier to package Anki for distributions. No other
code changes were required.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-05 19:39:51 +10:00
Aleksa Sarai
d2ada5a1ee
rslib: disable bzip2 feature
We can't link against libzip2.so.1 when building manylinux wheels, but
the only dependency which required this was "zip" and we don't appear to
make use of bzip2 in Anki.

This fixes the following "make build" error on Linux:

  x maturin failed
    Caused by: Failed to ensure manylinux compliance
    Caused by: Your library is not manylinux compliant because it links the following forbidden libraries: ["libbz2.so.1"]

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-05 19:39:11 +10:00
Aleksa Sarai
312393e825
rs: remove most &mut references in BackendService
The previous implementation had some slightly questionable memory safety
properties (older versions of PyO3 didn't uphold the Rust aliasing rules
and would thus create multiple &mut references to #[pyclass] objects).
This explains why Backend has internal Mutex<T>s even though all of its
methods took &mut self.

The solution is to simply make all methods take &self, which luckily
doesn't pose too make issues -- most of the code inside Backend already
has sufficient locking. The only two things which needed to be
explicitly handled where:

1. "self.runtime" which was fairly easy to handle. All usages of
   the Runtime only require an immutable reference to create a new
   Handle, so we could switch to OnceCell which provides
   lazy-initialisation semantics without needing a more heavy-handed
   Mutex<tokio::runtime::Handle>.

2. "self.sync_abort" was simply wrapped in a Mutex<>, though some of the
   odd semantics of sync_abort (not being able to handle multiple
   processes synchronising at the same time) become pretty obvious with
   this change (for now we just log a warning in that case). In
   addition, switch to an RAII-style guard to make sure we don't forget
   to clear the abort_handle.

As a result, we now no longer break Rust's aliasing rules and we can
build with newer versions of PyO3 which have runtime checks for these
things (and build on stable Rust).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-05 19:37:59 +10:00
Aleksa Sarai
70339e07f9
rslib: auto-format protobuf code
prost-build doesn't generate rustfmt-safe code, so we had to add it to
the ignore list for rustfmt on "make check". However, the ignore list
isn't supported by stable rustfmt, so we have to work around this some
other way -- in this case, just do "rustfmt" on the generated file in
"build.rs" (this way, formatting errors in checked-in source code are
still caught but generated code doesn't cause spurrious errors).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-04 16:30:06 +10:00
Damien Elmes
0455e760c6 another showDupes fix from ANH
https://forums.ankiweb.net/t/show-duplicates-not-working/2883/10
2020-09-04 10:13:30 +10:00
Damien Elmes
21749a3b0c sound tags need filename html escaped
https://forums.ankiweb.net/t/unable-to-play-longer-audio-on-cards/1313/30
2020-09-04 09:36:38 +10:00
Damien Elmes
c82a084edf handle quoted html chars in media check
https://forums.ankiweb.net/t/unable-to-play-longer-audio-on-cards/1313/30
2020-09-04 09:36:38 +10:00
Damien Elmes
dc1f489d3e Revert "Merge pull request #749 from ANH25/editor-media-autoplay"
This reverts commit 9aa3d7867e, reversing
changes made to c3a1acb524.

https://github.com/ankitects/anki/pull/749#issuecomment-686385112
2020-09-04 08:34:26 +10:00
Damien Elmes
a43135f3d5 fix custom study link being shown in filtered deck
https://forums.ankiweb.net/t/crashing-after-custom-study-learn-forgotten-cards/3013
2020-09-04 08:31:33 +10:00
Jakub Kaczmarzyk
a22f671f3b add maintainer label 2020-09-03 09:21:02 -04:00
Damien Elmes
ade7f438ce rebuild_filtered_deck() and new_filtered() 2020-09-03 18:02:47 +10:00
Damien Elmes
f87fa762be empty_filtered_deck() 2020-09-03 17:43:07 +10:00
Damien Elmes
56ceb6ba76 set_deck() 2020-09-03 17:42:46 +10:00
Damien Elmes
9214c4a700 support did:[deck id] search 2020-09-03 16:43:22 +10:00
Damien Elmes
97778bec43 log 0 day interval as 1 day
Allows distinguishing it from resetting to new, and is treated as
a one day delay when answering anyway.
2020-09-03 16:00:06 +10:00
Damien Elmes
b65174a026 move card sorting and resetting to backend 2020-09-03 15:54:15 +10:00
Damien Elmes
e56f83be84 set local offset when saving preferences 2020-09-03 12:43:18 +10:00
Jakub Kaczmarzyk
de5feef0a4 fix jakub kaczmarzyk's email 2020-09-02 16:12:52 -04:00
Jakub Kaczmarzyk
6e5519ef80 add Jakub Kaczmarzyk + rm whitespace 2020-09-02 15:58:26 -04:00