Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MXD incorrectly identifies some books as missing from calibre #32

Closed
WyndhamMisio opened this issue Jan 1, 2014 · 82 comments
Closed

MXD incorrectly identifies some books as missing from calibre #32

WyndhamMisio opened this issue Jan 1, 2014 · 82 comments

Comments

@WyndhamMisio
Copy link

The attached screenshot shows several eBooks as missing from calibre.

The Cassandra Clare books are in a different calibre library so that is correct. The others however, do exist in the current calibre library.

image

Or have I misunderstood something?


ps Very best wishes for a great 2014. :)

@GRiker
Copy link
Collaborator

GRiker commented Jan 2, 2014

I'm not understanding the issue. Please be more specific which books are missing.

@WyndhamMisio
Copy link
Author

The books missing are shown in the MXD window with a white background, apart from the Cassandra Clare books.

ie: Black Wings, Blood Magic, Bloody Skies, Picked at the Peak, The Preachers's Son, When Extended Family is Discovered and, When I Saw You.

Some of these are shown in the attached screenshot which has the current calibre library showing in the background.

eg: Black Starr Cross, Blood Magic and, Bloody Skies. The others do exist in calibre but are not visible in the current screenshot.

The MXD window has nearly two thousand books with a white background and my assumption is that this is probably correct as I synchronize Marvin from two calibre libraries.

I only spotted these, because I sorted by reading percentage to find the most recently read books. Consequently I can't say if the books noted above are the only ones shown in error.

@GRiker
Copy link
Collaborator

GRiker commented Jan 2, 2014

Hi Wyndham, Happy new year.

If the MXD window shows a book in white, that means that the plugin did not find a matching book in your current calibre library.

In your screenshot, the most likely explanation for the books you're expecting to shown as matched is that the author doesn't match between calibre and Marvin, even though the title does match. For a match to be detected, both the author and title must match exactly.

Additionally, the content of the book needs to match. If you have a book in Marvin, and a different version of the same book in calibre, they won't match. This can often happen if you add books from different sources. The easiest way to detect this is to simply open the book in calibre's viewer, then open the same book in Marvin. Most likely you will see that they are different versions of the same book.

It's also possible that there's another problem with the plugin, but these are the most likely explanations. Please close this issue if that's what you find, or provide additional metadata details about the books shown incorrectly.

@WyndhamMisio
Copy link
Author

I can confirm they have the same author. All the books in Marvin have been sourced from Calibre only, so it seems unlikely to me that the books are different.

If I update a book and then convert again, I usually download straight away to the mobile devices. In this case, I am fairly confident about these books as they are all recent reads.

Simple visual checks on the books show the following:

· Black Wings appears identical

· Blood Magic appears identical

· Bloody Skies appears identical

As a final test I sent these three books from Calibre to Marvin and re-ran MXD, and they no longer show as missing from Calibre. This leaves me a little frustrated.

I have to assume that it is either not possible, or easy, programmatically to distinguish between a book not existing (under the current rules, because the content is different in some, possibly small, respect) and to identify the book as possibly existing and the same book, but with differences. This could include slight differences in the title or author, such as Midnight Heir and The Midnight Heir, J.D. Robb and JD Robb, or Arthur Clarke and Arthur C. Clarke, etc.

There remain a few other books which are not being correctly identified (given the aforementioned provisions), so I can do further testing if you like.

@uten
Copy link

uten commented Jan 13, 2014

I have the same problem. I figured it might be a glitch from multiple versions of calibre/the plugins/Marvin, so I deleted every book from Marvin, Polished all the books to verify calibre and book metadata was identical and finally transferred them from Calibre.

Around half my Library of 500 books is 'not in calibre' even though I JUST copied it directly from calibre.

After some more experimenting, I also discovered when I select a single white colored book - in the Marvin Library subwindow of calibre, I don't even have the correct options if the books was missing (I only have View Metadata, and Delete Book).

However, if I select multiple books, I have the options to Delete Book, Export Metadata or Import Metadata. Even though the Library window says they are missing from calibre, I am not allowed to import the book to calibre.

Choosing 'Export Metadata from calibre' causes every selected white book to turn green. Once I close the Marvin Library and reopen it, they are white again. This only occurs with these mistakenly white books - I altered metadata in calibre to make a few books yellow and they updated properly and stayed green.

Hope that helps pinpoint the problem.

@GRiker
Copy link
Collaborator

GRiker commented Jan 13, 2014

If you can give me a specific set of steps that lead to the failure, along with a debug log, that would help pinpoint the problem.

@GRiker
Copy link
Collaborator

GRiker commented Jan 13, 2014

Here are a few more steps that would help in pinpointing the problem.

  • Select a particular book that is not recognized and focus on it, rather than working with a group of books.
  • Exit calibre, delete that book from Marvin's library from Marvin's UI
  • Restart calibre in debug mode, capturing the debug log (see issue Creating a new issue #1 for instructions on creating a debug log)
  • Start the calibre connector in Marvin.
  • Send the book to Marvin.
  • Start MXD

How is the book displayed in MXD?

If it's other than green, please post the debug log here in a new comment

@uten
Copy link

uten commented Jan 14, 2014

Ok, here you go. Did as you said. Book is still white.

Focused on a single book - Harry Crow by robst. I use Marvin for Fanfics mostly. Sorry the debug log is so long, but I still have a bunch of fanfic covers to make.

Also, I use the latest version of all apps/plugins and run calibre on OSX 10.9.1

calibre 1.19 isfrozen: True is64bit: True
Darwin-13.0.0-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '13.0.0', 'Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64')
Python 2.7.5
OSX: ('10.9.1', ('', '', ''), 'x86_64')
DEBUG: 0.0 iOSReaderApp:initialize(v1.3.4)
DEBUG: 0.0 iOSReaderApp:compile_ui()
DEBUG: 0.1 iOSReaderApp:_init_prefs(prefs created under v1.3.0)
DEBUG: 0.1 debug_libimobiledevice: False
DEBUG: 0.1 debug_plugin: True
DEBUG: 0.1 development_mode: False
DEBUG: 0.1 kindle_enabled_formats: [u'MOBI']
DEBUG: 0.1 kindle_supported_formats: [u'MOBI']
DEBUG: 0.1 marvin_edit_collections_cb: True
DEBUG: 0.1 marvin_protect_rb: False
DEBUG: 0.1 marvin_replace_rb: True
DEBUG: 0.1 marvin_update_rb: False
DEBUG: 0.1 preferred_reader_app: u'Marvin'
DEBUG: 0.1 iOSReaderApp:_get_connected_device_info()
DEBUG: 3.2 mounting 'com.appstafarian.MarvinIP'
DEBUG: 4.2 iOSReaderApp:_class_reconfigure('Marvin')
DEBUG: 4.2 iOSReaderApp:_load_reader_app_overlays('Marvin')
DEBUG: 4.3 loading 43 overlays
DEBUG: 4.3 adding overlay '_cover_subpath()'
DEBUG: 4.3 adding overlay '_cover_to_thumb()'
DEBUG: 4.3 adding overlay '_create_cover_element()'
DEBUG: 4.3 adding overlay '_create_new_book()'
DEBUG: 4.3 adding overlay '_evaluate_original_cover()'
DEBUG: 4.3 adding overlay '_evaluate_replaceable_cover()'
DEBUG: 4.3 adding overlay '_get_field_items()'
DEBUG: 4.3 adding overlay '_get_opf_tree()'
DEBUG: 4.3 adding overlay '_get_opf_xml()'
DEBUG: 4.3 adding overlay '_initialize_overlay()'
DEBUG: 4.3 adding overlay '_localize_database_path()'
DEBUG: 4.3 adding overlay '_parse_version()'
DEBUG: 4.3 adding overlay '_parse_xml()'
DEBUG: 4.3 adding overlay '_remove_existing_copy()'
DEBUG: 4.3 adding overlay '_report_upload_results()'
DEBUG: 4.3 adding overlay '_reset_ios_connection()'
DEBUG: 4.3 adding overlay '_schedule_metadata_update()'
DEBUG: 4.3 adding overlay '_stage_command_file()'
DEBUG: 4.3 adding overlay '_update_epub_metadata()'
DEBUG: 4.3 adding overlay '_wait_for_command_completion()'
DEBUG: 4.3 adding overlay '_watchdog_timed_out()'
DEBUG: 4.3 adding overlay '_xform_metadata_via_plugboard()'
DEBUG: 4.3 adding overlay 'add_books_to_metadata()'
DEBUG: 4.3 adding overlay 'books()'
DEBUG: 4.3 adding overlay 'can_handle()'
DEBUG: 4.3 adding overlay 'can_handle_windows()'
DEBUG: 4.3 adding overlay 'delete_books()'
DEBUG: 4.3 adding overlay 'eject()'
DEBUG: 4.3 adding overlay 'get_busy_flag()'
DEBUG: 4.3 adding overlay 'get_cc_mapping()'
DEBUG: 4.3 adding overlay 'get_file()'
DEBUG: 4.3 adding overlay 'guess_type()'
DEBUG: 4.3 adding overlay 'is_usb_connected()'
DEBUG: 4.3 adding overlay 'is_usb_connected_windows()'
DEBUG: 4.3 adding overlay 'post_yank_cleanup()'
DEBUG: 4.3 adding overlay 'prepare_addable_books()'
DEBUG: 4.3 adding overlay 'remove_books_from_metadata()'
DEBUG: 4.3 adding overlay 'set_busy_flag()'
DEBUG: 4.3 adding overlay 'set_cc_mapping()'
DEBUG: 4.3 adding overlay 'sync_booklists()'
DEBUG: 4.3 adding overlay 'thumbnail()'
DEBUG: 4.3 adding overlay 'upload_books()'
DEBUG: 4.3 adding overlay 'xml_to_unicode()'
DEBUG: 4.3 iOSReaderApp:_initialize_overlay(Marvin)
DEBUG: 4.3 existing thumb cache at '/Users/vladimyrh/Library/Caches/calibre/Marvin/thumbs.zip'
DEBUG: 4.3 ~~~~~~~~~~~~~~~~~~~~~~~~~ switching to Marvin overlay ~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting up...
DEBUG: 6.8 MarvinManagerAction:genesis(v1.1.1)
DEBUG: 6.8 MarvinManagerAction:init_options()
DEBUG: 6.8 AnnotationsDB:connect(db_version: 1)
DEBUG: 6.8 MarvinManagerAction:inflate_dialog_resources()
DEBUG: 6.8 MarvinManagerAction:compile_ui()
DEBUG: 7.4 iOSReaderApp:startup()
DEBUG: 8.2 MarvinManagerAction:rebuild_menus()
DEBUG: 8.2 Marvin not connected
Started up in 3.80 seconds with 1400 books
DEBUG: 9.4 libiMobileDevice:_afc_get_file_inf* Notification delivered.
o( ERROR: Object not found (8) path:u'/Library/calibre/connected.xml')
DEBUG: 12.4 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/calibre/connected.xml')
DEBUG: 15.5 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/calibre/connected.xml')
DEBUG: 18.5 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/calibre/connected.xml')
DEBUG: 21.5 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/calibre/connected.xml')
DEBUG: 24.5 Marvin version: (2, 6, 0)
DEBUG: 24.5 iOSReaderApp:reset()
DEBUG: 24.5 detected_device = (1452L, 4779L, 832L, u'Apple Inc.', u'iPad', u'99c98607a112bf5deb0ff18d9de154f6b471234d')
DEBUG: 24.5 report_progress = <bound method DeviceManager.report_progress of <DeviceManager(Thread-5, started daemon 4661972992)>>
DEBUG: 24.5 iOSReaderApp:open()
DEBUG: 24.5 vid:05ac pid:12ab
DEBUG: 24.5 MarvinManagerAction:on_device_connection_changed(iOS reader applications)
DEBUG: 24.5 mounting com.appstafarian.MarvinIP
DEBUG: 25.8 MarvinManagerAction:on_device_connection_changed(iPad3,4 running iOS 7.0.4)
DEBUG: 25.8 has_password: False
DEBUG: 25.8 MarvinManagerAction:rebuild_menus()
DEBUG: 25.8 Marvin connected
DEBUG: 25.8 iOSReaderApp:set_progress_reporter()
Job: 1 Get device information started
DEBUG: 25.8 iOSReaderApp:get_device_information()
DEBUG: 25.8 DeviceClass : iPad
DEBUG: 25.8 DeviceColor : black
DEBUG: 25.8 DeviceName : Vladimyr’s iPad
DEBUG: 25.8 FSBlockSize : 4096
DEBUG: 25.8 FSFreeBytes : 4256112640
DEBUG: 25.8 FSTotalBytes : 29909303296
DEBUG: 25.8 FirmwareVersion : iBoot-1940.3.5
DEBUG: 25.8 HardwareModel : P101AP
DEBUG: 25.8 ModelNumber : MD511
DEBUG: 25.8 PasswordProtected : False
DEBUG: 25.8 ProductType : iPad3,4
DEBUG: 25.8 ProductVersion : 7.0.4
DEBUG: 25.8 SerialNumber : DMQJL9XPF183
DEBUG: 25.8 TimeIntervalSince1970: 1389670529.05
DEBUG: 25.8 TimeZone : America/Indiana/Indianapolis
DEBUG: 25.8 TimeZoneOffsetFromUTC: -18000.0
DEBUG: 25.8 UniqueDeviceID : 99c98607a112bf5deb0ff18d9de154f6b471234d
DEBUG: 25.8 iOSReaderApp:free_space()
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
DEBUG: 26.4 iOSReaderApp:set_progress_reporter()
Job: 2 Get list of books on device started
DEBUG: 26.4 iOSReaderApp:books()
DEBUG: 26.4 iOSReaderApp:localize_database_path()
DEBUG: 26.4 updating local_db from u'/Library/mainDb.sqlite'
DEBUG: 26.5 (a series of cover files not found messages…)
DeviceJob: 2 Get list of books on device done, calling callback
DEBUG: 33.8 iOSReaderApp:settings(format_map for 'Marvin': [u'epub'])
DEBUG: 33.8 iOSReaderApp:settings(format_map for 'Marvin': [u'epub'])
DeviceJob: 2 Get list of books on device callback returned
Job: 2 Get list of books on device finished
No details available.
DEBUG: 54.0 iOSReaderApp:settings(format_map for 'Marvin': [u'epub'])
DEBUG: 55.9 iOSReaderApp:set_progress_reporter()
Job: 3 Upload 1 books to device:Harry Crow started
DEBUG: 55.9 iOSReaderApp:set_plugboards()
Device using plugboard epub MARVIN None
Setting metadata in: Harry Crow at: /var/folders/7
/fd1t8fms7cb0wjvmjy0dt1c80000gn/T/calibre_1.19.0_tmp_DeC6ZY/OtDui8caltmpfmt.epub
DEBUG: 56.9 iOSReaderApp:upload_books()
DEBUG: 56.9 'Harry Crow' by [u'robst'] does not exist in Marvin
DEBUG: 56.9 iOSReaderApp:_update_epub_metadata(Harry Crow)
DEBUG: 56.9 iOSReaderApp:_xform_metadata_via_plugboard(Harry Crow)
Device using plugboard epub MARVIN None
DEBUG: 56.9 no matching plugboard
DEBUG: 57.8 iOSReaderApp:_cover_to_thumb(Harry Crow)
DEBUG: 57.9 iOSReaderApp:_create_new_book(title: u'Harry Crow' uuid: u'5639ce11-ac64-4d7a-a7da-faa303ad951a')
DEBUG: 58.0 iOSReaderApp:_get_field_items(Harry Crow)
DEBUG: 58.0 iOSReaderApp:_evaluate_replaceable_cover()
DEBUG: 58.0 cover is replaceable
DEBUG: 58.1 iOSReaderApp:_stage_command_file(upload_books: 297 bytes)
DEBUG: 58.1 iOSReaderApp:_wait_for_command_completion(upload_books)
DEBUG: 58.1 22:36:39.012479: waiting for '/Library/calibre/status.xml'
DEBUG: 58.1 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/calibre/status.xml')
DEBUG: 59.1 22:36:40.017363: monitoring progress of upload_books
DEBUG: 59.1 22:36:40.025684: 0 100%
DEBUG: 60.1 22:36:41.032048: 'upload_books' complete
DEBUG: 60.1 iOSReaderApp:_localize_database_path()
DEBUG: 60.1 MarvinManagerAction:marvin_status_changed(upload_books)
DEBUG: 60.1 updating local_db from u'/Library/mainDb.sqlite'
DeviceJob: 3Job: 3 Upload 1 books to device:Harry Crow done, calling callback
Upload 1 books to device:Harry Crow finished
No details available.
DEBUG: 60.2 iOSReaderApp:add_books_to_metadata()
DEBUG: 60.5 iOSReaderApp:set_plugboards()
DeviceJob: 3 Upload 1 books to device:Harry Crow callback returned
DEBUG: 60.5 iOSReaderApp:set_progress_reporter()
Job: 4 Send metadata to device started
DEBUG: 60.5 iOSReaderApp:sync_booklists(automatic metadata management disabled)
DEBUG: 60.5 iOSReaderApp:free_space()
DeviceJob: 4 Send metadata to device done, calling callback
DeviceJob: 4 Send metadata to device callback returned
Job: 3 Upload 1 books to device:Harry Crow finished
No details available.
Job: 4 Send metadata to device finished
No details available.
DEBUG: 64.0 MarvinManagerAction:rebuild_menus()
DEBUG: 64.0 Marvin connected
DEBUG: 65.8 MarvinManagerAction:show_installed_books()
DEBUG: 65.8 MarvinManagerAction:launch_library_scanner(updating library index for virtual library u'')
DEBUG: 65.8 MarvinManagerAction:start_library_indexing()
DEBUG: 65.8 MarvinManagerAction:_busy_panel_setup()
DEBUG: 66.6 MarvinManagerAction:library_index_complete()
DEBUG: 66.6 MarvinManagerAction:_busy_panel_teardown()
DEBUG: 66.7 BookStatusDialog:initialize()
DEBUG: 66.7 BookStatusDialog:_generate_booklist()
DEBUG: 67.3 BookStatusDialog:_scan_library_books(571)
DEBUG: 68.1 BookStatusDialog:_get_installed_books()
DEBUG: 68.1 BookStatusDialog:_scan_marvin_books(533 books)
DEBUG: 68.1 BookStatusDialog:_localize_hash_cache()
DEBUG: 68.1 remote hash cache: v1, 533 books in cache
DEBUG: 68.1 BookStatusDialog:_purge_cached_orphans()
DEBUG: 69.5 BookStatusDialog:_update_remote_hash_cache()
DEBUG: 70.8 BookStatusDialog:_get_cover_hash(a series of no cover available messages…)
DEBUG: 73.0 BookStatusDialog:_purge_cover_hash_orphans()
DEBUG: 73.0 BookStatusDialog:_busy_panel_setup(Removing obsolete cover hashes)
DEBUG: 73.7 BookStatusDialog:_busy_panel_teardown()
DEBUG: 73.7 BookStatusDialog:_generate_marvin_hash_map()
DEBUG: 73.7 BookStatusDialog:_find_fuzzy_matches()
DEBUG: 73.7 BookStatusDialog:_busy_panel_setup(Preparing Marvin library view…)
DEBUG: 74.4 BookStatusDialog:_construct_table_data()
DEBUG: 75.0 BookStatusDialog:_construct_table_view()
DEBUG: 76.5 BookStatusDialog:_update_refresh_button()
DEBUG: 76.5 BookStatusDialog:_busy_panel_teardown()
DEBUG: 76.5 MarvinManagerAction:show_installed_books(533 books)
DEBUG: 114.4 BookStatusDialog:dispatch_button_click()
DEBUG: 114.4 BookStatusDialog:accept()
DEBUG: 114.4 BookStatusDialog:_save_column_widths()
DEBUG: 120.3 MarvinManagerAction:shutting_down()

