Xunius / Menotexport

Python solution to export annotations from your Mendeley library.
GNU General Public License v3.0
123 stars 20 forks source link

Retrieve correct username #28

Closed matteosecli closed 6 years ago

matteosecli commented 6 years ago

Make sure that the username corresponds to the profile with isSelf = "true".


Again, not an SQL expert so maybe it's not the correct or smarter way to do that. As already briefly discussed in https://github.com/Xunius/Menotexport/pull/27, the result I want to get is that the username is the one, among all the profiles listed in the table, that has the attribute isSelf = "true".

I attach below a screenshot of the corresponding table in my database: screenshot from 2018-07-21 19-30-50 - redacted

From my tests so far, this small edit seems to work.

Xunius commented 6 years ago

Hi @matteosecli Haven't heard from you for some time. Anyway, I recently came across a case that a user's windows GUI version hangs at the very beginning of the program, and it turns out that his Profiles table only has 1 entry with a isSelf==false, so it fetched nothing and then ret[0] gave an index out of bounds error. I asked him about his account and it seems that it is not a group account or shared account or anything special. Have you seen such things among your coauthors? Anyway, I made a patch that if there is only one entry it just gets whatever is there, see here.

matteosecli commented 6 years ago

Hi @Xunius Never noticed such a thing, but I totally agree on the fix!

Sorry for being a little quiet recently, but it's a period of hard work (and it will be so for the next month or so) before an important deadline. Hope I can soon report on the "tampering" I was making with the annotations! 😉