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
ebd0d4c5
Commit
ebd0d4c5
authored
Jul 25, 2015
by
miigotu
Browse files
Options
Downloads
Plain Diff
Merge pull request #2191 from SiCKRAGETV/kat-clean
Clean up some code in kat.py
parents
98a197ed
029704f1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/providers/kat.py
+23
-36
23 additions, 36 deletions
sickbeard/providers/kat.py
with
23 additions
and
36 deletions
sickbeard/providers/kat.py
+
23
−
36
View file @
ebd0d4c5
...
...
@@ -165,20 +165,17 @@ class KATProvider(generic.TorrentProvider):
search_string
=
{
'
Season
'
:
[]}
for
show_name
in
set
(
allPossibleShowNames
(
self
.
show
)):
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
if
ep_obj
.
show
.
air_by_date
or
ep_obj
.
show
.
sports
:
ep_string
=
show_name
+
'
'
+
str
(
ep_obj
.
airdate
).
split
(
'
-
'
)[
0
]
search_string
[
'
Season
'
].
append
(
ep_string
)
ep_string
=
show_name
+
'
Season
'
+
str
(
ep_obj
.
airdate
).
split
(
'
-
'
)[
0
]
ep_string
+=
str
(
ep_obj
.
airdate
).
split
(
'
-
'
)[
0
]
search_string
[
'
Season
'
].
append
(
ep_string
)
elif
ep_obj
.
show
.
anime
:
ep_string
=
show_name
+
'
'
+
"
%02d
"
%
ep_obj
.
scene_absolute_number
ep_string
+
=
"
%02d
"
%
ep_obj
.
scene_absolute_number
search_string
[
'
Season
'
].
append
(
ep_string
)
else
:
ep_string
=
show_name
+
'
S%02d
'
%
int
(
ep_obj
.
scene_season
)
+
'
-S%02d
'
%
int
(
ep_obj
.
scene_season
)
+
'
E
'
+
'
category:tv
'
#1) showName SXX -SXXE
ep_string
=
'
%s S%02d -S%02dE category:tv
'
%
(
sanitizeSceneName
(
show_name
),
ep_obj
.
scene_season
,
ep_obj
.
scene_season
)
#1) showName SXX -SXXE
search_string
[
'
Season
'
].
append
(
ep_string
)
ep_string
=
show_name
+
'
"
Season
'
+
str
(
ep_obj
.
scene_season
)
+
'"
-Ep*
'
+
'
category:tv
'
# 2) showName "Season X"
ep_string
=
'
%s
"
Season %d
"
-Ep* category:tv
'
%
(
sanitizeSceneName
(
show_name
),
ep_obj
.
scene_season
)
# 2) showName "Season X"
search_string
[
'
Season
'
].
append
(
ep_string
)
return
[
search_string
]
...
...
@@ -186,29 +183,22 @@ class KATProvider(generic.TorrentProvider):
def
_get_episode_search_strings
(
self
,
ep_obj
,
add_string
=
''
):
search_string
=
{
'
Episode
'
:
[]}
if
self
.
show
.
air_by_date
:
for
show_name
in
set
(
allPossibleShowNames
(
self
.
show
)):
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
+
\
str
(
ep_obj
.
airdate
).
replace
(
'
-
'
,
'
'
)
search
_string
[
'
Episode
'
].
append
(
ep_string
)
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
if
self
.
show
.
air_by_date
:
ep
_string
+=
str
(
ep_obj
.
airdate
).
replace
(
'
-
'
,
'
'
)
elif
self
.
show
.
sports
:
for
show_name
in
set
(
allPossibleShowNames
(
self
.
show
)):
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
+
\
str
(
ep_obj
.
airdate
).
replace
(
'
-
'
,
'
|
'
)
+
'
|
'
+
\
ep_obj
.
airdate
.
strftime
(
'
%b
'
)
search_string
[
'
Episode
'
].
append
(
ep_string
)
ep_string
+=
str
(
ep_obj
.
airdate
).
replace
(
'
-
'
,
'
'
)
+
'
|
'
+
ep_obj
.
airdate
.
strftime
(
'
%b
'
)
elif
self
.
show
.
anime
:
for
show_name
in
set
(
allPossibleShowNames
(
self
.
show
)):
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
+
\
"
%02i
"
%
int
(
ep_obj
.
scene_absolute_number
)
search_string
[
'
Episode
'
].
append
(
ep_string
)
ep_string
+=
"
%02d
"
%
ep_obj
.
scene_absolute_number
else
:
for
show_name
in
set
(
allPossibleShowNames
(
self
.
show
)):
ep_string
=
sanitizeSceneName
(
show_name
)
+
'
'
+
\
sickbeard
.
config
.
naming_ep_type
[
2
]
%
{
'
seasonnumber
'
:
ep_obj
.
scene_season
,
ep_string
+=
sickbeard
.
config
.
naming_ep_type
[
2
]
%
{
'
seasonnumber
'
:
ep_obj
.
scene_season
,
'
episodenumber
'
:
ep_obj
.
scene_episode
}
+
'
|
'
+
\
sickbeard
.
config
.
naming_ep_type
[
0
]
%
{
'
seasonnumber
'
:
ep_obj
.
scene_season
,
'
episodenumber
'
:
ep_obj
.
scene_episode
}
+
'
%s category:tv
'
%
add_string
'
episodenumber
'
:
ep_obj
.
scene_episode
}
+
'
category:tv
'
if
add_string
:
ep_string
+=
'
'
+
add_string
search_string
[
'
Episode
'
].
append
(
re
.
sub
(
'
\s+
'
,
'
'
,
ep_string
))
return
[
search_string
]
...
...
@@ -216,10 +206,7 @@ class KATProvider(generic.TorrentProvider):
def
_get_size
(
self
,
item
):
title
,
url
,
id
,
seeders
,
leechers
,
size
,
pubdate
=
item
if
not
size
:
return
-
1
return
size
return
size
or
-
1
def
_doSearch
(
self
,
search_params
,
search_mode
=
'
eponly
'
,
epcount
=
0
,
age
=
0
,
epObj
=
None
):
...
...
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