Issue with Photos Plugin and Samba Mount in NextCloud

Essentially every setting in the UI can be modified via occ.

This is useful whenever you have a problem with the UI (or just want to use the command-line to set or do something in Nextcloud such as if scripted a deployment).

In general you just need to determine whether a setting is:

  • system level
    • if so, use occ config:list system (for the most part)
  • app level system-wide
    • if so, use occ config:list <app>
  • user/account level
    • if so, use occ user:setting <account> <app>

So in this case, since this is an account level setting, we’ll need to use occ user:setting.

Viewing the current settings:

occ user:setting ACCOUNTNAME photos

Let’s say we want to modify this particular setting for the account ncuser:

www-data@ad627ff03e60:~/html$ ./occ user:setting ncuser photos
  - photos:
    - photosSourceFolders: ["/extLocalTmp"]
  - settings:
    - display_name: ncuser

The above shows the current settings for this account when using the photos app.

Now let’s look at how to change a setting.

Changing current settings

Most occ commands have help explanations of their options and occ user:settings is no different:

www-data@ad627ff03e60:~/html$ ./occ user:setting ncuser photos --help
Description:
  Read and modify user settings

Usage:
  user:setting [options] [--] <uid> [<app> [<key> [<value>]]]

Arguments:
  uid                                Account ID used to login
  app                                Restrict the settings to a given app [default: ""]
  key                                Setting key to set, get or delete [default: ""]
  value                              The new value of the setting

Let’s change the source folders for the Photos app (the topic of this thread) by adding the account’s /MyPhotos folder to the list:

www-data@ad627ff03e60:~/html$ ./occ user:setting ncuser photos photosSourceFolders '["/extLocalTmp", "/MyPhotos"]'
www-data@ad627ff03e60:~/html$ ./occ user:setting ncuser photos
  - photos:
    - photosSourceFolders: ["/extLocalTmp", "/MyPhotos"]
  - settings:
    - display_name: ncuser
www-data@ad627ff03e60:~/html$ 

Go visit the Photos app.

Done.

References: