View Single Post
Old 09-06-2014, 02:14 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Yes, you are on track. The SQL I am using for this is basically:

Code:
SELECT c.ContentId, c.Title, c.Attribution, sc.ShelfName
FROM content c LEFT OUTER JOIN ShelfContent sc 
		ON c.ContentId = sc.ContentId AND c.ContentType = 6  AND sc._IsDeleted = 'false' 
		JOIN Shelf s ON s.Name = sc.ShelfName AND s._IsDeleted = 'false' 
ORDER BY c.ContentId, sc.ShelfName
That will list each book with the shelves they are on. The "c.ContentType = 6" are the rows that describe each the book. And the "_IsDeleted" columns are a complication to the shelves that Kobo uses for their syncing.

As to adding the function, getting the shelves from the device has been asked for before. But, usually as part of the sync. I have just posted a beta version in the plugins thread. I think it will do what you want. Tell me how it goes and if you have any suggestions to improve it.
davidfor is offline   Reply With Quote