Jump to content
cmart2112

ANSWERED Add Directory To Library From Afar

Recommended Posts

cmart2112

Hello!  I manage a linux media server for my sister.  She lives in a remote location and only has broadband internet.  I built a linux server with emby on it with the intention of giving her an external USB drive from time to time with new content.  I can only access this machine via SSH, but within the local network, Emby is working like a champ.  My question is, how can I add the external USB to the Emby library via ssh?  I tried to symlink the content into the existing library directory, but it doesn't appear to be working.  The local hard drive is about 1TB and already full of content and the external hard drive is about 5 TB.  I have it mounted in the same root directory as the current content.  Any tips would be great!  Thanks!

Edited by cmart2112

Share this post


Link to post
Share on other sites
mastrmind11

Hello!  I manage a linux media server for my sister.  She lives in a remote location and only has broadband internet.  I built a linux server with emby on it with the intention of giving her an external USB drive from time to time with new content.  I can only access this machine via SSH, but within the local network, Emby is working like a champ.  My question is, how can I add the external USB to the Emby library via ssh?  I tried to symlink the content into the existing library directory, but it doesn't appear to be working.  The local hard drive is about 1TB and already full of content and the external hard drive is about 5 TB.  I have it mounted in the same root directory as the current content.  Any tips would be great!  Thanks!

Emby needs at least read access to the mount.  

Share this post


Link to post
Share on other sites
cmart2112

.

Edited by cmart2112

Share this post


Link to post
Share on other sites
cmart2112

Emby needs at least read access to the mount.  

 

Yes.  I think I have it wide open right now for testing (777)

Share this post


Link to post
Share on other sites
mastrmind11

 

Yes.  I think I have it wide open right now for testing (777)

 

oh, i see what you're saying.  you don't have the ability to select the library from with emby because you are remote w/ ssh access only.  is your sister able to add the library if you walk her through it?  if not, I'm fairly certain symlinking is supported, in which case you'd just have to send an API call via curl to refresh the library.

Share this post


Link to post
Share on other sites
cmart2112

oh, i see what you're saying.  you don't have the ability to select the library from with emby because you are remote w/ ssh access only.  is your sister able to add the library if you walk her through it?  if not, I'm fairly certain symlinking is supported, in which case you'd just have to send an API call via curl to refresh the library.

 

