TV shows library doesn't clean after erase file

Topic title is self descriptive.

When I erase a folder from /Movies/ don’t get that problem. Is only with /TVShows/.

kodi.log here:
https://ghostbin.com/paste/3bt9f/raw

I already checked similar topics with no light on my problem.

Erasing /home/osmc/.kodi/userdata/Database/MyVideos107.db helps but the problem comes back the moment I erase a folder from /TVShows/ showing the show but empty.

To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

So, please,

  • enable logging
  • reboot
  • reproduce the issue accessing a show you deleted before
  • upload the logs and provide the URL here

Thanks for your understanding. We hope that we can help you get up and running again shortly.

Thanks for your quick reply.

Here is the full log following the instructions. https://ghostbin.com/paste/kopox/raw

And a few screenshoots to illustrate my issue. Both on screen with osmc and via the web remote.
When first open TV Shows the interface show me old erased shows. Try to access one, is empty and coming back are gone. That last part doesn’t happen in the web interface/kodi iOS remote app, they stay all the time.

Please, provide the log set as specified in the mentioned article: Either use the method in My OSMC or the command sudo grab-logs -A and provide the URL.

Sorry, I misunderstood the log grabbing process. I tough that kodi.log was the only file written as announced the overlay during the process.

Here is the ‘extended’ log https://ghostbin.com/paste/j6anz

I redacted some names and passwords.

So, what can you:

Generally Kodi requires to manually start the update of the video library:

OSMC Skin, Main -> Movies -> < open the sideblade menu> -> update library

The same is valid for the manually cleanup which you can find somewhat hidden at:

OSMC Skin, Main -> Settings -> Media -> Library -> Clean Library

To make it more comfortable you can add a CLEANONUPDATE feature in /home/osmc/.kodi/userdata/advancedsettings.xml:

<advancedsettings>
...
        <videolibrary>
                <cleanonupdate>true</cleanonupdate>
        </videolibrary>
...
</advancedsettings>

This will do a post-cleanup whenever you manually start the library update.

Also there should exists add-ons (like services - watchdog) which automatically update+clean your videolibrary on a regular base but since I never used them, I let it to others to report their experience from here.

I inserted the code but didn’t work. Even after a couple of reboots.

I use watchdog service for automatic clean up of the library for a long time but still the empty shows are there. For instance when I erase a movie folder the update of the library is instantaneous but TV Shows are stuck there.

Any new idea of why this happen?

I’ve had the same problem for ever as well.
Movies fine, TV Shows you get rid of all the files, even the folder sometimes Kodi still lists the show with no episodes. Cleaned etc. no change.

Last time from memory I wiped the .db files and reimported everything.
https://forum.kodi.tv/showthread.php?tid=315851&pid=2606989#pid2606989

Tried removing a TV show (folder + all file content) with final update of the video library … worked like a charm with active CLEANONUPDATE.

From the logs I see no active CLEANONUPDATE

<?xml version="1.0" encoding="utf-8"?>
<advancedsettings>
	<videolibrary></videolibrary>
</advancedsettings>

Did you mean by

you have tried this with active CLEANONUPDATE AFTER you have taken the logs?

A new kodi.log here.

This is a little recap of what I done in this log.

• In advancedsettings.xml inserted the tag <cleanonupdate>true</cleanonupdate> so looks as JimKnopf suggested (I made that yesterday standalone without success)
• Erase MyVideos107.db as CalzorSuzay sugested. (I already try that before but the problem comes back when I erase a TV Show showing it empty in the library)
• Regenerate the library via ‘Set Content’ in Videos since the source is already set but Kodi doesn’t know what media is in each folder after erasing MyVideos107.db. Movies with Universal Movie Scrapper and TV Shows with The TVDB to pull metadata for the files.
• Enable debug login and reboot.
• Erase one TV Show
• Watchdog service https://kodi.wiki/view/Add-on:Watchdog erase that automatically but anyway update/clean video library manually.
• Looks like the show is gone but when enter TV Shows menu is still there just empty.
• If I enter in that show and come to the list the show is gone but if I coming back to main menu and entering again shows the erased TV Show on the list again. (That’s because is so annoying, over time the list becomes so dirty with empty shows!)
• Stop logging.
• Upload that log.

