View Single Post
Old 01-07-2023, 01:42 AM   #458
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,795
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That worked.

Tweaking my #kobopath template:

Code:
program:

	if $#kobostatus then

# Returns 'Fanfiction/Fandom' tag for fanfics
		if $$#booktype == 'Fanfiction' then
			list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')	
# Returns 'PDF' for PDFs
		elif $formats == 'PDF' then
			'PDF'
# Returns 'Loans' for Loans
		elif 'OVERDRIVE' in $formats then
			'Loans'
# Returns booktype for others
		else
			$#booktype
		fi

	fi
As seen in this screenshot, something that has multiple Fanfiction.Whatever tags lists all three. Oops!

Click image for larger version

Name:	2023-01-07 02_13_29-Edit template.png
Views:	43
Size:	37.8 KB
ID:	198858

Due to my tagging practices:
a) Fanfiction.Crossover is the always the first in the list;
a) I only have multiple tags when one is 'Fanfiction.Crossover'
b) I always prefer 'Crossover' for the first pick.

So based on this, I thought of two separate solutions:

Option #1: splitting the list:

Code:
	if $$#booktype == 'Fanfiction' then
		list_split(list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1'), ',', 'ff');	
		ff_0
Disadvantage: This relies on Fanfiction.Crossover being first on the list. However, I rarely make changes to those subtags.

Option #2 A second check for 'Crossover' specifically. Here, I'm checking the taglike #fanficcat but I could also check Fanfiction.Crossover directly.
Code:
	if $$#booktype == 'Fanfiction' then
			if 'Crossover' in $#fanficcat then 'Fanfiction/Crossover'
			else list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')
		fi
Disavantage: This relies on 'Crossover' always being in #fanficcat (or Fanfiction.Crossover in tags). This is pretty much always the case.

Another disavantage: This also relies on 'Crossover' not being in #fanficcat (or Fanfiction.Crossover in tags) when unneeded. Thanks to the way FFF works with multi-fandom stories, this has happened.

Based on that second disadvantage, I'm inclined to go with option #1. Does this make sense?


Last edited by ownedbycats; 01-07-2023 at 02:17 AM.
ownedbycats is offline   Reply With Quote