View Single Post
Old 03-31-2021, 10:24 AM   #1
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: 11,065
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: Specifying that an identifier does not exist

I am trying to convert these three rules into an advanced one:

Click image for larger version

Name:	2021-03-31 10_57_53-calibre - Preferences - Look & feel.png
Views:	112
Size:	24.7 KB
ID:	186262

Context: the first rule checks for url: identifiers I want to remove from finished fanfics, and the second two check for missing ao3/ffnet identifiers that I want to add to in-progress fanfics. If I see the icon, I then run my Cleanup: Fanfiction action chain to automagically do it.

I have this, which works (I changed a few things around):

Code:
program:
	status = $#fanficstatus;
	publisher = $publisher;
	ids = $identifiers;
	u = select(ids, 'url');
 	a = select(ids, 'ao3');
	f = select(ids, 'ffnet');

	if 
		u
		&& '(Archive of Our Own|Fanfiction.net)' in publisher  
		&& '(Completed|Abandoned|Oneshot)' in status
	then "metadata.png:"

	elif
		u
		&& a
		&& publisher = 'Archive of Our Own'
		&& status = 'In-Progress'
	then "metadata.png:"

	elif
		u
		&& f
		&& publisher = 'FanFiction.net'
		&& status = 'In-Progress'
	then "metadata.png:"

	fi
Except that && a and && f both specify "if these identifiers exist." How do I get it to instead specify "if these identifiers do not exist"?

Also, how would I specificy "if (A or F) exist" for the first part?

I see this part but I don't really understand how to make the syntax work

Code:
or_expression   ::= and_expression [ '||' and_expression ]*
and_expression  ::= not_expression [ '&&' not_expression ]*
not_expression  ::= [ '!' not_expression ]* | compare_exp

Last edited by ownedbycats; 03-31-2021 at 11:04 AM.
ownedbycats is online now   Reply With Quote