mandarons / icloud-docker

Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.
BSD 3-Clause "New" or "Revised" License
1.19k stars 49 forks source link

Filter out the "Shared Library" from photo sync #259

Closed nicx closed 2 months ago

nicx commented 2 months ago

I am running 4 instances of iCloud-docker, every instance stands for one family member. As of today I am syncing all photos of every family member. the regarding config is this:

photos:
  destination: "photos"
  remove_obsolete: true
  sync_interval: 14400
  filters:
    albums:
      #- "album1"
      #- "album2"
    file_sizes:
      - "original"
      # - "medium"
      # - "thumb"

Now I turned the feature "shared library" on and invited my family members to this library. With that change it seems that every photo in the shared library is synced with every instance of iCloud-docker.

My Question: Is it possible to filter out this shared library, but keep all other albums without specifying them explicitly? If yes, how?

Or in other words, what I want to achieve: I want to get synced all personal libraries of every family member with all albums, and I want to get synced the shared library with all albums only once.

mandarons commented 2 months ago

Yes. It is possible to filter out the shared library. Just add photos > filters > libraries > - PrimarySync in your config.yaml. This will only sync primary library and not shared library.

From README > Sample Configuration File:

filters:
# List of libraries to download. If omitted (default), photos from all libraries (own and shared) are downloaded. If included, photos only
# from the listed libraries are downloaded.
# libraries:
#   - PrimarySync # Name of the own library

# if all_albums is false - albums list is used as filter-in, if all_albums is true - albums list is used as filter-out
# if albums list is empty and all_albums is false download all photos to "all" folder. if empty and all_albums is true download all folders
albums:
nicx commented 2 months ago

@mandarons ok thanks. So I will add this option in the config of 3 family members and keep one config withour this option. With that I will get my wish :)

Is the option "all_albums" which I have not configured yet it any config helpful or disruptive in any case?

mandarons commented 2 months ago

It depends.

# if all_albums is false - albums list is used as filter-in, if all_albums is true - albums list is used as filter-out

It is just a different way of specifying filters. If current configuration is working for you, no need to change it.

nicx commented 2 months ago

@mandarons thanks. a last question: If I want to start from scrach because I want to change/use folder_format is it safe just to delete all downloaded photos, then update the config, and then icloud-docker would just redownload all photos again to the new folder structure?

mandarons commented 2 months ago

Yes. Deleting and starting over is okay except for one case - if you have remove_obsolete: false in your config.yaml. In your case, it is true. remove_obsolete flag tells the app whether to keep files available locally but removed on server, or not.