Open FichteFoll opened 6 years ago
Coincidentally I discovered that the tracker does work when I play episodes from a different location, i.e. my local hard drive. When I play them from a symlinked folder that is an sshfs mount (symlink because you can only set one media folder), it doesn't work.
Not sure if the symlink is really the problem here, but at least the library scanner works with them, which would be the first thing I expect to break.
Thanks for the report. Are you using the inotify or polling tracker? (This should appear in the log/status bar) From what I remember, symlinks don't seem to be working with inotify. The library scanner uses a different method to traverse the directories, which would explain why it works.
I'm quite confident I'm using inotify. I also seem to remember that notifications don't work with symlinks, but maybe you could add listens for each symlink discovered while crawling through the library? Or do this kind of crawl manually on start because people might have media scanning disabled. Or maybe it works with polling as well. I should try that.
Either way, this would also be solved by #179 as currently I have to edit the config to cycle between three different directories depending on where I stored my media (yes, I have multiple locations).
@FichteFoll I've implemented multiple directories in the develop
branch, please check if it works for you.
That said, I'll still debug symlinks. I haven't done any conscious change that would stop the library from traversing symlinks (pyinotify).
I just now looked into this, my bad. Effectively FUSE filesystems like SSHFS don't support inotify so it's expected that the inotify tracker wouldn't work. The library scanner uses regular directory scanning so it works. I'm afraid the inotify tracker wouldn't work even if you used the new multiple directories feature over your SFTP connection.
You could try to force the use of the polling tracker by specifying polling
as the tracker_type
in your config.json.
Thanks for investigating. I'll make a menta note to confirm this as soon as get to it.
FWIW my library has always been on a sshfs mount and inotify has worked on it. It definitely uses inotify as I had to increase the maximum number of watches to use certain other programs with trackma running. I was not using symlinks though!
Oh really, I should recheck it then. inotify will definitely not work remotely but if it works for you then it is generating inotify events if it occurs locally. I'll try with an SSH mount myself.
Yeah, it receives local events (e.g. me watching episodes or creating/copying/moving folders around on the mount) but not remote ones (moving folders around via the remote torrent client, new series folders being created by flexget etc.).
I also believe that this did work fine for me before as I was always using inotify and manually edited my media directory setting before launching trackma due to #179. (Still wasn't able to actually confirm this.)
@FichteFoll Last question, does the issue occur with pyinotify or inotify? (They're different trackers actually, it should say which one it's using in the terminal when it starts)
I am indeed using pyinotify. I can try to experiment a bit, but I'll be out of town for a while and won't have time for this for a few weeks.
pyinotify doesn't work through symlinks, it took me until reading the source for trackma and pyinotify to figure out why trackma wouldn't work for me. I think this, along with how the different trackers work (ie. the inotify trackers only work for files played under the selected media directory) should be documented somewhere. I'm not sure if this remote issue is related to pyinotify's limitations on symlinks, but I thought I should mention this here.
The tracker used to work, but it doesn't anymore. I think since the last update, which was on 2018-09-26, where I updated 0.7.6.r3.g7954a73-1 -> 0.7.6.r8.gb9e26e1-1 (so after 7954a73, probably), and it also doesn't work with current master.
I don't receive any mentions of the tracker finding something, despite even using trackma to play the next episode. My player is mpv and my config is as follows: