File::Remove(destPath);
}
- if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE)
- {
- r = File::Copy(filePath, destPath, false);
- if (r == E_SUCCESS)
- {
- if (r == E_SUCCESS)
- {
- ImageContentInfo contentInfo;
- r = contentInfo.Construct(&destPath);
- if (r == E_SUCCESS)
- {
- __pContentManager->CreateContent(contentInfo);
- r = GetLastResult();
- TryCatch(!IsFailed(r),,"CreateContent::the value is %s", GetErrorMessage(r));
- if (!isCopyOperation)
- {
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s", GetErrorMessage(r));
- }
- }
- }
- }
- }
- else if (pContentInfo->GetContentType() == CONTENT_TYPE_VIDEO)
+ r = File::Copy(filePath, destPath, false);
+
+ if ( r == E_SUCCESS )
{
- r = File::Copy(filePath, destPath, false);
- if (r == E_SUCCESS)
+ ContentManager::ScanFile(destPath);
+
+ if ( isCopyOperation == false)
{
- VideoContentInfo contentInfo;
- r = contentInfo.Construct(&destPath);
- {
- __pContentManager->CreateContent(contentInfo);
- r = GetLastResult();
- TryCatch(!IsFailed(r),,"CreateContent::the value is %s", GetErrorMessage(r));
- if (!isCopyOperation)
- {
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s", GetErrorMessage(r));
- }
- }
+ File::Remove(filePath); // if Move Op remove original file
+ ContentManager::ScanFile(filePath);
}
}
- CATCH:
+
delete pContentInfo;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));