Jump to content

Auto scan media


Recommended Posts

Posted

Hey all...

 

I run Emby and Plex but wanting to move to Emby full time... was going to get a lifetime licence in a few weeks off Emby or Plex and i really want to love Emby.

 

With plex it auto scans media as its added, so within a few minutes its loaded on plex but with emby it takes ages to load. I have the right settings in the library settings and im running U18.

 

 

Is there something im missing?

 

Thanks loads!

schmitty
Posted

You need to check Enable real time monitoring in the settings for each library. To have access to this option however, you need to click Show advanced settings, near the top right of the dialog.

 

 

Sent from my iPhone using Tapatalk

Posted

did that my mate but i still have to manually scan or wait about an hour

schmitty
Posted

Are you using a local, or cloud library?

 

 

Sent from my iPhone using Tapatalk

Posted

both but i will double check and test both mounts see if its the cloud mount thats slow or not.

schmitty
Posted

For some reason... possibly by design, real time monitoring only works for local libraries. Perhaps, @@Luke or @@ebr could shed some light on this.

 

 

Sent from my iPhone using Tapatalk

ember1205
Posted

I suspect that the real time monitoring requires the ability of the filesystem to directly notify the OS of file changes. Since the actual filesystem of a non-local filestore can't do that, this is likely why there is no ability to monitor remote mounts (cloud, NFS, etc.).

 

As far as not actually getting the library items to be loaded, check file permissions, folder permissions, and user/group ownership on both. Do a manual library scan and look at the metadata manager to verify that it's at least SEEING the folders and files. Also be sure you're using an appropriate naming scheme.

Posted

Hey its fine if i manually scan its just not auto scanning cloud folders i have to manually do it.

ember1205
Posted

Hey its fine if i manually scan its just not auto scanning cloud folders i have to manually do it.

 

My gut says that's what you should expect since the filesystem notification doesn't work on non-local media.

Posted

 

 

I suspect that the real time monitoring requires the ability of the filesystem to directly notify the OS of file changes. 

Yes this is correct. On linux INotify is used, so your filesystem would have to be able to work with that.

schmitty
Posted

Do you have any information on how to do this, Luke?

 

 

Sent from my iPhone using Tapatalk

mastrmind11
Posted (edited)

Do you have any information on how to do this, Luke?

 

 

Sent from my iPhone using Tapatalk

inotify is implemented at the vfs layer of the kernel, which means it works locally... it has no knowledge of what a remote client is doing.  ie, it's not designed for cloud.  maybe you could hack it to work if you added the media locally and used Auto Organize to move it to the cloud?  

Edited by mastrmind11
ember1205
Posted

When inotify indicates that something has changed on the filesystem, what does Emby actually "do" at that point? Does it scan what was specifically called out as having changed? Or, does it scan the whole library that contains the change?

 

If it's the latter, there might be a way to get it done with a cron job...

Posted

It scans the folder of what what was changed.

ember1205
Posted

It scans the folder of what what was changed.

 

If I have the directory structure of TV Shows -> Cheers -> Season 01, and I add an episode to Season 01, I would imagine that it scans that specific directory. Correct?

 

What happens if I create Season 02 under Cheers? Does it scan only Season 02? Cheers and Season 02? Cheers and all subdirectories?

Posted

It scans everything under the parent folder of whatever changed, but since it is only looking for differences it should be pretty quick.

ember1205
Posted

Create a mount point called /mnt/Movies1/media.

 

Mount your remote drive on that mount point.

 

Assuming /mnt/Movies1/media/ is where all Movie files on the remote filesystem live, you can periodically run a cron job to check the used/free space of that drive and compare it to previous checks. If a difference is seen, you write a file in /mnt/Movies1. With the library monitoring /mnt/Movies1, that will trigger a scan for that library.

  • 2 weeks later...
schmitty
Posted

Create a mount point called /mnt/Movies1/media.

 

Mount your remote drive on that mount point.

 

Assuming /mnt/Movies1/media/ is where all Movie files on the remote filesystem live, you can periodically run a cron job to check the used/free space of that drive and compare it to previous checks. If a difference is seen, you write a file in /mnt/Movies1. With the library monitoring /mnt/Movies1, that will trigger a scan for that library.

 

Can you offer an example of the cron/sh script?

ember1205
Posted

I don't have anything specific written, so this is just theory at this point...

 

You would have a specific mount point that you want to watch:

/mnt/Movies1/media

You check for used/free space with a command like:

df -m /mnt/Movies1/media | grep -v Filesystem

The second part of the command removes the header information so that you get JUST the filesystem info on a single line:

/mnt/Movies1/media         463905 126796    313476  29% /

If you execute this command from a script, you can draw it directly into a variable:

DISKSPACE=`df -m /mnt/Movies1/media | grep -v Filesystem`

You'll also need to read in the value of the filesystem from the last time something changed by reading it from a file (which won't exist the very first time):

OLDDISKSPACE=`cat /mnt/Movies1/diskspace.txt`

With both variables in place, you can compare them and take action if they're different:

if [ "$OLDDISKSPACE" != "DISKSPACE" ]; then
     echo "$DISKSPACE" > /mnt/Movies1/diskspace.txt
fi

This will cause the file /mnt/Movies1/diskspace to be updated. As long as the library is watching /mnt/Movies1 for changes, this should trigger a full scan of the disk below that point.

  • 10 months later...
Posted

I can image that for those using mergerfs "use_ino" should be set for auto-update to work properly?

Posted

I'm not sure that matters but please try it and let us know. Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...