Bug 444744

Summary: Recreate (video-) thumbnails selectively
Product: [Applications] kphotoalbum Reporter: Andreas Schleth <schleth_es>
Component: BackendAssignee: KPhotoAlbum Bugs <kpabugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: johannes
Priority: NOR    
Version: GIT master   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Andreas Schleth 2021-10-31 23:09:43 UTC
SUMMARY
After switching two video files (A -> tmp; B -> A; tmp -> B) on disk, the static and the video thumbnails remain as they were. For file B, the thumbnail for A is shown and vice versa.
Rebuilding all thumbnails does not change the video thumbnails. Recalculating the checksums might work(?). However, this is still running (and has been for a while now - we are at 3% after ~20 minutes...)

I would like to be able to re-create the videothumbnails for a selection of files only. 

STEPS TO REPRODUCE
1. have database with video clips and videothumbnails
2. take any two files A and B and switch their filenames using cli or any file manager (not KPA!)
3. view the thumbnails

OBSERVED RESULT
The videothumbnail for A is the old one of what is now B and vice versa.

EXPECTED RESULT
This is the expected result, as we were not telling KPA that.

MY RFQ:
Now, I would like to remedy the situation and rebuild the thumbnails (and only those) for just these two files, while keeping the meta-data as they were: meta-A -> A(new).
In other words: 
- select a few files
- say: "rebuild videothumbnail for selected files"
- have only these few files rebuild
- do not touch any meta data, except maybe the checksums of the selected files

KPA: v5.8.1-21-g7f709159
KDE Frameworks 5.76.0
Qt 5.12.7 (built against 5.12.7)
Comment 1 Andreas Schleth 2024-05-22 22:14:11 UTC
I just stumbled across this again (v5.12.0-129-g2c8635bc) and checked with a fresh build from git master (v5.12.0-133-g1de2d467). I think the maintenance feature "Refresh selected thumbnails and checksums" was introduced after I filed the first report (not sure). But it still does not (yet :-) work for video:

In my oldish version (-129-) the videothumbnail without a number (-0 ... -9) is refreshed, but the 10 other files that make up the "flicker film" (shown on mouse over) are not.

What happened with the demo-database (newest version):
* In the current version (-133-) I replaced the file movie.avi ("Hi I am Jesper...") with another avi file. 
* Then "Refresh ...": Nothing happened. File date remains the same for all videothumbnails.
* Then I deleted the files in .videothumbnails. This finally triggers the rebuild.
* The flicker now film shows the correct video. 
* The filenames in .videothumbnails remain the same (obviously they are just a hash of the filename).
* But the static image still shows Jesper.  :-(
* This only changes after hitting "crtl"+"+"

What happened with my own database (oldish version):
* After "Refresh..." there were two files (without the -x ending) with a new date stamp.
* The other corresponding files (*-0 ... *-9) still had their old date stamps.
* Only after deleting all 22 files the thumbnails were correctly regenerated.

What I expect:
* on "Refresh ..." the static and the dynamic thumbnail images of a movie should be replaced by a newer version

currently: 
KPA v5.12.0-129-g2c8635bc
KDE Frameworks Version 5.103.0
Qt Version 5.15.8
Comment 2 Johannes Zarl-Zierl 2024-07-02 22:24:05 UTC
Git commit 6784c08ab39894dc135a4bec6340aaf1a26b14fe by Johannes Zarl-Zierl.
Committed on 02/07/2024 at 22:22.
Pushed by johanneszarl into branch 'master'.

Merge branch 'work/jzarl/videothumbnailcache'


https://invent.kde.org/graphics/kphotoalbum/-/commit/6784c08ab39894dc135a4bec6340aaf1a26b14fe
Comment 3 Johannes Zarl-Zierl 2024-07-02 22:25:53 UTC
Hi Andreas,
Could you check the video thumbnail behavior again? I believe that this bug is not fixed...
Cheers,
  Johannes
Comment 4 Johannes Zarl-Zierl 2024-07-02 22:26:42 UTC
Sorry, I meant to say "...the bug is now fixed", not "not".
Comment 5 Andreas Schleth 2024-07-03 12:22:25 UTC
Hi Johannes,
I can confirm that the bug seems to be(* fixed with v5.12.0-160-gb8726fbf 
Very nice!
Thanks & Cheers, Andreas
(* works for me (TM)