Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
poquita
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
poquita
Commits
8d8298e3
Commit
8d8298e3
authored
3 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Trigger a Kodi scan after each run.
So it scans the audio library and finds new podcasts.
parent
f2f2b136
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.dockerignore
+1
-0
1 addition, 0 deletions
.dockerignore
Dockerfile
+1
-0
1 addition, 0 deletions
Dockerfile
crontab
+1
-1
1 addition, 1 deletion
crontab
kodi_scan
+24
-0
24 additions, 0 deletions
kodi_scan
with
27 additions
and
1 deletion
.dockerignore
+
1
−
0
View file @
8d8298e3
...
...
@@ -3,3 +3,4 @@
!poca.xml
!crontab
!entrypoint
!kodi_scan
This diff is collapsed.
Click to expand it.
Dockerfile
+
1
−
0
View file @
8d8298e3
...
...
@@ -20,6 +20,7 @@ RUN apk add --update --no-cache --virtual .lxml-build build-base git libxslt-dev
RUN
mkdir
--mode
777 db Podcasts
COPY
--chown=root:root crontab ./
COPY
--chown=root:root poca.xml ./
COPY
--chown=root:root kodi_scan /usr/local/bin/
COPY
--chown=root:root entrypoint /usr/local/sbin/docker-entrypoint
VOLUME
db Podcasts
ENTRYPOINT
["docker-entrypoint"]
...
...
This diff is collapsed.
Click to expand it.
crontab
+
1
−
1
View file @
8d8298e3
0 */4 * * * poca --config ./ || wget --spider https://notify.shore.co.il/send?message=Poca%20job%20failed.
0 */4 * * *
(
poca --config ./
&& kodi_scan )
|| wget --spider https://notify.shore.co.il/send?message=Poca%20job%20failed.
This diff is collapsed.
Click to expand it.
kodi_scan
0 → 100755
+
24
−
0
View file @
8d8298e3
#!/usr/bin/env python3
"""
Trigger a Kodi audio library update.
"""
import
json
import
urllib.request
KODI_RPC_URL
=
"
http://172.18.0.1:8080/jsonrpc
"
if
__name__
==
"
__main__
"
:
headers
=
{
"
content-type
"
:
"
application/json
"
}
request_data
=
{
"
jsonrpc
"
:
"
2.0
"
,
"
id
"
:
"
transmission
"
,
"
method
"
:
"
AudioLibrary.Scan
"
,
}
req
=
urllib
.
request
.
Request
(
KODI_RPC_URL
,
headers
=
headers
,
data
=
json
.
dumps
(
request_data
).
encode
(),
)
# pylint: disable-next=consider-using-with
urllib
.
request
.
urlopen
(
req
)
# nosec
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