@GRiker
Copy link
Collaborator

GRiker commented Jan 14, 2014

@uten, please send a copy of this book (Harry Crow) to me.

Is it generally true that the books you're having problems with are fan fiction?

@uten
Copy link

uten commented Jan 15, 2014

Book sent. Also, while the majority is fanfic, that is only because most of my books are fanfic.. But there are also novels, and non-fiction with the same problem.

And there is no common link. Some of the fanfic were created by FLAG, calibre's fanfic downloader, various other websites, and even some I've converted. Same with the Novels and Non-Fiction, they all come from various different places, including smashwords.

@GRiker
Copy link
Collaborator

GRiker commented Jan 15, 2014

@uten, thanks for sending the book. I added it to my test library, then added it to Marvin using calibre. Upon opening MXD it properly displayed as green when Show match status is enabled. I examined the book to be sure that there was nothing unusual about its internal metadata.

In studying your debug log more closely, it appears that you have a total of 1400 books in your calibre library (reported just after DEBUG 8.2). At DEBUG 67.3, it reports that you have 571 EPUBS in your library, and at DEBUG 68.1, it reports that you have 533 books installed in Marvin.

One possible explanation is that you have some filtering applied to your calibre library so that only certain books are displayed at the time you launch MXD. MXD only evaluates books currently displayed in your calibre window when showing matches. This was an optimization added for users with very large libraries.

Can you confirm that before launching MXD, Harry Crow is visible in the main calibre window?

Are you using a virtual library, or is there any filter that would prevent the Harry Crow book from being listed in the main calibre window at the time MXD is launched?

@uten
Copy link

uten commented Jan 15, 2014

I do use virtual Libraries. Specifically, the one I was using at the time is entitled "Books for Marvin" and contains all epub books. I did verify that the book was showing. It also shows a tick in calibre. The remaining epubs that I have still to transfer from calibre need to have metadata entered, or something similar.

That was the first thing I checked.

@uten
Copy link

uten commented Jan 15, 2014

Also, while the book shows as white, view metadata shows the Marvin metadata and the calibre metadata. The only difference is it doesn't have the option underneath each window to transfer metadata.

But selecting multiple white files does allow me to export metadata from calibre, turning the books green.
Closing the explorer, then reloading it shows the books as being white again.

The few yellow books allow me to export metadata from calibre, turning the books green.
Closing the explorer, then reloading it shows the books as still green.
HOWEVER, Disconnecting via the calibre connector in Marvin, then reconnecting, causes the books to turn yellow again, and the metadata shows up as the old bad stuff again.

So, since the metadata and status change is obviously not being saved on my ipad, is it possible that the data saying the book is in calibre isn't being written either? Is that stored on the ipad?

@GRiker
Copy link
Collaborator

GRiker commented Jan 15, 2014

Please do an experiment to update the metadata on the iPad from calibre for a given book, then opening the book in Marvin to see if the metadata was actually updated from the calibre values, regardless of the colors shown by the plugin.

Instead of reporting "the metadata shows up as the old bad stuff again", it would be more helpful if you could report the actual before/after metadata.

Also, can you do a manual inspection of the books in Marvin to see if there are duplicates of the problem books?

@GRiker
Copy link
Collaborator

GRiker commented Jan 15, 2014

@uten, please try this as well.

In calibre, open Preferences|Advanced|Miscellaneous, then click Open calibre configuration directory.

Exit calibre.

In that directory, open the plugins folder, then locate the file Marvin XD.json.

Open that file with a text editor, and find the line "show_match_colors": true,

Copy the entire line, and paste a copy below it, making sure that the indentation is exactly the same for the pasted copy.

Edit that line to read "development_mode": true,

Save and close the file.

This will add some additional diagnostic information to the debug log.

In that same directory, open iOS reader applications.json

Find the line "debug_plugin": true,

Change true to false

Save and close the file.

That will turn off debugging for the iOSRA plugin.

Do the same sequence you did before, deleting the book in Marvin, then starting Calibre in debug mode, adding the book, starting MXD. After the book shows white, close calibre, post the debug log.

@uten
Copy link

uten commented Jan 15, 2014

I chose Harry Crow to alter the metadata. I removed all the tags. Which turned it yellow. Updated the metadata which turned it white. The metadata did update however and it has stayed updated. Also picked a green colored book. Worked correctly. Green > Yellow > Green..

Weird thing number one. With yellow books. Just updating the metadata causes the following. They turn green until you disconnect, then next time you connect, they are yellow. However, one of them with this problem had an author written "Brighton, Patrick". I switched it to "Patrick Brighton" in calibre, then updated the metadata to Marvin. The book is now green. Since that worked, I altered the author of Harry Crow and updated. Still white.

One thing I did notice. Just looking at a books metadata in calibre MIGHT turn the book yellow. I chose the "Edit Metadata Individually" and then selecting next (or cancel). Some books turned yellow from that, and some didn't. After choosing to update the metadata to Marvin, they would switch back to either white or green. But it wasn't every book, and it wasn't just white or green colored books. That happening made me go WTF?? :)

@uten
Copy link

uten commented Jan 16, 2014

Debug File is way toooooooo long now, so I'll email it to you.

@uten
Copy link

uten commented Jan 16, 2014

BTW, what checksum format do you use to determine the hash? I figured I could run some files through to see if they match, but the only thing I know so far is what type it isn't.. :)

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

The checksum is computed by generating an MD5 hash of all the text and CSS files, ignoring images and the OPF file. The objective is to uniquely identify the content of the book, so that matches may be identified when the metadata doesn't match.
The source code is here, starting at line #2837.

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

I will review the debug file, but in the meantime, please try this:

  • Connect your iPad
  • Start the calibre connector in Marvin
  • Start calibre
  • After initialization, hold the Option key, then click the down arrow next to the blue MXD icon
  • In the Developer menu, select Delete calibre hashes, then select Delete Marvin hashes.
  • Restart calibre

Any differences?

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

(Edited version of debug log follows)

