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

Folder/path flexibility through env vars and better default root path. #265

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

frosit
Copy link
Collaborator

@frosit frosit commented Nov 2, 2023

Implemented more flexibility in changing the root directory for PlexRipper.

By default, Plexripper placed it's directories directly under /.
This PR has the following logic.

  • If PLEXRIPPER_ROOT_DIR env variable is set, use that as the path for the root direcotry, do not append the default subdir
  • if we can detect a user Home directory from env variables, use the home directory/subdir as root dir.
  • by default it still falls back to / but the default subdir is appended so we get /PlexRipper/Movies.

This goes for Linux/OSX but should also be implemented for Windows, with maybe different logic.

The default subdirectory I added is to ensure we don't automatically spread our folders in other directories, but rather stay together unless otherwise defined. This is a experimental PR which is not finished or properly tested yet.

src/Environment/PathProvider.cs Outdated Show resolved Hide resolved
src/Environment/PathProvider.cs Show resolved Hide resolved
src/Environment/Extensions/EnvironmentExtensions.cs Outdated Show resolved Hide resolved
@JasonLandbridge
Copy link
Collaborator

Just to add something I just thought off: In src/Data/PlexRipperDBContextSeed.cs we seed the database with the default folder paths based on what is set in the PathProvider, which is then used to set up the database.

The rough boot order:

  1. Set up SQLite database in /Config
  2. Set up Autofac for dependency injection
  3. Start background process scheduler
  4. Set up settings.json for user settings in the application
  5. Done

Only PlexRipper first creates the database (1), at the assumed location /Config but this can now change depending on where PlexRipper is running. So the database creation needs to wait on step 2. Which I think is more logical, only I remember doing this because I needed to guarantee that the database is created before anything else.

But I don't remember why that had to happen -_-"

Could the following work:
All binds are always done in /mnt/ in the docker container.
So config becomes /mnt/Config, default downloads become /mnt/Downloads etc? Then the user has to map those binds to a directory on their file system.

frosit and others added 3 commits April 6, 2024 14:58
@JasonLandbridge
Copy link
Collaborator

So this is how I have configured it now:

  1. On Linux, no env PLEXRIPPER_ROOT_PATH set:

image

  1. On Windows, no env PLEXRIPPER_ROOT_PATH set:

It should be C:\Users\[YourUserName]\AppData\Roaming\PlexRipper\

  1. On Linux with env PLEXRIPPER_ROOT_PATH set to /mnt/DATA/PlexRipperCache/:

image

The sub-folder will not be appended in the case of PLEXRIPPER_ROOT_PATH being set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants