Giter Site home page Giter Site logo

Comments (4)

sarkologist avatar sarkologist commented on July 19, 2024 1

i notice on master it is

def onLoadNote(self, *args, **kwargs):
for f in self.note.keys():
if f == config["NoteIdFieldName"] and not self.note[f]:
self.note[f] = str(uuid.uuid1())

but the code as downloaded from the anki addons page is

def onLoadNote(self, *args, **kwargs):
    for f in self.note.keys():
        if f == config["NoteIdFieldName"] and not self.note[f]:
            self.note[f] = str(self.note.id - int(15e11))

when i manually edit the extension locally to use uuid it works

from anki-addons.

sarkologist avatar sarkologist commented on July 19, 2024

I'm using anki 2.1.29. It always sets the note id to -1500000000000

from anki-addons.

JackElsey avatar JackElsey commented on July 19, 2024

Replacing the file __init__.py in the add-ons folder with the file from this repo fixed the problem for me.

from anki-addons.

ambimorph avatar ambimorph commented on July 19, 2024

i notice on master it is

def onLoadNote(self, *args, **kwargs):
for f in self.note.keys():
if f == config["NoteIdFieldName"] and not self.note[f]:
self.note[f] = str(uuid.uuid1())

but the code as downloaded from the anki addons page is

def onLoadNote(self, *args, **kwargs):
    for f in self.note.keys():
        if f == config["NoteIdFieldName"] and not self.note[f]:
            self.note[f] = str(self.note.id - int(15e11))

when i manually edit the extension locally to use uuid it works

If you want the old note id behaviour, instead of the uuid behaviour,
the fix for that is to check that the note id isn't - int(15e11) before adding anything.

I removed the subtraction, because for my purposes I need the note id to be the actual note id,
so in my case it was auto-filling with 0, because when you first open the add note form, there is no id yet.

I now have

if self.note.id != 0:
    self.note[f] = str(self.note.id)

in the onLoadNote section to avoid that, and the correct note id fills in next time it is opened.

from anki-addons.

Related Issues (20)

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.