Extending tagging or custom metadata

44 views
Skip to first unread message

Russell Adams

unread,
Mar 21, 2013, 4:33:50 AM3/21/13
to tm...@googlegroups.com
Professionally I collect a non-trivial amount of vendor documentation
on the products I support. I've been experimenting with using TMSU to
store these in a tagged format because directories simply aren't
enough. I insist on having a command line oriented tool, and Calibre
doesn't allow custom metadata. Thus, TMSU!

This is something of a feature request, based on my experience trying
to organize new downloads.

I'm typically saving more than just the file, I'd like to save the
source URL where I retrieved it from so it can be updated later. The
title of the document as opposed to the filename would also be useful.

So could TMSU support additional fields (url, title), or the ability
to add custom metadata? These don't need to be present in the
filesystem tree from my point of view, just available from tmsu should
I ask for the extended attributes on the file.

I've implemented a rough version of this using a scrip to edit PDF
metadata to store some of those items via exiftool when I save the
file to my TMSU database. That script is attached for review and
re-use by others.

I'm also considering updating the script to use the getfattr/setfattr
commands for ext* on Linux, provided here as an example:

http://blog.steve-miller.org/2010/03/file-metadata-in-linux.html

Then I could simply set and get metadata on files.

Thanks.

------------------------------------------------------------------
Russell Adams RLA...@AdamsInfoServ.com

PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/

Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3

Paul Ruane

unread,
Mar 22, 2013, 1:36:06 PM3/22/13
to tm...@googlegroups.com
Hi Russell,

For now the extended attributes are probably the easiest way forward for you. There are the 'attr', 'getfattr' and 'setfattr' commands for this on Linux. 'attr' is the only one which appears to work on my ext4 disk (despite the man page saying the 'attr' command is for XFS file systems).

I have actually had the idea of associating values with tags for some time: this is something on the roadmap (though I need to update the roadmap as I haven't in some time): https://bitbucket.org/oniony/tmsu/wiki/road_map

The idea being that you could do something like this:

    tmsu tag somefile author:bob
    tmsu tag otherfile author:sally
    tmsu files author
    somefile
    otherfile
    tmsu files author:bob
    somefile

But I haven't thought through all the ramifications of this yet. It might be something I could look at for 0.3.0.

Thanks
Paul



--
You received this message because you are subscribed to the Google Groups "tmsu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmsu+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Russell Adams

unread,
Mar 26, 2013, 7:55:23 AM3/26/13
to tm...@googlegroups.com
Paul,

On Fri, Mar 22, 2013 at 05:36:06PM +0000, Paul Ruane wrote:
> Hi Russell,
>
> For now the extended attributes are probably the easiest way forward for
> you. There are the 'attr', 'getfattr' and 'setfattr' commands for this on
> Linux. 'attr' is the only one which appears to work on my ext4 disk
> (despite the man page saying the 'attr' command is for XFS file systems).

This is a good point, but they are very fragile. Tar doesn't back them
up, cp doesn't clone them, etc.

It also appears that find cannot search on them, so they are of
limited utility.

> I have actually had the idea of associating values with tags for some time:
> this is something on the roadmap (though I need to update the roadmap as I
> haven't in some time): https://bitbucket.org/oniony/tmsu/wiki/road_map
>
> The idea being that you could do something like this:
>
> tmsu tag somefile author:bob
> tmsu tag otherfile author:sally
> tmsu files author
> somefile
> otherfile
> tmsu files author:bob
> somefile
>
> But I haven't thought through all the ramifications of this yet. It might
> be something I could look at for 0.3.0.

So in my use case the title and author might be something I would want
to visit through the filesystem interface or as a query at the
cli. (ie: Books/tagged/author/WellsHG)

But other keys like URL are only for reference, I'd be happy to query
TMSU for those values from the CLI.

As you saw from my script, I'm currently using exiftool to update the
PDF metadata with the information I'm trying to keep. While not
optimal, this is less fragile than xattr.

My use case is that many of the books I keep that are vendor docs are
frequently updated, and by keeping the source URL I can use curl to
fetch the latest version and update in place.

Thanks.
Reply all
Reply to author
Forward
0 new messages