|02-26-2011, 06:00 AM||#1|
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle PW2, Sony PRS-T1
Merge stuff in user categories with same name.
In light of the new grouped search user categories and hierarchical tag browser, I was looking into merging stuff in the Tag browser.
e.g. I have a combined search for "series,#series2,tags" and items with the tag "Star Trek.DS9", the series "Star Trek.DS9.Relaunch " and the #series2 "Star Trek.DS9.Mission Gamma ". This currently leades to three "Star Trek" in the tag browser, and each one will search it's origin category.
My first thought was to start with modifying the search generated in tag_view - tokens to just search the grouped search if possible and then as a second step try to figure out how to merge the entries in the tag browser. I Expected the first one to be easy as the tooltip of the items already displays the proper user category, but it turned out more difficult then I thought. Am I seeing this right that he just reuses the same object in the user category and in the actual category?
So I guess I would have to clone/recreate the object while merging them. Seems more difficult then I thought. Could someone give me some pointers where the user category tree is actually build?
Or am I trying something that will turn our really really complex? Now that I think about it, it might break some stuff that I never use. e.g. drag-n-drop on a merged entry would not be defined. Darn, it sounded to easy in my head.
|02-26-2011, 07:02 AM||#2|
"chaley", not "charley"
Join Date: Jan 2010
Device: Many android devices
You are correct, wherever possible, calibre uses the same 'Tag' object when placing the same tag in the TreeView. This permits several things, the most important being sharing of search state.
My understanding is that you want the item in the global-search-term (GST) user category not to be an instance of the tag, but instead be an instance of something like a search term. Although I wouldn't want it to behave this way, I can see why you would.
There are two ways to accomplish this.
1) The best would be two build the category information the way you want. The list of tags used in a category is built in library.database2.get_categories. There is a block of code there that constructs a temporary user category by merging all items from the 'real' categories into the new category. The block of code after that builds the category tag structures for all user categories, including this temporary one. You would change that code to:
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Early warning: addition of hierarchical user and built-in categories||chaley||Development||2||02-24-2011 03:15 PM|
|0.7.3 - User Categories||nynaevelan||Library Management||0||02-03-2011 11:51 AM|
|Classic Categories||thewolfe||Barnes & Noble NOOK||2||07-28-2010 03:28 PM|
|Merge feature request (different merge)||Tarran||Calibre||1||05-24-2010 10:57 AM|
|Categories?||river||Calibre||3||06-21-2009 02:21 PM|