calibre 1.19  isfrozen: True is64bit: True
Darwin-13.0.0-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '13.0.0', 'Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64')
Python 2.7.5
OSX: ('10.9.1', ('', '', ''), 'x86_64')
Starting up...
DEBUG:    0.0 MarvinManagerAction:genesis(v1.1.1) 
DEBUG:    0.0 MarvinManagerAction:init_options() 
DEBUG:    0.0 AnnotationsDB:connect(db_version: 1) 
DEBUG:    0.0 MarvinManagerAction:inflate_dialog_resources() 
DEBUG:    0.0 MarvinManagerAction:compile_ui() 
DEBUG:    1.2 MarvinManagerAction:rebuild_menus() 
DEBUG:    1.2  Marvin not connected
Started up in 3.62 seconds with 1418 books
DEBUG:    3.1 MarvinManagerAction:on_device_connection_changed(iOS reader applications) 
DEBUG:    3.1  mounting com.appstafarian.MarvinIP
DEBUG:    4.4 MarvinManagerAction:on_device_connection_changed(iPad3,4 running iOS 7.0.4) 
DEBUG:    4.4  has_password: False
DEBUG:    4.4 MarvinManagerAction:rebuild_menus() 
DEBUG:    4.4  Marvin connected
Job: 1 Get device information started
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
Job: 2 Get list of books on device started
Job: 1 Get device information finished
No details available.
DeviceJob: 2 Get list of books on device done, calling callback
DeviceJob: 2 Get list of books on device callback returned
Job: 2 Get list of books on device finished
No details available.
Job: 3 Upload 1 books to device:Harry Crow started
Device using plugboard epub MARVIN None
Setting metadata in: Harry Crow at: /var/folders/7_/fd1t8fms7cb0wjvmjy0dt1c80000gn/T/calibre_1.19.0_tmp_CtPqdv/aijWd3caltmpfmt.epub
Device using plugboard epub MARVIN None
DEBUG:   49.9 MarvinManagerAction:marvin_status_changed(upload_books) 
DeviceJob: 3 Upload 1 books to device:Harry Crow done, calling callback
DeviceJob: 3 Upload 1 books to device:Harry Crow callback returned
Job: 4 Send metadata to device started
DeviceJob: 4 Send metadata to device done, calling callback
DeviceJob: 4 Send metadata to device callback returned
Job: 3 Upload 1 books to device:Harry Crow finished
No details available.
Job: 4 Send metadata to device finished
No details available.
DEBUG:   61.4 MarvinManagerAction:main_menu_button_clicked() 
DEBUG:   61.4 MarvinManagerAction:show_installed_books() 
DEBUG:   61.4 MarvinManagerAction:launch_library_scanner(updating library index for virtual library u'Books For Marvin') 
DEBUG:   61.4 MarvinManagerAction:start_library_indexing() 
DEBUG:   61.4 MarvinManagerAction:_busy_panel_setup() 
DEBUG:   62.2 MarvinManagerAction:library_index_complete() 
DEBUG:   62.2 MarvinManagerAction:_busy_panel_teardown() 
DEBUG:   62.3 BookStatusDialog:initialize() 
DEBUG:   62.3 BookStatusDialog:_generate_booklist() 
DEBUG:   62.9 BookStatusDialog:_scan_library_books(589) 
DEBUG:   63.7 BookStatusDialog:_get_installed_books() 
DEBUG:   63.7 BookStatusDialog:_scan_marvin_books(533 books) 
DEBUG:   63.7 BookStatusDialog:_localize_hash_cache() 
DEBUG:   63.7  remote hash cache: v1, 533 books in cache
DEBUG:   65.1 BookStatusDialog:_update_remote_hash_cache() 
DEBUG:   65.8 BookStatusDialog:_get_calibre_id(u"1,001 Old-Time Household Hints: Timeless Bits of Household Wisdom for Today's Home and Garden" u'The Editors Of Yankee Magazine') 
DEBUG:   65.8  UUID match
DEBUG:   65.8 BookStatusDialog:_get_on_device_status() 
(multiple calls to _get_calibre_id, _get_on_device_status) 
DEBUG:   70.7 BookStatusDialog:_get_calibre_id(u'Harry Crow' u'Robst') 
DEBUG:   70.7  UUID match
DEBUG:   70.7 BookStatusDialog:_get_on_device_status() 
DEBUG:   70.7  533 cached books from Marvin
(multiple books)
DEBUG:   70.7  Harry Crow pubdate: datetime.datetime(2012, 6, 5, 4, 0)
DEBUG:   70.7 BookStatusDialog:_generate_marvin_hash_map() 
DEBUG:   70.7 BookStatusDialog:_find_fuzzy_matches() 
DEBUG:   70.8 BookStatusDialog:_busy_panel_setup(Preparing Marvin library view…) 
DEBUG:   71.4 BookStatusDialog:_construct_table_data() 
DEBUG:   71.4 BookStatusDialog:_generate_match_quality('1,001 Old-Time Household Hints: Timeless Bits of Household Wisdom for Today's Home and Garden') 
DEBUG:   71.4  uuid: u'4cf5de09-e5c5-4e68-8bd7-f7184b110e8e'
DEBUG:   71.4  matches: [u'4cf5de09-e5c5-4e68-8bd7-f7184b110e8e']
DEBUG:   71.4  on_device: u'Main'
DEBUG:   71.4  hash: '31b96dc9fdc9635f1598027818b8389a'
DEBUG:   71.4  metadata_mismatches: {}
DEBUG:   71.4  match_quality: GREEN
(multiple calls to _generate_match_quality)
DEBUG:   72.2 BookStatusDialog:_generate_match_quality('Harry Crow') 
DEBUG:   72.2  uuid: u'5639ce11-ac64-4d7a-a7da-faa303ad951a'
DEBUG:   72.2  matches: []
DEBUG:   72.2  on_device: u'Main'
DEBUG:   72.2  hash: '0b77c34ae22b35f84dabc50b0c702c7c'
DEBUG:   72.2  metadata_mismatches: {}
DEBUG:   72.2  match_quality: WHITE
DEBUG:   72.2 BookStatusDialog:_construct_table_view() 
DEBUG:   74.1 BookStatusDialog:_update_refresh_button() 
DEBUG:   74.1 BookStatusDialog:_busy_panel_teardown() 
DEBUG:   74.1 MarvinManagerAction:show_installed_books(533 books) 
DEBUG:   95.0 BookStatusDialog:dispatch_button_click() 
DEBUG:   95.0 BookStatusDialog:accept() 
DEBUG:   95.0 BookStatusDialog:_save_column_widths() 
DEBUG:  101.5 MarvinManagerAction:shutting_down() 

@uten
Copy link

uten commented Jan 16, 2014

Deleting the hashes has taken my white books from around 250 to 13. Main problem fixed. Something was obviously wrong with the hashes.

While fixing up some of the last thirteen white books, I did discover something. It seems that editing the book in calibre, then updating it to calibre left the book white. I tried just deleting the calibre hash info. Still White. On deleting both hash sets, a refresh turned the book green. Also happened that way if I just deleted the Marvin hash info. How does the plugin handle it if the hash it has is different to the files? Does it check for that? Is it possible the plugin has old hash data?

I do have a couple of ebooks that have a different problem. The cover shows up in Calibre, and in Marvin, but not on Marvin XD. Even after deleting the book, and re-adding it (after polishing of course), the problem remains. And causes the book to be white. I'll send you a copy of the ebook to see if it shows up for you.

Thanks so much for all your help so far!

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

@uten, I've built an updated version of MXD with more diagnostics that should help pin down the remaining unmatched books. You can download it from this link.

Save it to your desktop.

Start calibre with your iPad disconnected, then install the downloaded plugin from Preferences|Advanced|Plugins.

Create a debug log again with the same settings for development_mode (true).

This version of MXD should show the unmatched books in gray. Please confirm that the unmatched books are shown in gray, and that the other books are displayed with the proper colors.

The debug log will be large, email it to me as you have before.

If you're having different issues with MXD, please open a new issue with those details. I will try loading the book you sent me to see if there's an obvious problem with it.

In answer to your question about stored hashes, deleting the hashes from calibre and Marvin clears them completely, then they are recreated then next time you run the plugin. Calibre library hashes are stored in calibre's db, Marvin's hashes are stored on the iDevice.

In general, is the common denominator with the books that are missing that you've polished them in calibre and sent them to Marvin again after polishing?

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

FYI, the book you sent me The Trouble With Families loaded into Marvin and displayed in MXD without issue, so it's probably related to this issue. No need to open a new one.

A couple of questions:

  • When you use calibre's Polish books feature, which actions are enabled?
  • Click on the down arrow next to the red Marvin icon, then click Configure this device. Click the Marvin options tab. In the When sending books already in Marvin… section. Which radio button is selected?

@uten
Copy link

uten commented Jan 16, 2014

I sorta figured the problem was related - hence why I mentioned it in this thread. In hindsight, using the word different wasn't the best idea as by different, I meant the cover issue only.

BTW, when you viewed the metadata of the book I sent you, did it show the cover on the copy that was sent to Marvin??

As for Polish, I only use the Update Metadata, and Update Cover options.

I use the Replace option When Sending Books already in Marvin, as I discovered early on that it wasn't sending updated epubs to Marvin.

I'll send you the log as soon as I can. Thanks again!

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

With respect to the book you sent, MXD is not showing the cover in the metadata dialog, although the cover does display properly in Marvin's library view, calibre's library view and calibre's device view. The book is shown as green in MXD. There's clearly something wrong with the cover not showing in MXD. I'll track that down.

@GRiker
Copy link
Collaborator

GRiker commented Jan 16, 2014

The problem with the missing covers in the MXD metadata comparison dialog is now fixed. It was actually a typo in the iOS reader applications plugin, so you will need to download a revised version of that from this link.

  • Download the plugin to your desktop
  • Disconnect your iPad
  • Start calibre
  • Preferences|Advanced|Plugins
  • Install the downloaded version of the iOS reader applications plugin
  • Reconnect iPad, restart calibre. That should take care of the missing cover.

That fix will not affect any of the matching color issues we've been working on in this issue. Thanks for spotting that.

@uten
Copy link

uten commented Jan 17, 2014

Ok, Debug file on the way.

Sorry it took so long, but I had a migraine. :(

The book used is the one I sent you - "The trouble with families" by LaraBr

@GRiker
Copy link
Collaborator

GRiker commented Jan 17, 2014

(Edited version of debug log focusing on missing books only)

calibre 1.19  isfrozen: True is64bit: True
Darwin-13.0.0-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '13.0.0', 'Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64')
Python 2.7.5
OSX: ('10.9.1', ('', '', ''), 'x86_64')
Starting up...
DEBUG:    0.0 MarvinManagerAction:genesis(v1.1.1) 
DEBUG:    0.0 MarvinManagerAction:init_options() 
DEBUG:    0.0 AnnotationsDB:connect(db_version: 1) 
DEBUG:    0.0 MarvinManagerAction:inflate_dialog_resources() 
DEBUG:    0.0 MarvinManagerAction:compile_ui() 
DEBUG:    1.2 MarvinManagerAction:rebuild_menus() 
DEBUG:    1.2  Marvin not connected
Started up in 3.55 seconds with 1418 books
DEBUG:   17.7 MarvinManagerAction:on_device_connection_changed(iOS reader applications) 
DEBUG:   17.7  mounting com.appstafarian.MarvinIP
DEBUG:   19.0 MarvinManagerAction:on_device_connection_changed(iPad3,4 running iOS 7.0.4) 
DEBUG:   19.0  has_password: False
DEBUG:   19.0 MarvinManagerAction:rebuild_menus() 
DEBUG:   19.0  Marvin connected
Job: 1 Get device information started
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
Job: 2 Get list of books on device started
DEBUG:   19.7 libiMobileDevice:_afc_get_file_info( ERROR: Object not found (8) path:u'/Library/Application Support/com.appstafarian.marvin.covers/060d72fb9d676f0d9c657e4a7bf59d37.jpg') 
Job: 1 Get device information finished
No details available.
DeviceJob: 2 Get list of books on device done, calling callback
DeviceJob: 2 Get list of books on device callback returned
Job: 2 Get list of books on device finished
No details available.
Job: 3 Upload 1 books to device:The trouble with families started
Device using plugboard epub MARVIN None
Setting metadata in: The trouble with families at: /var/folders/7_/fd1t8fms7cb0wjvmjy0dt1c80000gn/T/calibre_1.19.0_tmp_hbxlNJ/iN0fzVcaltmpfmt.epub
Device using plugboard epub MARVIN None
DEBUG:   43.9 MarvinManagerAction:marvin_status_changed(upload_books) 
DeviceJob: 3 Upload 1 books to device:The trouble with families done, calling callback
DeviceJob: 3 Upload 1 books to device:The trouble with families callback returned
Job: 4 Send metadata to device started
DeviceJob: 4 Send metadata to device done, calling callback
DeviceJob: 4 Send metadata to device callback returned
Job: 4 Send metadata to device finished
No details available.
Job: 3 Upload 1 books to device:The trouble with families finished
No details available.
DEBUG:   48.7 MarvinManagerAction:main_menu_button_clicked() 
DEBUG:   48.7 MarvinManagerAction:show_installed_books() 
DEBUG:   48.7 MarvinManagerAction:launch_library_scanner(updating library index for virtual library u'Books For Marvin') 
DEBUG:   48.7 MarvinManagerAction:start_library_indexing() 
DEBUG:   48.7 MarvinManagerAction:_busy_panel_setup() 
DEBUG:   49.4 MarvinManagerAction:library_index_complete() 
DEBUG:   49.4 MarvinManagerAction:_busy_panel_teardown() 
DEBUG:   49.5 BookStatusDialog:initialize() 
DEBUG:   49.5 BookStatusDialog:_generate_booklist() 
DEBUG:   50.2 BookStatusDialog:_scan_library_books(589) 

(Edited to include only GRAY books)
DEBUG:   50.9                           HASH                                  UUID                   
DEBUG:   50.9  First Heart              c9a62e91fc32a7ec1b0bedf01e6eb1ca [u'176f7a1e-0ae0-4dc7-b777-2b7f58d69f30'] 
DEBUG:   50.9  Gifts of the Goddess     f2346f4bdc4a4b44dbdb8eaab294e5e3 [u'29c4d913-2a47-4a80-8a69-575a9c21d8ae', u'579d66d8-a2fa-420c-abb6-330388ec9ed3'] 
DEBUG:   50.9  Gothic Fascination       95d62d898ef0f307b7432d2601e096b7 [u'b93e0ed9-7184-49b3-af9f-efa0cf67d6b2', u'528562b3-2bdd-4444-8743-4254c6ba81e4'] 
DEBUG:   50.9  H Santini                2a91f50df53830c6075c59bf7d198c06 [u'41c7db38-ab38-4af3-8fc7-58262585ea26', u'd944ec9b-554d-478f-9fe6-560d027dd1d8'] 
DEBUG:   50.9  Harry Potter and the Go… 913ab342dc4484e6f7ca2265c27e7cfb [u'71dfe648-aec0-46eb-8c33-67433892ba51', u'1977fa15-0031-4de2-b17e-c125754977ba'] 
DEBUG:   50.9  Healing                  db5e0af5e1dca8c83964dd0a96d22043 [u'6bc7c6f6-ce9d-446a-91a5-eae488de9d57', u'661367c7-50c2-43b2-bc96-875547515e42'] 
DEBUG:   50.9  Hidden Pasts             6c0e1895725601c07c5c69a9d34f74f4 [u'b1ad37bf-8b76-4b3c-ba10-d62211198594', u'0002bd11-2b5c-4489-af92-6ab6b4ca3ca8'] 
DEBUG:   50.9  Knight By Inheritance    03c7f1dd109ddea01b7bda2df6970851 [u'5c3b761c-c884-4810-bf1e-758ae079c7c3', u'2044bb78-0d5c-48e0-8707-cdc39a25d664'] 
DEBUG:   50.9  Outrageous Fortune       e5644b2e23c5573b7ed4c4824fa670d2 [u'0981655d-7f25-4961-9b57-2711d3aae1b7', u'520e4f87-4ac0-4bae-b01c-b6f2422647c2'] 
DEBUG:   50.9  Rose's are Red, Laven…   12dc7972ac8c2faad61a449a3a5251a0 [u'f35be59d-09c0-4c13-a128-0c1a727282cc', u'8cb2b6c3-0045-4ad0-8817-19c31580b25a'] 
DEBUG:   50.9  The Trouble With Fam…    a3d859e84cbdca2fae1d18c2bd2b5d45 [u'dd39a3c6-ddb3-49fe-a84a-3f6e64f9d9f9'] 
DEBUG:   50.9  Waiting for Sunrise      d5bcdc5f49acb7f3444d569ede3415bd [u'f8a14dd9-c606-43d4-92a6-c8609dacb22e'] 

DEBUG:   50.9 BookStatusDialog:_get_installed_books() 
DEBUG:   50.9 BookStatusDialog:_scan_marvin_books(533 books) 
DEBUG:   50.9 BookStatusDialog:_localize_hash_cache() 
DEBUG:   51.0  remote hash cache: v1, 533 books in cache
DEBUG:   52.2 BookStatusDialog:_update_remote_hash_cache() 

DEBUG:   54.2 BookStatusDialog:_get_calibre_id(u'First Heart' u'groggy') 
DEBUG:   54.2  UUID match: 176f7a1e-0ae0-4dc7-b777-2b7f58d69f30
DEBUG:   54.2 BookStatusDialog:_get_calibre_id(u'Gifts of the Goddess' u'Lucifael') 
DEBUG:   54.2  UUID match: 579d66d8-a2fa-420c-abb6-330388ec9ed3
DEBUG:   54.3 BookStatusDialog:_get_calibre_id(u'Gothic Fascination' u'Lucifael') 
DEBUG:   54.3  UUID match: 528562b3-2bdd-4444-8743-4254c6ba81e4
DEBUG:   54.3 BookStatusDialog:_get_calibre_id(u'H Santini, Lock Stock and Two Smoking Wands' u'Lucifael') 
DEBUG:   54.3  UUID match: 41c7db38-ab38-4af3-8fc7-58262585ea26
DEBUG:   54.3 BookStatusDialog:_get_calibre_id(u'Harry Potter and the Golden Snitch' u'Lucifael') 
DEBUG:   54.3  UUID match: 71dfe648-aec0-46eb-8c33-67433892ba51
DEBUG:   54.4 BookStatusDialog:_get_calibre_id(u'Healing' u'Lucifael') 
DEBUG:   54.4  UUID match: 661367c7-50c2-43b2-bc96-875547515e42
DEBUG:   54.5 BookStatusDialog:_get_calibre_id(u'Hidden Pasts' u'Lucifael') 
DEBUG:   54.5  UUID match: 0002bd11-2b5c-4489-af92-6ab6b4ca3ca8
DEBUG:   54.6 BookStatusDialog:_get_calibre_id(u'Knight By Inheritance' u'Lucifael') 
DEBUG:   54.6  UUID match: 5c3b761c-c884-4810-bf1e-758ae079c7c3
DEBUG:   54.9 BookStatusDialog:_get_calibre_id(u'Outrageous Fortune' u'Lucifael') 
DEBUG:   54.9  UUID match: 0981655d-7f25-4961-9b57-2711d3aae1b7
DEBUG:   55.1 BookStatusDialog:_get_calibre_id(u"Rose's are Red, Lavender is Blue" u'Lucifael') 
DEBUG:   55.1  UUID match: 8cb2b6c3-0045-4ad0-8817-19c31580b25a
DEBUG:   55.5 BookStatusDialog:_get_calibre_id(u'Waiting for Sunrise' u'OlBear') 
DEBUG:   55.5  UUID match: f8a14dd9-c606-43d4-92a6-c8609dacb22e
DEBUG:   55.7 BookStatusDialog:_get_calibre_id(u'The trouble with families' u'LaraBr') 
DEBUG:   55.7  UUID match: dd39a3c6-ddb3-49fe-a84a-3f6e64f9d9f9

DEBUG:   55.8 BookStatusDialog:_generate_marvin_hash_map() 
DEBUG:   55.8 BookStatusDialog:_find_fuzzy_matches() 
DEBUG:   55.8 BookStatusDialog:_busy_panel_setup(Preparing Marvin library view…) 
DEBUG:   56.4 BookStatusDialog:_construct_table_data() 

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('First Heart') 
DEBUG:   56.7  uuid: u'176f7a1e-0ae0-4dc7-b777-2b7f58d69f30'
DEBUG:   56.7  matches: []
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: '45c934923a07661d1c5b9ae00eb7e3bd'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('Gifts of the Goddess') 
DEBUG:   56.7  uuid: u'579d66d8-a2fa-420c-abb6-330388ec9ed3'
DEBUG:   56.7  matches: [u'29c4d913-2a47-4a80-8a69-575a9c21d8ae', u'579d66d8-a2fa-420c-abb6-330388ec9ed3']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: 'f2346f4bdc4a4b44dbdb8eaab294e5e3'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('Gothic Fascination') 
DEBUG:   56.7  uuid: u'528562b3-2bdd-4444-8743-4254c6ba81e4'
DEBUG:   56.7  matches: [u'b93e0ed9-7184-49b3-af9f-efa0cf67d6b2', u'528562b3-2bdd-4444-8743-4254c6ba81e4']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: '95d62d898ef0f307b7432d2601e096b7'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('H Santini, Lock Stock and Two Smoking Wands') 
DEBUG:   56.7  uuid: u'41c7db38-ab38-4af3-8fc7-58262585ea26'
DEBUG:   56.7  matches: [u'41c7db38-ab38-4af3-8fc7-58262585ea26', u'd944ec9b-554d-478f-9fe6-560d027dd1d8']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: '2a91f50df53830c6075c59bf7d198c06'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('Harry Potter and the Golden Snitch') 
DEBUG:   56.7  uuid: u'71dfe648-aec0-46eb-8c33-67433892ba51'
DEBUG:   56.7  matches: [u'71dfe648-aec0-46eb-8c33-67433892ba51', u'1977fa15-0031-4de2-b17e-c125754977ba']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: '913ab342dc4484e6f7ca2265c27e7cfb'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('Healing') 
DEBUG:   56.7  uuid: u'661367c7-50c2-43b2-bc96-875547515e42'
DEBUG:   56.7  matches: [u'6bc7c6f6-ce9d-446a-91a5-eae488de9d57', u'661367c7-50c2-43b2-bc96-875547515e42']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: 'db5e0af5e1dca8c83964dd0a96d22043'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.7 BookStatusDialog:_generate_match_quality('Hidden Pasts') 
DEBUG:   56.7  uuid: u'0002bd11-2b5c-4489-af92-6ab6b4ca3ca8'
DEBUG:   56.7  matches: [u'b1ad37bf-8b76-4b3c-ba10-d62211198594', u'0002bd11-2b5c-4489-af92-6ab6b4ca3ca8']
DEBUG:   56.7  on_device: u'Main'
DEBUG:   56.7  hash: '6c0e1895725601c07c5c69a9d34f74f4'
DEBUG:   56.7  metadata_mismatches: {}
DEBUG:   56.7  match_quality: GRAY

DEBUG:   56.8 BookStatusDialog:_generate_match_quality('Knight By Inheritance') 
DEBUG:   56.8  uuid: u'5c3b761c-c884-4810-bf1e-758ae079c7c3'
DEBUG:   56.8  matches: [u'5c3b761c-c884-4810-bf1e-758ae079c7c3', u'2044bb78-0d5c-48e0-8707-cdc39a25d664']
DEBUG:   56.8  on_device: u'Main'
DEBUG:   56.8  hash: '03c7f1dd109ddea01b7bda2df6970851'
DEBUG:   56.8  metadata_mismatches: {}
DEBUG:   56.8  match_quality: GRAY

DEBUG:   56.9 BookStatusDialog:_generate_match_quality('Outrageous Fortune') 
DEBUG:   56.9  uuid: u'0981655d-7f25-4961-9b57-2711d3aae1b7'
DEBUG:   56.9  matches: [u'0981655d-7f25-4961-9b57-2711d3aae1b7', u'520e4f87-4ac0-4bae-b01c-b6f2422647c2']
DEBUG:   56.9  on_device: u'Main'
DEBUG:   56.9  hash: 'e5644b2e23c5573b7ed4c4824fa670d2'
DEBUG:   56.9  metadata_mismatches: {}
DEBUG:   56.9  match_quality: GRAY

DEBUG:   56.9 BookStatusDialog:_generate_match_quality('Rose's are Red, Lavender is Blue') 
DEBUG:   56.9  uuid: u'8cb2b6c3-0045-4ad0-8817-19c31580b25a'
DEBUG:   56.9  matches: [u'f35be59d-09c0-4c13-a128-0c1a727282cc', u'8cb2b6c3-0045-4ad0-8817-19c31580b25a']
DEBUG:   56.9  on_device: u'Main'
DEBUG:   56.9  hash: '12dc7972ac8c2faad61a449a3a5251a0'
DEBUG:   56.9  metadata_mismatches: {}
DEBUG:   56.9  match_quality: GRAY

DEBUG:   57.1 BookStatusDialog:_generate_match_quality('Waiting for Sunrise') 
DEBUG:   57.1  uuid: u'f8a14dd9-c606-43d4-92a6-c8609dacb22e'
DEBUG:   57.1  matches: []
DEBUG:   57.1  on_device: u'Main'
DEBUG:   57.1  hash: '1925248fd59de81ce71b3d3ae7c4f375'
DEBUG:   57.1  metadata_mismatches: {}
DEBUG:   57.1  match_quality: GRAY

DEBUG:   57.1 BookStatusDialog:_generate_match_quality('The trouble with families') 
DEBUG:   57.1  uuid: u'dd39a3c6-ddb3-49fe-a84a-3f6e64f9d9f9'
DEBUG:   57.1  matches: []
DEBUG:   57.1  on_device: u'Main'
DEBUG:   57.1  hash: '0cb70a005d7bf3ca2f9b5e4701d98a93'
DEBUG:   57.1  metadata_mismatches: {}
DEBUG:   57.1  match_quality: GRAY

DEBUG:   57.2 BookStatusDialog:_construct_table_view() 
DEBUG:   58.6 BookStatusDialog:_update_refresh_button() 
DEBUG:   58.6 BookStatusDialog:_busy_panel_teardown() 
DEBUG:   58.6 MarvinManagerAction:show_installed_books(533 books) 
DEBUG:   69.5 BookStatusDialog:dispatch_button_click() 
DEBUG:   69.5 BookStatusDialog:accept() 
DEBUG:   69.5 BookStatusDialog:_save_column_widths() 
DEBUG:   74.0 MarvinManagerAction:shutting_down() 

@GRiker
Copy link
Collaborator

GRiker commented Jan 17, 2014

@uten, here's what I'm observing from the latest debug log.

There are 12 unmatched books. 9 of those 12 - the ones with multiple UUID entries in the debug log - should have been flagged with a different color. I've added pink to represent books meeting the following conditions:

  • There is more than one copy of the book in calibre with identical content, but different UUIDs
  • There is one copy in Marvin matching the content
    I need some way of informing the user that there are two copies in calibre with the same content. Please don't edit your calibre library until we resolve this, as I will want you to test it.

I've updated MXD. Please download and install it from this link, then confirm that there are 9 pink books and 3 gray books displayed.

The other 3 - First Heart, The Trouble With Families, Waiting for Sunrise don't match because the hashes don't match between calibre and Marvin. We will need to do some more experiments to isolate why the hashes aren't matching.

Please confirm that the updated plugin behaves as described, then we'll consider the next step.

@GRiker
Copy link
Collaborator

GRiker commented Jan 22, 2014

@uten, I had an insight about why the updated fanfics were improperly identified as yellow instead of gray. I've updated both MXD and iOSRA, you will need to download and install both:

It's worth noting that an updated fanfic (or an edited epub) should never show yellow, only gray. If, after downloading a fanfic update a book is displayed as yellow, don't do the metadata update, but instead capture a debug log and post it.

Please let me know if this works properly.

@uten
Copy link

uten commented Jan 23, 2014

Tested it twice so far..

The book shows up as Gray.
I then transferred the book to Marvin, and it showed up as green.
The big problem is that every other book was gray.

I had to delete hashes and rebuild them.

Do you want a debug log of this?

@GRiker
Copy link
Collaborator

GRiker commented Jan 23, 2014

Yes, please send a debug log.

@GRiker
Copy link
Collaborator

GRiker commented Jan 23, 2014

Also, please clarify…
Are you saying that after you rebuilt the hashes, everything worked properly?
If everything is working properly now, a debug log won't tell me anything.
However, if books are consistently being shown in gray that should be green, yes, I need to see a debug log of that.

@uten
Copy link

uten commented Jan 23, 2014

While everything is working right now - after rebuilding the hashes - I have made sure I left some fanfics to update so I can get the error to replicate. I'll send you the debug log in a few minutes.

@GRiker
Copy link
Collaborator

GRiker commented Jan 23, 2014

Another silly typo. Please do the following:

  • Download and install updated MXD from this link
  • After launching calibre, clear Marvin hashes (this should be the last time you need to do that)
  • Launch MXD, see if things are working correctly.

I apologize, I should have caught that one but didn't. I really appreciate your assistance and persistence.

@uten
Copy link

uten commented Jan 24, 2014

Done. And done.. Works perfectly now.

And I was glad to help. :)

I will let you know if anything does crop up, but it looks awesome now.

@GRiker
Copy link
Collaborator

GRiker commented Jan 24, 2014

Whew. I will close this issue, feel free to reopen it. I'm planning to release this version after revising the help file to describe the new colors.

@GRiker GRiker closed this as completed Jan 24, 2014
@GRiker
Copy link
Collaborator

GRiker commented Jan 24, 2014

@uten, I'd like your input on a further refinement please.

I'm planning to display a dialog when gray books are detected, just before showing the MXD window. This would be similar to the dialog displayed when duplicate content is detected. Additionally, I'm planning to mark duplicates and updated books with a temporary marker in the main calibre window to make it easier to isolate the books needing further attention.

An updated version of MXD with this feature is available for download from this link.

Here's how this will appear to the user:

  • If there is duplicate content detected (magenta), the dialog will be shown (as before) with some additional text informing the user that the books are also marked with a temporary marker pin.
  • If there is updated content detected (gray), a similar dialog will be shown with a list of books with updated content. These books will also be marked with a temporary marker pin.

The most likely scenario is that either one condition or the other is active - in other words, there is some duplicated content, or some updated content, but not both. In the event that both duplicated content and updated content are detected, all books would be marked with the temporary marker.

Questions:

  • Do you like this feature?
  • Do you think it's confusing to inform the user of both conditions at the same time when that occurs?
  • This feature currently would delete any other temporary markers added by the user. Do you think that's a problem?

@uten
Copy link

uten commented Jan 25, 2014

You read my mind..

I was trying to figure out a way you could output a list of duplicates for the magenta books as just knowing I had them did make them hard to track down, but I had completely forgotten about temp markers. I'll create some magenta books, and some gray books, so I can see what the output looks like.

As for the third question, I think as long as they know they might lose their current temporary markers, there shouldn't be a problem - although given human nature, I'm sure someone will complain.. Regardless, both these conditions can't be found or fixed any other way, and help streamline both calibre's and Marvin's library. Lord knows enough of calibre's features already change the temp markers around. :)

