Skip to content
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

Fix: Fixed issue where deleted items were displayed in tag search results #13202

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Files.App/Services/FileTagsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async IAsyncEnumerable<TaggedItemModel> GetItemsForTagAsync(string tagUid
{
foreach (var item in FileTagsHelper.GetDbInstance().GetAll())
{
if (!item.Tags.Contains(tagUid))
if (!item.Tags.Contains(tagUid) || RecycleBinHelpers.IsPathUnderRecycleBin(item.FilePath))
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
continue;

var storable = await StorageService.TryGetStorableAsync(item.FilePath, cancellationToken);
Expand Down
2 changes: 2 additions & 0 deletions src/Files.App/Utils/Storage/Search/FolderSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ private async Task SearchTagsAsync(string folder, IList<ListedItem> results, Can
var dbInstance = FileTagsHelper.GetDbInstance();
var matches = dbInstance.GetAllUnderPath(folder)
.Where(x => tags.All(x.Tags.Contains));
if (string.IsNullOrEmpty(folder))
matches = matches.Where(x => !RecycleBinHelpers.IsPathUnderRecycleBin(x.FilePath));

foreach (var match in matches)
{
Expand Down