<div dir="ltr">Okay, I just checked the KF5:Solid source code and the UUID that is returned is actually the serial number returned by the Windows API (<a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumeinformationa">https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumeinformationa</a>).<div>So with sth. like this I can create a map from volume UUID to drive letter, even though this is not portable:</div><div><div style="line-height:19px"><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(197,134,192)">for</span> <span style="color:rgb(156,220,254)">drive</span> <span style="color:rgb(197,134,192)">in</span> <span style="color:rgb(78,201,176)">win32api</span>.<span style="color:rgb(220,220,170)">GetLogicalDriveStrings</span>().<span style="color:rgb(220,220,170)">split</span>(<span style="color:rgb(206,145,120)">'</span><span style="color:rgb(215,186,125)">\x00</span><span style="color:rgb(206,145,120)">'</span>):</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(197,134,192)">if</span> <span style="color:rgb(220,220,170)">len</span>(<span style="color:rgb(156,220,254)">drive</span>) == <span style="color:rgb(181,206,168)">3</span>:</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(197,134,192)">try</span>:</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(220,220,170)">print</span>(<span style="color:rgb(78,201,176)">win32api</span>.<span style="color:rgb(220,220,170)">GetVolumeInformation</span>(<span style="color:rgb(156,220,254)">drive</span>))</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(197,134,192)">except</span>:</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(220,220,170)">print</span>(<span style="color:rgb(206,145,120)">'Error for drive '</span>, <span style="color:rgb(156,220,254)">drive</span>)</div><div style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><br></div><br>Thanks for your help.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 1. Apr. 2023 um 13:36 Uhr schrieb Nino <<a href="mailto:nino.kettlitz@gmail.com">nino.kettlitz@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I see. Any idea how I could get the current drive letter in Python w/o reverse engineering the whole KDF:Solid library?<div><br></div><div>Cheers,</div><div>Nino</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 1. Apr. 2023 um 13:23 Uhr schrieb Maik Qualmann <<a href="mailto:metzpinguin@gmail.com" target="_blank">metzpinguin@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We use the KF5:Solid framework to get the drive information. The UUID is the <br>
partition UUID. So we are looking for the UUID that the Solid Framework <br>
returns to us as drive information and we get the corresponding path. <br>
Therefore, the drive letter can change with removable drives, we would find the <br>
new one via the UUID.<br>
<br>
Maik<br>
<br>
Am Samstag, 1. April 2023, 13:01:04 CEST schrieb Nino:<br>
> Hi,<br>
> <br>
> I'm trying to construct the full image path from the images in the sqlite<br>
> database.<br>
> <br>
> I have this file, for example:<br>
> X:\Nino\Pictures\2018-03\20160511_162826.jpg<br>
> <br>
> What I have so far is the:<br>
> - image filename (<a href="http://images.name" rel="noreferrer" target="_blank">images.name</a>): 20160511_162826.jpg<br>
> - the relative path in the album (albums.relativePath): /2018-03<br>
> - the root path of the album (albumRoots.specificPath): /Nino/Pictures<br>
> <br>
> What I'm missing though is the drive letter.<br>
> There is sth. like this in albumRoots.identifier: volumeid:?uuid=c472a11d<br>
> But the uuid is completely different(and very short) than what mountvol<br>
> gives me:<br>
> \\?\Volume{3293a795-02c3-11e8-b7f0-50e549c6af80}\<br>
> X:\<br>
> <br>
> How is Digikam constructing the filename from the database?<br>
> <br>
> Cheers,<br>
> Nino<br>
<br>
<br>
<br>
<br>
</blockquote></div>
</blockquote></div>