Improve Exif Query path handling
This commit is contained in:
@@ -356,8 +356,13 @@ impl ExifDao for SqliteExifDao {
|
|||||||
|
|
||||||
let mut connection = self.connection.lock().expect("Unable to get ExifDao");
|
let mut connection = self.connection.lock().expect("Unable to get ExifDao");
|
||||||
|
|
||||||
|
// Try both normalized (forward slash) and Windows (backslash) paths
|
||||||
|
// since database may contain either format
|
||||||
|
let normalized = path.replace('\\', "/");
|
||||||
|
let windows_path = path.replace('/', "\\");
|
||||||
|
|
||||||
match image_exif
|
match image_exif
|
||||||
.filter(file_path.eq(path))
|
.filter(file_path.eq(&normalized).or(file_path.eq(&windows_path)))
|
||||||
.first::<ImageExif>(connection.deref_mut())
|
.first::<ImageExif>(connection.deref_mut())
|
||||||
{
|
{
|
||||||
Ok(exif) => Ok(Some(exif)),
|
Ok(exif) => Ok(Some(exif)),
|
||||||
|
|||||||
Reference in New Issue
Block a user