-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Stex/release/0.1.1
Release/0.1.1
- Loading branch information
Showing
7 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
## [0.1.1] - 2020-07-28 | ||
|
||
### Changed | ||
|
||
* Removed zeitwerk (there weren't really enough files to even consider it necessary) | ||
* Fixed gem executable | ||
|
||
## [0.1.0] - 2020-07-28 | ||
|
||
Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# PlexSymlinker | ||
|
||
This gem allows creating a Plex-friendly folder structure with symlinks for your audio books. | ||
All you need are audio files with correct tagging, the gem takes care of making Plex understand them without you having to change the way you're organising your files. | ||
|
||
**The Problem** | ||
|
||
Most of my audio files are in apple's m4b format, leaving me with one file per book most of the times: | ||
|
||
📁 audiobooks | ||
∟ 📁 author name | ||
∟ book1.m4b | ||
∟ book2.m4b | ||
|
||
The problem with this structure is that Plex' music agent doesn't quite understand it. | ||
Even though the files are properly tagged with author, album, etc., Plex tends to create a giant album out of all the files inside - often with the first audio book as album name. | ||
|
||
What the Plex music agent expects is a structure like this: | ||
|
||
📁 audiobooks | ||
∟ 📁 author name | ||
∟ 📁 Book 1 | ||
∟ book1.m4b | ||
∟ 📁 Book 2 | ||
∟ book2.m4b | ||
|
||
This would mean that I'd have to introduce single-file-directories into my structure which didn't really make sense for me - especially as I have a lot of "Hörspiele" (mostly german format of short audio books with multiple actors + music). | ||
|
||
**This gem's solution** | ||
|
||
PlexSymlinker creates symlinks pointing to your actual audio files in exactly the | ||
structure Plex' music agent expects to find. It uses the embedded tags in your files to build it, | ||
so even one big directory with all your audio files in it would work as expected. | ||
|
||
Just point plex to the symlink directory instead of your actual files and you're good to go. | ||
|
||
## Usage | ||
|
||
Since the whole purpose of PlexSymlinker is to read a directory full of audio files and | ||
fill another directory with symlinks, we have to make sure the docker container has access to both of them. | ||
|
||
When using the docker image, the audio files directory is expected to be mounted | ||
as `/app/source` and the directory the symlinks should be placed in as `/app/target`. | ||
|
||
💡 You also have to pass in the `SYMLINK_TARGET_DIR` environment variable. | ||
Since the gem only sees `/app/source` inside the docker container, | ||
it would point all symlinks there instead of the actual directory on your host machine. | ||
Just set it to the same directory that you mounted as `/app/source`. | ||
|
||
### 0. Make sure your files are properly tagged! | ||
|
||
At least the album and album artist fields have to set accordingly. | ||
|
||
But since you are planning to import those files into Plex which needs a lot more information, | ||
it would make sense to fill out all details you can provide. | ||
|
||
### 1. Create the directory the symlinks should be placed in (if it doesn't exist yet) | ||
|
||
It's important that the directory exists (owned by your current user) before you mount it. | ||
|
||
mkdir -p /path/to/symlink/dir | ||
|
||
If you ran PlexSymlinker before, you can just re-run it on the same directory again. | ||
It will automatically sync the symlinks against the actual files. | ||
|
||
### 2. Run the docker image | ||
|
||
#### MacOS | ||
|
||
docker run -it --rm -v /path/to/audiobooks:/app/source:ro -v /path/to/symlink/dir:/app/target --env SYMLINK_TARGET_DIR=/path/to/audiobooks sterexx/plex_symlinker | ||
|
||
#### Linux | ||
|
||
💡 Under Linux, you have to make sure to set your current user/group id | ||
with `--user "$(id -u):$(id -g)"` - otherwise, all the generated symlinks/directories | ||
will be owned by the root user. Docker for mac/windows takes care of that for you automatically. | ||
|
||
docker run -it --user "$(id -u):$(id -g)" --rm -v /path/to/audiobooks:/app/source:ro -v /path/to/symlink/dir:/app/target --env SYMLINK_TARGET_DIR=/path/to/audiobooks sterexx/plex_symlinker | ||
|
||
### 3. Create a Plex library pointing to the symlink directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module PlexSymlinker | ||
VERSION = "0.1.0" | ||
VERSION = "0.1.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters