Page 1 of 1
New plugin search operator 'not defined'
Posted: 2010-04-21, 12:40 UTC
by MVV
To be able to search for files which doesn't have some plugin value we need new search operator like 'not defined' (or 'absent') which will match when plugin returns ft_fieldempty (or maybe also other errors too). E.g. currently it is not possible to search for files w/o product version string - all search operators fail.
Posted: 2012-03-22, 19:09 UTC
by tbeu
I hope to see this in TC8. Currently there is no workaround to find/select files returning ft_fieldempty.
Posted: 2012-04-30, 19:12 UTC
by tbeu
Christian, can you please comment on this suggestion.
Posted: 2012-05-03, 13:31 UTC
by ghisler(Author)
Sorry, TC8 RC1 is now feature-complete, I will not add any new features at this time. I haven't found a good solution for this yet, because not all plugins use the ft_fieldempty result, but return something like an empty string or 0.
Posted: 2012-05-03, 14:00 UTC
by MVV
Christian, if plugin returns empty string or 0, we can check it using additional check, but we can't check if plugin doesn't return any value at all...
Posted: 2012-05-03, 14:24 UTC
by tbeu
ghisler(Author) wrote:Sorry, TC8 RC1 is now feature-complete, I will not add any new features at this time.
OK, might be too late for now. But when this feature was first suggested two years ago it was not.
In my case users of my plugin ImageMetaData need to search for image files not containing GPS metadata. There is simply no way or workaround to do so.
Posted: 2014-07-30, 22:04 UTC
by tbeu
This wish came up again at
http://www.ghisler.ch/board/viewtopic.php?t=40861. Any chance to see it implemented in next version?
Posted: 2014-07-31, 10:09 UTC
by ghisler(Author)
I have re-added it to my list.
Posted: 2014-07-31, 11:25 UTC
by tbeu
Nice, thanks!
From contplug.h:
Code: Select all
#define ft_nosuchfield -1 // error, invalid field number given
#define ft_fileerror -2 // file i/o error
#define ft_fieldempty -3 // field valid, but empty
#define ft_ondemand -4 // field will be retrieved only when user presses <SPACEBAR>
#define ft_notsupported -5 // function not supported
#define ft_setcancel -6 // user clicked cancel in field editor
#define ft_delayed 0 // field takes a long time to extract -> try again in background
I noticed that I use ft_fieldempty and ft_nosuchfield in a confusing way for ImageMetaData plugin. If a field cannot be found it returns ft_fieldempty whereas it probably shout return ft_nosuchfield?? Not sure what is the appropriate solution here. WDX Guide displays nothing (empty string) for ft_fieldempty but text "ft_nosuchfield" for ft_nosuchfield (and text "ft_fileerror" for ft_fileerror). Therefore, a new search feature might also consider ft_nosuchfield and ft_fileerror beside the proposed ft_fieldempty.
Posted: 2014-07-31, 14:12 UTC
by MVV
If field is not supported for such format, plugin should return ft_nosuchfield.
If field value is empty, plugin should return ft_fieldempty.
However it is a question which value plugin should return if field is supported but is not present (e.g. in case of optional tags).
Posted: 2014-08-04, 14:12 UTC
by ghisler(Author)
I guess that the new option should handle both ft_nosuchfield and ft_fieldempty the same way. ft_nosuchfield is meant for the case where you have a plugin supporting multiple file types (e.g. mp3, jpg etc) and ask for a field which isn't supported by that particular file (e.g. ID3 tag in jpg, EXIF in mp3). ft_fieldempty is meant when the field exists (e.g. ID3 in mp3) but is not set, and returning an empty string would be wrong (e.g. numeric field).
Posted: 2014-08-04, 14:20 UTC
by tbeu
And what about the optional fields (e.g. EXIF in jpg)? ft_nosuchfield or ft_fieldempty? It is matter of taste but I'd prefer ft_fieldempty.
Posted: 2014-08-04, 14:40 UTC
by MVV
It is good idea to handle both
ft_nosuchfield and
ft_fieldempty in case of such operator, so it will work with both absent and empty optional fields.
Maybe
ft_fileerror should be handled too?
Posted: 2014-08-04, 14:46 UTC
by ghisler(Author)
No, ft_fileerror is meant for read errors, e.g. because the file is currently opened exclusively in a different program. This doesn't mean that the field isn't present, it could as well be contained in the file (just not accessible).