@uten
Copy link

uten commented Jan 25, 2014

Ok. Got to have a good look at it and I think it's awesome!!

I didn't find it confusing at all, for multiple reasons. Firstly, you can copy the info, so you can refer to it if you want, and secondly, and most importantly, the information is in two separate windows, that appear one after the other, so the information isn't really given to you at the same time anyway. If it was all on the one screen, it may have been a little more confusing, depending on layout of course, but this isn't confusing at all.

I like that temp markers are added to all the books in both categories. The only thing I can think of to make everyone happy (which would be a miracle), is to make the temp marker selecting optional, which may not be possible. IE, add a tick box or something that lets them choose to select the Magenta books, the Gray Books, or both, or neither.. Hope that made sense, but it is probably far too much work to do that for the one or two grumpy people. :)

During one of my debug saving sessions, this error popped up. It happened either when I closed the MXD window, or when I quit calibre - I did both a little too close together to know for certain which. And it didn't happen the next time.

calibre, version 1.20.0
ERROR: Unhandled exception: AttributeError:'NoneType' object has no attribute 'stop'

calibre 1.20 isfrozen: True is64bit: True
Darwin-13.0.0-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '13.0.0', 'Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64')
Python 2.7.5
OSX: ('10.9.1', ('', '', ''), 'x86_64')
Traceback (most recent call last):
File "calibre_plugins.marvin_manager.action", line 405, in main_menu_button_clicked
File "calibre_plugins.marvin_manager.action", line 827, in show_installed_books
File "calibre_plugins.marvin_manager.action", line 363, in launch_library_scanner
File "calibre_plugins.marvin_manager.action", line 390, in library_index_complete
File "calibre_plugins.marvin_manager.action", line 871, in _busy_panel_teardown
AttributeError: 'NoneType' object has no attribute 'stop'

