LUA API films.new() symlink issue?

I’m wondering about the behavior of films.new() with symlinks:

local dt = require "darktable"
-- Create a film roll with a symlink path
local new_film = dt.films.new("/symlink/folder")
-- Prints the actual resolved path (Issue: /mountpoint/folder instead of /symlink/folder)
dt.print(new_film.path) 

This shows that when creating the film roll, the symlink path is not preserved, but instead, it’s resolved to the actual path.

Is it supposed to be like that?

darktable 5.0.1 - API version 9.4.0

What operating system? I use symbolic linking heavily (in subdirectories, not root) and haven’t noticed a problem, but I’m on Linux. I’ll run some tests and see.

Sorry, I forgot: Ubuntu

I don’t have any problems with symlinks otherwise in the GUI, everything works as expected. It’s just with films.new() that this happens.

I can reproduce. If I create a root symlink to an existing set of pictures and import them, the symlink is preserved and not expanded. I’ll look at the code and see if I can figure out what’s happening.

1 Like

Is it due to my somewhat specific paths? I would have expected all paths to be resolved, but I haven’t tested it.

Specifically in my case:

/s/Bilder-NAS → /s/nucbox-NAS/Bilder
/s/nucbox-NAS → /m/nucbox-NAS

I just see, I have one link too many in there

In the case above where I said the symlink was preserved, I had to add the symlink as a location before it would let me import. So it may be related to whether darktable actually “knows” about the symlink.

EDIT: Tested it and it still expanded the path

I had also noticed this. Even if the film roll already exists under the symlink, films.new() creates a new one under the real path.

Edit: Same with dt.database.import("/s/Bilder-NAS/Archiv/"). The recursive import doesn’t take place under /s/Bilder-NAS/Archiv/, but under /m/nucbox-NAS/Bilder/Archiv/