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 01-30-2022, 01:33 PM   #1
Irian
Enthusiast
Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.
 
Posts: 47
Karma: 450
Join Date: Mar 2011
Device: PRS-600, PRS-650, Tolino Vision 3 HD, Kobo Libra H20
Kobo Directory Templates

Heya,

I've been using this template for a while and generally it works fine...

Code:
program:

series = test( field('series'), field('series'), '');
topic = test( field('#topic'), field('#topic'), '');

category = first_non_empty(series, topic);

strippedcategory = re(category, '^(A|The|An|Der|Die|Das)\s+', '');
initialofcategory = substr( strippedcategory, 0, 1 );

idx = field('series_index');
indexno = contains(idx, '\.', format_number(idx, '04.1f'), format_number(idx, '02d'));
index = test(series, strcat( indexno , ' - '), '');

cleanedCategory = re(category, ' & ', ' and ');
cleanedCategory = re(category, '&', ' and ');

foldernameforcategory = strcat(initialofcategory, '/', cleanedCategory, '/', index);

defaultfoldername = 'other/';

cleanedTitle = field('title');

finalfolder = test(category, foldernameforcategory, defaultfoldername);

strcat('books/', finalfolder, cleanedTitle );
Basically, for my kobo, my books are sorted under their series (if any) or their topic (a custom field), grouped by the first letter of either (A/A-Series, The; B/B-Topic, etc.). So far, so good...

Now I wanted to be clever and though, if I used the "topic" column to add a sub-topic as well, it could sort it under the sub-directory, for example:

"Programming" -> goes under P/Programming
"Programming/C" -> goes under P/Programming/C
"Programming/Java" -> goes under P/Programming/Java

In calibre when this is displayed, it also looks correct, but unfortunately, when loading them onto the Kobo, it actually works out to...

"Programming" -> goes under P/Programming
"Programming/C" -> goes under P/Programming_C
"Programming/Java" -> goes under P/Programming_Java

So, any idea what's causing this and is there an easy way to clean up the topic string to get the correct result?
Irian is offline   Reply With Quote
Old 01-30-2022, 02:31 PM   #2
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,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
slash is a special character to file systems, so the Value in the fields gets changed to _ when used in a file template. <this is for normal, cross OS compatibility process in Calibre>
theducks is offline   Reply With Quote
Advert
Old 01-30-2022, 04:51 PM   #3
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
See this thread:

https://www.mobileread.com/forums/sh...ht=underscores
ownedbycats is offline   Reply With Quote
Old 01-31-2022, 10:23 AM   #4
Irian
Enthusiast
Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.
 
Posts: 47
Karma: 450
Join Date: Mar 2011
Device: PRS-600, PRS-650, Tolino Vision 3 HD, Kobo Libra H20
Thanks, worked perfectly.
Irian is offline   Reply With Quote
Old 02-04-2022, 12:06 PM   #5
Irian
Enthusiast
Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.
 
Posts: 47
Karma: 450
Join Date: Mar 2011
Device: PRS-600, PRS-650, Tolino Vision 3 HD, Kobo Libra H20
Ok, one problem I found with that: Calibre does not recognize the books on the reader that way, so they appear there in the right folder, but Calibre does not show them as "On Device" when syncing... Hm...
Irian is offline   Reply With Quote
Advert
Old 02-05-2022, 01:31 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Irian View Post
Ok, one problem I found with that: Calibre does not recognize the books on the reader that way, so they appear there in the right folder, but Calibre does not show them as "On Device" when syncing... Hm...
Calibre should be matching the books on a Kobo device using the title and authors. There is a problem if there are multiple authors. Kobo only reads the first from the metadata and that breaks the matching. To counter this, I recommend using a metadata plugboard and setting the author using the template:

Code:
program: raw_list('authors', ', ')
That improves the matching for multiple authors to nearly perfect. And it is also the way the device understands authors, so it works better there.
davidfor is offline   Reply With Quote
Old 02-09-2022, 04:02 PM   #7
Irian
Enthusiast
Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.
 
Posts: 47
Karma: 450
Join Date: Mar 2011
Device: PRS-600, PRS-650, Tolino Vision 3 HD, Kobo Libra H20
To be honest, I really doubt that this is the reason. Before I added the re-placement, all books were correctly identified as being on my Kobo, only after doing so, suddenly they were synced to the correct directory (good) - but not recognized as "on the device" anymore (bad). So the only change I made is adding the "re..." thing. Also the fact that this happens only for the books that have that "/" in the custom field, but none of the others, points really in the direction of that being the problem, doesn't it?
Irian is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
News export to Kobo with templates biffhero Library Management 2 08-21-2020 08:22 AM
Kobo and directory structure DrunkenDonkey Kobo Reader 9 08-24-2016 01:01 PM
Mini how to do after delete .kobo directory? sbwtxj Kobo Developer's Corner 1 08-25-2014 11:31 PM
Kobo iOS file directory Kirbky Kobo Reader 2 02-13-2014 09:59 AM
directory on kobo to kopy books zoran Kobo Reader 5 07-19-2010 02:31 AM


All times are GMT -4. The time now is 12:56 AM.


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