• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #define MLOG_TAG "Media_Client"
16 
17 #include "cloud_data_convert_to_vo.h"
18 #include "cloud_meta_data.h"
19 
20 #include <string>
21 #include "media_log.h"
22 #include "media_file_utils.h"
23 
24 namespace OHOS::Media::CloudSync {
ConvertPhotosVoToCloudMetaData(const PhotosVo & photosVo)25 CloudMetaData CloudDataConvertToVo::ConvertPhotosVoToCloudMetaData(const PhotosVo &photosVo)
26 {
27     MEDIA_INFO_LOG("ConvertPhotosVoToCloudMetaData, photosVo: %{public}s.", photosVo.ToString().c_str());
28     CloudMetaData cloudMetaData;
29     cloudMetaData.fileId = photosVo.fileId;
30     cloudMetaData.cloudId = photosVo.cloudId;
31     cloudMetaData.size = photosVo.size;
32     cloudMetaData.path = photosVo.path;
33     cloudMetaData.fileName = photosVo.fileName;
34     cloudMetaData.type = photosVo.type;
35     cloudMetaData.modifiedTime = photosVo.modifiedTime;
36     cloudMetaData.originalCloudId = photosVo.originalCloudId;
37     for (auto &nodePair : photosVo.attachment) {
38         CloudFileData fileData;
39         fileData.filePath = nodePair.second.filePath;
40         fileData.fileName = nodePair.second.fileName;
41         fileData.size = nodePair.second.size;
42         cloudMetaData.attachment[nodePair.first] = fileData;
43     }
44     return cloudMetaData;
45 }
46 }  // namespace OHOS::Media::CloudSync