bugfix: 指令拍照媒体图片关系不到正确的文件夹

main
陈伟 3 weeks ago
parent aeb12f6ad1
commit 38a1cddc29

@ -242,6 +242,11 @@ public class ConfigSubscribe : IJob
string objectKey = data.file.object_key; string objectKey = data.file.object_key;
var folderKey = ((string)data.file.object_key).Split("/"); var folderKey = ((string)data.file.object_key).Split("/");
var parentKey = folderKey[2]; var parentKey = folderKey[2];
if (flightType.Equals(1))
{
parentKey = flightId;
}
var isExist = await _sqlSugarClient var isExist = await _sqlSugarClient
.Queryable<LasaMediaFile>() .Queryable<LasaMediaFile>()
.Where(x => x.Id.Equals(parentKey)).CountAsync(); .Where(x => x.Id.Equals(parentKey)).CountAsync();
@ -298,7 +303,7 @@ public class ConfigSubscribe : IJob
int width = 0, height = 0, focalLength = 0; int width = 0, height = 0, focalLength = 0;
int offset = 0, length = 0; int offset = 0, length = 0;
string model = ""; string model = "";
float? gimbalRoll= 0, gimbalPitch=0; float? gimbalRoll = 0, gimbalPitch = 0;
float? digitalZoomRatio = 1; float? digitalZoomRatio = 1;
var fileUrl = "http://" + _minioService.endPoint + "/" + _minioService._bucketName + var fileUrl = "http://" + _minioService.endPoint + "/" + _minioService._bucketName +
"/" + objectKey; "/" + objectKey;
@ -355,7 +360,6 @@ public class ConfigSubscribe : IJob
{ {
if (directory is ExifDirectoryBase) if (directory is ExifDirectoryBase)
{ {
if (directory.Name.Equals("Exif IFD0")) if (directory.Name.Equals("Exif IFD0"))
{ {
foreach (var tag in directory.Tags) foreach (var tag in directory.Tags)
@ -376,6 +380,7 @@ public class ConfigSubscribe : IJob
{ {
digitalZoomRatio = float.Parse(tag.Description); digitalZoomRatio = float.Parse(tag.Description);
} }
if (tag.Name.Equals("Exif Image Width")) if (tag.Name.Equals("Exif Image Width"))
{ {
width = int.Parse(tag.Description.Replace("pixels", "") width = int.Parse(tag.Description.Replace("pixels", "")
@ -466,7 +471,7 @@ public class ConfigSubscribe : IJob
Path = data.file.path, // 目前这个好像没有值 Path = data.file.path, // 目前这个好像没有值
CreateTime = createTime, CreateTime = createTime,
WorkspaceId = workspaceId, WorkspaceId = workspaceId,
ParentKey = folderKey[2], ParentKey = parentKey,
Tid = result.tid, Tid = result.tid,
Bid = result.bid, Bid = result.bid,
FlightType = flightType, FlightType = flightType,

Loading…
Cancel
Save