The path to the photos is not stored anywhere, but it probably is taken into account in the hash so that the correct profile is loaded in the situation where identically-named files exist in different folders:
~/photos/2018-10-01/001.raw
~/photos/2018-10-02/001.raw