Skip to content

Commit

Permalink
optimized check if the file can be converted
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimChegulov committed Oct 24, 2024
1 parent a2abf0f commit a9369a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions products/ASC.Files/Core/Helpers/DocSpaceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public static bool LocatedInPrivateRoomAsync<T>(Folder<T> room)

public static async Task<bool> IsWatermarkEnabled<T>(FileEntry<T> file, IFolderDao<T> folderDao)
{
if (file.RootFolderType is not (FolderType.VirtualRooms or FolderType.Archive))
{
return false;
}

var room = await GetParentRoom(file, folderDao);

return IsWatermarkEnabled(room);
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/Helpers/FileUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public bool CanCoAuthoring(string fileName)

public async Task<bool> CanConvert<T>(File<T> file)
{
var folderDao = daoFactory.GetFolderDao<T>();
var folderDao = daoFactory.GetCacheFolderDao<T>();
if (await DocSpaceHelper.IsWatermarkEnabled(file, folderDao))
{
return false;
Expand Down

0 comments on commit a9369a0

Please sign in to comment.