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
caa360d4
Commit
caa360d4
authored
12 years ago
by
Luca
Browse files
Options
Downloads
Patches
Plain Diff
PostProcessing Mod: Do not PostProcess files and dir again if we use KEEP_PROCESSING_DIR
parent
4b059e35
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/processTV.py
+20
-4
20 additions, 4 deletions
sickbeard/processTV.py
with
20 additions
and
4 deletions
sickbeard/processTV.py
+
20
−
4
View file @
caa360d4
...
...
@@ -90,6 +90,14 @@ def processDir (dirName, nzbName=None, recurse=False):
#Process Video File in the current Path
for
cur_video_file
in
videoFiles
:
# Avoid processing the same file again if we use KEEP_PROCESSING_DIR
if
sickbeard
.
KEEP_PROCESSED_DIR
:
myDB
=
db
.
DBConnection
()
sqlresult
=
myDB
.
select
(
"
SELECT * FROM tv_episodes WHERE release_name = ?
"
,
[
cur_video_file
.
rpartition
(
'
.
'
)[
0
]])
if
sqlresult
:
returnStr
+=
logHelper
(
u
"
You
'
re trying to post process the file
"
+
cur_video_file
+
"
that
'
s already been processed, skipping
"
,
logger
.
DEBUG
)
continue
cur_video_file_path
=
ek
.
ek
(
os
.
path
.
join
,
dirName
,
cur_video_file
)
try
:
...
...
@@ -196,13 +204,21 @@ def validateDir(path, dirName, returnStr):
sqlResults
=
myDB
.
select
(
"
SELECT * FROM tv_shows
"
)
for
sqlShow
in
sqlResults
:
if
dirName
.
lower
().
startswith
(
ek
.
ek
(
os
.
path
.
realpath
,
sqlShow
[
"
location
"
]).
lower
()
+
os
.
sep
)
or
dirName
.
lower
()
==
ek
.
ek
(
os
.
path
.
realpath
,
sqlShow
[
"
location
"
]).
lower
():
returnStr
+=
logHelper
(
u
"
You
'
re trying to post process an episode that
'
s already been moved to its show dir
"
,
logger
.
ERROR
)
returnStr
+=
logHelper
(
u
"
You
'
re trying to post process an episode that
'
s already been moved to its show dir
, skipping
"
,
logger
.
ERROR
)
return
False
#
check if the dir have at least one tv video file
#
Get the videofile list for the next checks
files
=
ek
.
ek
(
os
.
listdir
,
os
.
path
.
join
(
path
,
dirName
))
videoFiles
=
filter
(
helpers
.
isMediaFile
,
files
)
# Avoid processing the same dir again if we use KEEP_PROCESSING_DIR
if
sickbeard
.
KEEP_PROCESSED_DIR
:
numPostProcFiles
=
myDB
.
select
(
"
SELECT COUNT(release_name) as numfiles FROM tv_episodes WHERE release_name = ?
"
,
[
dirName
])
if
int
(
numPostProcFiles
[
0
][
0
])
==
len
(
videoFiles
):
returnStr
+=
logHelper
(
u
"
You
'
re trying to post process a dir that
'
s already been processed, skipping
"
,
logger
.
DEBUG
)
return
False
#check if the dir have at least one tv video file
for
video
in
videoFiles
:
try
:
NameParser
().
parse
(
video
)
...
...
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