Open cjdduarte opened 1 year ago
You can replace remainingCardCount.py with this to fix (just used the aqt.reviewer.Reviewer._remaining() code from latest Anki, as per the dev's comment)
from ..utils.JSCallable import JSCallable
from typing import cast, Union
from aqt import mw
@JSCallable
def getCurrentRemainingCardCount():
reviewer = mw.reviewer
# Code from aqt.reviewer.Reviewer._remaining()
counts: list[Union[int, str]]
idx, counts_ = reviewer._v3.counts()
counts = cast(list[Union[int, str]], counts_)
nu, lrn, rev = counts
return nu, lrn, rev
Need a time to init VM with newest Anki installation to test with.
I won't upgrade my main Anki to 23.10 (as I'm using other addons)
I noticed using that reviewer code as-is still causes a crash when you finish reviews, this seems to fix that as well:
from ..utils.JSCallable import JSCallable
from typing import cast, Union
from aqt import mw
@JSCallable
def getCurrentRemainingCardCount():
reviewer = mw.reviewer
if reviewer.card == None:
counts = [0, 0, 0]
else:
# Code from aqt.reviewer.Reviewer._remaining()
counts: list[Union[int, str]]
idx, counts_ = reviewer._v3.counts()
counts = cast(list[Union[int, str]], counts_)
nu, lrn, rev = counts
return nu, lrn, rev
I noticed using that reviewer code as-is still causes a crash when you finish reviews, this seems to fix that as well:
from ..utils.JSCallable import JSCallable from typing import cast, Union from aqt import mw @JSCallable def getCurrentRemainingCardCount(): reviewer = mw.reviewer if reviewer.card == None: counts = [0, 0, 0] else: # Code from aqt.reviewer.Reviewer._remaining() counts: list[Union[int, str]] idx, counts_ = reviewer._v3.counts() counts = cast(list[Union[int, str]], counts_) nu, lrn, rev = counts return nu, lrn, rev
Could you try:
Addon will have an error on the first Anki run. IDK how to fix it though... Addon will work on subsequent runs.
It still doesnt work? I tried adding the build.zip anki add on but it wont even let me add is as an add on. Dont know what to do now, keep getting same error.
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-13.5-arm64-arm-64bit
When loading remaining_time:
Traceback (most recent call last):
File "aqt.addons", line 245, in loadAddons
File "/Users/fatimahasan/Library/Application Support/Anki2/addons21/remaining_time/init.py", line 25, in
When loading remaining_time: Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "/Users/fatimahasan/Library/Application Support/Anki2/addons21/remaining_time/init.py", line 25, in from .utils import uuid # duplicate UUID checked here File "/Users/fatimahasan/Library/Application Support/Anki2/addons21/remaining_time/utils/uuid.py", line 52, in dupUUIDCheck() File "/Users/fatimahasan/Library/Application Support/Anki2/addons21/remaining_time/utils/uuid.py", line 45, in dupUUIDCheck raise RuntimeError( RuntimeError: Duplicate addon UUID 33b5ab52-7c44-4da7-92d4-4bf890a40f28 (previously registered on /Users/fatimahasan/Library/Application Support/Anki2/addons21/1508357010/utils/uuid.py
Remove the previous version and then install the build.ankiaddon
version.
https://github.com/trgkanki/remaining_time/releases/tag/v24.1.22i135
Test release. I cannot upload this to AnkiWeb (IDK why... maybe I should contact AnkiWeb admins), so I am distributing it here as an alternative.
Remove previous installation before installing this one
https://github.com/trgkanki/remaining_time/releases/tag/v24.1.22i135
Test release. I cannot upload this to AnkiWeb (IDK why... maybe I should contact AnkiWeb admins), so I am distributing it here as an alternative.
Remove previous installation before installing this one
Im getting an Error when trying to install "dist_remaining_time.ankiaddon": Invalid extension manifest
Sorry for inconvenience:
It now works, thank you very much!
(there still is an initial error, but this only occures on the first execution of Anki after installation after this the error no longer occures)
Still getting an error
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22631
Traceback (most recent call last): File "aqt.webview", line 50, in cmd File "aqt.webview", line 157, in _onCmd File "aqt.webview", line 680, in _onBridgeCmd File "_aqt.hooks", line 5415, in call File "C:\Users\joena\AppData\Roaming\Anki2\addons21\remaining_time\utils\JSCallable.py", line 29, in _onBridgeMessage ret = func(*argList) File "C:\Users\joena\AppData\Roaming\Anki2\addons21\remainingtime\jsapi\remainingCardCount.py", line 21, in getCurrentRemainingCardCount , counts = reviewer._v3.counts() AttributeError: 'NoneType' object has no attribute 'counts'
===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Add Hyperlink ['318752047', 2023-06-18T06:39, 'None', ''] Advanced Browser ['874215009', 2023-10-21T09:34, 'None', ''] AnKing Note Types Easy Customization ['952691989', 2024-01-19T15:17, 'None', mod] Batch Editing ['291119185', 2023-10-25T19:38, 'None', ''] BetterSearch ['1052724801', 2023-06-15T15:44, 'None', ''] Browser Resizer ['1435775540', 2023-11-11T11:16, 'None', ''] Browser TableEditor side-by-side horizontal split ['831846358', 2022-01-25T16:11, 'None', ''] Create Filtered Deck from the Browser ['861263371', 2017-08-29T13:57, 'None', ''] Customize Keyboard Shortcuts ['24411424', 2023-11-01T04:17, 'None', ''] Image Editor ['307397307', 2022-09-07T23:09, 'None', ''] Rebuild All Empty All for Anki 21 ['1810938259', 2018-07-19T23:40, 'None', ''] Review Heatmap ['1771074083', 2022-06-29T20:43, 'None', ''] Special Fields ['1102281552', 2023-11-01T11:37, 'None', mod] remaining_time ['remaining_time', 0, '24.1.23i147', '']
===IDs of active AnkiWeb add-ons=== 1052724801 1102281552 1435775540 1771074083 1810938259 24411424 291119185 307397307 318752047 831846358 861263371 874215009 952691989
===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed])
i am still getting start up failed with this
Sorry for inconvenience:
i am still getting start up failed with this
Sorry for inconvenience: dist_remaining_time.zip
What error?
i am still getting start up failed with this
Sorry for inconvenience: dist_remaining_time.zip
What error?
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-14.2.1-arm64-arm-64bit
Traceback (most recent call last):
File "aqt.progress", line 118, in handler
File "aqt.main", line 218, in on_window_init
File "aqt.main", line 317, in setupProfile
File "aqt.main", line 496, in loadProfile
File "_aqt.hooks", line 4107, in call
File "anki.hooks", line 34, in runHook
File "/Users/jerilynsimons/Library/Application Support/Anki2/addons21/remaining_time/utils/configrw.py", line 96, in _syncJSConfig
from .uuid import addonUUID
File "
===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Custom Background Image and Gear Icon ['1210908941', 2023-04-18T20:19, 'None', mod] Delay Overdue Cards ['43919973', 2020-08-16T17:10, 'None', ''] Find cards from UWorld test ['444814983', 2023-10-23T04:03, 'None', ''] Image Occlusion Enhanced ['1374772155', 2022-04-09T02:15, 'None', ''] Review Heatmap ['1771074083', 2022-06-29T20:43, 'None', ''] remaining_time ['remaining_time', 0, '24.1.23i147', '']
===IDs of active AnkiWeb add-ons=== 1210908941 1374772155 1771074083 43919973 444814983
===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Anki Habitica for 21 ['1758045507', 2023-12-16T06:33, 'None', ''] ImageResizer ['1214357311', 2023-12-02T19:58, 'None', ''] More Decks Stats and Time Left ['1556734708', 2023-09-24T09:08, 'None', ''] Progress Bar cards done cards left secondscard time spentleft and ETA ['1097423555', 2023-10-02T03:05, 'None', '']
Don't know how to fix this, sorry
Hi! I downloaded the zip file you provided above but it's still experiencing errors. Here is the code below:
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-13.6.3-x86_64-i386-64bit
When loading remaining_time:
Traceback (most recent call last):
File "aqt.addons", line 245, in loadAddons
File "/Users/tristan/Library/Application Support/Anki2/addons21/remaining_time/init.py", line 24, in
i encountered the same problem and downloaded the zip file. I thouht it wasn't working but now I noticed that everything works fine if I start anki while offline, open the deck and then connect to wifi. i only get the error when starting anki while connected to wifi. Once it works, i can also open a new deck and it will still work alright! Hope this helps!
I noticed using that reviewer code as-is still causes a crash when you finish reviews, this seems to fix that as well:
from ..utils.JSCallable import JSCallable from typing import cast, Union from aqt import mw @JSCallable def getCurrentRemainingCardCount(): reviewer = mw.reviewer if reviewer.card == None: counts = [0, 0, 0] else: # Code from aqt.reviewer.Reviewer._remaining() counts: list[Union[int, str]] idx, counts_ = reviewer._v3.counts() counts = cast(list[Union[int, str]], counts_) nu, lrn, rev = counts return nu, lrn, rev
AuroraWright's solution is perfect for me by manually editing the file. Installing add-on from the zip file or github release causes error.
Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22621
Traceback (most recent call last): File "aqt.webview", line 50, in cmd File "aqt.webview", line 157, in _onCmd File "aqt.webview", line 680, in _onBridgeCmd File "_aqt.hooks", line 5415, in call File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\remaining_time\utils\JSCallable.py", line 29, in _onBridgeMessage ret = func(*argList) File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\remainingtime\jsapi\remainingCardCount.py", line 21, in getCurrentRemainingCardCount , counts = reviewer._v3.counts() AttributeError: 'NoneType' object has no attribute 'counts'
===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) remaining_time ['remaining_time', 0, '24.1.23i147', '']
Anki 23.10 (72e57456) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2 Platform: Windows-10-10.0.22621 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2023-10-14 09:01:10 Extensões possivelmente envolvidas: Remaining time for Anki 21
Caught exception: Traceback (most recent call last): File "aqt.webview", line 46, in cmd File "aqt.webview", line 153, in _onCmd File "aqt.webview", line 660, in _onBridgeCmd File "_aqt.hooks", line 5407, in call File "C:\Anki\Anki.2.1.data\addons21\1508357010\utils\JSCallable.py", line 29, in _onBridgeMessage ret = func(*argList) File "C:\Anki\Anki.2.1.data\addons21\1508357010\jsapi\remainingCardCount.py", line 10, in getCurrentRemainingCardCount if reviewer.hadCardQueue: AttributeError: 'Reviewer' object has no attribute 'hadCardQueue'