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

Not all files to download are visible #902

Closed
kelson42 opened this issue Aug 2, 2024 · 17 comments · Fixed by #904 or #910
Closed

Not all files to download are visible #902

kelson42 opened this issue Aug 2, 2024 · 17 comments · Fixed by #904 or #910
Assignees
Milestone

Comments

@kelson42
Copy link
Contributor

kelson42 commented Aug 2, 2024

If I search for "bug" online, I get:
image

If I search for "bug" in library, I get:
image

I should not get different resulta IMHO, at least not for this search!

@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Aug 2, 2024

@kelson42 as of my initial findings it seems that we use custom DB query for these results, which is currently searching (in case of this "New" section) only:
- in the names of the ZIM files
- only within those that are not older than 1 month

private static func buildPredicate(searchText: String) -> NSPredicate {
var predicates = [
NSPredicate(format: "languageCode IN %@", Defaults[.libraryLanguageCodes]),
NSPredicate(format: "requiresServiceWorkers == false")
]
if let aMonthAgo = Calendar.current.date(byAdding: .month, value: -1, to: Date()) {
predicates.append(NSPredicate(format: "created > %@", aMonthAgo as CVarArg))
}
if !searchText.isEmpty {
predicates.append(NSPredicate(format: "name CONTAINS[cd] %@", searchText))
}
return NSCompoundPredicate(andPredicateWithSubpredicates: predicates)
}

It would be great to know how exactly the website search works, and we can adjust the query to match that.

@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Aug 2, 2024

I can confirm, that by modifying the search query to use both "name CONTAINS" OR "fileDescription CONTAINS" does return both results. So that solution is working for this specific case:
Screenshot 2024-08-02 at 23 49 40

The only question remains: is that good enough (as it's now a guess how the website search might work), or do we want an exact match ?

@BPerlakiH
Copy link
Collaborator

My other, slightly related concern about how the search works is that it's really hard to find a ZIM that is not "new". Currently the user can search only within the selected category (eg. "Other"), but that is a very strict rule, I think. We assume that the user knows which category that ZIM belongs to...
Putting it another way: we have no "global search" (eg: search in all categories).

@kelson42
Copy link
Contributor Author

kelson42 commented Aug 5, 2024

Reopening as I believe we should do more than this.

@BPerlakiH Thank you for your englighting comments, I will come back to you

@kelson42 kelson42 reopened this Aug 5, 2024
@kelson42
Copy link
Contributor Author

kelson42 commented Aug 5, 2024

My other, slightly related concern about how the search works is that it's really hard to find a ZIM that is not "new". Currently the user can search only within the selected category (eg. "Other"), but that is a very strict rule, I think. We assume that the user knows which category that ZIM belongs to...
Putting it another way: we have no "global search" (eg: search in all categories).

@BPerlakiH I agree. Please open an issue just for that and put it in next milestone.

@kelson42
Copy link
Contributor Author

kelson42 commented Aug 5, 2024

@BPerlakiH To complete this PR, can you change 1 month in 3 months because 1 month is really too short.

@BPerlakiH
Copy link
Collaborator

Increased the lifespan of "NEW" to be 3 months here: #910

@BPerlakiH
Copy link
Collaborator

new issue created here: #911

@kelson42
Copy link
Contributor Author

Seems even more broken thab before now!
image

@kelson42 kelson42 reopened this Aug 11, 2024
@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Aug 11, 2024

Hmm, interesting. It looks as if the catalog was empty...
I can see both ZIM files as a search result on my end.
Can you try to do a "refresh" with the button:
Screenshot 2024-08-11 at 10 50 12

@kelson42
Copy link
Contributor Author

Hmm, interesting. It looks as if the catalog was empty...

I can see both ZIM files as a search result on my end.

Can you try to do a "refresh" with the button:

Screenshot 2024-08-11 at 10 50 12

Library is refreshed.

@BPerlakiH
Copy link
Collaborator

Did the refresh solve the issue?

@kelson42
Copy link
Contributor Author

No

@BPerlakiH
Copy link
Collaborator

Can you do a screenshot of the "New" section when the search query is empty, and also one screenshot of "Settings > Languages" ?

@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Aug 11, 2024

Both of those results are in "English" only, so if you do not have English selected, there won't be any result for that query.

@kelson42
Copy link
Contributor Author

image image

@kelson42
Copy link
Contributor Author

Works now with latest testflight of this morning... somI guess the fix was still not included. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment