
# source code markers
#  XXX implement/fix next
#  XX  implement in next pass
#  XXD perferences defaults related issues
#  XXM wikidata metadata coupling
#  XXP potential preference
#  XXF future features
#  XXG gui visual issues
#  XXT data type issues

== Document markers somewhere ==
; marked:new
  : newly imported books
; marked:updated 
  : books that were updated with new metadata
; marked:newtag
  : books that contain a new tag not in the filtered list (try importing it)
; marked:error
  : something went wrong when updating the metadata for this book
; marked:dup
  : There are multiple matches for this book in wikidata, use the metadata plugin to pick one

merge_actual
  marked:updated
  marked:newtag
  marked:error

merge_series
  marked:updated error 

bulk_search dup

== search for missing books todo ==
* improve marker documentation
* (buttons?) autogenerate series numbers
* (button) update books with series data
* delegate to handle wdid's as URLs
* ? mark keys that have (both?) next/prev
* separate out import and match code for reuse
** re-run match on edited books?
** import missing prev/next references
* dynamic menu of marked books

== Showstopper bugs ==
use user edited fields or make them read only
   save series for matched books
   save author/title for unmatched books before inserting
bulk query needs to handle huge queries and split them or warn user at least

== Planned features not yet implemented ==

blacklist or test ISBN identifiers

handle books with multiple editions in wikidata (complex metadata query)
  oldest publication date
  collect additional tags

== possible preference options to add ==
(complain if you want any of these)
* confirm on delete (currently you can supress single column delete confirmation)

* When hiding entries, warn if enabled entires will be disabled

== Complex metadata options ==
(These can't be handled correctly with existing UI and algorithms.)

preference pane: special (or second column in options?)
 * pubdate
context action: swap series/series2
action: series data only (button in preferences, but no menu entry now)
action: pubdate only???

Series importer: (complex metadata)
* search for books in a series
* update books missing series info
* add empty books
* generate rankings for books with no series index from next/previous book links
* handle books in multiple series via additional custom columns
** use existing series info first if available
** sort series by index in each series

Advanced metadata merging for multivalue entries
replace overwrite column with a function
* replace / if empty (current)
* min /max /average?
* append? join multivalue with a character ( & or , default?)
* user defined function (from function / template editor): merge(original, [new] )
instead of property overwrite flag, use mode:
  mode = one of ( ignore, replace, append, ifempty, ifgreater/lesser
  currently for tags: ov==True->replace ov==False->append
  would need to add a combobox to the table?

Merge our custom identifier handler with the calibre ID handler in
  Preferences->Look and Feel->Book Details->Create rules to convert identifiers into links
 (this is probably mostly cosmetic to the user but would preserve identifiers independent from this plugin)

Add special handler for URL type properties
* wrap in html
* wrap in markdown [name](url title)
* insert as uri/url/urn (pick one or use next or suggest alt ID)

== Possible future features and minor UI bugs ==
(If any of these annoy or interest you, give feedback or they might never be worked on)

scroll to bottom after inserting and selecting new properties/tags

split view sizes could probably be dynamically resized better? (fit to viewport)

tell book details view to update after changing data
  how to fix? This may be a calibre bug, affects operations from other plugins
main view doesn't fully update when book data changes

hide / unhide resets view to sort values,
* it could insert / delete instead which would preserve selection
* could insert hidden values at end instead of resorting

check that all requested column names exist
  warn if user settings are not complet / columns don't exist
  (update ptCheckValid and replace calls to clear() with it)

integrate identifier editor with calibre's built in but hidden editor

show mapping between properties and tags with colors

add a progress indicator when importing large numbers of properties / tags

resize split view and columns better

provide a button? to deselect everything in either property_view or tag_view

tab:
  select first tab always?  (for goofs in designer save)
  remember last tab selected (don't save in options though)

ability to merge a subset of identifiers into selected books?
  this is already done for properties / tags
  identifiers seem to be rare enough merging all of them is fast

ability to hide identifiers (not currently planned)
  will require a minor rewrite to show/hide code

when importing properties guess a default column based on wikidata wdType (not planned)

check for ID name collisions

better guesses when guessed ID tag is very short

handle data merge errors better? causes include:
* multiple values in non-string fields (date, integer)
* wrong field type / misinterpreted
* multiple values in a single value field in wikidata
* missing data type handler (may have fixed all these)

button to re-import defaults (partial?)
  autofill fields from defaults if prop/id/tag is re-added

maybe support recognizing more overdrive ids? openlibrary?

make wikidata queries less pretty and more compact

make debug print of wikidata queries prettier / easier to copy/paste

detect wikidata query failure, offer to copy query to clipboard?

rate limit wikidata queries
* most querying is already inherently rate limited by needing to be triggerd by user action
* warn user when rate is too high?
* delay rapid queries?
* some user actions can generate huge queries that will fail; either warn user or split into staged queries

Handle multiple IDs of the same type (join with & ?)

