Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CouchPotatoServer
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
CouchPotatoServer
Commits
5658a85f
Commit
5658a85f
authored
Dec 4, 2012
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
Use splitstring when possible.
parent
0c5206f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
couchpotato/core/plugins/searcher/main.py
+6
-7
6 additions, 7 deletions
couchpotato/core/plugins/searcher/main.py
with
6 additions
and
7 deletions
couchpotato/core/plugins/searcher/main.py
+
6
−
7
View file @
5658a85f
...
...
@@ -3,7 +3,7 @@ from couchpotato.api import addApiView
from
couchpotato.core.event
import
addEvent
,
fireEvent
,
fireEventAsync
from
couchpotato.core.helpers.encoding
import
simplifyString
,
toUnicode
from
couchpotato.core.helpers.request
import
jsonified
,
getParam
from
couchpotato.core.helpers.variable
import
md5
,
getTitle
from
couchpotato.core.helpers.variable
import
md5
,
getTitle
,
splitString
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.plugins.base
import
Plugin
from
couchpotato.core.settings.model
import
Movie
,
Release
,
ReleaseInfo
...
...
@@ -305,19 +305,18 @@ class Searcher(Plugin):
movie_words
=
re
.
split
(
'
\W+
'
,
simplifyString
(
movie_name
))
nzb_name
=
simplifyString
(
nzb
[
'
name
'
])
nzb_words
=
re
.
split
(
'
\W+
'
,
nzb_name
)
required_words
=
[
x
.
strip
().
lower
()
for
x
in
self
.
conf
(
'
required_words
'
).
lower
()
.
split
(
'
,
'
)]
required_words
=
splitString
(
self
.
conf
(
'
required_words
'
).
lower
()
)
req_match
=
0
for
index
in
range
(
len
(
required_words
)):
req
=
[
x
.
strip
().
lower
()
for
x
in
required_words
[
index
].
lower
().
split
(
'
&
'
)]
if
len
(
list
(
set
(
nzb_words
)
&
set
(
req
)))
==
len
(
req
):
req_match
=
req_match
+
1
for
req_set
in
required_words
:
req
=
splitString
(
req_set
,
'
&
'
)
req_match
+=
len
(
list
(
set
(
nzb_words
)
&
set
(
req
)))
==
len
(
req
)
if
self
.
conf
(
'
required_words
'
)
and
req_match
==
0
:
log
.
info2
(
"
Wrong: Required word missing: %s
"
%
nzb
[
'
name
'
])
return
False
ignored_words
=
[
x
.
strip
().
lower
()
for
x
in
self
.
conf
(
'
ignored_words
'
).
split
(
'
,
'
)]
ignored_words
=
splitString
(
self
.
conf
(
'
ignored_words
'
).
lower
())
blacklisted
=
list
(
set
(
nzb_words
)
&
set
(
ignored_words
))
if
self
.
conf
(
'
ignored_words
'
)
and
blacklisted
:
log
.
info2
(
"
Wrong:
'
%s
'
blacklisted words: %s
"
%
(
nzb
[
'
name
'
],
"
,
"
.
join
(
blacklisted
)))
...
...
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