@GRiker
Copy link
Collaborator

GRiker commented Jan 25, 2014

I've uploaded a new build of MXD at this link.

This version includes a checkbox in the config dialog General options section to disable the temp markers.

I also added some code to recover from the error you reported above.

@uten
Copy link

uten commented Jan 25, 2014

Very nice.

Only other suggestion is to split the checkbox into two - one for Magenta, and one for Gray - to let people work on just one group at a time if they want.

@GRiker
Copy link
Collaborator

GRiker commented Jan 25, 2014

Yes, definitely the right way to go. Download and install the latest version from this link.

Feel free to suggest better wording for the dialogs, I know it's awkward. Note that the dialog text changes depending on whether flagging is enabled for each condition.

@uten
Copy link

uten commented Jan 25, 2014

Error found in the new selection.

If both options are ticked, only the updated content gets temporary markers. If they are selected independently (only one at a time), they work as they should.

As for the dialogs, I don't think they are awkward at all. They state the conditions and info needed, without any extraneous, confusing text added. You also have separated the points by paragraph breaks instead of bunching the information all together. I think the dialogs are well done.

@GRiker
Copy link
Collaborator

GRiker commented Jan 25, 2014

You are good tester. I thought I had tested for that.

Updated version available from this link. A few more tweaks to the text in both the dialog tooltips and the dialogs.

@uten
Copy link

uten commented Jan 25, 2014

Very nice. Works perfectly now..

I've been thinking, and we have been using the term updated. We should have been using differing, as it is possible to add the book to Marvin, then transfer it to calibre. And it shows as gray, which it should.

So instead of updated content, maybe call it differing content.

What really called it out to me, was you use the sentence "Marvin books with outdated content" in the dialog window, but it's not necessarily true.

As an example - I could use an online downloading service on my idevice to get an updated novel/fanfic/magazine whatever, then save it to Marvin. That puts the new version in Marvin, and the old one in calibre - and is a lot more work given that you have to also delete the old copy from calibre and you lose any metadata edits.... But you see what I mean???

@GRiker
Copy link
Collaborator

GRiker commented Jan 26, 2014

You're right, that path is perfectly valid. I will think about the wording, and also how to possibly handle a backload from Marvin to calibre without losing metadata.

@GRiker
Copy link
Collaborator

GRiker commented Jan 26, 2014

@uten, here's a lengthy brain dump of the situation as I see it.

First, here's a summary of how content mismatches (displayed as GRAY) are detected:

  • When MXD is launched, it generates a variety of information about books in the calibre library and books in the Marvin library.
  • One of the data points is calibre's opinion of whether or not a book is installed on the device, indicated by a checkmark in the On Device column in the Library window, and the In Library column in the Device window. Calibre displays a checkmark in those columns if either a) the UUIDs in the books match, or b) the title/author match.
  • If calibre thinks a book is installed in Marvin, the color selection algorithm will assign GREEN, YELLOW, ORANGE, MAGENTA or GRAY. GRAY is currently assigned when no other color can be assigned.
  • If calibre thinks a book is not installed in Marvin, the color selection algorithm assigns WHITE or RED.

