Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-25-2024, 04:32 PM   #766
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: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
For numerical columns, is there a better way to equal 0 while excluding nulls?

Code:
	elif (percent >=#1 && percent <=#99||$$#lastread !='None' && percent ==#0 && percent !='None')
	then 'currentlyreading'

Last edited by ownedbycats; 12-25-2024 at 04:55 PM.
ownedbycats is online now   Reply With Quote
Old 12-25-2024, 06:24 PM   #767
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,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
For numerical columns, is there a better way to equal 0 while excluding nulls?

Code:
	elif (percent >=#1 && percent <=#99||$$#lastread !='None' && percent ==#0 && percent !='None')
	then 'currentlyreading'
You don't say where you got "percent". If it comes from a $$#something then I would use
Code:
raw_field('#something', -1)
that ensures that if #something isn't defined then the value of percent is -1.
chaley is offline   Reply With Quote
Old 12-25-2024, 06:49 PM   #768
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: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Yup, that did it. I did have to change my 'undefined' check to make sure it worked:

Code:
program:

percent = raw_field('#percentread', -1);

	if 'dnf' inlist_field '#admintags'
	then 'didnotfinish'

	elif (percent >=#1 && percent <=#99||$$#lastread != 'None' && percent ==#0)
	then 'currentlyreading' 

	elif $#readinglist=='To Be Read' && percent ==#0
	then 'toberead' 

	elif readgoal() inlist $#admintags && percent ==#0
	then 'backlog' 

	elif percent >=#100
	then 'read' 

	elif percent >=#0
	then 'unread' 

	elif $$#percentread == 'None'
	then 'undefined' 

	fi
ownedbycats is online now   Reply With Quote
Old 12-26-2024, 04:32 AM   #769
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,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Code:
elif $$#percentread == 'None'
	then 'undefined'
This would be faster.
Code:
elif percent ==# -1
	then 'undefined'
If for some reason -1 won't work then pick a value that does, perhaps something like -100000.
chaley is offline   Reply With Quote
Old 12-26-2024, 06:38 AM   #770
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: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That did it.

I also just realized I could change line 14 to also use inlist_field and it still works.
ownedbycats is online now   Reply With Quote
Old 01-05-2025, 07:10 PM   #771
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis


Hi, is it possible to change icons individually in a template that is displayed in the tag browser?

like in format
Attached Thumbnails
Click image for larger version

Name:	Captura de pantalla 2025-01-05 160812.png
Views:	180
Size:	7.1 KB
ID:	212868   Click image for larger version

Name:	Captura de pantalla 2025-01-05 160246.png
Views:	185
Size:	4.2 KB
ID:	212869  
correoparaappzz is offline   Reply With Quote
Old 01-05-2025, 07:17 PM   #772
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: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Not by default. Job Spy can do it. GUI tool Tag browser icons.
ownedbycats is online now   Reply With Quote
Old 01-05-2025, 07:33 PM   #773
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by ownedbycats View Post
Not by default. Job Spy can do it. GUI tool Tag browser icons.
correoparaappzz is offline   Reply With Quote
Old 01-05-2025, 07:39 PM   #774
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,590
Karma: 29709834
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Format icon overrides can be placed in <calibre config>\resources\images\mimetypes.

Try to find 128x128 pngs.

BR
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-01-06 113452.jpg
Views:	199
Size:	43.2 KB
ID:	212870   Click image for larger version

Name:	Screenshot 2025-01-06 113847.jpg
Views:	198
Size:	238.0 KB
ID:	212871  
BetterRed is offline   Reply With Quote
Old 01-22-2025, 11:38 AM   #775
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,579
Karma: 7463599
Join Date: Sep 2020
Device: none
PHP Code:
programout '  💾 'epub=select(formats_sizes(),'EPUB'); epub_str=cmp(epub,'',''''strcat('EPUB: 'human_readable(epub), ' | ')); out=strcat(outepub_str); 
pdf=select(formats_sizes(),'PDF'); pdf_str=cmp(pdf,'',''''strcat('PDF: 'human_readable(pdf), ' | ')); out=strcat(outpdf_str); 
azw2=select(formats_sizes(),'AZW2'); azw2_str=cmp(azw2,'',''''strcat('AZW2: 'human_readable(azw2), ' | ')); out=strcat(outazw2_str); 
azw3=select(formats_sizes(),'AZW3'); azw3_str=cmp(azw3,'',''''strcat('AZW3: 'human_readable(azw3), ' | ')); out=strcat(outazw3_str); 
bmp=select(formats_sizes(),'BMP'); bmp_str=cmp(bmp,'',''''strcat('BMP: 'human_readable(bmp), ' | ')); out=strcat(outbmp_str); 
cbr=select(formats_sizes(),'CBR'); cbr_str=cmp(cbr,'',''''strcat('CBR: 'human_readable(cbr), ' | ')); out=strcat(outcbr_str); 
cbz=select(formats_sizes(),'CBZ'); cbz_str=cmp(cbz,'',''''strcat('CBZ: 'human_readable(cbz), ' | ')); out=strcat(outcbz_str); 
computer=select(formats_sizes(),'COMPUTER'); computer_str=cmp(computer,'',''''strcat('COMPUTER: 'human_readable(computer), ' | ')); out=strcat(outcomputer_str); 
dir=select(formats_sizes(),'DIR'); dir_str=cmp(dir,'',''''strcat('DIR: 'human_readable(dir), ' | ')); out=strcat(outdir_str); 
djvu=select(formats_sizes(),'DJVU'); djvu_str=cmp(djvu,'',''''strcat('DJVU: 'human_readable(djvu), ' | ')); out=strcat(outdjvu_str); 
docx=select(formats_sizes(),'DOCX'); docx_str=cmp(docx,'',''''strcat('DOCX: 'human_readable(docx), ' | ')); out=strcat(outdocx_str); 
fb2=select(formats_sizes(),'FB2'); fb2_str=cmp(fb2,'',''''strcat('FB2: 'human_readable(fb2), ' | ')); out=strcat(outfb2_str); 
gif=select(formats_sizes(),'GIF'); gif_str=cmp(gif,'',''''strcat('GIF: 'human_readable(gif), ' | ')); out=strcat(outgif_str); 
htmlz=select(formats_sizes(),'HTMLZ'); htmlz_str=cmp(htmlz,'',''''strcat('HTMLZ: 'human_readable(htmlz), ' | ')); out=strcat(outhtmlz_str); 
jpeg=select(formats_sizes(),'JPEG'); jpeg_str=cmp(jpeg,'',''''strcat('JPEG: 'human_readable(jpeg), ' | ')); out=strcat(outjpeg_str); 
jpg=select(formats_sizes(),'JPG'); jpg_str=cmp(jpg,'',''''strcat('JPG: 'human_readable(jpg), ' | ')); out=strcat(outjpg_str); 
kfx=select(formats_sizes(),'KFX'); kfx_str=cmp(kfx,'',''''strcat('KFX: 'human_readable(kfx), ' | ')); out=strcat(outkfx_str); 
lit=select(formats_sizes(),'LIT'); lit_str=cmp(lit,'',''''strcat('LIT: 'human_readable(lit), ' | ')); out=strcat(outlit_str); 
lrf=select(formats_sizes(),'LRF'); lrf_str=cmp(lrf,'',''''strcat('LRF: 'human_readable(lrf), ' | ')); out=strcat(outlrf_str); 
lrx=select(formats_sizes(),'LRX'); lrx_str=cmp(lrx,'',''''strcat('LRX: 'human_readable(lrx), ' | ')); out=strcat(outlrx_str); 
md=select(formats_sizes(),'MD'); md_str=cmp(md,'',''''strcat('MD: 'human_readable(md), ' | ')); out=strcat(outmd_str); 
mobi=select(formats_sizes(),'MOBI'); mobi_str=cmp(mobi,'',''''strcat('MOBI: 'human_readable(mobi), ' | ')); out=strcat(outmobi_str); 
odt=select(formats_sizes(),'ODT'); odt_str=cmp(odt,'',''''strcat('ODT: 'human_readable(odt), ' | ')); out=strcat(outodt_str); 
opml=select(formats_sizes(),'OPML'); opml_str=cmp(opml,'',''''strcat('OPML: 'human_readable(opml), ' | ')); out=strcat(outopml_str); 
png=select(formats_sizes(),'PNG'); png_str=cmp(png,'',''''strcat('PNG: 'human_readable(png), ' | ')); out=strcat(outpng_str); 
rar=select(formats_sizes(),'RAR'); rar_str=cmp(rar,'',''''strcat('RAR: 'human_readable(rar), ' | ')); out=strcat(outrar_str); 
rtf=select(formats_sizes(),'RTF'); rtf_str=cmp(rtf,'',''''strcat('RTF: 'human_readable(rtf), ' | ')); out=strcat(outrtf_str); 
snb=select(formats_sizes(),'SNB'); snb_str=cmp(snb,'',''''strcat('SNB: 'human_readable(snb), ' | ')); out=strcat(outsnb_str); 
svg=select(formats_sizes(),'SVG'); svg_str=cmp(svg,'',''''strcat('SVG: 'human_readable(svg), ' | ')); out=strcat(outsvg_str); 
tpz=select(formats_sizes(),'TPZ'); tpz_str=cmp(tpz,'',''''strcat('TPZ: 'human_readable(tpz), ' | ')); out=strcat(outtpz_str); 
txt=select(formats_sizes(),'TXT'); txt_str=cmp(txt,'',''''strcat('TXT: 'human_readable(txt), ' | ')); out=strcat(outtxt_str); 
xps=select(formats_sizes(),'XPS'); xps_str=cmp(xps,'',''''strcat('XPS: 'human_readable(xps), ' | ')); out=strcat(outxps_str); 
zero=select(formats_sizes(),'ZERO'); zero_str=cmp(zero,'',''''strcat('ZERO: 'human_readable(zero), ' | ')); out=strcat(outzero_str); 
zip=select(formats_sizes(),'ZIP'); zip_str=cmp(zip,'',''''strcat('ZIP: 'human_readable(zip), ' | ')); out=strcat(outzip_str); 
out 
Hi,

I'm using the above composite to display human readable format sizes and this looks fine on Book Details but I wanted to prevent the trailing pipe showing when there's only one format available, so instead of...

💾 EPUB: 1.2 MB |

the ideal output would be:

💾 EPUB: 1.2 MB

Ideas?
Attached Thumbnails
Click image for larger version

Name:	MWSnap 2025-01-22, 13_34_11.jpg
Views:	162
Size:	335.1 KB
ID:	213226  

Last edited by Comfy.n; 01-22-2025 at 11:43 AM.
Comfy.n is online now   Reply With Quote
Old 01-22-2025, 12:26 PM   #776
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,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Hi,

I'm using the above composite to display human readable format sizes and this looks fine on Book Details but I wanted to prevent the trailing pipe showing when there's only one format available, so instead of...

💾 EPUB: 1.2 MB |

the ideal output would be:

💾 EPUB: 1.2 MB

Ideas?
Put this just before the last line:
Code:
	if substr(out, -2, 0) == '| ' then
		out = substr(out, 0, -3)
	fi;
For fun, here is a template that does almost the same thing but hundreds of around fifty times faster. A difference is that the formats are output in alphabetic order, not the order you specified.
Code:
program: 
	out = '  💾  ';
	fmts = list_sort(formats_sizes(), 0, ',') ;
	for fmt_data in fmts:
		fmt = sublist(fmt_data, 0, 1, ':');
		size = sublist(fmt_data, 1, 2, ':'); 
		str = if size ># 0 then strcat(fmt, ': ', human_readable(size), ' | ') else '' fi;
		out=strcat(out, str) 
	rof;
	if substr(out, -2, 0) == '| ' then
		out = substr(out, 0, -3)
	fi;
	out

Last edited by chaley; 01-22-2025 at 01:06 PM.
chaley is offline   Reply With Quote
Old 01-22-2025, 12:33 PM   #777
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,579
Karma: 7463599
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post

For fun, here is a template that does almost the same thing but hundreds of times faster. A difference is that the formats are output in alphabetic order, not the order you specified.
Code:
program: 
	out = '  💾  ';
	fmts = list_sort(formats_sizes(), 0, ',') ;
	for fmt_data in fmts:
		fmt = sublist(fmt_data, 0, 1, ':');
		size = sublist(fmt_data, 1, 2, ':'); 
		str = if size ># 0 then strcat(fmt, ': ', human_readable(size), ' | ') else '' fi;
		out=strcat(out, str) 
	rof;
	if substr(out, -2, 0) == '| ' then
		out = substr(out, 0, -3)
	fi;
	out
Whee!

Much better indeed:

Click image for larger version

Name:	MWSnap 2025-01-22, 14_32_07.png
Views:	149
Size:	6.3 KB
ID:	213227

Click image for larger version

Name:	MWSnap 2025-01-22, 14_31_54.png
Views:	151
Size:	4.5 KB
ID:	213228

Comfy.n is online now   Reply With Quote
Old 01-22-2025, 04:38 PM   #778
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by Comfy.n View Post

Hi,

I'm using the above composite to display human readable format sizes and this looks fine on Book Details but I wanted to prevent the trailing pipe showing when there's only one format available, so instead of...

💾 EPUB: 1.2 MB |

the ideal output would be:

💾 EPUB: 1.2 MB

Ideas?
hi, how did you put images in the identifiers?
correoparaappzz is offline   Reply With Quote
Old 01-22-2025, 05:06 PM   #779
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,579
Karma: 7463599
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by correoparaappzz View Post
hi, how did you put images in the identifiers?
If I recall correctly, I had to create this composite column Identifiers2... {identifiers}

Click image for larger version

Name:	2025-01-22 19_00_40-Edit custom column.png
Views:	260
Size:	21.2 KB
ID:	213230

..then it's just a column icon rule set at Preferences -> Look&feel:

Click image for larger version

Name:	2025-01-22 19_01_41-Create_edit a column icon rule.png
Views:	244
Size:	23.8 KB
ID:	213231
Comfy.n is online now   Reply With Quote
Old 01-22-2025, 05:48 PM   #780
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by Comfy.n View Post
If I recall correctly, I had to create this composite column Identifiers2... {identifiers}

Attachment 213230

..then it's just a column icon rule set at Preferences -> Look&feel:

Attachment 213231


another question, is it posible to do the same in Book Details?
correoparaappzz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Management: various questions not worth their own thread ownedbycats Library Management 197 03-22-2025 10:29 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 11:50 PM.


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