noosfere is a database of books, volumes, covers, authors, translators,
cover designers, critics, critic's author, movies adaptation... noosfere is
NOT commercial, it is the DB of an association of authors, readers,
editors... see about.txt last but not least noosfere is in french ONLY:
noosfere defines itself as "nooSFere : encyclopédie francophone de
Science-Fiction."

Definition: A volume has in common with a book the author and the title but
not the cover, not the editor, not the isbn, not.. I want the information
about a volume... I want a coherent information. I hate swapping the cover
of a volume with that of another one because "it's nicer".

In order to collect the information about a volume one must use either the
ISBN, the author and the title. Because of that, author and title should be
as accurate as possible, or rather as similar as possible to noosfere...
(that is a hint: when it fails got to noosfere manualy, if the book exists
there, copy paste isbn, author and title in calibre, pay attention to the
order of the author's first name and LAST NAME)

If the ISBN exists a search in noosfere points to a serie of volumes (yet
only one book :-) )

If the author is the best known identifier a search in noosfere points to an
author's list of books (or a list of authors :-( ) out of this list, a match
to the title will point to a serie of volumes

If the title is the only reference, a search in noosfere will output a list
of books sorted by best mactch along with a score again a book will point to
a serie of volume. (In theory, it is yet to be implemented...)

