Giter Club home page Giter Club logo

ankicord's Introduction

meirl

ankicord's People

Contributors

nawavon avatar sirdx avatar stadas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ankicord's Issues

make sending requests to discord async every 15 seconds instead of every hook trigger

Right now the requests are sent only when a hook is triggered, i.e. when user goes to main menu or reviews a card, etc.
This is not ideal because if, for example, the user is still on the 15sec cooldown and they switch from reviewing to menu, it will not update the Rich Presence.
This can be fixed using python's Thread library by making the requests constantly send every 15 seconds and simply grabbing the currently active status from a variable instead of relying on a hook to activate. The hooks will still be used to update the status inside the code, though.

Requires Anki to be run as administrator to work on Windows (10/11?)

General info (please complete the following information):

  • OS: Windows 10/11?
  • Anki version N/A (probably unrelated anyway)
  • Any errors? No
  • Have you restarted Anki after installing the add-on? Yes

Describe the bug
Add-on does not work on Windows, without any errors (maybe some output if launched from the console?) if Anki is not launched as administrator.

Throws Error when Discord is not running.

General info (please complete the following information):

  • OS: Windows 10
  • Anki version: ⁨2.1.49
  • Any errors?: Yes, see copy below
  • Have you restarted Anki after installing the add-on?: Yes

Describe the bug
The addon throws the Error below whenever Anki is started when Discord is not running. For me, this is every time, Anki starts at system start and it starts faster than Discord does.


An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨Ankicord - Discord Rich Presence⁩':
⁨Traceback (most recent call last):
File "aqt\addons.py", line 230, in loadAddons
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813_init_.py", line 2, in
from .src import main
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 250, in
ac = Ankicord()
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 33, in init
self.rpc = pp.Presence(self.cfg_disc_id if self.cfg_disc_id else self.default_disc_id)
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\pypresence\presence.py", line 13, in init
super().init(*args, **kwargs)
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\pypresence\baseclient.py", line 28, in init
raise DiscordNotFound
1828536813.src.pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine

Activity does not update properly

  • OS: macOS 12.2.1
  • Anki version 2.1.49

I have my config set such that no activity is shown when I'm on the main screen. Opening the browser shows the "browsing cards" status on discord. However, closing the browser and returning to the main screen does not remove this activity. Same thing happens if I try to add cards from the main screen and then exit out of the add cards dialog

Config:

{
"defaults": {
"main": {
"activity": "on",
"card_count": "on",
"count_deck": "on",
"counts": [
"new",
"learn",
"review"
],
"deck_name": "off",
"discord_client": "745326655395856514",
"spotify": "off",
"timer": "on"
},
"statuses": {
"browsing_status": "Browsing Cards",
"editing_status": "Adding cards",
"menu_status": "",
"no_cards_left_txt": "No cards left!",
"reviewing_status": "Daily reviews"
}
}
}

Count only most recent deck - not working?

Hi, I love the addon and just wanted to post a bug that I am having.

I have my main anki deck that i keep up with daily, and then a secondary 'burner' anki deck that I kinda/sorta/should really do.
I have count_deck set to 'yes', however it seems to still sum up all of my unsuspended cards, rather than just my last deck, as you can see in the screenshots below. It should be only registering the latest deck, the Anking Overhaul deck.
image
image
image

Am I doing something wrong, or is there some sort of bug that I am happy to help troubleshoot

Support for versions under 2.149?

Hey, Idk if this is of interest to anyone but I would really like if this add-on worked with versions below 2.149. I use 2.135 & I cannot use it and can't find another that has the same functionality. Thanks for the help!

count_deck isn't working

  • OS: MacOs 12.2.1
  • Anki version 2.1.49

count_deck isn't working. I have count_deck and card_count set to on. While reviewing a deck with only 140 cards left, Discord shows I have 1200 cards left. The 1200 number goes down by 1 as I do cards in the 140 card deck.

client(or application)_id in config

i didn't understand how to make a pull request 😆
Thanks for the config addon, makes the integration more fun and the icon is awesome
gl to your uni

In the future
you could try creating the option to change the icon using the same idea as the background addon -that use a photo folder to change the background

ty for the addon

No effect after installation (Linux)

General info (please complete the following information):

  • OS: KDE Neon 20.04 (based on Ubuntu 20.04)
  • Anki version 2.1.51 (cf78a555)⁩
  • Any errors? No
  • Have you restarted Anki after installing the add-on? Yes

Describe the bug
I'm sorry I can't say much but I'm just not seeing anything happen when the addon is installed. Please let me know what information I can provide if it used to work on Linux.

Add-on not working

I downloaded the add-on, but for some reason, it is still not working. Do I have to enable something specific on Discord?

No activity spotted

Hi! thank you for making this add on.
I installed it using the anki code, but unfortunately nothing is displayed in my discord activity section. I tried playing around in the configs but to no avail. The same issue happened to me with the AnkiDiscord add on, so i was wondering if you're familiar with this situation.

since new update anki crashing and incorrect discord activity

image

yeah ever since i got the prompt for the update to ankicord my anki has crashed twice on startup of application and all it says as my discord activity is that I've been playing anki for (x) mins. that's aboutit . it was working perfectly fine previously

windows 11

General info (please complete the following information):

  • OS: [e.g. Windows 10]
  • Anki version [e.g. 2.1.44]
  • Any errors? [No / screenshot or copy-paste of error]
  • Have you restarted Anki after installing the add-on? [Yes / No]

Describe the bug
A clear and concise description of what the bug is.

