Files: added thirdparty rooms
This commit is contained in:
parent
e704983452
commit
1edb778115
@ -122,6 +122,7 @@ internal abstract class BoxDaoBase : ThirdPartyProviderDao<BoxProviderInfo>
|
||||
folder.Title = MakeFolderTitle(boxFolder);
|
||||
folder.FilesCount = boxFolder.ItemCollection != null ? boxFolder.ItemCollection.Entries.Count(item => item is BoxFile) : 0;
|
||||
folder.FoldersCount = boxFolder.ItemCollection != null ? boxFolder.ItemCollection.Entries.Count(item => item is BoxFolder) : 0;
|
||||
SetFolderType(folder, isRoot);
|
||||
|
||||
if (folder.CreateOn != DateTime.MinValue && folder.CreateOn.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
|
@ -126,6 +126,7 @@ internal abstract class DropboxDaoBase : ThirdPartyProviderDao<DropboxProviderIn
|
||||
folder.CreateOn = isRoot ? ProviderInfo.CreateOn : default;
|
||||
folder.ModifiedOn = isRoot ? ProviderInfo.CreateOn : default;
|
||||
folder.Title = MakeFolderTitle(dropboxFolder);
|
||||
SetFolderType(folder, isRoot);
|
||||
|
||||
if (folder.CreateOn != DateTime.MinValue && folder.CreateOn.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
|
@ -125,6 +125,7 @@ internal abstract class OneDriveDaoBase : ThirdPartyProviderDao<OneDriveProvider
|
||||
folder.ParentId = isRoot ? null : MakeId(GetParentFolderId(onedriveFolder));
|
||||
folder.CreateOn = isRoot ? ProviderInfo.CreateOn : (onedriveFolder.CreatedDateTime.HasValue ? _tenantUtil.DateTimeFromUtc(onedriveFolder.CreatedDateTime.Value.DateTime) : default);
|
||||
folder.ModifiedOn = isRoot ? ProviderInfo.CreateOn : (onedriveFolder.LastModifiedDateTime.HasValue ? _tenantUtil.DateTimeFromUtc(onedriveFolder.LastModifiedDateTime.Value.DateTime) : default);
|
||||
SetFolderType(folder, isRoot);
|
||||
|
||||
folder.Title = MakeItemTitle(onedriveFolder);
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Files.Core;
|
||||
|
||||
using File = Microsoft.SharePoint.Client.File;
|
||||
using Folder = Microsoft.SharePoint.Client.Folder;
|
||||
|
||||
@ -595,6 +597,8 @@ public class SharePointProviderInfo : IProviderInfo
|
||||
result.FilesCount = 0;
|
||||
result.FoldersCount = 0;
|
||||
|
||||
SetFolderType(result, isRoot);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -639,6 +643,19 @@ public class SharePointProviderInfo : IProviderInfo
|
||||
{
|
||||
_clientContext.Dispose();
|
||||
}
|
||||
|
||||
private void SetFolderType(Folder<string> folder, bool isRoot)
|
||||
{
|
||||
if (isRoot && (RootFolderType == FolderType.VirtualRooms ||
|
||||
RootFolderType == FolderType.Archive))
|
||||
{
|
||||
folder.FolderType = RootFolderType;
|
||||
}
|
||||
else if (FolderId == folder.Id)
|
||||
{
|
||||
folder.FolderType = FolderType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Singletone]
|
||||
|
@ -279,6 +279,7 @@ internal abstract class SharpBoxDaoBase : ThirdPartyProviderDao<SharpBoxProvider
|
||||
folder.Title = MakeTitle(fsEntry);
|
||||
folder.FilesCount = 0; /*fsEntry.Count - childFoldersCount NOTE: Removed due to performance isssues*/
|
||||
folder.FoldersCount = 0; /*childFoldersCount NOTE: Removed due to performance isssues*/
|
||||
SetFolderType(folder, isRoot);
|
||||
|
||||
if (folder.CreateOn != DateTime.MinValue && folder.CreateOn.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user