aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiederick de Vries <diederick@diederickdevries.net>2018-06-14 19:16:22 +0200
committerDiederick de Vries <diederick@diederickdevries.net>2018-06-14 19:16:52 +0200
commit648b4e51d9380dbc4f3866d6fc1183dcc22d8036 (patch)
tree0878d57381bbee1fe6d8a64048e5f9b0eb26d7ab
parentb8815cab9df6cf7afe3ef503a11647adeab71560 (diff)
downloadaftercare-648b4e51d9380dbc4f3866d6fc1183dcc22d8036.tar.gz
aftercare-648b4e51d9380dbc4f3866d6fc1183dcc22d8036.tar.bz2
aftercare-648b4e51d9380dbc4f3866d6fc1183dcc22d8036.zip
Add example config
-rw-r--r--README.md32
-rw-r--r--aftercare.service2
-rw-r--r--example.conf13
3 files changed, 22 insertions, 25 deletions
diff --git a/README.md b/README.md
index 8a6147c..4c62e5b 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
1# Aftercare 1# Aftercare
2 2
3Aftercare is a somewhat naive media file post processing script in Groovy. Will move all series episodes under the input folder into neat per serie and per season directories under the output folder. It recognises episode files by their filename extension. The episodes will be renamed into the form 3Aftercare is a somewhat naive media file post processing script in Groovy. Will move all series episodes under the input folder into neat per serie and per season directories under the output folder. It recognises episode files by their filename extension. The episodes will be renamed into the form
4 4
5 Series Name - SxxExx.ext 5 Series Name - SxxExx.ext
6 6
7The media can be inside directories, but don't have to be. Afterwards these original directories and files will be moved to a done folder with their contents for you to inspect. When something fails, the failed original will me moved to the error folder. 7The media can be inside directories, but don't have to be. Afterwards these original directories and files will be moved to a done folder with their contents for you to inspect. When something fails, the failed original will me moved to the error folder.
8 8
9Naive in the sense that it expects original file names like these: 9Naive in the sense that it expects original file names like these:
10 10
@@ -12,7 +12,7 @@ Naive in the sense that it expects original file names like these:
12 12
13where the series title is everything before the season/episode numbers. The S and E can be lowecase as well, the s can be left out and the E can also be an uppercase or lowercase X. Any dots are replaced with spaces. Any apostrophes in the title are discarded. 13where the series title is everything before the season/episode numbers. The S and E can be lowecase as well, the s can be left out and the E can also be an uppercase or lowercase X. Any dots are replaced with spaces. Any apostrophes in the title are discarded.
14 14
15Put a file with, name it `property.conf` or something else descriptive, and configure which directories, user, group and unix rights should be used: 15Rename and change the file named `example.conf` and configure which directories, user, group and unix rights should be used:
16 16
17 output The directory under which your media renderer expects the media files. 17 output The directory under which your media renderer expects the media files.
18 input The directory where the originals are 18 input The directory where the originals are
@@ -22,35 +22,19 @@ Put a file with, name it `property.conf` or something else descriptive, and conf
22 user The unix user which will own the resulting media files 22 user The unix user which will own the resulting media files
23 group The unix group which will own the resulting media files 23 group The unix group which will own the resulting media files
24 chmod The unix rights (octal notation) which the resulting media files should have 24 chmod The unix rights (octal notation) which the resulting media files should have
25 25
26 dry_run Whether Aftercare should do a dry run 26 dry_run Whether Aftercare should do a dry run
27 27
28 allowed a list of allowed file types 28 allowed a list of allowed file types
29 nrs a regex matching with how the original filenames state their series and episode number. 29 nrs a regex matching with how the original filenames state their series and episode number.
30
31Example:
32
33 output = "TV"
34 input = "complete"
35 done = "done"
36 error = "error"
37
38 user = "diederick"
39 group = "video"
40 chmod = "644"
41
42 dry_run = false
43
44 allowed = ['mkv', 'mp4', 'mpg', 'avi']
45 nrs = "[Ss]?[0-9]{1,2}[EeXx][0-9]{1,2}"
46 30
47You can run the script manually (`sudo` to set the unix user, group and rights): 31You can run the script manually (`sudo` to set the unix user, group and rights):
48 32
49 $ sudo groovy aftercare.groovy property.conf 33 $ sudo groovy aftercare.groovy properties.conf
50 34
51but you shouldn't. The two `systemd` files will let you run the script automatically every hour. In `aftercare.service`, adapt the line starting with `ExecStart` to point it to where you install Aftercare. Put both files in `/etc/systemd/system/` and do: 35but you shouldn't. The two `systemd` files will let you run the script automatically every hour. In `aftercare.service`, adapt the line starting with `ExecStart` to point it to where you install Aftercare. Put both files in `/etc/systemd/system/` and do:
52 36
53 $ sudo systemctl start aftercare.timer 37 $ sudo systemctl start aftercare.timer
54 $ sudo systemctl enable aftercare.timer 38 $ sudo systemctl enable aftercare.timer
55 39
56If your system doesn't use `systemd`, you can trigger Aftercare with inotify(7) or a cron job. Don't forget to periodically clean the `done` and `error` directories. 40If your system doesn't use `systemd`, you can trigger Aftercare with inotify(7) or a cron job. Don't forget to periodically clean the `done` and `error` directories.
diff --git a/aftercare.service b/aftercare.service
index 0a933d2..4110548 100644
--- a/aftercare.service
+++ b/aftercare.service
@@ -4,7 +4,7 @@ After=network.target
4 4
5[Service] 5[Service]
6Type=simple 6Type=simple
7ExecStart=/usr/bin/groovy /opt/aftercare/aftercare.groovy /opt/aftercare/properties.conf 7ExecStart=/usr/bin/groovy /path/to/aftercare/aftercare.groovy /path/to/aftercare/example.conf
8 8
9[Install] 9[Install]
10WantedBy=multi-user.target 10WantedBy=multi-user.target
diff --git a/example.conf b/example.conf
new file mode 100644
index 0000000..a658e52
--- /dev/null
+++ b/example.conf
@@ -0,0 +1,13 @@
1output = "TV"
2input = "tmp/complete"
3done = "tmp/done"
4error = "tmp/error"
5
6user = "diederick"
7group = "video"
8chmod = "644"
9
10dry_run = true
11
12allowed = ['mkv', 'mp4', 'mpg', 'avi']
13nrs = "[Ss]?[0-9]{1,2}[EeXx][0-9]{1,2}"