Loading
[WebDAV] Rewrite `OpenDocumentThumbnailOperation` to Ktor (#1931)
* Add Ktor HTTP client support
- Introduce `buildKtor` method in `DavHttpClientBuilder` for creating Ktor HTTP clients.
- Update `OpenDocumentThumbnailOperation` to use Ktor for downloading and creating thumbnails.
* Refactor HttpClientBuilder creation
- Extract common logic into `createBuilder` method
- Update `build` and `buildKtor` methods to use `createBuilder`
* Refactor OpenDocumentThumbnailOperation
- Remove unnecessary `withContext` call
- Use `HttpHeaders.Accept` and `ContentType.Image.Any` for HTTP header
- Simplify the function structure
* Refactor thumbnail generation
- Remove redundant `accessScope`
- Simplify and encapsulate thumbnail creation logic
- Ensure proper cancellation handling
* Update OpenDocumentThumbnailOperation logging
- Enhance cancellation log message with document ID
- Improve URL conversion warning message
* Update WebDAV operations and document handling
- Add `@MustBeClosed` annotation to `buildKtor` method in `DavHttpClientBuilder`
- Remove unnecessary imports and update URL conversion in `OpenDocumentThumbnailOperation`
- Add `toKtorUrl` method in `WebDavDocument` for URL conversion
* Use streaming bitmap decoding
* Add comments to OpenDocumentThumbnailOperation for future improvements
---------
Co-authored-by:
Arnau Mora <arnyminerz@proton.me>