Out of the volume list one must choose the best candidate to get a coherent
set of volumes attributes (cover, isbn, editor, critics, serie, serie nbr,
etc...


The nice think about noosfere is the power of the search (each word may be
"ANDed, exact or fuzzy match, etc...) The result gives a LOT of information
about the book, author, translator... And the nice think about calibre is
the possibility to insert working url in the comments and in the catalogs..
Thanks for that.

File worker.py is NOT stricly needed (read absolutely useless as I very
often reduce the match to ONE book) but it was nice to develop so I learned
how to create spawned process... :-)

REGISTERIT.BAT will create a zip file that will be pushed to the righ
place... It must be invoked any time a change is done to a .py file.

TESTIT.BAT will bost register and execute some testing (usefull when
debuging an url that behave differently (read when it displays one of my
bugs leftover)

This is a beta version (alpha is I guess when only me can make it work...).
Beta version translate to "c'est juste une bête version"... For the english
speaking people, this is a very very funny word play in french... all right,
at least it makes me laugh, even if I am the only one...

I still need to add some custom columns but I have not decided if I need to
design a config program in a window...

I have to decide how to give me the possiblity to choose what volume I want
in calibre... here: from preference, metadata download, (tickbox) Keep more
than one entry per source, the comment says: "Disable any metadata sources
you do not want by unchecking them. You can also set the cover priority.
Covers from sources that have a higher (smaller) priority will be preferred
when bulk downloading metadata.". Could I have lrpid to differenciate
different volumes of a same book??

ouch... bad surprise, noosfere find so many match to "G.-J. Arnaud"... even
with 'exact' match...I need to find a better way to filter the author list
provided... done: use from difflib import SequenceMatcher and swapping first
and last name before comparison

lrpid is nice for a unique id produced with time, but I guess I could use
the book or the voluem url as an id... (and maybe give a less self pointing
name to the id name)... I use both the book and the volume noosfere's
identifier (bk$<book-number-in-noosfere>$vl$<vol-number-in-noosfere>). With
that info, I can reach immediately to the book and/or to the volume, and
each volume gets a unique nsfr_id

Introduced (via calibre Options) a boolean to expand or not the publisher
field. Now, publisher contains publisher§collection name€serial code. § and €
used because very low probability to exist. Metadata bulk edit created to
help push the data to the right place.

Introduced (via calibre Options) a number to select the debug level

Introduced (via calibre Options) a choice to select how to push the priority
to get oldest or latest with or without preference over volume with ISBN.
Caution, this still choose the most verbose comments.

Introduced (via calibre Options) a string box. Filled with the (exact!!)
publisher name, it pushes priority to give a match on publisher name... Yes,
I know that the collection may still be wrong. The only way is to change the
nsfr_id to reflect what volume of the book we really want (the number,
including the sign if any, after the equal sign should show up glued to the
vl$<number>) and restart the metadata download.

Pushed to version 0,7,0 after refactoring some code to become function instead
of method...

Corrected instructions cause some volume have no value for coll_rsl, yet they
have a value for collection...

noosfere site changed.. so I had to adapt the plugin.. and correct some minors
bugs.. this mark version 0.9.0

add a conditional on title and authors... If a book has an nsfr_id or an isbn,
then author and/or title may be None...

Corrected a few (read quite a few... understand a lot) of comments. They are
more correct, more coherent... well, better...

It, from now on, extract the information about other editions... The first line
(a link) points to the pages of all the various volumes. The rest of the
information is a series of links to the volumes sorted by date and by editor.

Implemented the collect of "conseil de lecture" and Adaptation (of the book to
other media: tv, film...)
This still needs to be made optional before version 1

Sometimes, somme word sees the first letter separated from the rest of the word
(Espace vital,nsfr=vl$547 under Quatrième de couverture I saac Avsimov) This is
because html codes it as <b>I</b><b>saac Asimov</b>. I could try to write someting
IF and only IF there are a LIMITED number of such separator AND if coherent: for
noosfere pages it seems that: b stand for bold, <i>/<i> with i stands for italic...
needs verification.

rendu optionnel les informations présentées par noosfere sous les titres contenants:
 Prix obtenus,
 Cité dans les pages thématiques suivantes
 Cité dans les listes thématiques des oeuvres suivantes
 Cité dans les Conseils de lecture
 Adaptations

 Corrected the HTML code to get "Isaac Asimov" rather than "I saac Asimov" and/or
 "(italic)Né en Russie" rather than "(italic)N é en Russie"

16-11-2021: pushed version to 0.9.3 untill confirmed ok, before going to V.1.0.0

Wrote some doc about how to use best this plugin...

Simplified the search and setting of the cover page (cover URL is in a meta field in head)

improved (so I hope :) ) the auto-selection of volume and the comments inside the plugin
auto-selection:
  force editor field, empty,no match, exact match
  ISBN yes/no
  ponderation yes/no
  priorite de choix: oldest or latest (nothing else any more)

Corrected a few bugs preventing some metadata collection to work

added recognition "nom, prénom" beside "prénom nom" in the authors list...
(will submit "prénom nom" to search engine of noosfere improving success rate)

I am not sure how to wipe out the "series" field from within the plugin...
The question asked on mobileread stays unanswered... I cannot change the initial value
from workers as other spawned processes may be using it... (i guess there are some lock,
I would not like fire up a lock condition without a throughout knowledge of the lock
implementation). Should I wipe it up upfront, regardless of what is in the metadata?
what if something happens between the delete and the update... db corruption??? I have
too little understanding of calibre...
workaround:
wipe "series" field manually before running the metadata source gathering process...

Can't wipeout the series field... so need for noosfere DB utility for pre and postprocessing

choice adjustment to code and doc to reconciliate both

adaptation for changes in noosfere preventing correct detection of publish date
 (read depot legal date)

Sometimes, the cover image cannot be located in the header, but it is still available
 in the body... Modified cover discovery algorithm.

Some series sequence order number do include a letter in noosfere...
 example:
 Modified so that 4a reads 4.1 orand 7c reads 7.3 (letter position in french alphabet)

It seems that I am missing some functionalities while not overwriting 2 methods:
 get_book_url : used by calibre to convert the identifier to a URL...
 id_from_url : takes a URL and extracts the identifier details...
BOTH are now implemented...
Now, thanks to get_book_url, one can jump directly to the URL from within calibre:
 in the detail pane, ensure that ids have been selected for display,
  (Preferences → Interface → Look & feel → Book details.)
 Click on the id to get at the url page.
  Note that I will not remove the reference in the comment, because I want that
  information to show in the catalogs.
Now, thanks to id_from_url, to add or modify an id in the metadata editor, just
 copy and paste the url on the icon on the left of the ids field.

This sort of made noosfere_util a little less needed, yet if I want to distribute
 the information in the editor, or want to wipe the matadata "clean" before
 downloading it (some fields are never deleted, noosfere_util does). I still
 can use the noosfere_util web browser to slect the exact volume I want...

I made quite a few cosmetic modifications (comments style to document function,
 remove some useless code, ...)

I push noosfere DB to version 1.0.0

Repaired id_from_url (seems that some url's contain 'NumLivre=' instead of 'numlivre=')...
the 'good' fact is that one can access a volume using either:
https://www.noosfere.org/livres/niourf.asp?NumLivre=2146610758 or
https://www.noosfere.org/livres/niourf.asp?numlivre=2146610758

improved vol_seriel_seq detection when a 'decoupage annexe' (? other volume distribution ?) or
several omnibus collection exists: seen as (omn1) (omn2) ...

While doing the above 2, I modified the worker.py code into methods (easier to maintain)...
this (and of cousre, the repair and the vol_seriel_seq improvement) does
justify to uplift the version to 1.2.0