View Single Post
Old 07-23-2023, 12:06 PM   #8706
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,045
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by culytera View Post
I'm trying to understand why my test entries aren't being used despite including only them as subject tags.

Basically what I'm trying to do is retrieving the first item in a list. I've managed to do this (maybe??) as shown on the title page, but for whatever reason it's taking other entries as subject tags. I didn't see any conflicting settings on overrides/defaults. Here's the relevant code:
...
It looks like despite editing the string as a list the items still exist.
You've exactly identified it. FFF is using the list, not the string.

The code for getting include_subject_tags is specifically calling for the lists (keeplists=True) which bypasses _LIST processing.

getSubjectTags() uses lists so it doesn't need to re-split things again. It doesn't matter for Calibre tags, but does very much for epub tags.

IE, if genre contains ['Action','Comedy'], you want to get:
<dc:subject>Action</dc:subject>
<dc:subject>Comedy</dc:subject>

Not:
<dc:subject>Action, Comedy</dc:subject>

That code--or rather its predecessor--almost certainly predates _LIST. And likely replace_metadata, etc. It's hard to track exact history past ~8 years ago due to the project name changing, code restructuring, and the project moving from code.google to github all at the same time.

So in all likelihood, I've just never considered this corner case before. And I'm not entirely sure how to address it.
  • Just removing keeplists=True fixes your case, but leads directly to the <dc:subject> tag issue above.
  • Re-splitting is complicated by the fact that each metadata entry list can configurably have a different separator (join_string_X setting). And include_in_X means it's not obvious which separator may apply.
Perhaps it's finally time to separate Calibre Tags from include_subject_tags... I'll need to think about this a bit.

BTW, kudos for figuring out teststory and using it well for its intended purpose.
JimmXinu is offline   Reply With Quote