Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2023, 08:10 PM   #496
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Yep!
ownedbycats is online now   Reply With Quote
Old 02-06-2023, 12:39 PM   #497
isarl
Addict
isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.
 
Posts: 293
Karma: 2534928
Join Date: Nov 2022
Location: Canada
Device: Kobo Aura 2
I have created a custom column to hold status flags for my books. In the Look & Feel settings, I am setting custom icons for this column by using templates.

My template is currently producing a value like:

Code:
transparent.png:transparent.png:transparent.png:ok.png:h-ellipsis.png

However, the transparent PNG is not spacing out the other icons as intended. It is a 128×128 pixel 8-bit/colour RGBA non-interlaced PNG.
This is because I wish for icons not present in the current book to still take up horizontal space. To demonstrate visually using single characters to represent each PNG in the list above (space for transparent.png, O for ok.png, E for h-ellipsis.png), I want this:

Code:
   OE
not this:
Code:
OE
transparent.png attached in case anybody wants it for debugging purposes.

My current theories are that the transparent PNG, having no content, is being displayed but trimmed down to a smaller size – or that you cannot add the same image to a composed icons column more than once – or both. Any insight is greatly appreciated!
Attached Images
 

Last edited by isarl; 02-06-2023 at 12:42 PM.
isarl is offline   Reply With Quote
Old 02-06-2023, 04:01 PM   #498
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by isarl View Post
I have created a custom column to hold status flags for my books. In the Look & Feel settings, I am setting custom icons for this column by using templates.

My template is currently producing a value like:

Code:
transparent.png:transparent.png:transparent.png:ok.png:h-ellipsis.png

However, the transparent PNG is not spacing out the other icons as intended. It is a 128×128 pixel 8-bit/colour RGBA non-interlaced PNG.
This is because I wish for icons not present in the current book to still take up horizontal space. To demonstrate visually using single characters to represent each PNG in the list above (space for transparent.png, O for ok.png, E for h-ellipsis.png), I want this:

Code:
   OE
not this:
Code:
OE
transparent.png attached in case anybody wants it for debugging purposes.

My current theories are that the transparent PNG, having no content, is being displayed but trimmed down to a smaller size – or that you cannot add the same image to a composed icons column more than once – or both. Any insight is greatly appreciated!
It works fine for me.

The library view showing the icons:
Click image for larger version

Name:	Clipboard01.jpg
Views:	444
Size:	34.2 KB
ID:	199538

The template that produces the icons:
Click image for larger version

Name:	Clipboard02.jpg
Views:	457
Size:	65.4 KB
ID:	199539

The folder containing the icon png files. transparent.png is your file.
Click image for larger version

Name:	Clipboard04.jpg
Views:	466
Size:	19.9 KB
ID:	199540

My guess is that you never added transparent.png to the possible icons (folder cc_icons).
chaley is offline   Reply With Quote
Old 02-06-2023, 04:15 PM   #499
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
New question:

I created several user-categories to group the entries in taglike #fanficcat. (For several reasons, I prefer to leave the column itself as nonhierarchical entries.)
Attachment 199438

To find books that have entries not present in the categories, I search for #fanficcat:true AND @Fanfiction.Fandoms:.false. Is it possible to also check this with a template?

EDIT:

Code:
program: 
	if 
		$#fanficcat 
		&& !'Fandom' inlist user_categories() 
	then 
		'aaaa' 
	fi
That is one way, probably the best. However, you could use
Code:
ids = book_values('id', '#fanficcat:true AND @Fanfiction.Fandoms:.false', ',', 0)
then check if $id is in the returned list. This will be slow if it is used in a composite, OK in an action chain or a template search.


Quote:
Originally Posted by ownedbycats View Post
In the book list, there's a stray comma at the beginning of this composite taglike. Where is it coming from?

EDIT: It goes away if I run the strcat through list_remove_duplicates.
It happens because there is always a comma at the end of the list, creating an empty item. When the list is sorted to be displayed the empty item is less than everything so it goes to the front.

The list_remove_duplicates() function also removes empty items.

