masonr / PLEXiDRIVE

Scripts to facilitate the use of cloud storage (such as Google Drive) as storage for Plex media server
MIT License
147 stars 19 forks source link

Allow Multiple Libraries per Media Collection Type #5

Open masonr opened 7 years ago

masonr commented 7 years ago

Allow multiple libraries for each type (TV Show & Movies).

Would need to define the lib type (tv shows vs movies) and each would need their own local path on the filesystem before being uploaded to keep track of what library to scan afterwards.

masonr commented 7 years ago

I think this would introduce a lot of unneeded complexity. Putting this one on hold unless requested by multiple individuals.

sinfuljosh commented 6 years ago

I think this could be done by adding one extra variable to specify the Folder Name to be used. And an array option specifying what is "Movies" and what is "TV Shows"

movie_libraries="movies|3dmovies" tvshow_libraries="tvshows|kidshows"

and the variables needed for each one would be one additional. local_LIBRARY_path= plex_LIBRARY_path= plex_LIBRARY_section= plex_LIBRARY_folder=

Alternatively the last one can have a fallback in the event that someone does not add the folder name they want to use, it could take the last directory in the local path and apply that as the plex folder.

In the upload scripts you get the list of libraries from the first variable i listed. You wrap the existing code into a loop that runs for each of the libraries. it uses the library string to pull the conf values and you replace the hard coded 'Movies' and "TV Shows' with variables that can be defined at the start of the loop.

Will do some trial and error and see what i can do to expand on this. But seems doable without alot of reworking. just a little wrapping of existing script.

masonr commented 6 years ago

@sinfuljosh - agreed that the extra variables would be necessary to achieve this. I think the main reason I didn't pursue this was an assumption that most people aren't using multiple different libraries (perhaps that was a faulty assumption). And thus didn't want to commit the extra time into adding the functionality.

But if it's useful to you and you are able to take a stab at it, then I definitely encourage you to do so. Please let me know what progress you make.

sinfuljosh commented 6 years ago

Havn't had a chance to fully focus on this. But I was able to make use of your script as a means to upload newly acquired content to my google drive (without the mounted setup). But I was able to make use of your script (minus the mounting of cloud storage) to automate the copying of newly acquired content directly to my google drive to be used in my cloud based plex server.

I did have to make a few changes to make it work with OSX (the version of find in OSX is a little different).

I also modified your script so that it doesnt use the video file name without the extension as the directory name. Instead it actually reads the existing directory path and recreates it on google drive when copying via rclone.

My ultimate goal is to wrap it into a way that it can be the last step once sonarr/radarr completes their tasks and the script can begin to copy it to google drive for a redundant sister plex server setup.

Hoping to work on it more soon. But looks promising. :)

masonr commented 6 years ago

@sinfuljosh - No worries, glad the scripts have been helpful :)

I also modified your script so that it doesnt use the video file name without the extension as the directory name. Instead it actually reads the existing directory path and recreates it on google drive when copying via rclone.

This is in reference to the upload-movies.sh script? Yeah, I did that because half the time when I download movies it creates a folder for them and the other half I'm downloading manually so the media file ends up at the top level "movies" directory. To limit the number of Plex scans, I create the movie's folder (filename-extension) if it's not there on the cloud account so just that folder can be scanned instead of the entire movies directory. If you always use a auto-downloader that organizes it for you, then you probably wouldn't run into this issue.