Sorry, but this log is again unusable since incomplete; would you please have again a look at the topic I mentioned above how to create and upload a log set we expect here to help you?

As long as you don’t want/can upload the requested log set, have your own look in whatever you create and look for something like:

14:30:16.432 T:4060082944 WARNING: Process directory '/mnt/Intenso2766GB/video/Serien/The Returned/' does not exist - skipping scan and clean.
14:30:16.432 T:4060082944 WARNING: Process directory '/mnt/Intenso2766GB/video/Serien/iZombie/' does not exist - skipping scan and clean.
14:30:16.438 T:4060082944  NOTICE: CleanDatabase: Starting videodatabase cleanup ..
14:30:16.438 T:4080354048   DEBUG: CAnnouncementManager - Announcement: OnCleanStarted from xbmc
14:30:16.438 T:4080354048   DEBUG: GOT ANNOUNCEMENT, type: 16, from xbmc, message OnCleanStarted
14:30:16.447 T:3912233728   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: VideoLibrary.OnCleanStarted  - data: null
14:30:16.449 T:4060082944   DEBUG: CleanDatabase: Cleaning files table
14:30:16.450 T:4060082944   DEBUG: CleanDatabase: Cleaning episode table
14:30:16.455 T:4060082944   DEBUG: CleanDatabase: Cleaning paths that don't exist and have content set...
14:30:16.537 T:3895456512   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: VideoLibrary.OnCleanStarted  - data: null
14:30:16.858 T:4060082944   DEBUG: CleanDatabase: Cleaning tvshow table
14:30:16.858 T:4060082944   DEBUG: CleanDatabase: Cleaning path table
14:30:16.859 T:4060082944   DEBUG: CleanDatabase: Cleaning genre table
14:30:16.860 T:4060082944   DEBUG: CleanDatabase: Cleaning country table
14:30:16.860 T:4060082944   DEBUG: CleanDatabase: Cleaning actor table of actors, directors and writers
14:30:16.887 T:4060082944   DEBUG: CleanDatabase: Cleaning studio table
14:30:16.888 T:4060082944   DEBUG: CleanDatabase: Cleaning set table
14:30:17.004 T:4060082944  NOTICE: CleanDatabase: Cleaning videodatabase done. Operation took 00:00

Here I deleted two series folder namely “The Returned” and “IZombie” before running the update library with cleanonupdate active.

If you don’t see lines with skipping scan and clean and CleanDatabase: Starting videodatabase cleanup content, you have to troubleshoot why … by your own. It might have to do with the 3rd party addon “Watchdog” but who knows?
In summary this is more a Kodi issue than OSMC … but without the requested data I reduce my time investment and interest in this, sorry.

I really really sorry I didn’t notice I was cropping part of the log. Here is the full log (all +8000 lines) PrivateBin

I see for instance those lines:

15:11:23.316 T:1545597696 WARNING: Process directory 'smb://<<smbname>>/<<hdd>>/TVShows/My Next Guest Needs No Introduction With David Letterman/' does not exist - skipping scan and clean.
15:11:23.336 T:1545597696  NOTICE: CleanDatabase: Starting videodatabase cleanup ..

But cleanonupdate is active so is not working?

:man_shrugging: Sorry, your link still shows an incomplete log which ends 15:10:17.437 … tried several browsers which seem not to be to root cause for this garbled data. Why not simply follow the instructions in the link to the OSMC wiki mentioned above?

I don’t do grab-logs -Abecause it publish some info I don’t want in the clear, like my cifs/smb password, usernames, hostnames…

Looks like my logs are so long for every paste service.

Are you using Smart Playlists?
Here is a workaround.

No smart playlists. Just plain TV Shows and Movies menus dragging from a SMB on my LAN.

I investigate about this SMB server and the folders (because hidden files on it) but nothing there.

Also tried Kodi on a macOS and can NOT replicate the problem. So I can confirm is a OSMC issue.

Another thing you could try is adding this to your advancedsettings.xml

 <videolibrary>
      <hideemptyseries>true</hideemptyseries>  <!-- hide empty series in the video library -->
 </videolibrary>

Adding that setting did nothing for me even though I have empty series.

You have consistently failed to provide the information we require to properly diagnose and fix your issue. Please posts logs or we’ll have to close this thread. How to submit a useful support request - General - OSMC