The right fix is to remove the comma at the end with something like
Code:
re(v, ',$', '')
chaley is offline   Reply With Quote
Old 02-06-2023, 04:22 PM   #500
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Also, another question related to column icons. In an advanced rule, what is the most correct way to return no icon?

Example: My 'Cleanup' VL also searches for marked:true books.

Code:
program:

first_non_empty(
 [lots of entries for specific metadata issues]

## Fallback
	if is_marked() then ' ' fi,
	if 'Cleanup' inlist virtual_libraries() then 'polish.png' fi
)
If I use '' (no space), it returns 'polish.png' for marked books. Hence the whitespace.
ownedbycats is online now   Reply With Quote
Old 02-06-2023, 04:33 PM   #501
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Also, another question related to column icons. In an advanced rule, what is the most correct way to return no icon?

Example: My 'Cleanup' VL also searches for marked:true books.

Code:
program:

first_non_empty(
 [lots of entries for specific metadata issues]

## Fallback
	if is_marked() then ' ' fi,
	if 'Cleanup' inlist virtual_libraries() then 'polish.png' fi
)
If I use '' (no space), it returns 'polish.png' for marked books. Hence the whitespace.
The function first_non_empty() stops when it finds a non-empty value. The string '' is empty so the function goes on to the next possibility.

The fix is to remove the is_marked() check and add something like
Code:
! is_marked() &&
to the cleanup check
chaley is offline   Reply With Quote
Old 02-06-2023, 05:04 PM   #502
isarl
Addict
isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.
 
Posts: 293
Karma: 2534928
Join Date: Nov 2022
Location: Canada
Device: Kobo Aura 2
Quote:
Originally Posted by chaley View Post
My guess is that you never added transparent.png to the possible icons (folder cc_icons).
Well guessed, that man! I am on Linux, so they don't go in my AppData folder, but I was able to determine that cc_icons is instead located in the ~/.config/calibre directory. (I had been incorrectly placing it in the same directory as the rest of Calibre's icons, owned by root:root, at /usr/share/calibre/images! Now it's owned by my user and group, not root's, and it's in the cc_icons folder.)

Thank you so much; it's now working just as I had intended.
isarl is offline   Reply With Quote
Old 02-06-2023, 08:23 PM   #503
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Also, another question related to column icons. In an advanced rule, what is the most correct way to return no icon?

Example: My 'Cleanup' VL also searches for marked:true books.

Code:
program:

first_non_empty(
 [lots of entries for specific metadata issues]

## Fallback
	if is_marked() then ' ' fi,
	if 'Cleanup' inlist virtual_libraries() then 'polish.png' fi
)
If I use '' (no space), it returns 'polish.png' for marked books. Hence the whitespace.
Also, switch_if() doesn't have this problem. When the if part is true, the value is returned even if it is empty.
chaley is offline   Reply With Quote
Old 02-06-2023, 09:19 PM   #504
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks

Also, another question:

For the user category question, I wanted specifically to find #fanficcat entries that are not assigned under Fanfiction.Fandoms.[subcategory]. Is what I came up with the best option for that? (If there's multiple entries, having one of them in the category but others not will make it not return a value.)

Last edited by ownedbycats; 02-06-2023 at 09:23 PM.
ownedbycats is online now   Reply With Quote
Old 02-06-2023, 11:09 PM   #505
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Thanks

Also, another question:

For the user category question, I wanted specifically to find #fanficcat entries that are not assigned under Fanfiction.Fandoms.[subcategory]. Is what I came up with the best option for that? (If there's multiple entries, having one of them in the category but others not will make it not return a value.)
If#fanficcat is a single value then the most accurate method would be to check whether the full value is in the list. Something like
Code:
if ! '(^Fanfiction.Fandoms.' & #fanficcat & '$' ) inlist user_categories() then ...
If it is multivalued then either a loop or 2 lists and list_difference() would work.
chaley is offline   Reply With Quote
Old 02-08-2023, 12:26 PM   #506
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks

New question.

