INTERACT FORUM

More => Old Versions => JRiver Media Center 21 for Linux => Topic started by: Awesome Donkey on February 03, 2016, 01:56:29 pm

Title: [Request] Use the existing image and video folders in HOME directory
Post by: Awesome Donkey on February 03, 2016, 01:56:29 pm
Currently MC will create folders for images and videos in the HOME directory, named Images and Video. This is not an issue for music, as MC will use the existing Music folder.

The problem with this is, on the distros I've used there exists already directories for images and videos, named Pictures and Videos.

Here's a screenshot: http://i.imgur.com/EWvSXyc.png

This is my request: Detect whether existing folders for Pictures and Videos exist and if so, use them. If they don't exist, create Images and Video.
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: bob on February 04, 2016, 11:26:54 am
Currently MC will create folders for images and videos in the HOME directory, named Images and Video. This is not an issue for music, as MC will use the existing Music folder.

The problem with this is, on the distros I've used there exists already directories for images and videos, named Pictures and Videos.

Here's a screenshot: http://i.imgur.com/EWvSXyc.png

This is my request: Detect whether existing folders for Pictures and Videos exist and if so, use them. If they don't exist, create Images and Video.
Likely a good idea though I don't think those directory names are standardized. Isn't that desktop specific?
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: Awesome Donkey on February 04, 2016, 12:00:47 pm
They *shouldn't* be, since I can install multiple DMs and they seem to use the same directories in HOME.
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: mwillems on February 09, 2016, 08:47:59 am
The "special" directories typically use the same nomenclature in the big DEs (Gnome, Unity, XFCE, and I think KDE), but the reason that's the case is that there is a more or less standard way of registering the "special" directories in the user configuration files using the xdg spec:

See https://wiki.archlinux.org/index.php/Xdg_user_directories and https://freedesktop.org/wiki/Software/xdg-user-dirs/

Gnome, Cinnamon, XFCE, and KDE (to my knowledge) just query the xdg config files and use what's there for system operations.  I know this for a fact with Gnome and XFCE, because I had to recreate the directories on a few systems after an accident. Just creating a directory with the proper name won't get a DE to treat the directories as "special" (i.e. save appropriate files there by default, index them, etc.), they need to be specified in the xdg config file in order to receive special treatment.

So it seems like having JRiver read the xdg config files (where available) and using those directories would be the standards-compliant way to do it, and would catch the majority of desktop environments.  It would also handle corner cases where the directory names differ from the defaults for whatever reason (distro customization or user manual config changes).  Xdg even supplies a utility to handle the queries (detailed in the arch wiki link above).  Xdg is also how most DEs auto-handle localization for those directories, so it would be a potential labor saver for JRiver as well (no need to translate the directory names, etc.).
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: geier22 on February 11, 2016, 09:31:45 pm
i agree with the request of Awesome Donkey. The name of the directory is also dependent on the localization. All distros place by default in German following directories:

My /home/hans/.config/user-dirs.dirs:

Code: [Select]
XDG_DESKTOP_DIR = "$ HOME / desk"
XDG_DOWNLOAD_DIR = "$ HOME / Downloads"
XDG_TEMPLATES_DIR = "$ HOME / Templates"
XDG_PUBLICSHARE_DIR = "$ HOME / Public"
XDG_DOCUMENTS_DIR = "$ HOME / Documents"
XDG_MUSIC_DIR = "$ HOME / Music"
XDG_PICTURES_DIR = "$ HOME / Images"
XDG_VIDEOS_DIR = "$ HOME / videos" [/ code]
This has the consequence that also the Music folder is duplicated as Music of JRiver.
so i have following JRiver - directories:

/ Home / hans / Documents besides / home / hans / Documents
/ Home / hans / video next to / home / hans / Videos
/ Home / hans / Music besides / home / hans / Music
/ Home / hans / Images next / home / hans / Images
Google Übersetzer für Unternehmen:Translator ToolkitWebsite-Übersetzergoogle
Sofortübersetzung deaktivierenÜber Google ÜbersetzerMobilCommunityDatenschutzerklärung & NutzungsbedingungenHilfeFeedback geben

upppss-  I see now that I have made a mistake during the copy and paste. correct is:
Code: [Select]
XDG_DESKTOP_DIR="$HOME/Schreibtisch"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Vorlagen"
XDG_PUBLICSHARE_DIR="$HOME/Öffentlich"
XDG_DOCUMENTS_DIR="$HOME/Dokumente"
XDG_MUSIC_DIR="$HOME/Musik"
XDG_PICTURES_DIR="$HOME/Bilder"
XDG_VIDEOS_DIR="$HOME/Videos"

/ home / hans / Dokumente       besides  / home / hans / Documents
/ home / hans / Videos               besides  / home / hans / Video
/ home / hans / Musik                 besides  / home / hans / Music
/ home / hans / Bilder                 besides  / home / hans / Images
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: bob on February 12, 2016, 10:06:02 am
Seems like it would be enough to simply read the XDG environment variables and use those unless they are undefined.
Title: Re: [Request] Use the existing image and video folders in HOME directory
Post by: mwillems on February 12, 2016, 10:41:23 am
Seems like it would be enough to simply read the XDG environment variables and use those unless they are undefined.


If by "read the XDG environment variables" you mean calling xdg-user-dir, that would work, but just looking for conventional shell environment variables likely would not.  My default "env" doesn't include all the XDG directories on every DE so trying to pluck them out of the default shell environment would not work for many cases. However, xdg-user-dir always returns the correct answers when called.  I just wanted to be sure, because the shell environment does sometimes get the XDG directories exported to it, but not reliably.