Quote:
Originally Posted by ownedbycats
I'd like to check extra_file_names for a file called 'Alternate Cover' (any extension). If it exists, add an entry to the #admintags column. Referencing the column would be faster than referencing extra_file_names for column icons and the like.
Is there any improvements I can make to this?
Code:
program:
alternatecover = if 'Alternate Cover' inlist extra_file_names(',') then 'cover:alternate' else '' fi;
list_union($#admintags, alternatecover, ',')
|
This version is faster, avoiding the inlist and avoiding the list_union if there is no alternate cover.
Code:
program:
if has_extra_files('^Alternate Cover$') then
list_union($#admintags, 'cover:alternate', ',')
else
$#admintags
fi