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 03-02-2025, 06:57 AM   #16
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
I still don't know what happens or why it only happens with an ereader, but if I change the template to this:
Code:
program:
  new_des = '';
  pref="#C:";
  for i in '#des':
    j = pref & i;
    new_des = list_union(new_des, j, ',')
  rof;
  new_des
, it works, so I'm happy with that.
Where did you put that template? If you put it in a custom column definition or in the Kobo driver, it sort-of confirms what I thought -- that there is a problem with stored user template functions and possibly stored templates, in this context. Managing their availability to threads and processes is a nightmare. Python and GPM templates are stored as the template text and compiled as needed so they are by definition avaiiable when needed.

Another thought -- too late given you have a solution. Were the books with the problem marked as "On Device" when the reader was connected? If not then the problem could have been historical because the value in the Kobo database would be used. The fact that changing the template fixed it argues against this theory. The fact that you weren't getting exceptions in the log argues for it.

I know you prefer python over the template language. This python template should do the same thing as the GPM template above.
Code:
python:
def evaluate(book, context):
	pref="#C:"
	new_list = [pref + v for v in book.get('#des', [])]
	return ', '.join(new_list)
chaley is offline   Reply With Quote
Old 03-02-2025, 07:04 AM   #17
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,635
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
Where did you put that template? If you put it in a custom column definition or in the Kobo driver, it sort-of confirms what I thought -- that there is a problem with stored user template functions and possibly stored templates, in this context. Managing their availability to threads and processes is a nightmare. Python and GPM templates are stored as the template text and compiled as needed so they are by definition avaiiable when needed.
Exactly, it's in the custom column definition. And yes, I can see how it can be a nightmare.

Quote:
Originally Posted by chaley View Post
Another thought -- too late given you have a solution. Were the books with the problem marked as "On Device" when the reader was connected? If not then the problem could have been historical because the value in the Kobo database would be used. The fact that changing the template fixed it argues against this theory. The fact that you weren't getting exceptions in the log argues for it.
Yes, they are marked as "On Device", and no, I've not changed the template, I've created a new column with the new template and used it I prefer not touching something that is working at some reader and use something new. I'll remove the "wrong" column after some time.

Quote:
Originally Posted by chaley View Post
I know you prefer python over the template language. This python template should do the same thing as the GPM template above.
Code:
python:
def evaluate(book, context):
	pref="#C:"
	new_list = [pref + v for v in book.get('#des', [])]
	return ', '.join(new_list)
Thank you very much for this template, really. It's not that I prefer it, it's that I'm more comfortable and faster doing it. The templates I've shown is really copied from the examples in the template language manual (I don't read the whole manual but use it when necessary ), so it's find for me. I've used too many programming languages in my life to stick only to one, really.

And thanks a lot for checking this problem, I know it's not normal and there are a lot of users, so I really appreciate you check it.
Terisa de morgan is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kobo ereader freeze problem akiyamakazumi Kobo Reader 14 03-25-2024 09:47 AM
Moving Collections to New Kobo eReader ppowell002 Kobo Reader 2 07-23-2022 07:06 AM
kobo/caliber problem with series/collections Vampgirl82 Devices 9 05-29-2015 03:16 AM
Kobo Touch "My Collections" Problem TheArtfulDodger Devices 6 01-03-2014 08:13 AM
Best EReader for Collections? KindleKid Which one should I buy? 11 07-21-2011 10:05 AM


All times are GMT -4. The time now is 02:00 PM.


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