Does not work with discord web

General info:

  • OS: Windows 10
  • Anki version 23.10.1(Qt6)
  • Any errors? No
  • Have you restarted Anki after installing the add-on? Yes

Describe the bug
Basically, it works completely fine with the desktop Discord app, but I generally use the web ver. which just completely doesn't work.

error when reviewer does not return a card

ERROR:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-10 22:18:06

Caught exception:
Traceback (most recent call last):
File "aqt\reviewer.py", line 837, in onBuryCard
File "aqt\main.py", line 691, in reset
File "aqt\main.py", line 656, in moveToState
File "aqt\hooks_gen.py", line 2679, in call
File "anki\hooks.py", line 34, in runHook
File "C:\Users\ASUS\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 200, in on_state
self.last_deck = mw.col.decks.get(mw.reviewer.card.did)
AttributeError: 'NoneType' object has no attribute 'did'

Error when interacting with UI (Decks, Add, Browse, Stats, Sync)

General info (please complete the following information):

  • OS: [Windows 10]
  • Anki version [2.1.49]
  • Any errors? [Yes, copy-paste of error below]
  • Have you restarted Anki after installing the add-on? [Yes]

Describe the bug
When clicking on the top buttons (Decks, Add, Browse, Stats, Sync), this error pops up.

Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-04-10 21:28:39

Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000022411123C10>
Traceback (most recent call last):
File "asyncio\proactor_events.py", line 115, in del
File "asyncio\proactor_events.py", line 79, in repr
File "asyncio\windows_utils.py", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'

Crash when opening Profiles window

General info (please complete the following information):

  • OS: [Windows 11]
  • Anki version: [2.1.50]
  • Any errors? [Yes, copy-paste of error below]
  • Have you restarted Anki after installing the add-on? [Yes]

Describe the bug
Whenever the Profiles window opens Anki instantly crashes. This occurs when clicking the Switch Profile button and when launching Anki. It only crashes on launch if the user has multiple profiles saved as this causes the Profile window to open on start-up.

Debug info:
Anki 2.1.50 (26d40c3a) Python 3.9.7 Qt 6.2.2 PyQt 6.2.2
Platform: Windows 10
Flags: frz=True ao=True sv=?
Add-ons, last update check: 2022-04-14 08:39:42

Caught exception:
Traceback (most recent call last):
File "aqt.progress", line 115, in handler
File "aqt.main", line 186, in on_window_init
File "aqt.main", line 232, in setupProfileAfterWebviewsLoaded
File "aqt.main", line 277, in setupProfile
File "aqt.main", line 283, in showProfileManager
File "aqt.main", line 672, in moveToState
File "aqt.hooks_gen", line 3594, in call
File "anki.hooks", line 34, in runHook
File "C:\Users\Joshua\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 193, in on_state
self.__update_rpc_next_state()
File "C:\Users\Joshua\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 157, in __update_rpc_next_state
node = mw.col.sched.deck_due_tree()
AttributeError: 'NoneType' object has no attribute 'sched'

Status and cards not updating

General info (please complete the following information):

  • OS: [e.g. Windows 11]
  • Anki version [e.g. 23.12.1]
  • Any errors? [

Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.22631

Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 116, in del
File "asyncio.proactor_events", line 108, in close
File "asyncio.base_events", line 751, in call_soon
File "asyncio.base_events", line 515, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Ankicord - Discord Rich Presence ['1828536813', 2023-08-16T10:53, 'None', '']

===IDs of active AnkiWeb add-ons===
1828536813

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

]

  • Have you restarted Anki after installing the add-on? [Yes]

Discord wont update the cards left or the status. It just says I'm slacking off and wont change the number of cards i have left even if I'm in a deck and doing cards. If I open browse cards while in a deck I get this error to pop up and it updates my status to browsing cards. but then when I close it, it goes back to slacking off.

Enhancement: Option to update more frequently

Hi, thanks for making this, I was using the AnkiDiscord addon for some time now, but I'm switching over to this one because it seems to be better in almost every way.

Is there a reason why the status is limited to update only every 15 seconds? Would it be possible to make a config option to allow more frequent status updates? I manually changed it in main.py to update every 5 sec for now but I assume those changes will be overwritten next time this addon gets updated. Thanks.

Anki Keeps Insisting New Update Available After Install

General info (please complete the following information):

  • OS: [e.g. Windows 10] MacOS Ventura 13.5
  • Anki version [e.g. 2.1.44] 2.1.65
  • Any errors? [No / screenshot or copy-paste of error] No errors
  • Have you restarted Anki after installing the add-on? [Yes / No] Yes

Describe the bug

After the latest update, every time I check for updates in Anki, this add-on pops up as having an available update (latest 8/15/2023 update). Installing the updates does nothing it appears, and I am prompted to install the update again once I check for updates. On latest public Anki 65, MacOS.

Turning off the timer doesn't work

  • OS: Windows 11
  • Anki version Version ⁨2.1.54 (b6a7760c)⁩
  • Any errors? no
  • Have you restarted Anki after installing the add-on? yes

Turning off the timer doesn't work
image
image

show cards left for currently active deck instead of all decks

Thanks for taking this on.

I generally have a problem with both addons including the old.

Both count the total cards in each deck.

but some of my decks I have are inactive and not on my study list.

It would be much much better if it just took the values that are in the current active deck that is being studied until it says "Congratulation, this deck is finished for today".

as for the current implementation I cannot use the card_count setting because it shows a value of almost 8000 cards left which is rather misleading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.