Bug "Clean video library" removes existing movies
#1
Hello,
Since I changed my video folder structure on my NAS, a "clean video library" removes often movies from my database, which actually still exist.

My structure, when it works correctly (one folder that contains everything):
Movies
|- MOVIES HERE

My new structure (categorized in year range and some special genre as subfolders):
Movies
|- 1900-1999
||- MOVIES HERE
|- 2000-2005
||- MOVIES HERE
...
|- Family
||- MOVIES HERE
...

It seems that a cleanup randomly removes an entire subfolder from the database.

Kodi's "Scan recursively" is activated for the media library.

Because I replace movies very often, I need to clean after each update. So All my database updates are followed by a cleanup every time (via Add-on:XBMC_Library_Auto_Update). And most of time, my database shrinks by 200 items after a cleanup. A further update would bring the items back, but [update cleanup update] is not a good approach and in addition scanning of 200 items takes not less time...

Someone any idea or ran into the same issue?

Issue on latest Kodi 17.1 on Win32 (Win10) and Odroid C2 and Raspberry Pi 2 (via latest Libreelec).
Reply
#2
Just some minutes ago, i did a test:
I had like 1000 movies. After I have done a clean, the movies only counts 700. However I did not delete or rename a single movie...

My log:
Code:
18:53:58.690 T:4988  NOTICE: CVideoDatabase::CleanDatabase: Starting videodatabase cleanup ..
18:53:58.690 T:9368   DEBUG: CAnnouncementManager - Announcement: OnCleanStarted from xbmc
18:53:58.690 T:9368   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnCleanStarted
18:53:58.706 T:4988   DEBUG: DialogProgress::Open called
18:53:58.706 T:4988   DEBUG: ------ Window Init (DialogConfirm.xml) ------
18:53:58.756 T:8932   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: VideoLibrary.OnCleanStarted  - data: null
18:53:58.780 T:12084   DEBUG: CDVDDemuxFFmpeg::Open - avformat_find_stream_info starting
18:53:58.783 T:12084   DEBUG: CDVDDemuxFFmpeg::Open - av_find_stream_info finished
18:53:58.783 T:12084   DEBUG: CDVDDemuxFFmpeg::AddStream ID: 0
18:53:58.783 T:12084   DEBUG: CDVDDemuxFFmpeg::AddStream ID: 1
18:54:01.691 T:4988   DEBUG: CWinEventsWin32::WndProcWindow is active
18:54:01.694 T:4988   DEBUG: CWinEventsWin32::WndProc: Focus switched to process D:\****\sublime_text.exe
18:54:07.575 T:4988   DEBUG: ------ Window Deinit (Pointer.xml) ------
18:54:28.613 T:12032   DEBUG: Thread JobWorker 12032 terminating (autodelete)
18:54:28.613 T:12456   DEBUG: Thread JobWorker 12456 terminating (autodelete)
18:54:28.613 T:13944   DEBUG: Thread JobWorker 13944 terminating (autodelete)
18:55:04.788 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning files table
18:55:04.793 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning movie table
18:55:04.952 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning paths that don't exist and have content set...
18:55:05.329 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning tvshow table
18:55:05.330 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning path table
18:55:05.330 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning genre table
18:55:05.367 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning country table
18:55:05.387 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning actor table of actors, directors and writers
18:55:06.161 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning studio table
18:55:06.189 T:4988   DEBUG: CVideoDatabase::CleanDatabase: Cleaning set table
18:55:07.221 T:4988  NOTICE: CVideoDatabase::CleanDatabase: Cleaning videodatabase done. Operation took 01:08
18:55:07.221 T:9368   DEBUG: CAnnouncementManager - Announcement: OnRemove from xbmc
18:55:07.221 T:9368   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnRemove
18:55:07.221 T:9368   DEBUG: CAnnouncementManager - Announcement: OnRemove from xbmc
18:55:07.221 T:9368   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnRemove
18:55:07.221 T:9368   DEBUG: CAnnouncementManager - Announcement: OnRemove from xbmc
18:55:07.222 T:9368   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnRemove
18:55:07.222 T:9368   DEBUG: CAnnouncementManager - Announcement: OnCleanFinished from xbmc
18:55:07.222 T:9368   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnCleanFinished

I don't understand this semi-wipe...
Are more information needed to give me some hints or a kind of solution?


P.S. Is it possible that the time during opening a folder takes too long sometimes (via NTFS on the NAS), which leads to this wipes? Does the "clean" wait a bit after navigating to a folder recursively?
Reply
#3
Sorry for the monologue.
I found the issue and created a pull requests that includes a fix: https://github.com/xbmc/xbmc/pull/11937
Reply

Logout Mark Read Team Forum Stats Members Help
"Clean video library" removes existing movies0