View Single Post
Old 03-31-2021, 11:39 AM   #2
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,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
First, note that the test of 'u' is the same in all the condition clauses and you never subsequently use 'u', so it can be factored out.

You use 'unary not' (!) to invert a condition, in your case to return True if the variable is empty.

Given the above, I think you want:
Code:
program:
	if select(ids, 'url') then
		status = $#fanficstatus;
		publisher = $publisher;
		ids = $identifiers;
		a = select(ids, 'ao3');
		f = select(ids, 'ffnet');

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

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

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

		fi
	fi
chaley is offline   Reply With Quote