might be able to walk her though it... but would rather manage the process on my end.  I created the symlinks last week and asked if she saw the new content last night (which she didn't).  I assumed the regularly scheduled library scan would have picked up the symlinked content by now.

Share this post


Link to post
Share on other sites
Q-Droid

Here's an idea worth testing. It's a deliberately sloppy way that might trick Emby into "thinking" the libary paths are always there.

 

Assuming you're using automount for the USB and have everything sorted out already.

 

Create full library paths for Emby on the filesystem, these are examples so adjust for your directory structure:

/mnt/portable/media/movies

/mnt/portable/media/series

/mnt/portable/media/<other>

 

Add the above to Emby as libraries, to suit your needs.

 

Make sure your external drive matches the above library paths from the mount point from media on down, USB has /media/...

 

Now setup the external drive to automount at /mnt/portable. The idea is to overlay the existing library paths with matching ones on the external drive so mounted or not the directories are always there. What will be missing or change is the media itself which would have to be re-scanned.

Share this post


Link to post
Share on other sites
cmart2112

Here's an idea worth testing. It's a deliberately sloppy way that might trick Emby into "thinking" the libary paths are always there.

 

Assuming you're using automount for the USB and have everything sorted out already.

 

Create full library paths for Emby on the filesystem, these are examples so adjust for your directory structure:

/mnt/portable/media/movies

/mnt/portable/media/series

/mnt/portable/media/<other>

 

Add the above to Emby as libraries, to suit your needs.

 

Make sure your external drive matches the above library paths from the mount point from media on down, USB has /media/...

 

Now setup the external drive to automount at /mnt/portable. The idea is to overlay the existing library paths with matching ones on the external drive so mounted or not the directories are always there. What will be missing or change is the media itself which would have to be re-scanned.

 

I considered this, but wont mounting the USB in the same directory as the current content essentially HIDE the items on the local drive?

 

https://unix.stackexchange.com/questions/198542/what-happens-when-you-mount-over-an-existing-folder-with-contents

Share this post


Link to post
Share on other sites
Q-Droid

Those library paths would be used only for the USB content, they are not the permanent media libs. And yes, the idea is to deliberately hide them with a matching directory tree so when the USB is swapped out, unmounted or mounted the structure does not change, only the media. Basically it's to keep Emby from complaining about missing locations.

 

The catch is that you have to pick a dir tree and stick with it when you send new media to your sister.

Share this post


Link to post
Share on other sites
cmart2112

Those library paths would be used only for the USB content, they are not the permanent media libs. And yes, the idea is to deliberately hide them with a matching directory tree so when the USB is swapped out, unmounted or mounted the structure does not change, only the media. Basically it's to keep Emby from complaining about missing locations.

 

The catch is that you have to pick a dir tree and stick with it when you send new media to your sister.

 

Great.  Thanks.  And where would I stick the "local" media?  Just consider it a loss?  I hate to lose 1TB of capacity of possible.

Share this post


Link to post
Share on other sites
Q-Droid

Great.  Thanks.  And where would I stick the "local" media?  Just consider it a loss?  I hate to lose 1TB of capacity of possible.

 

The local media remains untouched. You can have as many libraries as you want pointing to as many paths as you want: Movies, USB Movies, TV, USB TV, Cloud Movies, Scary Movies, etc. It doesn't matter.

 

In my example, the paths and libraries are new ones created to be used only by the USB drives you send, not the existing internal ones, those don't change. Do you expect to have multiple USB drives connected at the same time?

Share this post


Link to post
Share on other sites
Q-Droid

I'd like to add than you can also have multiple paths defined in a media library. Both paths would be permanent, one for the internal media and one for the USB media. So the content appears as a consolidated view in the Emby UI.

Edited by Q-Droid

Share this post


Link to post
Share on other sites
cmart2112

The local media remains untouched. You can have as many libraries as you want pointing to as many paths as you want: Movies, USB Movies, TV, USB TV, Cloud Movies, Scary Movies, etc. It doesn't matter.

 

In my example, the paths and libraries are new ones created to be used only by the USB drives you send, not the existing internal ones, those don't change. Do you expect to have multiple USB drives connected at the same time?

Sorry, I'm kinda slow :).  I'm not following.

 

Current directory structure in the Emby Library:

/media/video/movies

/media/video/tv_shows

/media/video/kids_shows

 

Current USB mount point:

/media/usb/movies

/media/usb/tv_shows

/media/usb/kids_shows

 

The way I understand it, if I were mount the external drive to /media/video (instead of /media/usb), the local contents would no longer be visible.  Do you think I'm missing something?

Share this post


Link to post
Share on other sites
Q-Droid

Sorry, I'm kinda slow :).  I'm not following.

 

Current directory structure in the Emby Library:

/media/video/movies

/media/video/tv_shows

/media/video/kids_shows

 

Current USB mount point:

/media/usb/movies

/media/usb/tv_shows

/media/usb/kids_shows

 

The way I understand it, if I were mount the external drive to /media/video (instead of /media/usb), the local contents would no longer be visible.  Do you think I'm missing something?

 

Yes. "The Emby Library" is not a static monolithic thing, it's very flexible in how you can layout and organize your media.

 

I see where we're not on the same page.  You don't have to mount the USB on /media, you can go deeper.

 

Walking thru this:

Leave the current internal directory structure alone.

 

Using the example above for now but you can change it.

 

If you want to stick to the above then you could create /movies, /tv_shows and /kids_shows on the USB root instead of /media.

 

Mount the USB to /media/usb instead of /media and the local stuff remains untouched.

 

You can reorganize the USB a little, still mount on /media/usb though you could end up with /media/usb/media/movies, /media/usb/media/tv_shows, etc.

 

Or pick a different path for the USB mount like /mnt/usb or /mnt/portable, it's up to you.

 

If you look at my original example it goes nowhere near the internal/local media.

Edited by Q-Droid

Share this post


Link to post
Share on other sites
cmart2112

Yes. "The Emby Library" is not a static monolithic thing, it's very flexible in how you can layout and organize your media.

 

I see where we're not on the same page.  You don't have to mount the USB on /media, you can go deeper.

 

Walking thru this:

Leave the current internal directory structure alone.

 

Using the example above for now but you can change it.

 

If you want to stick to the above then you could create /movies, /tv_shows and /kids_shows on the USB root instead of /media.

 

Mount the USB to /media/usb instead of /media and the local stuff remains untouched.

 

You can reorganize the USB a little, still mount on /media/usb though you could end up with /media/usb/media/movies, /media/usb/media/tv_shows, etc.

 

Or pick a different path for the USB mount like /mnt/usb or /mnt/portable, it's up to you.

 

If you look at my original example it goes nowhere near the internal/local media.

 

Great.  Thanks for this info.

 

I guess I'm still not following how I can update the Emby Library without access to the web interface.  I only have ssh access and the current libraries are configured to the directories mentioned above.  I'm not really worried about the specific mount locations or directory structure of the external drive (I can quickly update all of that).  The crux of my question is, "how can I get Emby to recognize the content on the external drive when the library is only configured for the directories previously mentioned"?

 

Thanks again for the help.

Share this post


Link to post
Share on other sites
Q-Droid

Do you mean a library rescan or the first time setup? The setup would be a one time thing but still needs to be done. Maybe that's the part I've missed. If you can walk her through adding the new paths to the existing libraries then you're done, otherwise you'd have to figure out a way.

 

Could you try an SSH tunnel to launch Emby in a browser from your end?

Share this post


Link to post
Share on other sites
cmart2112

I am not talking about a library rescan or the first time setup.  The library is already setup (and working) with the local content (the media on the actual server).  I am talking about adding the content that exists on the external USB drive to the existing library OR modifying the library paths to incorporate wherever I have the USB mounted all via the command line.

 

I've tried the ssh tunnel (sock proxy), but her bandwidth is BAD and I can't seem to connect. I've also tried to connect via app.emby.media/ and also had no luck.

 

I can make the necessary changes to the library config when I go over there to visit and have access to the web interface, but again, i was trying to get everything configured via ssh.

 

I think you have it right when you said "otherwise you'd have to figure out a way".  That is what brought me here.  I'm trying to figure out a way :)

Share this post


Link to post
Share on other sites
Q-Droid

Let me know if there's something I haven't explained right or you think I've left out. I often make assumptions when I think something is clear.

Share this post


Link to post
Share on other sites
mastrmind11

Why can't you enable external connections on her server and just connect your own client to her server?  Even with a shitty connection, that should be enough for you to add the usb libraries and run a scan.

Share this post


Link to post
Share on other sites
cmart2112

Why can't you enable external connections on her server and just connect your own client to her server?  Even with a shitty connection, that should be enough for you to add the usb libraries and run a scan.

 

I have no idea!  I have external connections enabled on the server (as well as my own), but I can't seem to connect.  Whenever I try, I get a "connection failure: we're unable to connect to the selected server right now.  Please ensure it's running and try again."

Share this post


Link to post
Share on other sites
Luke

I have no idea!  I have external connections enabled on the server (as well as my own), but I can't seem to connect.  Whenever I try, I get a "connection failure: we're unable to connect to the selected server right now.  Please ensure it's running and try again."

 

@@cmart2112, i would suggest checking out our Connection Troubleshooter:

https://github.com/MediaBrowser/Wiki/wiki/Connectivity

 

Please try the steps listed there and let us know which ones succeed, and which ones do not. Thanks.

Share this post


Link to post
Share on other sites
cmart2112

@@cmart2112, i would suggest checking out our Connection Troubleshooter:

https://github.com/MediaBrowser/Wiki/wiki/Connectivity

 

Please try the steps listed there and let us know which ones succeed, and which ones do not. Thanks.

 

@@Luke Thanks for checking in!!

 

Well... none of them worked.

 

1- Locate Your External Address - I can't locate the External Address from the dashboard because I can't access the web UI from where I am.  But I am able to check via the terminal (curl https://ipinfo.io/ip)

2- Test Your External Address - This always fails

3- Setup Port Forwarding - Again, I don't have local access to the network, so I cant access the local router

4- Verify Public Port - I forgot to check this... but 8096 IS blocked.

 

While the Web UI would obviously be the easiest (and preferred) way to perform this task... it really isn't what I'm asking here.  I'd like to see if there is a way to update the library location Emby looks at via the command shell (which is all I have reliable access to).  I setup a reverse SSH tunnel on the device before I delivered it to my sister assuming I would be able to do everything I needed via SSH.  I can't even "directly" ssh into the box (if that makes sense).

 

I can perform all these other administrative steps when I am onsite... but that won't be till Christmas time and I'd like to get the external hard drive running before then.  

Edited by cmart2112

Share this post


Link to post
Share on other sites
mastrmind11

So symlink each of the folders on the USB drive to the existing emby library and fire up a library scan via the api (or wait for the next scheduled scan).  You have to create a symlink for each movie folder independently, you can't just symlink the top level usb folder because emby wont traverse it.

Edited by mastrmind11
  • Like 1

Share this post


Link to post
Share on other sites
cmart2112

So symlink each of the folders on the USB drive to the existing emby library and fire up a library scan via the api (or wait for the next scheduled scan).  You have to create a symlink for each movie folder independently, you can't just symlink the top level usb folder because emby wont traverse it.

 

I smylinked each media file (ln -s /media/usb/tv_shows/* /media/video/tv_shows/) and it didn't work.

Edited by cmart2112

Share this post


Link to post
Share on other sites
cmart2112

oh no... I didn't use the absolute path when creating the symlinks.  Let me scan again and see if that fixed things.  how embarrassing. 

Share this post


Link to post
Share on other sites

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...