Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
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
SickRage-1
Commits
d451077d
Commit
d451077d
authored
Dec 26, 2015
by
miigotu
Browse files
Options
Downloads
Patches
Plain Diff
Allow replacing a higher quality with a lower quality if it is in your preferred qualities
Fixes
https://github.com/SickRage/sickrage-issues/issues/329
parent
814697cc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/postProcessor.py
+14
-12
14 additions, 12 deletions
sickbeard/postProcessor.py
with
14 additions
and
12 deletions
sickbeard/postProcessor.py
+
14
−
12
View file @
d451077d
...
...
@@ -148,7 +148,7 @@ class PostProcessor(object):
logger
.
DEBUG
)
return
PostProcessor
.
DOESNT_EXIST
def
list_associated_files
(
self
,
file_path
,
base_name_only
=
False
,
subtitles_only
=
False
,
subfolders
=
False
):
def
list_associated_files
(
self
,
file_path
,
base_name_only
=
False
,
subtitles_only
=
False
,
subfolders
=
False
):
# pylint: disable=unused-argument
"""
For a given file path searches for files with the same name but different extension and returns their absolute paths
...
...
@@ -970,7 +970,9 @@ class PostProcessor(object):
if
self
.
is_proper
and
new_ep_quality
==
old_ep_quality
:
self
.
_log
(
u
"
New file is a proper/repack, marking it safe to replace
"
)
else
:
self
.
_log
(
u
"
File exists and new file is the same or lower quality than existing, marking it unsafe to replace
"
)
_
,
preferred_qualities
=
common
.
Quality
.
splitQuality
(
int
(
show
.
quality
))
if
new_ep_quality
not
in
preferred_qualities
:
self
.
_log
(
u
"
File exists and new file quality is not in a preferred quality list, marking it unsafe to replace
"
)
return
False
# Check if the processed file season is already in our indexer. If not, the file is most probably mislabled/fake and will be skipped
...
...
@@ -993,7 +995,7 @@ class PostProcessor(object):
# try to find out if we have enough space to perform the copy or move action.
if
not
helpers
.
isFileLocked
(
self
.
file_path
,
False
):
if
not
verify_freespace
(
self
.
file_path
,
ep_obj
.
show
.
_location
,
[
ep_obj
]
+
ep_obj
.
relatedEps
):
if
not
verify_freespace
(
self
.
file_path
,
ep_obj
.
show
.
_location
,
[
ep_obj
]
+
ep_obj
.
relatedEps
):
# pylint: disable=protected-access
self
.
_log
(
"
Not enough space to continue PP, exiting
"
,
logger
.
WARNING
)
return
False
else
:
...
...
@@ -1006,7 +1008,7 @@ class PostProcessor(object):
# clean up any left over folders
if
cur_ep
.
location
:
helpers
.
delete_empty_folders
(
ek
(
os
.
path
.
dirname
,
cur_ep
.
location
),
keep_dir
=
ep_obj
.
show
.
_location
)
helpers
.
delete_empty_folders
(
ek
(
os
.
path
.
dirname
,
cur_ep
.
location
),
keep_dir
=
ep_obj
.
show
.
_location
)
# pylint: disable=protected-access
except
(
OSError
,
IOError
):
raise
EpisodePostProcessingFailedException
(
"
Unable to delete the existing files
"
)
...
...
@@ -1015,16 +1017,16 @@ class PostProcessor(object):
# curEp.status = common.Quality.compositeStatus(common.SNATCHED, new_ep_quality)
# if the show directory doesn't exist then make it if allowed
if
not
ek
(
os
.
path
.
isdir
,
ep_obj
.
show
.
_location
)
and
sickbeard
.
CREATE_MISSING_SHOW_DIRS
:
if
not
ek
(
os
.
path
.
isdir
,
ep_obj
.
show
.
_location
)
and
sickbeard
.
CREATE_MISSING_SHOW_DIRS
:
# pylint: disable=protected-access
self
.
_log
(
u
"
Show directory doesn
'
t exist, creating it
"
,
logger
.
DEBUG
)
try
:
ek
(
os
.
mkdir
,
ep_obj
.
show
.
_location
)
helpers
.
chmodAsParent
(
ep_obj
.
show
.
_location
)
ek
(
os
.
mkdir
,
ep_obj
.
show
.
_location
)
# pylint: disable=protected-access
helpers
.
chmodAsParent
(
ep_obj
.
show
.
_location
)
# pylint: disable=protected-access
# do the library update for synoindex
notifiers
.
synoindex_notifier
.
addFolder
(
ep_obj
.
show
.
_location
)
notifiers
.
synoindex_notifier
.
addFolder
(
ep_obj
.
show
.
_location
)
# pylint: disable=protected-access
except
(
OSError
,
IOError
):
raise
EpisodePostProcessingFailedException
(
"
Unable to create the show directory:
"
+
ep_obj
.
show
.
_location
)
raise
EpisodePostProcessingFailedException
(
"
Unable to create the show directory:
"
+
ep_obj
.
show
.
_location
)
# pylint: disable=protected-access
# get metadata for the show (but not episode because it hasn't been fully processed)
ep_obj
.
show
.
writeMetadata
(
True
)
...
...
@@ -1170,7 +1172,7 @@ class PostProcessor(object):
# If any notification fails, don't stop postProcessor
try
:
# send notifications
notifiers
.
notify_download
(
ep_obj
.
_format_pattern
(
'
%SN - %Sx%0E - %EN - %QN
'
))
notifiers
.
notify_download
(
ep_obj
.
_format_pattern
(
'
%SN - %Sx%0E - %EN - %QN
'
))
# pylint: disable=protected-access
# do the library update for KODI
notifiers
.
kodi_notifier
.
update_library
(
ep_obj
.
show
.
name
)
...
...
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
sign in
to comment