Skip to content

Fix: Fixed issue where some files failed to load properties #14850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/Files.App/Data/Models/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,9 @@ await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
getThumbnailOnly,
getIconOnly ? IconOptions.ReturnIconOnly : IconOptions.None);

cancellationTokenSource.Token.ThrowIfCancellationRequested();
if (cancellationTokenSource.Token.IsCancellationRequested)
break;

await Task.Delay(500);
}
}
Expand Down Expand Up @@ -1090,13 +1092,12 @@ await Task.Run(async () =>
}

cts.Token.ThrowIfCancellationRequested();
await LoadItemThumbnailAsync(item);
_ = LoadItemThumbnailAsync(item);

if (item.IsLibrary || item.PrimaryItemAttribute == StorageItemTypes.File || item.IsArchive)
{
if (!item.IsShortcut && !item.IsHiddenItem && !FtpHelpers.IsFtpPath(item.ItemPath))
{
cts.Token.ThrowIfCancellationRequested();
matchingStorageFile = await GetFileFromPathAsync(item.ItemPath, cts.Token);
if (matchingStorageFile is not null)
{
Expand Down Expand Up @@ -1129,7 +1130,6 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() =>
{
if (!item.IsShortcut && !item.IsHiddenItem && !FtpHelpers.IsFtpPath(item.ItemPath))
{
cts.Token.ThrowIfCancellationRequested();
BaseStorageFolder matchingStorageFolder = await GetFolderFromPathAsync(item.ItemPath, cts.Token);
if (matchingStorageFolder is not null)
{
Expand Down Expand Up @@ -1172,10 +1172,7 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() =>
}

if (loadGroupHeaderInfo && isFileTypeGroupMode)
{
cts.Token.ThrowIfCancellationRequested();
groupImage = await GetItemTypeGroupIcon(item, matchingStorageFile);
}
}
catch (Exception)
{
Expand Down