sobjornstad / AnkiLPCG

Addon for dae/anki for studying lyrics and poetry
https://ankilpcg.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
155 stars 22 forks source link

Add Author field #21

Open cashpw opened 3 years ago

cashpw commented 3 years ago

Resolves #20.

cashpw commented 3 years ago

It looks like I didn't set the upgrade path correctly. I'm not seeing the "In order to import..." dialog when starting Anki.

sobjornstad commented 3 years ago

Ah, I think you've misunderstood how the note type classes work. For a minor upgrade like this one where the change can be made in place without creating a new note type, you don't need to create a new class -- you update the existing class to be the version that a new user would get, then make the upgrade_* routine apply the changes necessary to get the previous version to match the new version.

sobjornstad commented 3 years ago

And you need to add an item to the upgrades tuple on the LpcgOne note type to get LPCG to notice that there's a new upgrade available. Details documented in the upgrade_from() method of the ModelData superclass.

cashpw commented 3 years ago

There; I think I've fixed it up. I tested it locally (at 1.3.0, then upgrading to 1.3.1 by copying the built files into the addon directory) and everything worked.

sobjornstad commented 3 years ago

@cashweaver Are you going to have a chance to take a look at these requested tweaks soon? I'd like to get a new version out.

cashpw commented 3 years ago

@sobjornstad Sorry for the delay!