Linux Kodi misses new episodes due to unchanged modified date
#1
Bug 
I finally found out the cause of Kodi's consistent failure to add most new episodes. Only removing and adding the show again worked. It failed to detect new items because the modified date has not changed for the directory. Running the touch "directory" command fixes the issue. This happens even when you specifically scan for new content of a particular show meaning it is impossible to scan new episodes without first removing the show and then running a full library scan.
Why does Kodi work this way? Modified date does not change for directories when files are modified or added within a sub-directory such as season folder. This is easily avoidable if Kodi just scanned sub directories to see if modified-date is different on any sub-directories. This seems like a major bug to me or am I missing something? Is there a workaround?
Reply
#2
which filesystem do you use?
Reply
#3
(2017-02-18, 15:42)wsnipex Wrote: which filesystem do you use?

ext4
Reply
#4
Manually creating a folder and a sub-folder within on the root of a ext4 filesystem and then creating a file or folder within does not change the modified date of the first folder.
Reply
#5
Hi DominicM,

You are not the only one!

I have noticed this bug; or at least something similar: Scanning for new content would not always result in new TV episodes being detected, despite the name and season and episode information being correct.

Often I would just have to play the problem files manually by ignoring the 'library view' and then drilling through to the file itself from the Videos/Files menu. The next day, perhaps after I had rebooted KODI, the episode would then show up in the library.

Folder timestamp issues could explain this behaviour, I guess.

S
Reply
#6
(2017-02-19, 01:53)StuXP Wrote: Hi DominicM,

You are not the only one!

I have noticed this bug; or at least something similar: Scanning for new content would not always result in new TV episodes being detected, despite the name and season and episode information being correct.

Often I would just have to play the problem files manually by ignoring the 'library view' and then drilling through to the file itself from the Videos/Files menu. The next day, perhaps after I had rebooted KODI, the episode would then show up in the library.

Folder timestamp issues could explain this behaviour, I guess.

S

Assuming you are on linux an easy way to verify this is to run "touch series_directory_path" command on the series that won't scan all episodes and see if it will scan after that.
Reply
#7
I should also add that the episodes in question are all named properly and have .nfo files generated for them by Sonarr so they are not being seen at all. The logs simply show that there's no change with the series even in debug mode.
Reply
#8
Hi

Thanks for the suggestion, DominicM. I will try it out next time I encounter the problem. Sorry. but could you just explain how I would run "touch series_directory_path", as am a bit of a Linux novice. Can this be done from the Terminal on my Mac?

Thanks,

S
Reply
#9
(2017-02-19, 11:01)StuXP Wrote: Hi

Thanks for the suggestion, DominicM. I will try it out next time I encounter the problem. Sorry. but could you just explain how I would run "touch series_directory_path", as am a bit of a Linux novice. Can this be done from the Terminal on my Mac?

Thanks,

S

touch changes the date modified to current time. If you mean if it can be done FROM you mac then yes as as long as you main system is proper linux and not quasi linux like mac though the touch command might work on mac also I ma not sure. You can also just rename the series folder and rename again to original name, that will accomplish the same thing.
Reply
#10
(2017-02-18, 16:07)DominicM Wrote: Manually creating a folder and a sub-folder within on the root of a ext4 filesystem and then creating a file or folder within does not change the modified date of the first folder.

edit:
creating a file does update the parent dirs modify timestamp
Reply
#11
(2017-02-19, 11:38)wsnipex Wrote:
(2017-02-18, 16:07)DominicM Wrote: Manually creating a folder and a sub-folder within on the root of a ext4 filesystem and then creating a file or folder within does not change the modified date of the first folder.

edit:
creating a file does update the parent dirs modify timestamp

You misunderstood me, the creation or editing of a file DOES change the date modified of a parent dir but it does NOT change it for level2-parent directory.

For example assuming episode path is /mnt/series/testseries/Season 1/episode.ext

If you create or modify file or folder in "/mnt/series/testseries", date modified will update. On the other hand if you do the same in "/mnt/series/testseries/Season 1" the "testseries" date modified will be unchanged.


Content settings are:

This directory contains: TV Series
Chose information provider: The TVDB
Both checkboxes unchecked.
Reply
#12
as long as "folder contains a single Tv Show" is disabled, it should still work, and does for me.
Reply
#13
(2017-02-19, 12:18)wsnipex Wrote: as long as "folder contains a single Tv Show" is disabled, it should still work, and does for me.

It's disabled.


I did some testing just now where I copied one episode and changed the episode number to +1 the current one. Did a library update and the episode was NOT scanned in.

This is the only line relevant to the particular show.
Code:
DEBUG: VideoInfoScanner: Skipping dir '/mnt/series/#########/' due to no change

It looks like Kodi does not even scan this directory, why?


If I run Scan for new content I get this in the logs:

Code:
DEBUG: VideoInfoScanner: Skipping dir '/mnt/series/###/' due to no change
DEBUG: VideoInfoScanner: Skipping dir '/mnt/series/###/Season 1/' due to no change
DEBUG: VideoInfoScanner: Skipping dir '/mnt/series/###/Season 2/' due to no change

Episode not scanned in till now. I create an empty folder in Season 2 folder and scan for new content again, this is the log:

Code:
VideoInfoScanner: Rescanning dir '/mnt/series/###/' due to change (B310F560ADDF2928ECB44FAC3F962729 != 39B06D998421C8A23C17D96389634893)

DEBUG: VideoInfoScanner: Found episode match /mnt/series/###/Season 1/###.ext (s1e1) [s([0-9]+)[ ._x-]*e([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)([^\\/]*)$]
######## repeats for each episode

DEBUG: GetEpisodeId (/mnt/virtual/###/Season 1/###.ext), query = select idEpisode from episode where idFile=2555
######## repeats for each existing episode

DEBUG: VideoInfoScanner: No NFO file found. Using title search for '/mnt/series/###/Season 2/###.ext'

##### api calls etc...


It seems that creating a folder or renaming a file does NOT change date modified even of the parent directory (checked with ls -lt command). Creating a folder in the Season folder for some reason made kodi scan the episode in. Creating a folder as root still did not change parent folders modified date. This is very odd. Could ownership or permissions settings affect modified date even for root like this? If not then maybe it is an issue with the virtual pooling system that I am using, but it still doesn't explain why kodi doesn't scan file with unchanged modified date (I think you said it should still work) or why creating a folder made kodi scan episodes even though it did not change date modified.
Reply
#14
Code:
It seems that creating a folder or renaming a file does NOT change date modified even of the parent directory
this is your issue then, because this is not normal ext4 behavior.
Reply
#15
(2017-02-19, 13:16)wsnipex Wrote:
Code:
It seems that creating a folder or renaming a file does NOT change date modified even of the parent directory
this is your issue then, because this is not normal ext4 behavior.

Yes but can you please explain why kodi behaves in this odd way as per the previous post. Why would creating a folder that doesn't change date modified make kodi work? etc...

Even on a pure ext4 filesystem (I tested) the grandparent directory date modified does not change. This means that the full library scan would still fail to scan the new episodes because date modified on the series folder would not change and Kodi doesn't even scan Season folders. Scan for new content should work as it does indeed scan Season folders at least that's what's in the logs.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi misses new episodes due to unchanged modified date0