That part of the documentation is out of date. There is no “watched folder” functionality currently for LibreTime, before I put together this latest PR there was no easy way to import music from a filesystem at all, other than a few shell scripts. You basically had to manually upload everything through the web interface.
What I put together currently only creates a folder where anything you copy into it will be uploaded to LibreTime and deleted from the filesystem. I tried to implement the watched folder setup through modifying the code a previous contributor had put together but ran into numerous issues where it wouldn’t playback files and basically found that it wasn’t very compatible with the web API. When LibreTime was still the Airtime SaaS-dev branch (aka Airtime.pro) they refactored the code so that it could work with Amazon S3 so that they could put everyones data in a single cloud repository and not have to worry about it. But they left the filesystem as an option and that is what we have been using.
What currently happens to a file as it is imported is that it is moved into /srv/airtime/stor/imported/#/artist/track.file and the # corresponds to the user ID of the person uploading it. Everything will be put under user ID /1/ at the moment when uploaded through the PR I put together. The metadata is what is used to display and search for tracks in LibreTime, so it is pretty important that it be consistent. I believe that when you edit the track title etc it also changes the metadata on the file. But I’m not totally sure.
So I haven’t finished coding my PR. But let me provide some comments on your suggestions.
For the first 1 - I understand what you are proposing here but I’m not sure how easily it could be implemented as the watched folder functionality doesn’t currently exist. Specifically LibreTime stores all of the metadata for its files in the Postgres SQL database, and it creates this through analyzing the file upon import. LibreTime would need to rescan all of the files and see if any of them had changed and then update the database if it detects a change. If a file is deleted or moved it isn’t as straight forward either. So that is an issue.
So this is a challenge for stations using LibreTime and that is how to maintain large databases of music. Another issue with the whole remote filesystem is the source of truth plan would be what happens if someone uploads a file directly to the LibreTime web UI. The way watched folders originally worked is the files normally uploaded would be added to the local filesystem and the watched folders are separate and so nothing is ever added to them but instead just stored on the local filesystem.
- The web interface currently doesn’t do any review alert and I’m not totally sure how to best implement this with any kind of filesystem import. Figuring out a way to do this seems like a good idea though.
So one additional feature I was thinking of adding to my code was the ability to scan a folder and import everything in it. This could be used with a remote filesystem but the question becomes how to determine if a file was imported already. There is no duplicate detection currently in LibreTime and so I think this would be essential before we scan a folder and import everything while leaving the files intact. Also my thought is that the files would be copied to LibreTime’s local filesystem rather than it attempting to play files from a sshfs or other network mount. This would help ensure that they are locally available for play even if there is an issue with the network or whatever. But it also makes the duplicate detection aspect of it even more important.
So I’m not sure how this would work AS IS with your current setup but when I get back to working on the PR I’ll definitely try to keep in mind the feedback you gave. I wonder how automated filesystem importing by scanning an existing folder would work for you all. I don’t think there is easy way to keep your existing filesystem as the sole source of truth if you are going to have people using the web UI to uploaded as well. I do think this is an interesting problem to try to solve, and the filesystem/folders created by LibreTime are kind of a mess in comparison to those created by humans with attention to detail.