Repository navigation
feat: add document support, previews, and media type filters - #780
Open
Lolle2000la wants to merge 4 commits into
Open
Lolle2000la wants to merge 4 commits into
Lolle2000la wants to merge 4 commits into
Conversation
Contributor
|
|
# Conflicts: # flatpak/cargo-sources.json
Owner
Author
|
Added pure-Rust |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds document format management (
MediaType::Document,DocumentKind), bounded thumbnails/previews/metadata extraction, active-session media type filter chips, and related settings/translations/docs acrossmedia-sort-core,media-sort-backend,media-sort-gui,resources/locale/{en,de,ja}, andwebsite/.Core Built-in Document Support (Pure Rust)
.pdf):hayro0.9 page-0 white-paper thumbnail, high-res multi-page RGBA preview (Prev/Next,PageUp/PageDown), PDF metadata (Pages,Title,Author,Subject,Creator,Producer,Created). Encrypted PDFs returnOk(None)thumbnail (nomedia_errorsnoise) and anEncryptedpreview card with[Open Externally]..cbz,.cb7,.cbt,.cbr): Natural page sorting (page2<page10), bounded decompression viazip/sevenz-rust2/tar/rarchive(with optional hostunrar/7zfallback outside Flatpak/Snap), optionalComicInfo.xmlmetadata, shared multi-page image preview..epub):container.xml+ OPF cover image thumbnail, metadata (Chapters,Title,Author,Publisher,Language,Date,Identifier), spine chapter XHTML-to-Markdown preview viaiced::widget::markdown, chapterPrev/Nextnavigation, and path-traversal sanitization (sanitize_archive_rel_path)..txt,.md,.markdown,.csv,.tsv): Bounded UTF-8 read (<=256 KiBwith NUL-byte binary rejection),iced::widget::markdownrendering withhttp:///https://-only link handling, CSV/TSV spreadsheet table grid, monospace plain-text viewer.Hybrid Office & OS Integration
Thumbnails/thumbnail.png,docProps/thumbnail.*) -> OS native thumbnailer (QLThumbnailGeneratoron macOS,IShellItemImageFactorySIIGBF_THUMBNAILONLYon Windows) ->Ok(None)cleanly (ThumbnailCancelled-> Lucide subtype fallback icon, never recorded inmedia_errors, never spawnssofficein grid scans)..xlsx,.xlsm,.xlsb,.xls,.ods): Multi-sheet interactive viewer viacalamine..docx,.odt,.pptx,.odp,.doc,.ppt,.rtf): Uses headless LibreOffice (soffice --headless --convert-to pdf) +hayromulti-page rendering whenadvanced.enable_libreoffice_previewis enabled and hostsofficeis detected outside Flatpak/Snap sandboxes; falls back to pure-Rust DOCX/ODT Markdown extraction, PPTX/ODPSlidescard view, RTF stripped text, or OS preview /NoPreviewBackendcard for legacy.doc/.ppt.Filtering, Settings & Localization
Images,Video,Audio,Documentswith per-type counts) above the media grid so loose mixed folders can be filtered on the fly without touching config.general.show_documents_by_default(bool, defaulttrue) andadvanced.enable_libreoffice_preview(bool, defaulttrue), persisted inconfig.tomland exposed in the Settings dialog + localized docs (en/de/ja).filesystem_tests::test_scan_filtered_by_extensionfrom.txtto.binsince.txtis now a scanned document type.Verification
Run on Linux (
x86_64) in/home/luca/development/Media-Sort-documents:cargo fmt --all --— passedcargo clippy --workspace --all-targets -- -D warnings— passed (only pre-existing manifest unused-dep warnings onwebpinbenchmarksandtracinginmedia-sort-core)cargo test --workspace— all workspace suites passed (0 failures;iced-mpvhas 1 pre-existing ignored doctest), including:media-sort-core: 137 unit + 5detect_locale_tests+ 3locale_testsmedia-sort-backend: 41 unit + 2audio_tests+ 14document_tests+ 12filesystem_tests+ 51 + 10 integration testsmedia-sort-gui: 230 unit + 23 integration testsbenchmarks: 21 + 11 + 23 testscargo check -p media-sort-gui --features demo,--features velopack, andmedia-sort-backend --features pulse— all passednpm --prefix website ci && npm --prefix website run format && npm --prefix website run lint && npm --prefix website run build— passed (59 pages built cleanly)Known Caveats & Untested Paths
os_preview.rs): Implemented againstobjc2-quick-look-thumbnailing/objc2-core-graphicsandwindows0.62 crate APIs, but compiled/verified on Linux only so far; Apple/Windows CI runners in this PR will verify cross-OS compilation and tests.rarchive(zstd-sys) &.cbrtests:rarchivecompiles Czstd-syscleanly on Linux; corrupt/empty.cbrhandling is tested, while creating a real.cbrarchive in tests was skipped because no proprietaryrarencoder CLI is installed on the test host.hayro0.9): Upstreamhayrodoes not decrypt encrypted PDFs (handled gracefully with anEncryptedUI card) and lacks some advanced blend/knockout groups.soffice,unrar,7z) are deliberately disabled whenis_sandboxed()detects Flatpak or Snap, relying on pure-Rust fallbacks and[Open Externally].