Now, let's consider typical workflows for adding books from calibre to Marvin, then tweaking in calibre:

  • User adds a book to calibre. Calibre assigns a UUID to the book.
  • User sends that book to Marvin. The book is shown with a checkmark in both the Library and Device windows.
  • User launches MXD. The book is shown in GREEN, meaning that the book is in both calibre and Marvin, the UUID and metadata match, with a single copy in each location.
  • User closes MXD, and edits metadata in calibre or Marvin, then relaunches MXD. Book is shown in YELLOW, indicating a metadata mismatch. User has option of resolving, using either source as the master.
  • User downloads an updated version of the book (your fanfic scenario) or edits the book from calibre. The UUID doesn't change, as it's still the same entry in the calibre library, but the content has changed, causing a hash mismatch. Book is shown in GRAY.

Here's the workflow when adding a book from Marvin to calibre:

  • User adds a book from some external source to Marvin.
  • User launches MXD. The book is shown in WHITE, as it's not matched with any book in the calibre library.
  • User selects Add to calibre library from the context menu in MXD.
  • MXD adds the book to calibre's library. Marvin is informed of the calibre-assigned UUID, which will enable the book to be displayed as GREEN in future MXD sessions.

We've already seen that if a user-initiated change occurs to a book in the calibre library, say downloading an updated fanfic or editing the book, the UUID doesn't change, allowing MXD to detect that the book's identity is the same, but the content has been updated, resulting in GRAY.

But what happens when the user replaces a book in Marvin? (Users cannot directly edit a book's content in Marvin, only some of the metadata.) If the user tries to re-download a book whose author and title match a book already installed in Marvin, Marvin does not replace it. This is a safety feature, as Marvin retains lots of state information about a book, including last read position, annotations, bookmarks, etc, all of which would be invalidated by replacing the underlying content of the book. So the only way to truly replace a book in Marvin, using Marvin's UI, is to a) delete the book from Marvin's library, then b) re-download it. Doing so creates an new entry in Marvin's database, without a matching calibre UUID.

This suggests a particular scenario in which it might be possible to fool the current color algorithm:

  • User adds a book from an online source to Marvin
  • User transfers that book from Marvin to calibre using MXD's Add to calibre library feature
  • User deletes that book in Marvin, and re-downloads a refreshed version from the online source
  • User launches MXD. Calibre says it recognizes the book, as the Title and Author match. MXD assigns GRAY, because the hashes don't match.
  • How would the user get the latest copy of the book from Marvin's library to calibre? The best way (currently) would be to delete the book from the calibre library, and re-add it to calibre using the Add to calibre library feature, which would get the UUIDs back in sync. This has the undesired side effect of losing any metadata edits the user may have made on the calibre side.

My sense is that this is an unlikely scenario - once a Marvin user starts using calibre to manage content, they would tend to do all content management from calibre, not Marvin. The recommended approach would be to add the latest version of the book to the existing entry in calibre, retaining metadata and UUID.

If I were to make a change, here's how I think it would work:

  • Display the book in a new color, TEAL, meaning that there is a title/author match between libraries, but a content and UUID mismatch - in other words, the book was updated in Marvin. GRAY would mean the UUIDs match, but the content does not. I would change the terminology for GRAY to 'content mismatch', to make it similar to YELLOW's 'metadata mismatch'. TEAL would mean 'updated content in Marvin'.

The implementation would be a context menu item for TEAL books, Update in calibre library, which would fetch a copy of the Marvin version of the book, apply that copy to the existing calibre entry, then update Marvin's UUID for that book to match the already-existing calibre entry for that title/author. This would retain existing metadata in calibre and get everything back in sync.

I need to do more research to confirm that this is possible. It would be challenging to test.


So, in summary, your scenario is certainly possible, but an informed user could avoid the problem by adding the updated content to calibre rather than Marvin. A more elegant solution would be to add a new color TEAL representing updated Marvin content, with a context menu action updating the calibre library from the Marvin book.

@GRiker
Copy link
Collaborator

GRiker commented Jan 26, 2014

I've updated the plugin to revise the terminology from 'outdated content' to 'differing content'. You can download the latest version of the plugin from this link.

@uten
Copy link

uten commented Jan 26, 2014

Wow. Lots of info to think about.

I happen to agree that this is an unlikely situation. I only discovered it because I was actively attempting to check everything. I personally would never use Marvin in that way, unless I had to travel for a while. And that point there was why I brought it up.

I do like your solution, both simple and elegant.

Once you determine whether or not it's even possible, maybe a poll to see how many people would like the Teal color. Until then, a simple note, letting them know how to avoid the 'problem', would work.

I'll keep thinking on it, and if I think of anything else, I'll let you know.

@GRiker
Copy link
Collaborator

GRiker commented Jan 26, 2014

With respect to the colors, what I've been doing is subdividing the color wheel, trying to pick colors as far apart as possible so they can be distinguished by folks with vision problems. So it's not personal taste, it's maximizing visible difference.

I picked GRAY because it suggested something broken. One option with GRAY would be to do a lighter shade and a darker shade, which would keep them grouped and visibly related. But first I need to confirm the other requirements before fine-tuning the color assignment.

I do appreciate the time and effort you've invested to help improve MXD - I wish you had been around when I was originally developing it. The recent improvements are significant.

@GRiker
Copy link
Collaborator

GRiker commented Jan 26, 2014

Out of curiosity, I added the code to subdivide GRAY into two groups - those where the content has been updated in calibre, and those where the content has been updated in Marvin. Calibre updates are still shown as GRAY, Marvin updates are shown as CYAN. You can download it from this link. To clarify, this is the only change - the CYAN group is treated identically to the GRAY group.

I hacked Marvin's database to force a CYAN book in my test library for testing purposes, but I'm curious to know if any of your books show up as CYAN?

@uten
Copy link

uten commented Jan 26, 2014

I added a few books and edited a few more to try and get all the colors to show.

I had all the colors show up. Cyan included.

On a side note. There may be a problem with using light gray to do with viewing angle and color profiles... My three year old knocked my monitor askew while I was fixing up the library, and I went from having a white book and two gray books to having three off-white books. I took a screenshot (attached below) and checked on a windows desktop, a windows laptop and an ipad, and the only one that displayed it correctly at any angle was my ipad. Both windows computers displayed the gray lighter than the Mac, but the worst was the laptop despite the fact I got it looking identical to the ipad at the correct viewing angle.

And even minor messing with the color profile also turned all three off-white..

Not sure if it's worth worrying about too much, but I also know there aren't many monitors that have the correct color profile. And it was only white and light gray that were affected like this.

On the upside, the white and light gray were able to help me fine tune my color profiles so they showed correctly on my Windows computers.

I couldn't decide if this was nitpicking or not, so I figured I'd let you decide. :)

image

@GRiker
Copy link
Collaborator

GRiker commented Jan 27, 2014

I darkened GRAY by 5%, that should help. Download from this link.

@uten
Copy link

uten commented Jan 27, 2014

That did it. You can still tell the difference, no matter what now. :)

@GRiker
Copy link
Collaborator

GRiker commented Jan 27, 2014

I've made another revision which you can download from this link.
This version shows books updated in calibre with a light gray background, and books updated in Marvin with a dark gray background. Books updated in either location will be reported together in the Updated content dialog box. The details section lists the books separately.

I'm still thinking about whether or not to add the functionality to update books from within the MXD dialog. If I do this, it will need to be bidirectional - in other words, you should be able to send a book updated in calibre to Marvin, and a book updated in Marvin should update the calibre copy.

For the moment, the books are identified with enough details that the user can resolve the issues manually.

@uten
Copy link

uten commented Jan 27, 2014

Very nice. There is certainly enough information to resolve things quite easily.

The problem with updating books via MXD isn't just that. Sometimes, the updated book will alter the metadata (especially true in Marvin as it creates a new book - in calibre you can usually disable it). So not only do you need to transfer the books in both directions, the option would need to be there to transfer the 'old' metadata to the updated book, so that any edits someone made aren't lost.

Resolving the issue manually make take a little longer, but it isn't difficult at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants