zim-tools icon indicating copy to clipboard operation
zim-tools copied to clipboard

zimdump show weird behaviour

Open kelson42 opened this issue 3 years ago • 3 comments

$ zimdump show --ns=M --url=Name gutenberg_fa_all_2022-01.zim 
Entry not found

is wrong, it should deliver the name like:

$ zimdump show --url=M/Name gutenberg_fa_all_2022-01.zim 
gutenberg_fa_all_2022-01

kelson42 avatar Aug 13 '22 10:08 kelson42

I wonder if keeping the --ns option is a good thing.

Libzim moved to an API where we remove/hide the namespace, it is a bit odd (and buggy) to keep the concept in zimdump.

  • The dump command only "user" entries (in C namespace) for new zim files. So the --ns option is useless.
  • The PR #316 works only because of the compatibility layer to support old bookmarks (including the ns) with old zimfiles (even if it works with new zim files)

It would be better to ask ourselves how we provide a better api to display metadata (and other non user entries ?) Maybe a zimdump metadata --name=Name gutenberg_fa_all_2022-01.zim ?

mgautierfr avatar Aug 22 '22 13:08 mgautierfr

Either ways are OK, but having both seems indeed a bit confusing.

kelson42 avatar Aug 22 '22 14:08 kelson42

The right approach is probably to remove fully the namespace concept IMO... and create the appropriate function to access other namespaces. This is how the libzim works and zimdump should work like this probably.

kelson42 avatar Sep 02 '22 14:09 kelson42