Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
transmission-docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
transmission-docker
Commits
5c2b30a9
Commit
5c2b30a9
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Trigger a Kodi library scan after a download completes.
parent
e6625713
No related branches found
No related tags found
No related merge requests found
Pipeline
#1284
passed
4 years ago
Stage: test
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/Dockerfile
+2
-0
2 additions, 0 deletions
daemon/Dockerfile
daemon/kodi-scan
+42
-0
42 additions, 0 deletions
daemon/kodi-scan
daemon/settings.json
+2
-2
2 additions, 2 deletions
daemon/settings.json
with
46 additions
and
2 deletions
daemon/Dockerfile
+
2
−
0
View file @
5c2b30a9
...
@@ -4,11 +4,13 @@ RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpin
...
@@ -4,11 +4,13 @@ RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpin
gosu
\
gosu
\
&&
\
&&
\
apk add
--update
--no-cache
\
apk add
--update
--no-cache
\
curl
\
transmission-daemon
\
transmission-daemon
\
&&
\
&&
\
mkdir
-m
777 /run/transmission
mkdir
-m
777 /run/transmission
COPY
--chown=root:root entrypoint /usr/local/sbin/docker-entrypoint
COPY
--chown=root:root entrypoint /usr/local/sbin/docker-entrypoint
COPY
--chown=root:root settings.json /etc/transmission/
COPY
--chown=root:root settings.json /etc/transmission/
COPY
--chown=root:root kodi-scan /usr/local/bin/
VOLUME
/var/lib/transmission
VOLUME
/var/lib/transmission
WORKDIR
/var/lib/transmission
WORKDIR
/var/lib/transmission
ENV
HOME /var/lib/transmission
ENV
HOME /var/lib/transmission
...
...
This diff is collapsed.
Click to expand it.
daemon/kodi-scan
0 → 100755
+
42
−
0
View file @
5c2b30a9
#!/bin/sh
set
-eu
scan
()
{
case
"
${
1
:-}
"
in
audio
)
curl
\
--data-binary
\
'{ "jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "transmission"}'
\
-H
'content-type: application/json;'
\
http://172.18.0.1:8080/jsonrpc
;;
video
)
curl
\
--data-binary
\
'{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "transmission"}'
\
-H
'content-type: application/json;'
\
http://172.18.0.1:8080/jsonrpc
;;
*
)
scan video
;
scan audio
;;
esac
}
starts_with
()
{
[
"
${
1
##
$2
}
"
!=
"
$1
"
]
}
is_in_dir
()
{
!
starts_with
"
$(
realpath
--relative-base
"
$1
"
"
$2
"
)
"
'/'
}
if
[
-z
"
${
TR_TORRENT_DIR
:-}
"
]
then
scan
elif
is_in_dir
'/var/lib/transmission/Downloads/TV Shows'
"
$TR_TORRENT_DIR
"
then
scan video
elif
is_in_dir
'/var/lib/transmission/Downloads/Movies'
"
$TR_TORRENT_DIR
"
then
scan video
elif
is_in_dir
'/var/lib/transmission/Downloads/Music'
"
$TR_TORRENT_DIR
"
then
scan audio
else
scan
fi
This diff is collapsed.
Click to expand it.
daemon/settings.json
+
2
−
2
View file @
5c2b30a9
...
@@ -55,8 +55,8 @@
...
@@ -55,8 +55,8 @@
"rpc-whitelist"
:
"127.0.0.*,192.168.*.*,10.*.*.*,172.16.*.*,172.17.*.*,172.18.*.*,172.19.*.*,172.2?.*.*,172.30.*.*,172.31.*.*"
,
"rpc-whitelist"
:
"127.0.0.*,192.168.*.*,10.*.*.*,172.16.*.*,172.17.*.*,172.18.*.*,172.19.*.*,172.2?.*.*,172.30.*.*,172.31.*.*"
,
"rpc-whitelist-enabled"
:
false
,
"rpc-whitelist-enabled"
:
false
,
"scrape-paused-torrents-enabled"
:
true
,
"scrape-paused-torrents-enabled"
:
true
,
"script-torrent-done-enabled"
:
fals
e
,
"script-torrent-done-enabled"
:
tru
e
,
"script-torrent-done-filename"
:
""
,
"script-torrent-done-filename"
:
"
/usr/local/bin/kodi-scan
"
,
"seed-queue-enabled"
:
false
,
"seed-queue-enabled"
:
false
,
"seed-queue-size"
:
10
,
"seed-queue-size"
:
10
,
"speed-limit-down"
:
100
,
"speed-limit-down"
:
100
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment