Nextcloud photos directory doesn't change

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 27.0.1 LSIO image
Operating system and version (eg, Ubuntu 20.04): Unraid 6.12.3
Apache or nginx version (eg, Apache 2.4.25): NPM v2.10.4
PHP version (eg, 7.4): 8.2.8

The issue you are facing:

Why I’m seeing media(photos and videos) that is not part of the “Photos directory” that I declared? For example here, I’m seeing other media outside of this /Pictures folder in the Photos app. Even if I change the directory, it doesn’t change.

Is this the first time you’ve seen this error? (Y/N): N

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'Redis',
    'port' => 6379,
    'timeout' => 0.0,
  ),
  'datadirectory' => '/data',
  'instanceid' => 'REMOVED',
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' => 
  array (
    0 => 'REMOVED',
    1 => 'REMOVED',
    2 => 'REMOVED',
  ),
  'dbtype' => 'pgsql',
  'version' => '27.0.1.2',
  'overwrite.cli.url' => 'REMOVED',
  'dbname' => 'REMOVED',
  'dbhost' => 'postgresql',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'REMOVED',
  'dbpassword' => 'REMOVED',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'REMOVED',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'REMOVED',
  'mail_smtppassword' => 'REMOVED',
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\Imaginary',
    1 => 'OC\\Preview\\Movie',
    2 => 'OC\\Preview\\MP3',
    3 => 'OC\\Preview\\MP4',
    4 => 'OC\\Preview\\TXT',
    5 => 'OC\\Preview\\MarkDown',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\HEIC',
    8 => 'OC\\Preview\\TIFF',
    9 => 'OC\\Preview\\MKV',
    10 => 'OC\\Preview\\AVI',
  ),
  'preview_imaginary_url' => 'http://imaginary:9000',
  'default_phone_region' => 'REMOVED',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'loglevel' => 0,
  'memories.ffmpeg_path' => '/usr/bin/ffmpeg',
  'memories.ffprobe_path' => '/usr/bin/ffprobe',
  'memories.transcoder' => '/config/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64',
  'memories.no_transcode' => false,
  'memories.qsv' => true,
  'memories.exiftool' => '/config/www/nextcloud/apps/memories/exiftool-bin/exiftool-amd64-musl',
  'maintenance' => false,
  'memories.vod.path' => '/config/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.vod.disable' => false,
  'memories.vod.vaapi' => true,
  'theme' => '',
  'memories.gis_type' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'memories',
    1 => 'ransomware_protection',
    2 => 'metadata',
  ),
);

Got help from @pagdot from Linuxserver discord channel and here’s the solution in case someone was having the same problem.

Solution:

  1. You need to create a file and save it as .nomedia and add it to the folder you want to exclude.
  2. rescan library “occ files:scan --all”

Reference => Photos - Can I exclude folders?