Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sick-Beard
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Sick-Beard
Commits
1f7dc857
Commit
1f7dc857
authored
Apr 19, 2012
by
Nic Wolfe
Browse files
Options
Downloads
Plain Diff
Merged synology changes which keep the synology index updated if the notifier is selected
parents
a0c14d2a
44c4d000
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sickbeard/notifiers/synoindex.py
+32
-2
32 additions, 2 deletions
sickbeard/notifiers/synoindex.py
sickbeard/postProcessor.py
+5
-1
5 additions, 1 deletion
sickbeard/postProcessor.py
with
37 additions
and
3 deletions
sickbeard/notifiers/synoindex.py
+
32
−
2
View file @
1f7dc857
...
...
@@ -35,9 +35,39 @@ class synoIndexNotifier:
def
notify_download
(
self
,
ep_name
):
pass
def
update_library
(
self
,
ep_obj
):
def
moveFolder
(
self
,
old_path
,
new_path
):
self
.
moveObject
(
old_path
,
new_path
)
def
moveFile
(
self
,
old_file
,
new_file
):
self
.
moveObject
(
old_file
,
new_file
)
def
moveObject
(
self
,
old_path
,
new_path
):
if
sickbeard
.
USE_SYNOINDEX
:
synoindex_cmd
=
[
'
/usr/syno/bin/synoindex
'
,
'
-N
'
,
ek
.
ek
(
os
.
path
.
abspath
,
new_path
),
ek
.
ek
(
os
.
path
.
abspath
,
old_path
)]
logger
.
log
(
u
"
Executing command
"
+
str
(
synoindex_cmd
))
logger
.
log
(
u
"
Absolute path to command:
"
+
ek
.
ek
(
os
.
path
.
abspath
,
synoindex_cmd
[
0
]),
logger
.
DEBUG
)
try
:
p
=
subprocess
.
Popen
(
synoindex_cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
cwd
=
sickbeard
.
PROG_DIR
)
out
,
err
=
p
.
communicate
()
#@UnusedVariable
logger
.
log
(
u
"
Script result:
"
+
str
(
out
),
logger
.
DEBUG
)
except
OSError
,
e
:
logger
.
log
(
u
"
Unable to run synoindex:
"
+
ex
(
e
))
def
deleteFolder
(
self
,
cur_path
):
self
.
makeObject
(
'
-D
'
,
cur_path
)
def
addFolder
(
self
,
cur_path
):
self
.
makeObject
(
'
-A
'
,
cur_path
)
def
deleteFile
(
self
,
cur_file
):
self
.
makeObject
(
'
-d
'
,
cur_file
)
def
addFile
(
self
,
cur_file
):
self
.
makeObject
(
'
-a
'
,
cur_file
)
def
makeObject
(
self
,
cmd_arg
,
cur_path
):
if
sickbeard
.
USE_SYNOINDEX
:
synoindex_cmd
=
[
'
/usr/syno/bin/synoindex
'
,
'
-a
'
,
ek
.
ek
(
os
.
path
.
abspath
,
ep_obj
.
location
)]
synoindex_cmd
=
[
'
/usr/syno/bin/synoindex
'
,
cmd_arg
,
ek
.
ek
(
os
.
path
.
abspath
,
cur_path
)]
logger
.
log
(
u
"
Executing command
"
+
str
(
synoindex_cmd
))
logger
.
log
(
u
"
Absolute path to command:
"
+
ek
.
ek
(
os
.
path
.
abspath
,
synoindex_cmd
[
0
]),
logger
.
DEBUG
)
try
:
...
...
This diff is collapsed.
Click to expand it.
sickbeard/postProcessor.py
+
5
−
1
View file @
1f7dc857
...
...
@@ -184,6 +184,8 @@ class PostProcessor(object):
self
.
_log
(
u
"
Deleting file
"
+
cur_file
,
logger
.
DEBUG
)
if
ek
.
ek
(
os
.
path
.
isfile
,
cur_file
):
ek
.
ek
(
os
.
remove
,
cur_file
)
# do the library update for synoindex
notifiers
.
synoindex_notifier
.
deleteFile
(
cur_file
)
def
_combined_file_operation
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
,
action
=
None
):
"""
...
...
@@ -763,6 +765,8 @@ class PostProcessor(object):
try
:
ek
.
ek
(
os
.
mkdir
,
dest_path
)
helpers
.
chmodAsParent
(
dest_path
)
# do the library update for synoindex
notifiers
.
synoindex_notifier
.
addFolder
(
dest_path
)
except
OSError
,
IOError
:
raise
exceptions
.
PostProcessingFailed
(
"
Unable to create the episode
'
s destination folder:
"
+
dest_path
)
...
...
@@ -815,7 +819,7 @@ class PostProcessor(object):
notifiers
.
plex_notifier
.
update_library
()
# do the library update for synoindex
notifiers
.
synoindex_notifier
.
update_library
(
ep_obj
)
notifiers
.
synoindex_notifier
.
addFile
(
ep_obj
.
location
)
# do the library update for trakt
notifiers
.
trakt_notifier
.
update_library
(
ep_obj
)
...
...
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