feat(ffi): enable content scanner by passing an existing instance#6689
feat(ffi): enable content scanner by passing an existing instance#6689jmartinesp wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6689 +/- ##
==========================================
+ Coverage 89.89% 89.91% +0.01%
==========================================
Files 396 396
Lines 110412 110434 +22
Branches 110412 110434 +22
==========================================
+ Hits 99258 99295 +37
+ Misses 7370 7360 -10
+ Partials 3784 3779 -5 ☔ View full report in Codecov by Harness. |
Add `get_media_fetcher` too.
poljar
left a comment
There was a problem hiding this comment.
A couple of strange things in this PR but ok. Once fixed feel free to merge.
| self.inner.set_media_fetcher(media_fetcher).await; | ||
|
|
||
| *self.content_scanner.write().await = content_scanner; |
There was a problem hiding this comment.
Can't we put this into the if branch, this avoids the need to expose DefaultMediaFetcher publicly.
Also, what's the purpose of the ContentScanner struct? Are you going to scan stuff manually on the app side?
Adding this struct could have been a nice self-contained commit or even PR for that matter, as it's not related to the hot-swapping of a media fetcher.
| assert!(client.content_scanner().await.is_none()); | ||
| assert_eq!(client.inner.get_media_fetcher().await.to_string(), "DefaultMediaFetcher"); |
There was a problem hiding this comment.
That's a strange way to do this. Usually we do this type of test with pointers to check that the objects are the same.
Can we at least use the Debug implementation so we don't add unnecessary and possibly confusing Display implementations?
Replace setting up the content scanner at the
ClientBuilderto being able to set it on the fly when needed.It's a lot easier for the clients to enable/disable this on the fly than having to create the client with the value ahead of time.
Signed-off-by: