INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [Request] Use the existing image and video folders in HOME directory  (Read 3986 times)

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7367
  • The color of Spring...

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.
Logged
I don't work for JRiver... I help keep the forums safe from Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | Topping D50s DAC | Edifier R2000DB Bookshelf Speakers

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13487
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #1 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?
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7367
  • The color of Spring...
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #2 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.
Logged
I don't work for JRiver... I help keep the forums safe from Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | Topping D50s DAC | Edifier R2000DB Bookshelf Speakers

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5174
  • "Linux Merit Badge" Recipient
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #3 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.).
Logged

geier22

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 418
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #4 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
Logged
Debian Testing x64 (multiarch) Xfce
TEAC UD-H01 - Yamaha A-S1000 /
Midrange- Studiomonitore by FÖÖN
AsRock Z390 Extreme4- Intel Core i9 9900/ 32 GB Ram

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13487
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #5 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.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5174
  • "Linux Merit Badge" Recipient
Re: [Request] Use the existing image and video folders in HOME directory
« Reply #6 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.
Logged
Pages: [1]   Go Up