Search database by filename
I think that this is a great utility, I love the searching by tags. It makes it so much easier to find files. I was thinking something that is probably very simple, but I think would be useful is to have the ability to search on matching filename / path. For example, return all files in the database whose path / filename contain "mp3", to return all files with an mp3 extension. While I know it is easy to tag the files in the first place, if you miss that tag and want to re-tag based on the filename or simply want to return files who name / path matches the wildcard, it could be very powerful. Please forgive me if this functionality already exists and I just have not figured out how to access it.
Hi,
Thanks for the kind words.
There is the --path option but that's only for limiting the results to files under a given path. There's nothing for more general matching on paths. Perhaps the path option could be extended to allow globbing, i.e. The use of * and ?.
On 10 Feb 2017 00:02, "dan3501" [email protected] wrote:
I think that this is a great utility, I love the searching by tags. It makes it so much easier to find files. I was thinking something that is probably very simple, but I think would be useful is to have the ability to search on matching filename / path. For example, return all files in the database whose path / filename contain "mp3", to return all files with an mp3 extension. While I know it is easy to tag the files in the first place, if you miss that tag and want to re-tag based on the filename or simply want to return files who name / path matches the wildcard, it could be very powerful. Please forgive me if this functionality already exists and I just have not figured out how to access it.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/114, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAXB8Ehmh90Lwrf2blI9_rvIl0l11Ouks5ra6kagaJpZM4L81Hu .
Perhaps. My thought is that to utilize globbing would essentially pull all the data records from the database and cull the results. I can actually do that now by doing something like:
tmsu files mp3|grep -i jackson
This works, and is in fact pretty quick. I was just thinking that a more elegant approach would be to return only the records you are interested in from the database to begin with.
But like I said, I've only started using the program recently, and am sure that I can write a bash function in combination with this approach to achieve what I need.
Dan
Another thing to mention on this (though I appreciate it is a year later) is that when I started this project I had the idea of 'auto-tags': tags that get automatically created for the files you add based upon the properties of the files. I had grand visions of modules or scripts that could be added that would apply these auto-tags when you (otherwise) tag a file.
As an example, tagging any file could add a 'size' tag, for the file size in bytes. Adding an image file could add 'width' and 'height' tags. Adding an audio or video file could add the temporal length of the recording, &c.
Another of these could be properties of the filename itself. For example, you could have an 'ext' tag for the file extension and 'filename' for the actual filename itself.
Whether these would be added to the database or dynamically generated when such a query is made I never did decide on, but I imagine the latter approach would be pretty slow.