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 06-22-2022, 09:38 AM   #1
junni
Member
junni began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Oct 2021
Device: kobo libra 2
Custom column - Last Chapter

Hi there


As the title says, i'm looking for a way to display on a custom column, the name of the last chapter of a book. This is somewhat useful for some on-going fanfics i automatically download which the author doesn't update the "complete" tag, and only writes "END(...)" on the last chapter.
If there is a way to do this, i will be very grateful to whoever can offer a solution.

Best regards
junni is offline   Reply With Quote
Old 06-22-2022, 02:05 PM   #2
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,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I just have an enumerated (fixed-value text) column with the fanfic status. If a book has the incorrect status I just manually set it to complete.

On the topic of keeping track of read chapters, though: Here's the composite column I use to display chapters:

Click image for larger version

Name:	2022-06-22 15_04_34-calibre — __ My Books __ Fanfiction __.png
Views:	273
Size:	11.2 KB
ID:	194483

Caveats: This depends heavily on two things:

1. You use FanFicFare (because the file structure depends on it)
2. You read with a Kobo and use Kobo Utilities' custom column feature. (As such, your column will only update when you connect the device; I do it on a daily basis, so not much a problem for me.)

Code:
program:

## You'll need to replace these column names with your own
input = $#kobobookmark;
status = $#fanficstatus;
# Misspelled this because 'count' is a function
ccount = $$#chaptercount;

	if 
## I check my 'fandom' column to see if a book is a fanfic
		$#fanficcat
	then
## This checks that the fanfic has a Kobo bookmark saved
		if	
				substr(input, 0, 10) == 'OEBPS/file'
			&& 	
## I ignore oneshots and FanFicFare anthologies
				!status inlist 'Anthology,Oneshot'

		then		
## Extracts the 'current chapter' from the bookmarks, subtracts 1, and then formats them as 'currentchapno/totalchapno'
			strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount)
		else
			ccount
		fi

## This is some other formatting stuff for other books
	elif
		ccount == 'None'
	then
		'Not Set'

	elif
		ccount >#1
	then
		ccount

	fi
Note that I pause at the beginning of chapters. If you prefer to pause at the end of chapters, you'll prefer this for line 22 to remove the subtraction:

Code:
			strcat(format_number(re(input, '.*\/file(\d+).*', '\1'), '{0:,d}'), '/',ccount)

Last edited by ownedbycats; 06-22-2022 at 05:39 PM.
ownedbycats is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using RE to extract pattern from custom column into another custom column activedirectory Library Management 1 12-15-2019 08:07 PM
Adding custom column with any lookup-name gives me empty column as a result? Ahu Lee Library Management 16 06-09-2019 12:14 PM
Custom column built from word count column Montana Harper Library Management 3 10-04-2018 09:57 PM
Move selected data from series column to a new custom column fvdham Library Management 3 06-02-2017 03:49 PM
Custom column returns value based on value of another custom column? calvin-c Calibre 3 09-14-2013 02:24 PM


All times are GMT -4. The time now is 04:59 AM.


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