ENH - complete and secure EasyShare integration

This commit is contained in:
smx.pusha
2026-08-12 07:15:26 +02:00
parent 14f0b7a178
commit eeb3396f52
18 changed files with 959 additions and 39 deletions
+26
View File
@@ -1,3 +1,5 @@
SkyPhoneGarage = {}
Bridge.Database.AfterMigration("sky_phone", function()
local supported_systems = {
@@ -200,6 +202,30 @@ local function owned_vehicle_row(identifier, plate)
return rows[1], table_name, owner_column, garage_system
end
function SkyPhoneGarage.ResolveShare(source, plate_value)
local plate = normalized_plate(plate_value)
if not plate then
return nil
end
local identifier = Bridge.Framework.GetIdentifier(source)
if type(identifier) ~= "string" or identifier == "" then
return nil
end
local row, _, _, garage_system = owned_vehicle_row(identifier, plate)
if not row then
return nil
end
local vehicle = vehicle_dto(row, garage_system)
local title = vehicle.nickname ~= "" and vehicle.nickname or vehicle.plate
return {
title = title,
subtitle = vehicle.plate,
copyText = title .. "\n" .. vehicle.plate .. " · " .. vehicle.status,
link = "skyphone://garage/vehicle/" .. vehicle.plate,
meta = { kind = vehicle.kind, location = vehicle.location, status = vehicle.status },
}
end
local function status_snapshot(row)
local snapshot = {}
for _, column in ipairs({ "stored", "state", "in_garage", "parked" }) do