Giter Club home page Giter Club logo

vlg's Introduction

vlg

Plex Virtual Library Builder

VLG is built using Go, so you will need to install Go to get started. Go is very easy to use and get started with.

Config

vlg.json

{
    "hostname": "http://PLEX__HOST",
    "port": 32400,
    "plextoken": "YOUR__PLEX__TOKEN",
    "sections": [
        {
            "_id": "1",
            "name": "Movies",
            "virtuallibpath": "PATH__TO__VIRTUAL__LIBRARY__ROOT__PATH",
            "virtuallibpoolroot": "PATH__TO__POOLED__VIRTUAL__LIBRARY__ROOT",
            "virtuallibpool": [
                "POOLED__DRIVE__1", 
                "POOLED__DRIVE__2"
            ]
        }
    ]
}

Where:
PLEX__HOST = the host name of your Plex Server (http://localhost)
YOUR__PLEX__TOKEN = your Plex Api Token

VLG supports two types of Virtual Libraries:

  • Where the main library and the virtual library are on the same disk or filesystem
  • Where the main library and the virtual library are part of a Pool like Stablebit Drive Pool

PATH__TO__VIRTUAL__LIBRARY__ROOT__PATH would be the path on the disk to where you want your virtual library to reside. (Z:\Media\VirtualLib\)

If your main library and virtual library are part of a pool like Stablebit Drive Pool use these variables:
PATH__TO__POOLED__VIRTUAL__LIBRARY__ROOT would be the root drive for the pool (Z:)
POOLED_DRIVE__1 would be the first drive in the pool (D:\PoolPart.2807d48d-46e3-450a-8f23-6f32328a9cd1)
POOLED_DRIVE__2 would be the second drive in the pool (E:\PoolPart.2807d48d-46e3-450a-8f23-6f32328a9cd1)

You can have as many pooled drives as you would like but it is best to have a mapping for each drive in the pool. If not, sometimes the folder will appear empty and Plex wont be able to import the media.

Now, keep in mind when using the Stablebit Drive Pool, you only need to include the roots to the pool and NOT the paths to where the media actually lives. VLG will extract the paths from what Plex provides and generate virtual paths and build the symlinks needed for Plex.

How to add media to Virtual Libraries

Adding media to virtual libraries is very easy and media can be in as many or as few virtual libraries as you want.

In order to add a title to a virtual library:

  • Open plex and find the title you would like to add to a virtual library. Plex Title Screen

  • Click the Edit button (looks like a pencil) Plex Edit Screen

  • Click the Tags tab.

  • Add a virtual library tag to the Collections area near the bottom. VLG looks for VL- tags (VL-Kids, VL-StandUp, VL-Christmas) VLG supports having titles in multiple virtual libraries. So having VL-Kids VL-Animation on Big Buck Bunny would include it in the Kids and Animation virtual libraries.

  • Click SAVE CHANGES

Run VLG

I prefer to have VLG nightly because I dont frequently make changes but you could easily have it set to run hourly or more. It's up to you to decide based on your needs.

On windows you can have VLG run using a scheduled task using Start > Task Scheduler
On linux you can have VLG run using cron

Just make sure the vlg.json file is able to be found when running vlg using automation.

Adding your Virtual Libraries to Plex

VLG works just like a normal folder on your OS by creating Virtual Libraries within the PATH__TO__VIRTUAL__LIBRARY__ROOT__PATH based on the VL- tags it finds.

For example a virtual library tag of VL-Kids and PATH__TO__VIRTUAL__LIBRARY__ROOT__PATH set as Z:\Media\VirtualLib would create a virtual library root folder Z:\Media\VirtualLib\Kids

Within Plex you only need to add your new virtual library by added it like you would any other folder containing media. You DO NOT need to have every virtual library added to Plex. This is useful for seasonal or event based libraries where having a Halloween virtual library visible only during the Halloween season is as easy as adding the library and sharing it with your users as needed.

vlg's People

Contributors

jayrox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vlg's Issues

Support for multiple mounted drives

Hi,

My request is as follow:
Support for multiple drives in Linux / BSD. The drives are a part of two different pools, but mounted on two different folders. So that would create the following setup of folders:

/media/movies
/mnt/movies

In Plex both folders is added to the library. Since hard link across devices it not possible, it's not possible to have one folder where these pool symlinks to.

Maybe it can be solved with variables?
Example vlg.sjon:

{
        "hostname": "http://localhost",
        "port": 32400,
        "plextoken": "xxxxxxxxxxxx",
        "sections": [
                {
                        "_id": "1",
                        "name": "Movies",
                        "virtuallibpath": "$devicepath/plexvlg",
                        "virtuallibpoolroot": "$devicepath",
                        "virtuallibpool": [
                                "/media/movies/",
				"/mnt/movies"
                        ]
                }
        ]
}

where variable $devicepath would be pulled from Plex and it contains which root folder the media is stored, can be pulled by perfoming GET request again /library/sections and reading Location from the XML.

Not working

This is not working out of the box...
Using FreeBSD. Installed GO then:

go build .
./vlg

No virtual libs created. After hours of debugging, the script is not picking up my paths for the media.
I have two folders for one media section, script is only picking up one, example from the XML-output:

$ curl http://localhost:32400/library/sections/?X-Plex-Token=xxxxx
[...]
<Directory allowSync="1" art="/:/resources/movie-fanart.jpg" composite="/library/sections/1/composite/xxx" filters="1" refreshing="0" thumb="/:/resources/movie.png" key="1" type="movie" title="Movies" agent="com.plexapp.agents.imdb" scanner="Plex Movie Scanner" language="no" uuid="76b7ec35-07bc-433e-ad06-27c1bc131024" updatedAt="1231231212" createdAt="1231231212">
<Location id="1" path="/media/movies" />
<Location id="16" path="/mnt/movies" />
</Directory>
[...]

what the script sees then is:
[{Title:Movies Path:/mnt/movies ID:16 VirtualLibPath:/media/plexvlg/}]

Please investigate and maybe write a how-to use this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.