Am Freitag, 14. Februar 2014, 20:02:25 schrieb Patrick Shanahan: > * David Vincent-Jones <[email protected]> [02-14-14 17:07]: > > On 14/02/14 11:26 AM, Patrick Shanahan wrote: > > > That may introduce another problem for those of use who use numeric > > > tags, > > > ie: sports player jersey numbers... > > > > I suspect that player numbers are likely to be prefixed with the team > > name designation > > since mine are already grouped by team, another tag, seems superfluous to > add chars to their jersey numbers. > > Since you have a problem with loooong tags, why not limit the tag length > to something reasonable (another question) like <30 chars....?
Maybe this would solve your issues: a tiny lua script that goes through all tags on startup and deletes those that are longer than a (configurable) length. To use it, copy the attached file to ~/.config/darktable/lua/ (you might have to create the directory) and add the following line to ~/.config/darktable/luarc require "delete_long_tags" (you might have to create that file). Now you can set the maximal allowed tag length in the preferences (it defaults to something big for safety reasons) and restart darktable. I'm leaving the task of running the code whenever a new tag gets created as an exercise to the reader. HTH Tobias PS: If you want to do a dry run first: remove the line "t:delete()" and watch stdout
dt = require "darktable"
dt.preferences.register("delete_long_tags", "length", "integer",
"maximum length of tags to keep",
"tags longer than this get deleted on start",
666, 0, 65536)
max_length = dt.preferences.read("delete_long_tags", "length", "integer")
for _,t in ipairs(dt.tags) do
len = #t.name
if len > max_length then
print("deleting tag `"..t.name.."' (length: "..len..")")
t:delete()
end
end
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________ darktable-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/darktable-devel
