carlos1172 / ProgressBarTimeLeft

Hello, this is my first "add-on" (which isn't really by me since I just tweaked/merged Glutanimate's Progress Bar add-on with Carlos Duarte's More Decks Stats and Time Left add-on.). I basically got the progress bar to work on 2.1.49, as well as added statistics for cards left, percentage left, time (s) spent per card based on today's reviews, and time left based on how fast you've done today's reviews. Note: it says studied 637 cards in 1.36 hours today (7.67 s/card) but that's not reflected in the progress bar because I did those reviews on iPad. Also, the progress bar only tracts reviews in your current anki session. If you restart the app, it'll reset to 0 cards done (but the total cards left will be less already). I have not tested this on any other version besides 2.1.49, but I just wanted to share it since it took me a while to get this working and I'm very proud of it (and am hugely thankful to Glutanimate and Mr. Duarte). Installation: Unzip them and paste them in C:\%APPDATA%\Anki2\addons21
14 stars 8 forks source link

Progress bar all blacked out #13

Open tb9198 opened 2 years ago

tb9198 commented 2 years ago

Hello! Really enjoy your addon. But it has some problem since the update on 7/21. The progress bar is all blacked out.

this is what error says: Debug info: Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.16 Flags: frz=True ao=True sv=? Add-ons, last update check: 2022-07-27 17:41:57 Add-ons possibly involved: ⁨Progress Bar cards done cards left secondscard time spentleft and ETA⁩

Caught exception: Traceback (most recent call last): File "aqt/progress.py", line 54, in handler File "aqt/main.py", line 150, in on_window_init File "aqt/hooks_gen.py", line 2602, in call File "/Users/ianthienbui/Library/Application Support/Anki2/addons21/1097423555/reviewer_progress_bar.py", line 169, in add_info x = (mw.col.sched.day_cutoff - 86400 no_days) 1000 AttributeError: 'NoneType' object has no attribute 'sched'

carlos1172 commented 2 years ago

Try updating Anki

tb9198 commented 2 years ago

Updated the anki to the newer version. Now the entire bar is blue as if i finished the deck. Look below:

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue to the add-on author. Debug info: Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 5.14.1 PyQt 5.14.1 Platform: Mac 12.4 Flags: frz=True ao=True sv=? Add-ons, last update check: 2022-07-28 15:26:16 Add-ons possibly involved: ⁨Progress Bar cards done cards left secondscard time spentleft and ETA⁩

Caught exception: Traceback (most recent call last): File "aqt.progress", line 118, in handler File "aqt.main", line 198, in on_window_init File "aqt.hooks_gen", line 2801, in call File "/Users/ianthienbui/Library/Application Support/Anki2/addons21/1097423555/reviewer_progress_bar.py", line 169, in add_info x = (mw.col.sched.day_cutoff - 86400 no_days) 1000 AttributeError: 'NoneType' object has no attribute 'sched'

carlos1172 commented 2 years ago

Are you on Qt5 or Qt6? What are the steps to reproduce the problem? Please disable all other addons

khonkhortisan commented 2 years ago

This error only happens when the select user profile dialog is allowed to show - when not running anki.exe -p "User 1". There's no mw.col because it doesn't know whose collection.anki2 SQL database to use. I'm on Versión ⁨2.1.54 (b6a7760c)⁩ Python 3.9.7 Qt 6.3.1 PyQt 6.3.1


    Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
    Platform: Windows 10
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2022-08-04 14:09:21

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['cloze_overlapper', 0, 'None', '']
    '' ['speech-to-text', 0, 'None', '']
    '' ['tagtovlc', 0, 'None', mod]
    3 add-ons merged quicker anki explain deletion explain database check ['777545149', 2019-09-26T06:03, 'None', '']
    Add Card Do First Review ['1394953283', 2020-11-11T06:40, 'None', '']
    Anki Killstreaks ['579111794', 2021-12-15T07:20, 'None', '']
    Anki X Markdown X MindMap ['728482867', 2022-07-08T21:07, 'None', '']
    Anki Zoom ['538879081', 2020-04-03T17:20, 'v1.1.3', '']
    AnkiFlash Flashcards Importer Vietnamese English Japanese Chinese French ['1129289384', 2021-11-27T11:52, 'None', '']
    AnkiHub ['1322529746', 2022-07-17T10:11, 'None', '']
    AnkiWebView Inspector ['31746032', 2022-04-08T12:44, 'None', '']
    Ankicord - Discord Rich Presence ['1828536813', 2022-05-03T02:50, 'None', '']
    Asset Manager ['656021484', 2021-08-29T14:07, 'None', '']
    Auto Ease Factor ['1672712021', 2021-03-21T11:11, 'None', mod]
    AutoDefine - Automatically define vocabulary words with pronunciations and image ['2136497008', 2020-11-15T15:16, 'None', mod]
    AwesomeTTS - Add speech to your flashcards ['1436550454', 2022-07-21T19:35, 'None', '']
    Batch Editing ['291119185', 2019-06-04T16:10, 'None', '']
    CC-CEDICT for Anki Chinese dictionary ['418828045', 2022-03-23T05:22, 'None', mod]
    CN Bulk Generate Chinese Hanzi Homophone List to field ['1709020234', 2017-09-18T00:41, 'None', '']
    Chinese Companion - frequency sort HSK suspend heisig support and more ['2129668097', 2019-05-20T01:02, 'None', '']
    Chinese Pinyin Translator Zhuyin Bopomofo Gwoyeu Romatzyh ['1792056402', 2018-11-08T19:27, 'None', mod]
    Chinese Prestudy ['882364911', 2020-11-02T22:43, 'None', '']
    Chinese Support Redux v0142 ['1128979221', 2021-03-28T19:19, 'None', mod]
    Chinese Words Finder ['2048169015', 2020-07-07T05:32, 'None', '']
    Chinese-Text-Scanner ['2121493325', 2020-06-27T21:53, 'None', mod]
    Cloze Hide All ['1709973686', 2021-09-11T03:00, '21.9.11i107', mod]
    Cloze Overlapper for Anki 21 ['109531687', 2021-01-11T19:12, 'None', '']
    Color Confirmation ['1084228676', 2020-03-14T05:13, 'None', mod]
    Content Injector ['166455199', 2020-09-03T09:08, 'None', mod]
    Correcting a bug in anki which makes new card appearing in wrong order ['127334978', 2019-12-09T01:38, 'None', '']
    CrowdAnki JSON exportimport Edit history Collaborate on deck creation ['1788670778', 2022-05-27T14:32, 'None', '']
    Dark title bars for windows ['1718996340', 2022-01-31T05:46, 'None', '']
    DeepL Translator ['972129549', 2022-07-30T15:16, '1.0.0', mod]
    Delay siblings ['1369579727', 2022-06-03T16:05, 'None', mod]
    DrawingPad ['370778248', 2019-08-21T21:36, 'None', '']
    Editor Live Preview ['1960039667', 2021-10-08T21:06, 'None', '']
    External Note Editor for the Browser ['1996266159', 2020-03-31T13:59, 'None', '']
    Fast Word Query Multi-threaded queries for words from local or web dictionaries ['1807206748', 2019-06-22T20:10, 'None', '']
    Fast cards reposition ['544982740', 2021-09-19T06:51, 'None', '']
    Flexible Cloze ['1632356464', 2022-05-27T01:57, 'None', '']
    HTML Window source ['1214415810', 2020-02-18T05:20, 'None', '']
    Hitmarkers ['1776869150', 2020-03-31T15:04, 'None', '']
    Image Occlusion Enhanced ['1374772155', 2022-04-09T00:15, 'None', '']
    LPCG LyricsPoetry Cloze Generator ['2084557901', 2021-07-24T15:17, 'None', '']
    Leaderboard ['41708974', 2022-05-12T02:46, 'None', mod]
    Migaku Chinese ['498302176', 2021-04-12T15:29, 'None', mod]
    Migaku Retirement ['1666520655', 2021-01-13T16:37, 'None', mod]
    MorphMan for Anki 21 ['900801631', 2022-01-29T14:23, 'None', '']
    No Distractions Full Screen Clean review interface  TabletTouch support ['1049863218', 2020-08-13T15:59, 'v4.1.8', mod]
    Progress Bar cards done cards left secondscard time spentleft and ETA ['1097423555', 2022-07-29T05:40, 'None', mod]
    Review Heatmap ['1771074083', 2022-06-29T18:43, 'None', '']
    Review Hotmouse ['1928346827', 2022-05-16T21:25, '2.6', mod]
    Search and Replace Tags ['138501288', 2018-02-08T16:03, 'None', '']
    Semantic HTML tags in editor ['844409145', 2019-03-20T15:26, 'None', mod]
    Speed Focus Mode auto-alert auto-reveal auto-fail ['1046608507', 2019-06-04T16:10, 'None', '']
    Update lookup Tags ['1715601279', 2018-11-19T10:25, 'None', '']
    Web Browser - Search terms Import texts and images automatically ['864545277', 2022-01-17T13:33, 'None', mod]
    YT Subs2SRS ['1633834851', 2020-03-19T05:43, 'None', '']
    extended editor for field for tables searchreplace ['805891399', 2022-03-13T03:51, 'None', '']
    maobi - Chinese Hanzi Writing Quizzes in Anki v0 5 2 ['931477147', 2021-02-21T09:14, 'None', mod]
    right hand reviews  hjkl answer shortcuts  Handy Answer Keys configurable ['850294128', 2021-12-06T07:00, 'None', mod]

    ===IDs of active AnkiWeb add-ons===
    1046608507 1049863218 1084228676 109531687 1097423555 1128979221 1129289384 1214415810 127334978 1322529746 1369579727 1374772155 138501288 1394953283 1436550454 1632356464 1633834851 166455199 1666520655 1672712021 1709020234 1709973686 1715601279 1718996340 1771074083 1776869150 1788670778 1792056402 1807206748 1828536813 1928346827 1960039667 1996266159 2048169015 2084557901 2121493325 2129668097 2136497008 291119185 31746032 370778248 41708974 418828045 498302176 538879081 544982740 579111794 656021484 728482867 777545149 805891399 844409145 850294128 864545277 882364911 900801631 931477147 972129549

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['TitleAgo', 0, 'None', '']
    '' ['countnotifier', 0, 'None', '']
    '' ['numbers2stripes █▓▒░', 0, 'None', '']
    Additional Card Fields Fork for 21 ['744725736', 2022-02-21T14:22, 'None', '']
    Advanced Answer Sounds ['1167194350', 2022-05-29T00:30, 'None', mod]
    AnkiConnect ['2055492159', 2022-07-14T13:15, 'None', '']
    AnkiDiscord - Discord integration for Anki ['1133851639', 2020-01-13T17:53, 'None', '']
    Answer visual  auditory  custom text reinforcement ['976516370', 2021-10-24T08:05, 'None', '']
    Autosync 21 ['1726633659', 2019-08-19T10:15, 'None', '']
    Birl Reinforcement ['949451391', 2021-02-23T11:59, 'None', '']
    Blitzkrieg II - Advanced Browser Sidebar BETA8 ['564851917', 2020-04-16T20:53, 'None', '']
    Button Colours Good Again ['2494384865', 2021-04-06T07:57, 'None', '']
    Chinese Getter ['972150718', 2021-06-23T07:27, 'None', mod]
    Closet For Anki ['272311064', 2022-07-13T15:03, 'None', '']
    Contanki - Controller Support for Anki beta ['1898790263', 2022-08-01T18:26, 'v0.7.0-beta', mod]
    Debug No Sound ['881480056', 2020-08-20T13:16, 'None', '']
    Enhanced Cloze for Anki 21 ['1990296174', 2022-07-21T02:41, 'None', '']
    Extended Heatmap Updated January 2022 ['2011818092', 2022-02-01T18:28, 'None', '']
    Google Translate ['1536291224', 2022-07-30T14:55, 'None', mod]
    HyperTTS - Add speech to your flashcards ['111623432', 2022-07-01T07:37, 'None', '']
    Kanji Colorizer stroke order diagrams ['1964372878', 2020-11-03T10:33, 'None', '']
    Little Anki stealth mode ['1692384869', 2021-02-03T01:43, 'None', '']
    Long term backups ['529955533', 2019-07-07T19:37, 'None', '']
    Multiple Choice for Anki ['1566095810', 2022-04-07T23:25, 'None', '']
    No Distractions Full Screen ['5049862214', 0, 'v4.1.8', '']
    Percentage Heatmap ['1314463504', 2021-01-05T19:23, 'None', mod]
    Pinyin on top of Hanzi ['417709332', 2018-01-30T08:09, 'None', '']
    Puppy Reinforcement ['1722658993', 2020-03-02T12:23, 'None', '']
    Random Sprites ['897478712', 2022-01-23T23:38, 'None', '']
    Randomize Fonts ['1603486068', 2021-03-19T12:50, 'None', mod]
    Test Your Pronunciation Cloud Speech to Text ['673333980', 2021-04-16T07:34, 'None', '']
    Yomisama JapaneseChinese ['907186589', 2020-07-24T10:18, 'None', '']
    numbers2stripes ['2088639269', 2021-11-04T22:16, 'None', '']
khonkhortisan commented 2 years ago

In case someone else reads this issue looking for this cause:

  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\1097423555\reviewer_progress_bar.py", line 368, in updatePB
    left = dt.timestamp() + tzsec + t.total_seconds()
TypeError: unsupported operand type(s) for +: 'float' and 'str'

I had a different cause for a black progress bar: "tz": "8" instead of "tz": 8, fixed by resetting the addon config through the menu.

carlos1172 commented 1 year ago

Try updating Anki

Regards, Carlos Resurreccion On Jul 28, 2022, 7:16 AM +0800, tb9198 @.***>, wrote:

Hello! Really enjoy your addon. But it has some problem since the update on 7/21. The progress bar is all blacked out. this is what error says: Debug info: Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.16 Flags: frz=True ao=True sv=? Add-ons, last update check: 2022-07-27 17:41:57 Add-ons possibly involved: ⁨Progress Bar cards done cards left secondscard time spentleft and ETA⁩ Caught exception: Traceback (most recent call last): File "aqt/progress.py", line 54, in handler File "aqt/main.py", line 150, in on_window_init File "aqt/hooks_gen.py", line 2602, in call File "/Users/ianthienbui/Library/Application Support/Anki2/addons21/1097423555/reviewer_progress_bar.py", line 169, in add_info x = (mw.col.sched.day_cutoff - 86400 no_days) 1000 AttributeError: 'NoneType' object has no attribute 'sched' — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>