Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2020, 05:15 AM   #1
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,011
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
Search by device?

Is there a way in calibre to search by device?

For instance, something like
  • ondevice:devincename to search for books that are on a specific device; false if that device is not currently connected, as ondevice by itself currently does
  • isconnected:devicename that is true if a specific device is connected, so I can have a branch of a saved search specific to a device
  • isconnected:any for a branch of a saved search for any connected device

Last edited by compurandom; 09-16-2020 at 05:17 AM.
compurandom is offline   Reply With Quote
Old 09-16-2020, 09:03 AM   #2
uli
Zealot
uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.uli can program the VCR without an owner's manual.
 
Posts: 109
Karma: 194274
Join Date: Jun 2011
Location: Montreal
Device: Kobo, Calibre
With the Reading List add-on, create "auto populated list" for each device, in the column update section have: when changed, add/remove, #device = reader_name

#device:reader_name // on specific reader
#device:true // on any reader

Or instead just use the add-on to sync lists to a specific device... so a saved search would just be a reading list..

Make auto-pop lists with search: #sendto:any, kobo, kindle, etc
JobSpy has an option to quickly tag books with: 1, #sendto=any, 2 #sendto=kobo, etc

Example:
Edit: (for any device have the list add only, not replace.)
Attached Thumbnails
Click image for larger version

Name:	calibre_1.png
Views:	86
Size:	10.0 KB
ID:	181983   Click image for larger version

Name:	calibre_2.png
Views:	86
Size:	12.4 KB
ID:	181984  

Last edited by uli; 09-16-2020 at 09:05 AM.
uli is offline   Reply With Quote
Advert
Old 09-16-2020, 10:48 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by compurandom View Post
Is there a way in calibre to search by device?

For instance, something like
  • ondevice:devincename to search for books that are on a specific device; false if that device is not currently connected, as ondevice by itself currently does
  • isconnected:devicename that is true if a specific device is connected, so I can have a branch of a saved search specific to a device
  • isconnected:any for a branch of a saved search for any connected device
ondevice is a temporary column that only exists when a device is connected.