Code:
program:

	if
		list_count($#fanficcat, ',') == 3
		&& 'Crossover' in $#fanficcat 
		&&	
		('Mass Effect Trilogy' in $#fanficcat && 'Mass Effect: Andromeda' in $#fanficcat)
		|| 
		('Half-Life' in $#fanficcat && 'Portal' in $#fanficcat)
		then
			'yes'
		fi
Three checks:

1. There are three items in the taglike #fanficcat.
2. One of them is 'Crossover.'
3. The other two are either "Mass Effect Trilogy, Mass Effect Andromeda" or "Half-Life, Portal."

Examples, to make it more clear:
Spoiler:

"Half-Life, Portal" - ✘ no match
"Crossover, Half-Life, Mass Effect Trilogy" - ✘ no match
"Crossover, Half-Life, Portal, zzz" - ✘ no match
"Crossover, Half-Life, Portal" - ✔ 'yes'


However, I messed up the operators as I'm getting 'yes' on a book where #fanficcat is "Half-Life, Portal" (two items and it does not include crossover). Where did I make the mistake?

Last edited by ownedbycats; 02-08-2023 at 12:37 PM.
ownedbycats is online now   Reply With Quote
Old 02-08-2023, 01:45 PM   #507
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Thanks

New question.

Code:
program:

	if
		list_count($#fanficcat, ',') == 3
		&& 'Crossover' in $#fanficcat 
		&&	
		('Mass Effect Trilogy' in $#fanficcat && 'Mass Effect: Andromeda' in $#fanficcat)
		|| 
		('Half-Life' in $#fanficcat && 'Portal' in $#fanficcat)
		then
			'yes'
		fi
Three checks:

1. There are three items in the taglike #fanficcat.
2. One of them is 'Crossover.'
3. The other two are either "Mass Effect Trilogy, Mass Effect Andromeda" or "Half-Life, Portal."

Examples, to make it more clear:
Spoiler:

"Half-Life, Portal" - ✘ no match
"Crossover, Half-Life, Mass Effect Trilogy" - ✘ no match
"Crossover, Half-Life, Portal, zzz" - ✘ no match
"Crossover, Half-Life, Portal" - ✔ 'yes'


However, I messed up the operators as I'm getting 'yes' on a book where #fanficcat is "Half-Life, Portal" (two items and it does not include crossover). Where did I make the mistake?
|| is lower priority than && so the clause after the || stands alone. You must put parentheses around the pair of clauses in the ||.

I recommend you always use parentheses to ensure that clauses are grouped how you want.
chaley is offline   Reply With Quote
Old 02-12-2023, 09:03 PM   #508
Trimbuk2
Member
Trimbuk2 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2022
Device: Kindle 2007, Android(Huawei)
Hello!

I hope this is the right forum to ask this question, I currently have a virtual library from which I select the books to sync with the device, is there any way to make it show only the books that are not synced on the device?
Trimbuk2 is offline   Reply With Quote
Old 02-12-2023, 09:16 PM   #509
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Trimbuk2 View Post
Hello!

I hope this is the right forum to ask this question, I currently have a virtual library from which I select the books to sync with the device, is there any way to make it show only the books that are not synced on the device?
If the device is plugged in, you can use ondevice:false.

If the device is not plugged in, no.

For 'offline' access to this information, some users like to make a custom column. Boolean (yes/no) for a single device. For multiple, a taglike (comma-separated text like tags) with the device names. (Other options too, but these two are easy to set up.)

Last edited by ownedbycats; 02-12-2023 at 09:28 PM.
ownedbycats is online now   Reply With Quote
Old 02-12-2023, 09:22 PM   #510
Trimbuk2
Member
Trimbuk2 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2022
Device: Kindle 2007, Android(Huawei)
Thanks for the help!
Trimbuk2 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Management: various questions not worth their own thread ownedbycats Library Management 229 08-13-2025 06:41 PM
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates Boilerplate4U Development 13 07-07-2020 02:35 AM
Questions on Kobo [Interfered with another thread topic] spdavies Kobo Reader 8 10-12-2014 11:37 AM
[OLD Thread] Some questions before buying the fire. darthreader13 Kindle Fire 7 05-10-2013 09:19 PM
Thread management questions meme Feedback 6 01-31-2011 05:07 PM


All times are GMT -4. The time now is 05:38 PM.


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