04-13-2011, 10:24 AM | #31 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Re the toolbar button - well you have both keyboard shorctus and menu options as additional way to move to the next group, so hopefully that should be enough. Maybe one day Kovid will offer a way of creating plugin widgets to the main GUI (a few people have raised things in the past like wanting a status panel etc). A little panel able to be displayed on the book details pane or something which could have next/previous group buttons, a count of duplicates etc would offer another way to navigate all this stuff. Not likely to happen any time soon if at all though.
|
04-13-2011, 10:56 AM | #32 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
To do this the best way, we would: - need to add the ability for a plugin (or any other code) to apply an arbitrary search as a search restriction. This can be done rather easily by adding a 'current search' option to the restriction box. Selecting 'current search' will copy what is in the search box and apply it as a restriction. I will look at this, as it would be useful independent of duplicate detection. - have the plugin apply the search 'marked:duplicates' as a restriction. - make next and previous do as you described. Quote:
|
||
Advert | |
|
04-13-2011, 07:35 PM | #33 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
v0.2 Beta
Here is another version for you incorporating a number of the changes and additions mentioned above. Add the duplicate exemption support raised the complexity several times but I "think" it is getting there.
If you have downloaded a previous version, please delete the "Find Duplicates.json" config file from your plugins folder. I couldn't be bothered with backwards compatibility for a beta. Stuff I know differs in this release:
The marking dictionary stuff is quite different to my first version. What I do now is store a whole bunch of markings at the same time, and recalculate them all every time you do an action. So for instance you could at any point do "marked:duplicates" to see all the books reported as duplicates. In fact Charles you can do this as a saved search, manually turn on highlighting and then use the next/previous group to do exactly as we discussed above a little more "manually". At the same time it is also possible to view individual groups using "marked:duplicate_group_000x". Choosing next/previous result will recalculate the marked books, but if you felt so inclined you could just overtype the number and hit Go to see a specific group etc. The third simultaneous marking is "marked:not_duplicate". This is applied to all books that are part of a duplicate exemption. In theory we could use the above for sorting when showing all duplicate books, as I store composite values with "duplicate_group_000x" always at the beginning of the "marked" field value. I haven't bothered to apply any sorting at this point but the ability is there. Removing duplicate exemptions is as I described in posts above - for each book you have seleted, it removes all associated exemption pairings. So if you initially mark a group that has (1,2,3) that will create exemptions of (1,2),(1,3),(2,3). If you were to right click on book 3 and choose remove exemption, then refresh your search it will just keep (1,2). Clearly I haven't thrashed it and could well have broken new stuff so as always feedback appreciated. If you don't like the menus, names, ordering, want more/less confirmations or whatever please offer suggestions along with anything else that comes to mind. I suspect we are closer to a 1.0 release than 0 which the number indicates but it may just be wishful thinking. Last edited by kiwidude; 04-15-2011 at 07:48 PM. Reason: Later beta in this thread |
04-14-2011, 04:22 AM | #34 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
apply_text_search_restriction(some_search) Quote:
Will try the new version soon... |
||
04-14-2011, 04:43 AM | #35 | |||
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
Quote:
I say "usually" because it depends on how many other groups that book is in as to whether it will sort next to it. In a happy case, the marked column would be like this: Say you have Group 5 of (11,12) and Group 6 of (11,13), caused by a duplicate exclusion in place between (12,13). book 11 is marked 'duplicate_group_0005,duplicates' book 12 is marked 'duplicate_group_0005,duplicate_group_0006,not_dup licate,duplicates' book 13 is marked 'duplicate_group_0006,not_duplicate,duplicates' So sorting by marked text will in this case put them together on screen. If however book 13 also happens to be part of a group 1, then book 13 is marked: 'duplicate_group_0001,duplicate_group_0006,not_dup licate,duplicates' So initially it will sort at the top in group 1, not next to the members of its second related group of group 6. However if the user processes their duplicates sequentially and resolves group 1 first, then the marked text for book 13 would be updated to remove that duplicate_group_0001 and it would appear as per my initial example above in the right place. So basically a book that was in multiple groups (assuming it is the "winner" of any earlier merges) will progressively move down the screen to be displayed with its next associated merge group. It's just a theoretical approach to displaying all duplicate groups at once . And as marked is not a visible column, the user could "break" the sorting at any point by clicking on a column heading, though I would keep re-applying it every time they move next/previous. Quote:
Last edited by kiwidude; 04-14-2011 at 04:49 AM. |
|||
Advert | |
|
04-14-2011, 07:57 AM | #36 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I have submitted code to sort on named fields. Assuming it is accepted, the API is:
Code:
library_view.sort_by_named_field(field, order, reset=True) Order is a boolean. True == ascending. If reset is true, the screen is repainted. Note that the screen is always repainted if the field is a visible column. |
04-14-2011, 08:02 AM | #37 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Hi Charles - two questions: (1) what if you want to apply multiple sort columns, and (2) if I sort by one field, is it going to be on top of whatever sorting was already applied (i.e. they become a secondary sort)?
Kind of the same question I know |
04-14-2011, 08:11 AM | #38 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
- to sort on multiple columns, sort on them one at a time in reverse order. - the sort is stable, so any existing order becomes secondary. And you didn't ask, but - field sorts are entered into sort history. This means that sorts of non-visible columns are preserved across db cache refreshes and db searches. |
|
04-14-2011, 10:59 AM | #39 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The sort changes are now in trunk.
|
04-14-2011, 11:39 AM | #40 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
OK, finally got time to try it.
I really like using the search restriction and the marking. Setting up the search restriction by hand is easy, although having it done for me would be nice. One nit: the duplicate groups are random (it seems) in terms of title order. They jump all over the place. Next group bounces from Collected Essays to Xenocide to Collected Poems. It would be nice if the groups were ordered in ascending title sort order, where the lowest title in the group controls the order. Sorting by duplicate group would help because the flow will be 'down', but then the titles will be sorted oddly if a book is in more than one group. I confess that I am not sure what is best here. (You know things are going well when I start mentioning this kind of thing. ) In terms of behavior: clearly switching to 'highlighting mode' should set the search restriction and the highlight_only flag. The issue is the one you mentioned -- when does the highlight_only flag get reset to what it was? I am tempted to put a copy of that checkbox back onto the main gui so that the user can easily see it change and can easily reset it. However, real estate is precious, so I would propose a very terse label, something like "H/O" next to the checkbox with a tooltip that tells the user to see the configuration dialog for more information. Showing duplicate groups is close to useless if the highlighting flag is set unless the search restriction is set to not_duplicate. Is there a way (will there be a way) to see the books in their non-dup pairs? I would like to select a book and have that books non-dups highlighted. Otherwise I have no idea what the pairs are, at least as I can tell. I think this plugin is very nice. Once it is stable, I would argue that it be merged into calibre itself. |
04-14-2011, 02:29 PM | #41 | |||||
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Hey Charles, thanks for the feedback again.
I thought you might like the marking. Awesome foresight when you added that feature to Calibre to suggest putting a dictionary in place now wasn't it? Quote:
Quote:
When displayed, what I am doing (now) is to first sort by title, and then by marked group (which is why I asked about multiple sorts above). So within each group you would have some consistency, plus the overall pattern to the groups. Quote:
Quote:
Displaying the pairs is the tricky one. We are back to the old chestnut of trying to indicate to the user which is the "root". For instance we could just again use highlighting mode, set a restriction of "marked:not_duplicates", and then give you a menu option of "Show exemptions for this book" which then highlights all the books it is paired with. However as soon as they move their selection they will of course lose who the parent was. Buried two layers of menu down isn't exactly the easiest gui access too. And of course there is also the question of whether you would want this ability while looking at your duplicate groups, rather than only when looking at all your exemptions... I don't have any answers at this point, unless we go back to the idea of a separate dialog again for showing the exemptions? Quote:
|
|||||
04-14-2011, 02:35 PM | #42 |
creator of calibre
Posts: 43,864
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm perfectly fine with having this functionality builtin. I'll leave it up to you and Charles, when you feel it is ready for inclusion, just send me the patch for review.
|
04-14-2011, 03:02 PM | #43 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@Charles potentially for this one (and yes I should raise a ticket but I'll ask about it first). Could the library view select_rows logic be tweaked (I know Qt has various options and it is something that bugs me from time to time).
Right now when you have a lot of results, and the screen gets refreshed (like after editing metadata or whatever), all it does when restoring selections is make sure the first row in your selection is visible. And if that row was near the bottom of the screen, the selected row just becomes the last row visible. Which is a pain because you cannot see the next row, and in the case of this duplicates plugin in show all mode trying to highlight the next group means you have to keep on scrolling to see it's members I would rather that where possible the selection be put into the middle of the screen, so you have visible rows either side in your workflow to look at next or previous rows. Or at least with a decent amount of row padding like 10 rows or something. Shall I raise a ticket or will you just fix it in your usual efficient fashion? P.S. I see I just spent my 1000th post on wishing Kovid well. Only appropriate I guess. |
04-14-2011, 03:09 PM | #44 | |||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
Quote:
|
|||
04-14-2011, 03:33 PM | #45 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@Starson - yeah I did warn about the config file thing in the post it is attached to, but can't blame you for not reading all of my ramblings
@Charles - I don't suppose there is a convenient way to identify what the current sort column is? I discovered that sorting every time you move to the next duplicate group is quite slow. So what would be better I think (since the topmost sort column is that of "marked") is to check whether that is still the current top sort column, and only apply my sorts again of title then marked if it is not. The user can't sort on "marked" since it is not visible, so this should work as an optimisation. I know from my ViewManager plugin that I can get down and dirty and roll around in get_state() with sort history etc, but I thought I would ask you first before I did that again to see if you had a better suggestion |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Duplicate Detection | Philosopher | Library Management | 114 | 09-08-2022 07:03 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
Duplicate Detection | albill | Calibre | 2 | 10-26-2010 02:21 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |
Help with Chapter detection | ubergeeksov | Calibre | 0 | 09-02-2010 04:56 AM |