diff options
author | pigmonkey <pigmonkey@web> | 2016-04-20 16:32:36 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2016-04-20 16:32:36 +0000 |
commit | 96a0666939670713d45b307a75158eab5185e89a (patch) | |
tree | bd52d6179afac6ab29134afa6e138bdb28b5e1f8 /doc | |
parent | dbfc00e2a6ad99200da35f75f889174cd7bfd195 (diff) |
Diffstat (limited to 'doc')
-rw-r--r-- | doc/forum/Using_integer_ranges_with_metadata.mdwn | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/forum/Using_integer_ranges_with_metadata.mdwn b/doc/forum/Using_integer_ranges_with_metadata.mdwn new file mode 100644 index 000000000..1cdbe5067 --- /dev/null +++ b/doc/forum/Using_integer_ranges_with_metadata.mdwn @@ -0,0 +1,40 @@ +I keep my movie collection in an annex. I recently wrote a python script that pulls information about each movie down from IMDB and stores it as metadata on the annexed file. One of the attributes I'm storing is `rating`. For instance, the metadata for my copy of Blade Runner looks like this: + + $ git annex metadata blade_runner.mkv + metadata blade_runner.mkv + director="Ridley Scott" + director-lastchanged=2016-04-20@04-21-33 + genre="Sci-Fi" + genre="Thriller" + genre-lastchanged=2016-04-20@04-21-33 + lastchanged=2016-04-20@04-21-33 + rating=8.2 + rating-lastchanged=2016-04-20@04-21-33 + runtime=117 + runtime-lastchanged=2016-04-20@04-21-33 + title="Blade Runner" + title-lastchanged=2016-04-20@04-21-33 + year=1982 + year-lastchanged=2016-04-20@04-21-33 + ok + +I can now use the metadata to ask git annex to show me all movies with a rating of 8.2. + + $ git annex find --metadata rating=8.2 + blade_runner.mkv + +However, that isn't very useful. What I want to do is specify a range. For example, I want to ask git annex to show me all movies with a rating above 8: + + $ git annex find --metadata rating=>8 + +Or, show me all movies with a rating between 6 and 9 + + $ git annex find --metadata rating=>6 rating=<9 + +Is something like this possible? + +I'd like to do something similar with the `year` attribute. Right now I can use metadata views to group movies by their release year, which is pretty neat. + + $ git annex view "year=*" + +But I would also like to be able to give a range so that I could group movies by release decade, for example. |