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
80d46273
Commit
80d46273
authored
Mar 14, 2011
by
Nic Wolfe
Browse files
Options
Downloads
Patches
Plain Diff
Fix another post-processing issue
parent
d5fe5356
Branches
Branches containing commit
Tags
build-486
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/postProcessor.py
+23
-2
23 additions, 2 deletions
sickbeard/postProcessor.py
with
23 additions
and
2 deletions
sickbeard/postProcessor.py
+
23
−
2
View file @
80d46273
...
@@ -143,6 +143,13 @@ class PostProcessor(object):
...
@@ -143,6 +143,13 @@ class PostProcessor(object):
ek
.
ek
(
os
.
remove
,
cur_file
)
ek
.
ek
(
os
.
remove
,
cur_file
)
def
_combined_file_operation
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
,
action
=
None
):
def
_combined_file_operation
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
,
action
=
None
):
"""
file_path: The full path of the media file to copy
new_path: Destination path where we want to copy the file to
new_base_name: The base filename (no extension) to use during the copy. Use None to keep the same name.
associated_files: Boolean, whether we should copy similarly-named files too
action: function that takes an old path and new path and does an operation with them (move/copy)
"""
if
not
action
:
if
not
action
:
self
.
_log
(
u
"
Must provide an action for the combined file operation
"
,
logger
.
ERROR
)
self
.
_log
(
u
"
Must provide an action for the combined file operation
"
,
logger
.
ERROR
)
...
@@ -179,6 +186,12 @@ class PostProcessor(object):
...
@@ -179,6 +186,12 @@ class PostProcessor(object):
action
(
cur_file_path
,
new_file_path
)
action
(
cur_file_path
,
new_file_path
)
def
_move
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
):
def
_move
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
):
"""
file_path: The full path of the media file to move
new_path: Destination path where we want to move the file to
new_base_name: The base filename (no extension) to use during the move. Use None to keep the same name.
associated_files: Boolean, whether we should move similarly-named files too
"""
def
_int_move
(
cur_file_path
,
new_file_path
):
def
_int_move
(
cur_file_path
,
new_file_path
):
...
@@ -193,6 +206,12 @@ class PostProcessor(object):
...
@@ -193,6 +206,12 @@ class PostProcessor(object):
self
.
_combined_file_operation
(
file_path
,
new_path
,
new_base_name
,
associated_files
,
action
=
_int_move
)
self
.
_combined_file_operation
(
file_path
,
new_path
,
new_base_name
,
associated_files
,
action
=
_int_move
)
def
_copy
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
):
def
_copy
(
self
,
file_path
,
new_path
,
new_base_name
,
associated_files
=
False
):
"""
file_path: The full path of the media file to copy
new_path: Destination path where we want to copy the file to
new_base_name: The base filename (no extension) to use during the copy. Use None to keep the same name.
associated_files: Boolean, whether we should copy similarly-named files too
"""
def
_int_copy
(
cur_file_path
,
new_file_path
):
def
_int_copy
(
cur_file_path
,
new_file_path
):
...
@@ -649,7 +668,9 @@ class PostProcessor(object):
...
@@ -649,7 +668,9 @@ class PostProcessor(object):
new_file_name
=
new_base_name
+
'
.
'
+
orig_extension
new_file_name
=
new_base_name
+
'
.
'
+
orig_extension
else
:
else
:
new_base_name
=
self
.
file_name
# if we're not renaming then there's no new base name, we'll just use the existing name
new_base_name
=
None
new_file_name
=
self
.
file_name
try
:
try
:
# move the episode and associated files to the show dir
# move the episode and associated files to the show dir
...
...
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