Google Drive folder mtime

Recently moved from ACD to Google and noticed that Kodi wasn’t picking up new files with library scans. It turns out that Kodi will check the mtime on a folder to determine whether it’s change and needs to be scanned. Looking at some recent uploads I notice that the file has the correct mtime, but the folder isn’t being updated (is this the normal behaviour of a file system?).

I’m not doing anything special to transfer the files:

rclone move -v --no-traverse /stuff/ Google:

Should the folders mtime get updated with the new files, or is this a bug/something not implemented yet?

Kodi supports changing this behaviour so it recursively scans each folder but it slows down the scan considerably for obvious reasons.

Cheers

Just as an alternative, I do a manual scan of just that file / directory as it comes in.

CONTENT=VideoLibrary.Scan
CONTENT=AudioLibrary.Scan
PATH=the directory of the file. Not the file itself… with a series, you’re better off specifying the whole series rather than just the season. Always include the training slash…

Examples:
/data/Media/Videos/Series/Tosh.0/
/data/Media/Videos/Movies/<movie_name>/

curl -m 10 --data-binary '{ "jsonrpc": "2.0", "method": "'${CONTENT}'","params": {"directory":"'${PATH}'"}, "id": "mybash"}' -H 'content-type: application/json;' http://$HOST:$PORT/jsonrpc
1 Like

Thanks for the tip @calisro. To be honest I’m not that keen to do that every time new stuff is added (regularly). I was just wanting to know whether rclone/gdrive was functioning as it should be (in that folder mtimes aren’t updated with new files). If so, I’ll just change the kodi config so it does a more comprehensive scan of directories.

Ah, looks like this is a known issue - https://github.com/ncw/rclone/issues/1460

You can disable the ‘fasthash’ scanning in Kodi by editing advancedsettings.xml

<videolibrary>
    <usefasthash>false</usefasthash>
</videolibrary>

#<usefasthash>true</usefasthash> <!-- defaults to true. Set to false in order to skip hashing based on the folders modification time.

1 Like

Changing fast hash definitely adds new files to the library but it’s slow and causes tons of API hits. With the move from plexdrive to rclone cache and now rclone vfs, it looks like the directory tree isn’t put into cache.

I have a remote server that handles all of the uploading and my local server mounts it to serve to local Kodi boxes. Has there been any headway on figuring out how to edit the top-level mtime when files are added to subdirs? I’d like to remove false if at all possible.

Appreciated!