Symlink on AppleTV and AFP?

Hi.

Cause there is no synchronisation between two or more AppleTVs and Media Player, I used some “hands”. I found the files from Media Player (User/Library/Preferences/Media) and sync them between a folder on my NAS.

My NAS has AFP.

Is there a possibility to symlink this “Media”-Folder (of Media Player) with the folder on my NAS?

Have fun!

Any? :slight_smile: :frowning:

I support this request!

I’m developing a script which will sort my video folder on the NAS. It would be very handy to use symlinks to directories so that I can create folders like “Recently downloaded”, “No subtitles”, “Animations” and just use links to refer to the original location of the video files (on the same volume).

Currently, I can of course create and see the symlinks both on the NAS and on the NAS AFP mounted on my Mac, but not on ATV!

I use symlinks on my NAS without any problems. For instance I have my movies organised so that I can access them in several ways e.g. Title, year etc. The ATV2 seems to be treating these symlinks as if they were the files they point to without any problem. In fact for my movies I ONLY use symlinks, and never directly access the underlying files without going through a symlink.

Interesting! Do your symlink point to directories or to files?

Both.   I symlink to directories when I have a movie as TS_VIDEO type format, and files if it is as iso.

I am guessing that the NAS is hiding from the ATV2 the fact that it is a symlink which is why it works without any issue.

 

Does not seem to work for me, but I will test a few more methods. Do you mind if I ask a few more things to try and understand?

  • Are you browsing the NAS share from ATV2 as an AFP share mounted using the FireCore MediaPlayer?

  • Are you creating the symlinks natively in the NAS (e.g. by SSH:ing to it)?

  • Are you linking the files/dirs using absolute or relative path?

 

I am able to link files so that they show up on the ATV2, but when I try to play them I get an error. Directories don’t show up at all, but I will try a few more ways of creating the links.

Doing a little bit of research, I got some partial results:

  • I can do hardlinks by SSHing to the NAS. Those shows up correctly in Media Player! Hardlinking directories is normally not allowed AFAIK so haven’t tried.

  • Apparently, AFP does not resolve symlinks before it serves to clients. And because a symlink is just a string that contains a path, it means that if you create a symlink on your NAS to e.g. /share/video/file.avi when the ATV2 reads this, it should look at that exact path which means locally on the ATV (where the file isn’t). Relative symlinks should work in that case but seems not for me, depends on how Media Player is implemented…

[quote=ripperdoc] 

  • Yes I am using an AFP share from the Media Player - the NAS end is running Netatalk to provide the AFP support.

  • I ssh into the NAS and use ln -s to create the symlinks (the NAS is running Linux)

  • I cann use relative or absolute paths - they both work.

As I said, I do not believe that the ATV2 knows that a symnlink is being used - this is all being handled at the NAS level…

 

Then it is just a difference between implementations of AFP servers. Some resolve symlinks before sending them to clients such as ATV2, some do not (mine seems to not resolve). But Media Player should at least be able to handle correctly made relative symlinks, which is currently not the case (for me, at least).