plex_symlinker 0.1.0 β†’ 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2451ea81acfe07abdde34f95d0d4f8170254d2caf711b7de8c6350ee42e331ea
4
- data.tar.gz: a36385ba8fb204f8d1f1ee742318e9fa1b9eeb8485833b389c6adffe676a03d3
3
+ metadata.gz: d23ef490e9f660776bb21694e736334eb08305d14860ec61fc31332f59d63b05
4
+ data.tar.gz: 37f932ab2732e8aa656fc0044dae683459f5ae462d1e4f6bc8c6a9d6e21ac527
5
5
  SHA512:
6
- metadata.gz: 314f13fbd52f6923991d91e5637484ab771a5ad9abc4a5bb2a5ceb802c8132ab76dd25414c5ea34927ac6d0ba718520077199032ad801d31e9fb0087411fee01
7
- data.tar.gz: 49b3fb4632f59cbef70171e512f589312933bce9ab822b33d12a850ba44673274598addbd86786721633f3f97d57fadbfcf1fa6f78c50a07d0a03ee12a617087
6
+ metadata.gz: 0ccd7fed691c3407eb6d51a3484d261fc69ece2b21cc9cf9a4146a918498d638e63bfd77ab689ecaeb180c892bbbcca93ef82181942c34183548119c0f7c8995
7
+ data.tar.gz: e93bb0c59dd110a6f8d94caab77fc45990dba7efac8494227effb205b76877f95c22cac0dc783d3df964781b412a4d30d88140c7667fc8d2ed0ab7a212092f67
data/.gitignore CHANGED
@@ -8,5 +8,7 @@
8
8
  /tmp/
9
9
  /spec/tmp/
10
10
 
11
+ *.gem
12
+
11
13
  # rspec failure tracking
12
14
  .rspec_status
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## [0.1.1] - 2020-07-28
4
+
5
+ ### Changed
6
+
7
+ * Removed zeitwerk (there weren't really enough files to even consider it necessary)
8
+ * Fixed gem executable
9
+
10
+ ## [0.1.0] - 2020-07-28
11
+
12
+ Initial Release
@@ -1,12 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plex_symlinker (0.1.0)
4
+ plex_symlinker (0.1.1)
5
5
  activesupport (~> 6.0)
6
6
  ruby-progressbar (~> 1.10)
7
7
  slop (~> 4.8)
8
8
  taglib-ruby (~> 1.0)
9
- zeitwerk (~> 2.4)
10
9
 
11
10
  GEM
12
11
  remote: https://rubygems.org/
@@ -0,0 +1,80 @@
1
+ # PlexSymlinker
2
+
3
+ This gem allows creating a Plex-friendly folder structure with symlinks for your audio books.
4
+ 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.
5
+
6
+ **The Problem**
7
+
8
+ Most of my audio files are in apple's m4b format, leaving me with one file per book most of the times:
9
+
10
+ πŸ“ audiobooks
11
+ ∟ πŸ“ author name
12
+ ∟ book1.m4b
13
+ ∟ book2.m4b
14
+
15
+ The problem with this structure is that Plex' music agent doesn't quite understand it.
16
+ 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.
17
+
18
+ What the Plex music agent expects is a structure like this:
19
+
20
+ πŸ“ audiobooks
21
+ ∟ πŸ“ author name
22
+ ∟ πŸ“ Book 1
23
+ ∟ book1.m4b
24
+ ∟ πŸ“ Book 2
25
+ ∟ book2.m4b
26
+
27
+ 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).
28
+
29
+ **This gem's solution**
30
+
31
+ PlexSymlinker creates symlinks pointing to your actual audio files in exactly the
32
+ structure Plex' music agent expects to find. It uses the embedded tags in your files to build it,
33
+ so even one big directory with all your audio files in it would work as expected.
34
+
35
+ Just point plex to the symlink directory instead of your actual files and you're good to go.
36
+
37
+ ## Usage
38
+
39
+ Since the whole purpose of PlexSymlinker is to read a directory full of audio files and
40
+ fill another directory with symlinks, we have to make sure the docker container has access to both of them.
41
+
42
+ When using the docker image, the audio files directory is expected to be mounted
43
+ as `/app/source` and the directory the symlinks should be placed in as `/app/target`.
44
+
45
+ πŸ’‘ You also have to pass in the `SYMLINK_TARGET_DIR` environment variable.
46
+ Since the gem only sees `/app/source` inside the docker container,
47
+ it would point all symlinks there instead of the actual directory on your host machine.
48
+ Just set it to the same directory that you mounted as `/app/source`.
49
+
50
+ ### 0. Make sure your files are properly tagged!
51
+
52
+ At least the album and album artist fields have to set accordingly.
53
+
54
+ But since you are planning to import those files into Plex which needs a lot more information,
55
+ it would make sense to fill out all details you can provide.
56
+
57
+ ### 1. Create the directory the symlinks should be placed in (if it doesn't exist yet)
58
+
59
+ It's important that the directory exists (owned by your current user) before you mount it.
60
+
61
+ mkdir -p /path/to/symlink/dir
62
+
63
+ If you ran PlexSymlinker before, you can just re-run it on the same directory again.
64
+ It will automatically sync the symlinks against the actual files.
65
+
66
+ ### 2. Run the docker image
67
+
68
+ #### MacOS
69
+
70
+ 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
71
+
72
+ #### Linux
73
+
74
+ πŸ’‘ Under Linux, you have to make sure to set your current user/group id
75
+ with `--user "$(id -u):$(id -g)"` - otherwise, all the generated symlinks/directories
76
+ will be owned by the root user. Docker for mac/windows takes care of that for you automatically.
77
+
78
+ 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
79
+
80
+ ### 3. Create a Plex library pointing to the symlink directory
data/README.md CHANGED
@@ -59,6 +59,24 @@ all necessary dependencies and can be used out-of-the-box by mounting the necess
59
59
 
