I’m currently working on the calibre-web app integration in Yunohost.
I’m not very please with the way I handled the the data folder integration (currently, I create a folder in /home/yunohost.app/ or I use the one the user give me, without checking rw access).
The issue I have is similar to app like nextcloud where the data folder may be quite big (my own calibre library is around 4Go big) and I cannot just put it in the home folder on a small SD card on a raspberry Pi + I need to be able to read and write into this folder.
I noticed that the nextcloud app is creating/using helpers for multimedia integration that are not yet “released” for global usage and I wondered if I may use them or if I should wait until they are release or find another way to handle the data directory? Is there any “best practices” regarding multimedia data management in Yunohost? Do we have any “central” multimedia folder where all these data should be put?
I assume that other apps dealing with media data have the same kind of issue, how did you do it?
Any advice is welcome!
That’s a good way to handle those file, first because it’ll be easy for an admin to “mount bind” this directory in a separate hard disk. And second, because all apps using the same kind of files will know where to find them, and so the files won’t be duplicate.
So, I’ve been giving it some thoughts. As you mention in Choix d’un dossier multimédia, centralizing the multimedia data in a single place is the best way to ensure consistency and eliminate duplicate.
However there is still the question of the choices the users are given at installation time (as except for command line, there are no way to change things from inside Yunohost as of today) : Should I force the library to be in the yunohost.multimedia or should I ask the user for a folder and then create a link to this folder? Should it be shared library or private? Should I stop asking so many questions?
In my opinion, letting the admin choose the actual physical location is better, so I would go for a link from yunohost.multimedia to the library . So far, I was thinking of this implementation:
If the app is set as a public app, then create a link from the yunohost.multimedia/Share/eBook to the physical location
If the app is set as a private app, then create a link from the yunohost.multimedia/$admin/eBook/$app to the physical location And would then let the admin give appropriate acces to whom he wants. This would also ensure that in case of multi-instance, we do not mess with multiple library.
The rational behind that is that if the app is public, it means that we want to share the data anyway, while if it’s private we mean to have a more strict access control.
What do you think?
Also, I’ve been looking at you ynh_multimedia helpers and I would like to add an eBook categorie to the current Video/Audio/Image list to make it easier for me (and also, books are media! ).
So I’d like to :
Update ynh_media_build.sh to add this “eBook” folder to a V1.2
update README.md for yunohost.multimedia
update ynh_multimedia_build_main_dir to change release and checksum.
Did I miss something? Is that ok for you?
Using either Share or the user directory is a good idea.
But, unless I’m misunderstanding, I think it would be better to put the files into the multimedia directories, and not just a symbolic link. Otherwise, we’re loosing the idea of keeping all that kind of files at the same place.
The idea behind is also to let all applications using ebooks find the same collection at the same place.
About adding a new directory called eBooks, well, those directories are mainly an example of what can be in this directory. If you want to add a new directory, feel free to add it. But you don’t really need to update the helper to do so.
You’re free to mkdir whatever you want in it. The only thing is, if there’s another app using ebooks, be sure you’re using the same directory. Otherwise, it would be too bad
Well, IMHO the idea is to access all media at the same place, not store them at the same place.
For example people running yunohost on a Pi will not want to have their data on the SD card on which is the /home/ by default (unless they’ve set some specific partition or move every thing to an HDD, but that’s another subject).
Maybe I’m overthinking it and I should just put the multimedia directory and let people deal with it manually
That’s the point of adding them directly in the helpers! Being sure that everybody use the same directory!
No, the idea is to store them at the same place.
Your app is going to use the ebook collection of an user, there’s no reason that your app will be the only one to do so.
So, the ebook collection should not be duplicate in many places, for each app.
That’s the purpose of multimedia directories, to store all media in the same place. First because the media will then not be duplicated for each app, also because a new app will know where to find the files. And finally, because if an admin want to move his media in another place, it’s easier to move an entire directory into another hard disk than to move each separate directory.
People running a Pi, if they’re careful, should move their entire home into a separate HD !
Anyway, people running a Pi will find an easy way to move a directory elsewhere by using a mount bind. Otherwise, their ebook collection will not be their biggest problem. Having music or video will be a bigger concern.
Well, that’s just that I’m not so fond of adding too many directories unless we’re sure we’re going to use them. But, after all, ebooks are becoming quite common. So let’s do it.