Cloudbox / autoscan

Autoscan replaces the default Plex and Emby behaviour for picking up changes on the file system.
MIT License
597 stars 49 forks source link

Multiple Paths for one trigger? #129

Closed rycore closed 2 years ago

rycore commented 2 years ago

In Sonarr I have path/AnimeTV, path/KidsTV and path/TV, because I like to keep these things seperate, with Autoscan I don't see anything in the documentation about whether or not we can add multiple paths, we can add multiple triggers, but not paths. Also can we add an anchor to more than one mount if we're not using UnionFS or MergerFS? If I have AnimeTV in one mount and TV/KidsTV in another mount?

Here's an example of how i think I can write this, but would greatly appreciate any help.

anchors:
  - /mnt/fusemount/Gdrive-Series/anchor.txt
  - /mnt/fusemount/Gdrive-AnimeTV/anchor.txt
  - /mnt/fusemount/Gdrive-Movies/anchor.txt

triggers:
  sonarr:
    - name: sonarr-docker # /triggers/sonarr-docker
      priority: 2

      # Rewrite the path from within the container
      # to your local filesystem.
      rewrite:
        - from: /mnt/fusemount/Gdrive-Series/TV/
          to: /mnt/fusemount/Gdrive-Series/TV/

        - from: /mnt/fusemount/Gdrive-Series/KidsTV/
          to: /mnt/fusemount/Gdrive-Series/KidsTV/

        - from: /mnt/fusemount/Gdrive-AnimeTV/
          to: /mnt/fusemount/Gdrive-AnimeTV/
edrock200 commented 2 years ago

Your thought is correct, but given that the paths are identical, you don't need any rewrite rules.

rycore commented 2 years ago

Your thought is correct, but given that the paths are identical, you don't need any rewrite rules.

Thanks for letting me know I was on the right track. I assume then I just do the following.

anchors:
  - /mnt/fusemount/Gdrive-Series/anchor.txt
  - /mnt/fusemount/Gdrive-AnimeTV/anchor.txt
  - /mnt/fusemount/Gdrive-Movies/anchor.txt

triggers:
  sonarr:
    - name: sonarr-docker # /triggers/sonarr-docker
      priority: 2

      # Rewrite the path from within the container
      # to your local filesystem.
      paths:
        - path: /mnt/fusemount/Gdrive-Series/TV/
        - path: /mnt/fusemount/Gdrive-Series/KidsTV/
        - path: /mnt/fusemount/Gdrive-AnimeTV/

Or is it possible to just run path: /mnt/fusemount/Gdrive-Series/ for both TV and KidsTV?

m-rots commented 2 years ago
anchors:
  - /mnt/fusemount/Gdrive-Series/anchor.txt
  - /mnt/fusemount/Gdrive-AnimeTV/anchor.txt
  - /mnt/fusemount/Gdrive-Movies/anchor.txt

triggers:
  sonarr:
    - name: sonarr-docker # /triggers/sonarr-docker
      priority: 2

As @edrock200 mentioned, you do not need any rewrite rules. So the above config is all you need for the sonarr trigger.

I assume the three paths are scannable by Plex directly and thus do not need to be converted. Otherwise I'd suggest you to read the basics of path rewriting first as it would be possible to rewrite /mnt/fusemount/ to anything else.