60
60
  ### Using the gem executable
61
61
 
62
+ #### 0. Make sure your files are properly tagged!
63
+
64
+ At least the `album` and `album artist` fields have to set accordingly.
65
+
66
+ But since you are planning to import those files into Plex which needs a lot more information,
67
+ it would make sense to fill out all details you can provide.
68
+
69
+ #### 1. Run the gem executable with source and target directory
70
+
71
+ ```bash
72
+ plex_symlinker /path/to/audiobooks /path/to/symlinks
73
+ ```
74
+
75
+ πŸ’‘ If you ran PlexSymlinker before, you can just re-run it on the same directory again.
76
+ It will automatically sync the symlinks against the actual files and even delete no longer existing files.
77
+
78
+ #### 2. Create a Plex library pointing to the symlink directory
79
+
62
80
  ### Using the Docker image
63
81
 
64
82
  Please refer to [Docker Hub](https://hub.docker.com/r/sterexx/plex_symlinker) for instructions
@@ -4,11 +4,13 @@ require "active_support/all"
4
4
  require "pathname"
5
5
  require "ruby-progressbar"
6
6
  require "taglib"
7
- require "zeitwerk"
8
7
 
9
- loader = Zeitwerk::Loader.for_gem
10
- loader.setup
11
- loader.eager_load
8
+ require "plex_symlinker/file_types/audio_file"
9
+ require "plex_symlinker/file_types/mp3"
10
+ require "plex_symlinker/file_types/mp4"
11
+ require "plex_symlinker/operation"
12
+ require "plex_symlinker/symlink"
13
+ require "plex_symlinker/version"
12
14
 
13
15
  module PlexSymlinker
14
16
  class Error < StandardError; end
@@ -1,3 +1,3 @@
1
1
  module PlexSymlinker
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
- spec.metadata["source_code_uri"] = "https://github.com/stex/plex_symlinker"
16
+ spec.metadata["source_code_uri"] = spec.homepage
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
19
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -28,5 +28,4 @@ Gem::Specification.new do |spec|
28
28
  spec.add_runtime_dependency "ruby-progressbar", "~> 1.10"
29
29
  spec.add_runtime_dependency "slop", "~> 4.8"
30
30
  spec.add_runtime_dependency "taglib-ruby", "~> 1.0"
31
- spec.add_runtime_dependency "zeitwerk", "~> 2.4"
32
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plex_symlinker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Exner
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
- - !ruby/object:Gem::Dependency
70
- name: zeitwerk
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '2.4'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '2.4'
83
69
  description: 'Create a plex music agent friendly symlink structure for your audiobook
84
70
  files. '
85
71
  email:
@@ -93,12 +79,14 @@ files:
93
79
  - ".rspec"
94
80
  - ".standard.yml"
95
81
  - ".travis.yml"
82
+ - CHANGELOG.md
96
83
  - CODE_OF_CONDUCT.md
97
84
  - Dockerfile
98
85
  - Dockerfile.dev
99
86
  - Gemfile
100
87
  - Gemfile.lock
101
88
  - LICENSE.txt
89
+ - README.dockerhub.md
102
90
  - README.md
103
91
  - Rakefile
104
92
  - bin/ci-build-dev