Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include/exclude directories based on file presence - workaround for multiple directories per library #996

Closed
alxbelu opened this issue May 13, 2024 · 2 comments

Comments

@alxbelu
Copy link

alxbelu commented May 13, 2024

Is your feature request related to a problem? Please describe.
I'd like to group libraries/add multiple directories to one library, both in order to not need duplicate plugin stacks as well as not having to mess with the underlying file-structure, which for all other purposes than tdarr, suits my current needs.

Describe the solution you'd like
Assuming it's still not possible to implement #217, I'd suggest adding config variables to libraries for an "include file" and "exclude file", acting as the first filter during scanning, the presence of either file dictates if the library should process the directory (and any subdirectories).

Describe alternatives you've considered

  • Moving massive amounts of data to a file structure that appeases tdarr, but conflicts with other services and use
  • Scanner settings "File paths containing entered values will be ignored"; requires the value to be present in the path for each media file, rather than co-exist in the same directory.
  • Adding multiple directories to a library, as suggested in [Feature request] Multiple Folders per Library #217
  • Suggesting a "library group" feature in tdarr, where one could add multiple libraries, which would then copy all settings besides the directory path, but this seems to just build more code on a foundation that's not ideal, besides presumably needing much more code and logic compared to another filter for the scanner.

Additional context
As an example:
Libraries:

  1. hevc-tv: directory=/media/tv, include-file=".tdarr-hevc", exclude-file=".tdarr-ignore"
  2. h264-tv: directory=/media/tv, exclude-file=".tdarr-*"

/media/tv/some.show/ contains a file named ".tdarr-hevc" as well as media files/directories
/media/tv/another.show/ only contains media files/directories
/media/tv/fancy.show/ contains a file named ".tdarr-ignore" as well as media files/directories

The presence of ".tdarr-hevc" in /media/tv/some.show/ would cause the library "hevc-tv" to process it, and consequently would add any files found in that directory and its subdirectories to the queue (as per other library filters), however it would not process /media/tv/another.show/ as there was no ".tdarr-hevc" file present in that directory.

Conversely, the library "h264-tv" would not process /media/tv/some.show/ since it was configured to exclude directories containing ".tdarr-*", but it would process /media/tv/another.show/.

Neither library would process /media/tv/fancy.show/ since both are configured to exclude directories containing ".tdarr-ignore".

Besides essentially allowing multiple directories for each library, this also allows us to exclude specific folders one might wish to keep intact (for e.g. favourite content/etc).

Ultimately, I'd still prefer the #217 route, as that'd allow all configuration to happen directly in tdarr and it'd be much less finicky to remember to add include/excludes to libraries as well as to put the actual files in respective folders, still though, I'd be quite happy with this finicky approach compared to the current lack of any option.

@HaveAGitGat
Copy link
Owner

Have you tried using a flow? You can re-use the same flow across all libraries and using Check File Name Includes you can use regex to ignore or include files in a flow route. Could also add a flow plugin that checks the current dir for .tdarr-ignore or whatever else you're after.

@HaveAGitGat
Copy link
Owner

Scanner settings "File paths containing entered values will be ignored"; requires the value to be present in the path for each media file, rather than co-exist in the same directory.

Not sure what you meant by that but you can put the directory paths that you'd like to ignore. You don't need to put the full path for each file.
image

Between that and flow plugins it's possible to do everything in terms of excluding folder and files and the flow plugins can be edited/customised to do anything you're after. I suppose a question would be what's the reason for excluding a file/folder? If it's due to the files being in a certain resolution or codec etc then there are also flow plugins to check that and not process the file. So I think everything is covered for now without implementing #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants