-- @query details_local_metadata
-- @db localContent 32.0
-- @param localId TEXT
SELECT
    im.Size                AS size,
    im.ModTime             AS modTimeSec,
    im.CreatedTime         AS createdTimeSec,
    mm.Width               AS width,
    mm.Height              AS height,
    mm.Description         AS description,
    mm.CameraMake          AS cameraMake,
    mm.CameraModel         AS cameraModel,
    mm.fNumber             AS fNumber,
    mm.ExposureNumerator   AS exposureNumerator,
    mm.ExposureDenominator AS exposureDenominator,
    mm.FocalLength         AS focalLength,
    mm.ISO                 AS iso,
    COALESCE(
        (SELECT json_group_array(tm.TagName)
         FROM localContent.TagMetadata tm
         WHERE tm.FileSystemID = im.FileSystemID),
        '[]'
    ) AS tagsJson
FROM localContent.ItemMetadata  im
INNER JOIN localContent.MediaMetadata mm ON mm.FileSystemID = im.FileSystemID
WHERE im.LocalID = ?localId
LIMIT 1
