Directory listing gets into subdirs twice?
#1
With Kodi 17.1 on Win10, I enter an SMB directory which is the root of a share with 1,541 directories in it. Listing the root of SMB sources has been slow on earlier version of Kodi too but I thought I would go in an look at the logs after setting samba.statfiles to false (which is not looked at on Windows). Here is what i found.

Code:
20:56:39.054 T:4100   DEBUG: CGUIMediaWindow::GetDirectory (smb://JANA/Movies/)
20:56:39.054 T:4100   DEBUG:   ParentPath = [smb://JANA/Movies/]
20:56:39.297 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:00.651 T:11672   DEBUG: Previous line repeats 1538 times.
20:57:00.651 T:11672   DEBUG: Thread JobWorker 11672 terminating (autodelete)
20:57:00.651 T:4088   DEBUG: Thread JobWorker 4088 terminating (autodelete)
20:57:00.651 T:10648   DEBUG: Thread JobWorker 10648 terminating (autodelete)
20:57:00.663 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:00.755 T:12708   DEBUG: Previous line repeats 6 times.
20:57:00.755 T:12708   DEBUG: Thread JobWorker 12708 terminating (autodelete)
20:57:00.760 T:4100   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
20:57:22.785 T:4100   DEBUG: Previous line repeats 1535 times.

It looks like it looked through 3,082 items. Subsequent tests all sum up to 3,082 as well.

Since 3,082 is 1,541 x 2, it appears ...
  1. connecting to the share root didn't call CWin32SMBDirectory::ConnectAndAuthenticate, and
  2. Kodi connects and goes through each directory on the share twice.


What troubles me is that to show the names of the directories Kodi shouldn't got through those directories at all which it is doing twice.
CWin32SMBDirectory::ConnectAndAuthenticate is called by RealExists so perhaps Kodi is checking the existence of each item (why?) and perhaps doing that twice?

On a smaller scale, if I go into any of those directories that have subdirectories (say 7), the log show 2 x count lines (14).

Am I missing the logic somewhere or is something wrong here?
Reply
#2
If you're getting your source scraped twice, it would mean you have two sources and as a consistence two paths and two of everything, cover etc. I guess you're updating your library on launch needlessly and from my point of view unless you've added something, why bother. The context menu allows for updates of single sources, perhaps it might be better to break your collection into a few sub sources. Are you seeing ' 3,082' movies in your library? or just the 1,541
Reply
#3
This is not a scrape on startup. It is me doing ActivateWindow(VideoLibrary, "smb://JANA/Movies/", return).

I have only one source pointing to "\\JANA\Movies", i rechecked. Library has 1,963 movies because I have sets in their own folders and that 1,541 is the number of folders at depth 0 under the source.
Reply
#4
Any ideas? Is it human error or a bug?
Reply
#5
Might be a bug has crept in, look at the path and see if one of the characters in the path is 'capitalized' and the second listing for the same video, which would denote a second path. I looked in the trac, but didn't see it.. might be fixed.
Reply
#6
PatK, thanks for looking into this. The log only contains the numbers and not the paths.

I did a clean setup of Kodi 17.2 RC1 20170419-661dd08d22 and a fresh database. It has 1540 titles and per the logs, it performed ConnectAndAuthenticate 3080 times.

Code:
19:56:57.162 T:11080   DEBUG: ------ Window Init (MyVideoNav.xml) ------
19:56:57.164 T:11080   DEBUG: CGUIMediaWindow::GetDirectory (sources://video/)
19:56:57.164 T:11080   DEBUG:   ParentPath = [sources://video/]
19:56:57.183 T:11104   DEBUG: Thread BackgroundLoader start, auto delete: false
19:56:57.198 T:11080   DEBUG: Keyboard: scancode: 0x1c, sym: 0x000d, unicode: 0x0000, modifier: 0x0
19:56:57.239 T:11104   DEBUG: Thread BackgroundLoader 11104 terminating
19:57:03.171 T:11080   DEBUG: Keyboard: scancode: 0x50, sym: 0x0112, unicode: 0x0000, modifier: 0x0
19:57:03.171 T:11080   DEBUG: CInputManager::OnKey: down (0xf081) pressed, action is Down
19:57:03.293 T:11080   DEBUG: Keyboard: scancode: 0x50, sym: 0x0112, unicode: 0x0000, modifier: 0x0
19:57:09.571 T:11080   DEBUG: Keyboard: scancode: 0x1c, sym: 0x000d, unicode: 0x000d, modifier: 0x0
19:57:09.693 T:11080   DEBUG: CInputManager::OnKey: return (0xf00d) pressed, action is Select
19:57:09.698 T:11080   DEBUG: CGUIMediaWindow::GetDirectory (smb://JANA/Movies/)
19:57:09.698 T:11080   DEBUG:   ParentPath = [sources://video/]
19:57:09.935 T:11080   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
19:57:39.699 T:15020   DEBUG: Previous line repeats 2048 times.
19:57:39.699 T:15020   DEBUG: Thread JobWorker 15020 terminating (autodelete)
19:57:39.706 T:11080   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
19:57:39.840 T:11292   DEBUG: Previous line repeats 9 times.
19:57:39.840 T:11292   DEBUG: Thread JobWorker 11292 terminating (autodelete)
19:57:39.846 T:11080   DEBUG: XFILE::CWin32SMBDirectory::ConnectAndAuthenticate: Connected to "\\JANA\Movies" with username "HTPC" and with password
19:57:54.333 T:2176   DEBUG: Previous line repeats 1020 times.

I did another run, this time without scanning in any items into the database, and i see ConnectAndAuthenticate called 6160 times (4 x 1540).Huh
Reply

Logout Mark Read Team Forum Stats Members Help
Directory listing gets into subdirs twice?0