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-06-2024, 11:37 PM   #1
nixR3ad
Enthusiast
nixR3ad began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Sage / rm2
Truncated directory names from Send to Device template

I'm a kobo user, and I finally switched to Koreader 100% (not just PDFs anymore). So, the send-to-device template is something I'm only now looking at after 7 years of supporting Calibre. I'm using a Sage at the moment. My template is

Code:
Books/{#genre}/{author_sort}/{series:|| -} {series_index:re(^(\d)(\.|$),0\1\2)|| -} {title} - {authors}
Where #genre is a custom column to which a book is assigned exactly one value.

I sent a book to the device with the genre: Buddhism.

It worked almost correctly. However, the top directory is 'Boks' instead of 'Books.' Nested beneath that, I have 'Budism' instead of 'Buddhism.' Likewise, the author's name was shortened.

I have the same template stored in Calibre's device-send and Kobo utility plugin (I'm using the extended driver), because I don't know which setting is being respected. When I use this template for 'Save to Disk," it works fine.

Am I doing something incorrectly? It's not a huge impact... I can find the book, and after 7 years of trying to tweak the "Perfect Reader Library," I'm now old and just want to read. While this one title is easy to find, I worry about pushing my other 300 titles to the device this way.
nixR3ad is offline   Reply With Quote
Old 01-07-2024, 12:44 AM   #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: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
That is done to comply with Path length limits for the lesser of all OS.

Your issue is a perfect example of why file by metadata is such a weak choice and why something like the Calibre Tag Browser is so great for selecting books.
Pick an Author, and only 3 exact tags. Calibre can do that
My native Kobo can do by Collection, Series or Author
theducks is offline   Reply With Quote
Old 01-08-2024, 12:20 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: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I've had this happen before.

Quote:
Originally Posted by ownedbycats View Post
I'm not sure if this would also be present with the regular Kobo driver.

I ran into a glitch where between the length of multiple (long) author names and the .kepub extension, the filepath seemed to hit some sort of limit and truncated part of my custom save path ({#kobopath}/{author_sort}/{title} - {authors}) , resulting it ending up in K:\Fanion\ instead of \Fanfiction\.

Thankfully I was able to fix it with a {author_sort:sublist(0,1,&)} to show only the main author, but I found it strange that it truncated the path instead of the filename. Did I make a user error?
Quote:
Originally Posted by davidfor View Post
The path creation is done by calibre. The drivers supply a maximum path length and calibre works something out in that. It does tend to shorten the actual file name more than the rest of the path, but, I have seen this myself. I use a couple of different libraries, and put the library name first. Occasionally the library name gets shortened. From a quick look at the code, all parts of the path can be shortened, but the longer the part, the more will be taken from it. Hence the file name part will usually be changed the most.
Quote:
Originally Posted by ownedbycats View Post
The original truncated path was exactly 180 characters (setting author_sort to a sublist shortened it to 156) and the filename did change quite a bit. If it had been able to display in full, it would've been 205 characters.
Quote:
Originally Posted by davidfor View Post
The driver sets the maximum path length to 185 characters. With it needing to remove 20 characters, I am not surprised the first directory was touched.
ownedbycats is offline   Reply With Quote
Old 01-11-2024, 12:47 AM   #4
nixR3ad
Enthusiast
nixR3ad began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Sage / rm2
My books have many tags. For as seldom I use them, I do not want to give them up. That said I don't see myself ever using the tag search function in koreader to find any titles.

The books each belong to one distinct genre. And though I know why allowing custom user metadata in the koreader config can get hairy, and I've read the discussions on Git Hub on why it isn't easily allowed.

If I could map my existing genre column to koreader's existing tag lookup, I could dispense altogether with my need for a FM based solution like my template and keep my many tags.

Sorry to get off topic, but this is what prompted the template. Suggestions (other than jump on github where I'm going next)?
nixR3ad is offline   Reply With Quote
Old 01-11-2024, 01:19 AM   #5
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: 20,576
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
How about:

Create a tag-like custom column called My Tags/#mytags,
Copy what's in tags to #mytags,
Fire up Manage Categories : Tags
Remove all the tags you don't want to see in KOReader.

Click image for larger version

Name:	Screenshot 2024-01-11 171110.jpg
Views:	24
Size:	159.6 KB
ID:	205750

Then devise a way of dealing with new books infested with tags you don't want in KOReader… perhaps via an Intake library.

BR

Last edited by BetterRed; 01-11-2024 at 03:14 AM. Reason: forgot the screenshot
BetterRed is offline   Reply With Quote
Old 01-14-2024, 09:34 PM   #6
nixR3ad
Enthusiast
nixR3ad began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Sage / rm2
Creating the top-level #shelf (genre) directories didn't always work when the complete path and filename were still very long. I decided which information I needed to find titles as well as reconstruct them on another system (data recovery), and compromised.

Since my koreader filesystem view contains the metadata, I whittled down the file paths and names to have only this:

Code:
books/{#shelf:||/}{series:||/}{author_sort:sublist(0,1,&)}-{series_index:re(^(\d)(\.|$),0\1\2)||-}{title:sublist(0,1,:)}
A 5th history book by John Smith, Shawn Frank, & Dan Brown in a series about pirates would become:

PHP Code:
books/History/Great_Pirates/Smith,_John-05-Samuel_Bellamy_for_President.epub 
A non-serial book of Poetry titled: "Nobody Bought This: Because Quite Frankly I'm Not That Great a Poet and Should Have Finished My Degree" becomes:

PHP Code:
books/Poetry/Me,_Author-Nobody_Bought_This.epub 
Then, I generate a Calibre catalog and place it at the top level.

The bit I'm working on is "personal" documents. I manage some documents with Calibre that I don't need to show beneath ~/books. I have a yes/no column to mark these as "personal." Currently, I give them the #shelf "personal," and they appear as

PHP Code:
~/books/personal/document.txt 
I'd prefer to have them saved as

PHP Code:
~/personal/document.txt 
I can't get a template correct that generates a new top-level path based on a boolean field.
nixR3ad is offline   Reply With Quote
Reply

Tags
kobo, template


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send to device - Template help Snow Sciles Library Management 12 05-26-2014 05:16 PM
How To Configure Calibre Device/Target Directory with distinct names and settings? gabby98 Devices 2 02-26-2014 01:50 PM
Template Help - Send to device Snow Sciles Library Management 4 10-08-2013 07:54 AM
send book to device - ignores directory jom Calibre 1 11-27-2010 05:56 PM
Send to device template rockeh Calibre 6 08-17-2010 05:28 PM


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


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