Bug 410114

Summary: Display file metadata from alternative source during Baloo indexing operation
Product: [Frameworks and Libraries] baloo-widgets Reporter: Łukasz Szeremeta <betterkde>
Component: generalAssignee: Stefan Brüns <stefan.bruens>
Status: RESOLVED FIXED    
Severity: normal CC: a.stippich, betterkde, nate
Priority: NOR Keywords: usability
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=409881
Latest Commit: Version Fixed In: 20.04.0
Sentry Crash Report:

Description Łukasz Szeremeta 2019-07-22 18:11:30 UTC
SUMMARY
File properties are not displayed for unindexed files if indexation is on. When indexing is disabled on the given media, file properties are visible instantly. Why do I need to activate re-indexing manually or restart my system if indexation is enabled to see additional metadata in new files? Maybe it would be possible to display properties without waiting also in the case of indexation enabled? I mentioned about this in the bug 409876 and bug 409881. As Nate Graham told: "What might make sense is to always display the KFileMetadata-extracted properties during indexing, and then only replace that information with the Baloo-extracted information  for each individual file as it gets indexed. That would definitely be a nice UX improvement.". Thanks for looking at it.

STEPS TO REPRODUCE
1. Make sure if indexing is turned on at the main disk, if not, turn it on
2. Wait to indexing end
3. Download file with additional metadata (e.g. this photo with EXIF: https://github.com/ianare/exif-samples/blob/master/jpg/Canon_40D.jpg) and save it on main disk (not external)
4. Open Dolphin and find downloaded file
5. Right click -> Properties

OBSERVED RESULT
Only standard properties are visible: file type, size, modification time, tags, stars and comments.

EXPECTED RESULT
Standard properties + some other metadata like camera model and so on

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE Neon User Edition 5.16.3 (Linux 4.18.0-25-generic)
(available in About System)
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Stefan Brüns 2019-11-13 23:58:54 UTC
Git commit d202cc3854c007f40cc6da13532fd30bfdaded2a by Stefan Brüns.
Committed on 13/11/2019 at 23:58.
Pushed by bruns into branch 'master'.

Use realtime indexing as fallback when DB has no property data

Summary:
In case the DB provides no data, try to fetch the properties directly
from the file using the new OnDemandIndexer class.

If required, start the extractor in the background, fetch UserMetaData
and wait for the extractor, then unite the results.
Depends on D25248

Test Plan:
  # suspend baloo (`balooctl suspend`)
  # copy a file with properties (e.g. PNG) to a included location
    `cp ~/foo.png ~/foo_2.png`
  # `balooshow ~/foo.png ~/foo_2.png` should only display "Cached properties"
     for the original file
  # dolphin displays properties for both files (in the side panel)

Reviewers: #baloo, ngraham, astippich

Reviewed By: #baloo, ngraham, astippich

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D25250

M  +30   -8    src/filefetchjob.cpp
M  +10   -1    src/filefetchjob.h
M  +11   -8    src/filemetadataprovider.cpp
M  +5    -0    src/ondemandextractor.cpp
M  +1    -0    src/ondemandextractor.h

https://commits.kde.org/baloo-widgets/d202cc3854c007f40cc6da13532fd30bfdaded2a