What I do is put a tag in my #usertags column: "onKobo or onKindle"
then use an and type search:
Code:
ondevice:true and #usertags:onkobo
(if you don't test for the #usertag, ut applies to any device connected)
theducks is offline   Reply With Quote
Old 09-19-2020, 06:31 PM   #4
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,011
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
Quote:
Originally Posted by theducks View Post
ondevice is a temporary column that only exists when a device is connected.

What I do is put a tag in my #usertags column: "onKobo or onKindle"
then use an and type search:
Code:
ondevice:true and #usertags:onkobo
(if you don't test for the #usertag, ut applies to any device connected)
I already do that, but there's problems with it, not the least of which is creating an extra column.

So what I really want is the list of books that use to be on the current device but have been deleted since last sync. Your suggestion works for one device, but what if I have two devices and want to have a single search for both devices that gives the deleted books for the current device.
compurandom is offline   Reply With Quote
Old 09-19-2020, 07:58 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You moan and cry and bite the bullet and Tag (I chose to use a custom column, but nothing stops you from writing the to the normal {tags} )

Calibre does NOT store 'on device' once disconnected. and AFAIK the device ID (written in the root of the device as a speed up) is not available to us users either.
theducks is offline   Reply With Quote
Advert
Old 09-19-2020, 08:39 PM   #6
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,011
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
Quote:
Originally Posted by theducks View Post
You moan and cry and bite the bullet and Tag (I chose to use a custom column, but nothing stops you from writing the to the normal {tags} )

Calibre does NOT store 'on device' once disconnected. and AFAIK the device ID (written in the root of the device as a speed up) is not available to us users either.
Sigh. YES. I'm already doing that!

I don't care about what isn't stored. What I want is a way to write a search that knows _which_ device is currently connected, and then compare against the correct tag or correct custom column or whatever.

Also, I'm having problems with my tags getting randomly reset. It doesn't happen every time, so I can't figure it out.
compurandom is offline   Reply With Quote
Old 09-19-2020, 08:48 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
The only 'reset' of tags I have seen is CASE can change if the imported (Add books) has it different. The 'tag' remains (calibre does not consider case when searching tags).

If your tags go away. Something you are doing is causing that to happen.

Do watch out for the tag 'News", that can get auto cleaned (the content).
theducks is offline   Reply With Quote
Old 09-20-2020, 11:49 AM   #8
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,011
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
I've just verified it.
I have a reading list that is
* autopopulated from books on device
* update column for add to list only

The tag associated with this not always but usually gets deleted if the book isn't on the device but the tag was previously set. I guess "add to list only" doesn't mean that?
compurandom is offline   Reply With Quote
Old 09-20-2020, 12:06 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Ah! That is a PI action, not a (default) Calibre action.
You might ask in THAT plugin thread
theducks is offline   Reply With Quote
Old 09-20-2020, 12:35 PM   #10
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,011
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
This still would be a lot easier if I could have a device sensitive search.
compurandom is offline   Reply With Quote
Old 09-20-2020, 01:13 PM   #11
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,955
Karma: 4604435
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I agree with compurandom that search about 'column' like ondevice but containing a name for the connected device would be useful thing to have.

Unfortunately, grepping through the calibre code, there are a lot of places where 'ondevice' gets special treatment. Adding a new pseudo column would touch a lot of stuff.

Alternative idea: Is there, or could there be, a template function that returns a device name? Then a custom column-from-columns could use the function to make it available in searches?

compurandom: Is this all about device specific SmartEject searches, or do you have other use cases as well?
JimmXinu is offline   Reply With Quote
Old 09-20-2020, 01:29 PM   #12
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,416
Karma: 8012664
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by JimmXinu View Post
Alternative idea: Is there, or could there be, a template function that returns a device name? Then a custom column-from-columns could use the function to make it available in searches?
Well isn't this a coincidence.

I was playing today and wrote a new template function that returns a comma-separated set of colon-separated items, like identifiers. If the book is not on-device the function returns the empty string. If a book is on-device it returns at least three key:data items. Two keys are always there: 'name' and 'count' with the obvious values. There will also be at least one of the keys 'main', 'carda', and 'cardb', telling you where the book is stored on the device. You can get more than one storage key if the book is on the device more than once. The value part of of a storage item is the UUID calibre assigned to the storage. Example:
Code:
name:Folder Device, count:3, main:6e3f844e-bcd8-43c9-8a13-5e1dba3ccf1b
which says that there are 3 copies of the book on the "Folder Device", all in "main" memory.

You use the "select" function to get the data you are interested in.

The funny thing: I decided not to commit the changes thinking that no one would use the function. Was I wrong? Would this function get used?
chaley is offline   Reply With Quote
Old 09-20-2020, 01:41 PM   #13
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,955
Karma: 4604435
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
That does sound a lot like what I just described, yes.

But I'm don't think it would cover what I was suggesting, because it only applies to books that are on the device. When searching for books that aren't on the device, there's nothing to tell you what device is attached.

I was thinking of a function that would return something like what `self.gui.device_manager.get_current_device_inform ation().get('info', None)` does for all books when a device is attached.

Is device manager accessible from a template function I wonder?
JimmXinu is offline   Reply With Quote
Old 09-20-2020, 02:06 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,681
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by uli View Post
With the Reading List add-on, create "auto populated list" for each device, in the column update section have: when changed, add/remove, #device = reader_name

#device:reader_name // on specific reader
#device:true // on any reader

Or instead just use the add-on to sync lists to a specific device... so a saved search would just be a reading list..

Make auto-pop lists with search: #sendto:any, kobo, kindle, etc
JobSpy has an option to quickly tag books with: 1, #sendto=any, 2 #sendto=kobo, etc

Example:
Edit: (for any device have the list add only, not replace.)
That is what I do for my eBooks I have on my H2O. I a custom column for Y/N that works for me for when my H2O is not plugged in.
JSWolf is offline   Reply With Quote
Old 09-20-2020, 02:10 PM   #15
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,416
Karma: 8012664
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by JimmXinu View Post
But I'm don't think it would cover what I was suggesting, because it only applies to books that are on the device. When searching for books that aren't on the device, there's nothing to tell you what device is attached.
What would you do with this information? "ondevice:false" tells you what books are not on the device. The template language can't modify metadata so it can't populate a column.
Quote:
I was thinking of a function that would return something like what `self.gui.device_manager.get_current_device_inform ation().get('info', None)` does for all books when a device is attached.

Is device manager accessible from a template function I wonder?
Yes it is, but there are problems. The templates are re-evaluated before the device manager has fully closed the device. The ondevice column is correct but get_current_device_information can return an info structure for a bit after the device disconnects. I saw this because some books still had device information after the disconnect.

I could add a function that returns the connected device name, but it wouldn't be guaranteed to be the empty string for a time after a device disconnects.

And yes, the device manager is visible to custom template functions.

The reason I didn't commit the changes is manual intervention will always be needed to make the information permanent (stored in a custom column). Doing it automatically would require a plugin that gets signaled when a device connects and disconnects. The plugin would update a tags-like custom column with something like "device_name:yes" or "device_name:no".
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple same book on device: which search expression? un_pogaz Library Management 3 12-29-2018 11:50 AM
Aura Can't search bookstore on my device MV89 Kobo Reader 9 11-29-2013 05:21 PM
Search for Books on Device random43743 Calibre 3 04-23-2011 10:44 AM
search for books not on device alansplace Calibre 2 01-05-2011 01:07 PM
Search restriction bug when device is plugged in Manichean Calibre 6 09-11-2010 04:52 PM


All times are GMT -4. The time now is 07:25 PM.


MobileRead.com is a privately owned, operated and funded community.