Quote:
Originally Posted by ownedbycats
currentchap/totalchap will only work for FanFicFare-downloaded stories. For regular books the file-structure varies too much to be reliably detectable with a regex.
Code:
program:
input = $#kobobookmark;
# Don't change this to 'count' as that's a function
ccount = $$#chaptercount;
if
## Checks that a Fanfiction has a Kobo bookmark and is not anthology|oneshot
## If you don't use a booktype-column, change this to check something else like a fandom column.
$#booktype=='Fanfiction'
&&
substr(input, 0, 10) == 'OEBPS/file'
&& !$#fanficstatus in 'Anthology,Oneshot'
then
## Extracts the 'current chapter' from the bookmarks, subtracts 1, and then formats them as 'currentchap/totalchap'
strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount)
## This will display the regular chapter-count for everything else.
else
ccount
fi
|
Cool. For input = $#kobobookmark; would I use #kobostatus since that's where I'm currently putting the location information?
Although I may change the column name since Status, to me, indicates Unread, Reading, Finished.
And for $#booktype=='Fanfiction' I have a column called #library that is 'Text, but with a set of permitted values' wherein the values are Fanfic, Fiction, Non-Fiction. Would that work?