Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SiCKRAGE
sickrage
Commits
f50a313c
Commit
f50a313c
authored
Oct 17, 2017
by
echel0n
Browse files
Fixed issue with gettext underscore being replaced when using underscore as throwaway variable
parent
1da0430d
Changes
22
Hide whitespace changes
Inline
Side-by-side
changelog.md
View file @
f50a313c
# Changelog
-
*
932733f - 2017-10-17: Fixed issue #90 - iptorrents provider needs update
-
*
177e1bc - 2017-10-17: Fixed issue with gettext underscore being replaced when using underscore as throwaway variable
-
*
1da0430 - 2017-10-17: Fixed issue #90 - iptorrents provider needs update
-
*
8a3d08a - 2017-10-16: Release v9.1.38
-
*
8b8eab5 - 2017-10-16: Fixed issue with JS gettext and using system default language selection
-
*
372b24e - 2017-10-16: Fixed
'
No Content
'
error and added more translated languages
...
...
sickrage/core/helpers/__init__.py
View file @
f50a313c
...
...
@@ -929,6 +929,7 @@ def create_https_certificates(ssl_cert, ssl_key):
return
True
def
md5_for_file
(
filename
):
"""
Generate an md5 hash for a file
...
...
@@ -1242,7 +1243,7 @@ def get_size(start_path='.'):
total_size
=
0
try
:
for
dirpath
,
_
,
filenames
in
os
.
walk
(
start_path
):
for
dirpath
,
_
_
,
filenames
in
os
.
walk
(
start_path
):
for
f
in
filenames
:
fp
=
os
.
path
.
join
(
dirpath
,
f
)
try
:
...
...
@@ -1324,7 +1325,7 @@ def verify_freespace(src, dest, oldfile=None):
import
sys
def
disk_usage
(
path
):
_
,
total
,
free
=
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
()
_
_
,
total
,
free
=
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
()
if
sys
.
version_info
>=
(
3
,)
or
isinstance
(
path
,
unicode
):
fun
=
ctypes
.
windll
.
kernel32
.
GetDiskFreeSpaceExW
else
:
...
...
@@ -1451,18 +1452,20 @@ def getFreeSpace(directories):
size
=
None
if
os
.
path
.
isdir
(
folder
):
if
os
.
name
==
'nt'
:
_
,
total
,
free
=
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
(),
\
ctypes
.
c_ulonglong
()
_
_
,
total
,
free
=
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
(),
ctypes
.
c_ulonglong
()
if
sys
.
version_info
>=
(
3
,)
or
isinstance
(
folder
,
unicode
):
fun
=
ctypes
.
windll
.
kernel32
.
GetDiskFreeSpaceExW
# @UndefinedVariable
fun
=
ctypes
.
windll
.
kernel32
.
GetDiskFreeSpaceExW
else
:
fun
=
ctypes
.
windll
.
kernel32
.
GetDiskFreeSpaceExA
# @UndefinedVariable
ret
=
fun
(
folder
,
ctypes
.
byref
(
_
),
ctypes
.
byref
(
total
),
ctypes
.
byref
(
free
))
if
ret
==
0
:
raise
ctypes
.
WinError
()
fun
=
ctypes
.
windll
.
kernel32
.
GetDiskFreeSpaceExA
ret
=
fun
(
folder
,
ctypes
.
byref
(
__
),
ctypes
.
byref
(
total
),
ctypes
.
byref
(
free
))
if
ret
==
0
:
raise
ctypes
.
WinError
()
return
[
total
.
value
,
free
.
value
]
else
:
s
=
os
.
statvfs
(
folder
)
size
=
[
s
.
f_blocks
*
s
.
f_frsize
/
(
1024
*
1024
),
(
s
.
f_bavail
*
s
.
f_frsize
)
/
(
1024
*
1024
)]
if
single
:
return
size
...
...
@@ -1483,7 +1486,7 @@ def restoreVersionedFile(backup_file, version):
numTries
=
0
new_file
,
_
=
os
.
path
.
splitext
(
backup_file
)
new_file
,
_
_
=
os
.
path
.
splitext
(
backup_file
)
restore_file
=
'{}.v{}'
.
format
(
new_file
,
version
)
if
not
os
.
path
.
isfile
(
new_file
):
...
...
@@ -1838,4 +1841,4 @@ def clean_hosts(hosts, default_port=None):
else
:
cleaned_hosts
=
''
return
cleaned_hosts
\ No newline at end of file
return
cleaned_hosts
sickrage/core/process_tv.py
View file @
f50a313c
...
...
@@ -232,7 +232,7 @@ def processDir(dirName, nzbName=None, process_method=None, force=False, is_prior
result
.
result
=
True
for
processPath
,
_
,
fileList
in
os
.
walk
(
os
.
path
.
join
(
path
,
curDir
),
topdown
=
False
):
for
processPath
,
_
_
,
fileList
in
os
.
walk
(
os
.
path
.
join
(
path
,
curDir
),
topdown
=
False
):
if
not
validateDir
(
path
,
processPath
,
nzbNameOriginal
,
failed
,
result
):
continue
...
...
@@ -355,7 +355,7 @@ def validateDir(path, dirName, nzbNameOriginal, failed, result):
# Get the videofile list for the next checks
allFiles
=
[]
allDirs
=
[]
for
_
,
processdir
,
fileList
in
os
.
walk
(
os
.
path
.
join
(
path
,
dirName
),
topdown
=
False
):
for
_
_
,
processdir
,
fileList
in
os
.
walk
(
os
.
path
.
join
(
path
,
dirName
),
topdown
=
False
):
allDirs
+=
processdir
allFiles
+=
fileList
...
...
sickrage/core/processors/post_processor.py
View file @
f50a313c
...
...
@@ -171,7 +171,7 @@ class PostProcessor(object):
def
recursive_glob
(
treeroot
,
pattern
):
results
=
[]
for
base
,
_
,
files
in
os
.
walk
(
treeroot
):
for
base
,
_
_
,
files
in
os
.
walk
(
treeroot
):
goodfiles
=
fnmatch
.
filter
(
files
,
pattern
)
results
.
extend
(
os
.
path
.
join
(
base
,
f
)
for
f
in
goodfiles
)
return
results
...
...
@@ -775,7 +775,7 @@ class PostProcessor(object):
# if there is a quality available in the status then we don't need to bother guessing from the filename
if
ep_obj
.
status
in
Quality
.
SNATCHED
+
Quality
.
SNATCHED_PROPER
+
Quality
.
SNATCHED_BEST
:
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
_
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
if
ep_quality
!=
Quality
.
UNKNOWN
:
self
.
_log
(
"The old status had a quality in it, using that: "
+
Quality
.
qualityStrings
[
ep_quality
],
...
...
@@ -805,7 +805,7 @@ class PostProcessor(object):
# Try getting quality from the episode (snatched) status
if
ep_obj
.
status
in
Quality
.
SNATCHED
+
Quality
.
SNATCHED_PROPER
+
Quality
.
SNATCHED_BEST
:
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
_
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
if
ep_quality
!=
Quality
.
UNKNOWN
:
self
.
_log
(
"The old status had a quality in it, using that: "
+
Quality
.
qualityStrings
[
ep_quality
],
...
...
@@ -845,7 +845,7 @@ class PostProcessor(object):
try
:
p
=
subprocess
.
Popen
(
script_cmd
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
cwd
=
sickrage
.
PROG_DIR
)
out
,
_
=
p
.
communicate
()
out
,
_
_
=
p
.
communicate
()
self
.
_log
(
"Script result: "
+
str
(
out
),
sickrage
.
srCore
.
srLogger
.
DEBUG
)
except
OSError
as
e
:
...
...
@@ -867,7 +867,7 @@ class PostProcessor(object):
if
self
.
is_priority
:
return
True
_
,
old_ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
_
_
,
old_ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
# if SR downloaded this on purpose we likely have a priority download
if
self
.
in_history
or
ep_obj
.
status
in
Quality
.
SNATCHED
+
Quality
.
SNATCHED_PROPER
+
Quality
.
SNATCHED_BEST
:
...
...
@@ -945,7 +945,7 @@ class PostProcessor(object):
# retrieve/create the corresponding TVEpisode objects
ep_obj
=
self
.
_get_ep_obj
(
show
,
season
,
episodes
)
_
,
old_ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
_
_
,
old_ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
# get the quality of the episode we're processing
if
quality
and
not
Quality
.
qualityStrings
[
quality
]
==
'Unknown'
:
...
...
sickrage/core/queues/__init__.py
View file @
f50a313c
...
...
@@ -77,7 +77,7 @@ class srQueue(threading.Thread):
return
self
.
_queue
.
queue
def
get
(
self
,
*
args
,
**
kwargs
):
_
,
_
,
item
=
self
.
_queue
.
get
(
*
args
,
**
kwargs
)
_
_
,
_
_
,
item
=
self
.
_queue
.
get
(
*
args
,
**
kwargs
)
return
item
def
put
(
self
,
item
,
*
args
,
**
kwargs
):
...
...
sickrage/core/queues/postprocessor.py
View file @
f50a313c
...
...
@@ -53,14 +53,14 @@ class srPostProcessorQueue(srQueue):
:param proc_type: processing type, auto/manual
:return: instance of PostProcessorItem or None
"""
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
PostProcessorItem
)
and
cur_item
.
directory
==
dirName
and
cur_item
.
mode
==
proc_type
:
return
cur_item
return
None
@
property
def
is_in_progress
(
self
):
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
PostProcessorItem
):
return
True
return
False
...
...
@@ -93,7 +93,7 @@ class srPostProcessorQueue(srQueue):
"""
length
=
{
'auto'
:
0
,
'manual'
:
0
}
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
PostProcessorItem
):
if
cur_item
.
proc_type
==
'auto'
:
length
[
'auto'
]
+=
1
...
...
sickrage/core/queues/search.py
View file @
f50a313c
...
...
@@ -51,26 +51,26 @@ class srSearchQueue(srQueue):
srQueue
.
__init__
(
self
,
"SEARCHQUEUE"
)
def
is_in_queue
(
self
,
show
,
segment
):
for
_
,
_
,
cur_item
in
self
.
queue
:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
:
if
isinstance
(
cur_item
,
BacklogQueueItem
)
and
cur_item
.
show
==
show
and
cur_item
.
segment
==
segment
:
return
True
return
False
def
is_ep_in_queue
(
self
,
segment
):
for
_
,
_
,
cur_item
in
self
.
queue
:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
:
if
isinstance
(
cur_item
,
(
ManualSearchQueueItem
,
FailedQueueItem
))
and
cur_item
.
segment
==
segment
:
return
True
return
False
def
is_show_in_queue
(
self
,
show
):
for
_
,
_
,
cur_item
in
self
.
queue
:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
:
if
isinstance
(
cur_item
,
(
ManualSearchQueueItem
,
FailedQueueItem
))
and
cur_item
.
show
.
indexerid
==
show
:
return
True
return
False
def
get_all_ep_from_queue
(
self
,
show
):
ep_obj_list
=
[]
for
_
,
_
,
cur_item
in
self
.
queue
:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
:
if
isinstance
(
cur_item
,
(
ManualSearchQueueItem
,
FailedQueueItem
))
and
str
(
cur_item
.
show
.
indexerid
)
==
show
:
ep_obj_list
.
append
(
cur_item
)
return
ep_obj_list
...
...
@@ -95,14 +95,14 @@ class srSearchQueue(srQueue):
return
False
def
is_backlog_in_progress
(
self
):
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
BacklogQueueItem
):
return
True
return
False
def
is_dailysearch_in_progress
(
self
):
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
DailySearchQueueItem
):
return
True
...
...
@@ -110,7 +110,7 @@ class srSearchQueue(srQueue):
def
queue_length
(
self
):
length
=
{
'backlog'
:
0
,
'daily'
:
0
,
'manual'
:
0
,
'failed'
:
0
}
for
_
,
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
for
_
_
,
_
_
,
cur_item
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]:
if
isinstance
(
cur_item
,
DailySearchQueueItem
):
length
[
'daily'
]
+=
1
elif
isinstance
(
cur_item
,
BacklogQueueItem
):
...
...
sickrage/core/queues/show.py
View file @
f50a313c
...
...
@@ -51,7 +51,7 @@ class srShowQueue(srQueue):
if
not
show
:
return
False
return
show
.
indexerid
in
[
x
.
show
.
indexerid
if
x
.
show
else
0
for
_
,
_
,
x
in
self
.
queue
if
x
.
action_id
in
actions
]
return
show
.
indexerid
in
[
x
.
show
.
indexerid
if
x
.
show
else
0
for
_
_
,
_
_
,
x
in
self
.
queue
if
x
.
action_id
in
actions
]
def
_isBeing
(
self
,
show
,
actions
):
return
self
.
currentItem
is
not
None
and
show
==
self
.
currentItem
.
show
and
self
.
currentItem
.
action_id
in
actions
...
...
@@ -84,7 +84,7 @@ class srShowQueue(srQueue):
return
self
.
_isBeing
(
show
,
(
ShowQueueActions
.
SUBTITLE
,))
def
_getLoadingShowList
(
self
):
return
[
x
for
_
,
_
,
x
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]
if
x
and
x
.
isLoading
]
return
[
x
for
_
_
,
_
_
,
x
in
self
.
queue
+
[(
None
,
None
,
self
.
currentItem
)]
if
x
and
x
.
isLoading
]
def
updateShow
(
self
,
show
,
force
=
False
):
...
...
@@ -153,7 +153,7 @@ class srShowQueue(srQueue):
raise
CantRemoveShowException
(
"{} is already queued to be removed"
.
format
(
show
))
# remove other queued actions for this show.
for
_
,
_
,
x
in
self
.
queue
:
for
_
_
,
_
_
,
x
in
self
.
queue
:
if
x
and
x
.
show
and
x
!=
self
.
currentItem
and
show
.
indexerid
==
x
.
show
.
indexerid
:
self
.
queue
.
remove
(
x
)
...
...
sickrage/core/scene_exceptions.py
View file @
f50a313c
...
...
@@ -95,7 +95,7 @@ def retrieve_exceptions(get_xem=True, get_anidb=True):
# each exception is on one line with the format indexer_id: 'show name 1', 'show name 2', etc
cur_line
=
None
for
cur_line
in
sickrage
.
srCore
.
srWebSession
.
get
(
loc
).
text
.
splitlines
():
indexer_id
,
_
,
aliases
=
cur_line
.
partition
(
':'
)
indexer_id
,
_
_
,
aliases
=
cur_line
.
partition
(
':'
)
if
not
aliases
:
continue
...
...
sickrage/core/searchers/trakt_searcher.py
View file @
f50a313c
...
...
@@ -128,7 +128,7 @@ class srTraktSearcher(object):
sickrage
.
srCore
.
srLogger
.
debug
(
"No shows found in your library, aborting library update"
)
return
traktShow
=
[
x
for
_
,
x
in
library
.
items
()
if
traktShow
=
[
x
for
_
_
,
x
in
library
.
items
()
if
int
(
indexerid
)
==
int
(
x
.
ids
[
srIndexerApi
(
indexer
).
trakt_id
])]
except
Exception
as
e
:
sickrage
.
srCore
.
srLogger
.
warning
(
...
...
sickrage/core/tv/episode/__init__.py
View file @
f50a313c
...
...
@@ -1057,7 +1057,7 @@ class TVEpisode(object):
return
''
return
parse_result
.
release_group
_
,
epQual
=
Quality
.
splitCompositeStatus
(
self
.
status
)
_
_
,
epQual
=
Quality
.
splitCompositeStatus
(
self
.
status
)
if
sickrage
.
srCore
.
srConfig
.
NAMING_STRIP_YEAR
:
show_name
=
re
.
sub
(
r
"\(\d+\)$"
,
""
,
self
.
show
.
name
).
rstrip
()
...
...
sickrage/core/tv/show/__init__.py
View file @
f50a313c
...
...
@@ -1241,7 +1241,7 @@ class TVShow(object):
if
curEp
.
location
and
curEp
.
status
in
Quality
.
DOWNLOADED
:
if
sickrage
.
srCore
.
srConfig
.
EP_DEFAULT_DELETED_STATUS
==
ARCHIVED
:
_
,
oldQuality
=
Quality
.
splitCompositeStatus
(
curEp
.
status
)
_
_
,
oldQuality
=
Quality
.
splitCompositeStatus
(
curEp
.
status
)
new_status
=
Quality
.
compositeStatus
(
ARCHIVED
,
oldQuality
)
else
:
new_status
=
sickrage
.
srCore
.
srConfig
.
EP_DEFAULT_DELETED_STATUS
...
...
@@ -1467,7 +1467,7 @@ class TVShow(object):
return
Overview
.
GOOD
elif
epStatus
in
Quality
.
DOWNLOADED
+
Quality
.
SNATCHED
+
Quality
.
SNATCHED_PROPER
+
Quality
.
FAILED
+
Quality
.
SNATCHED_BEST
:
_
,
bestQualities
=
Quality
.
splitQuality
(
self
.
quality
)
_
_
,
bestQualities
=
Quality
.
splitQuality
(
self
.
quality
)
if
bestQualities
:
maxBestQuality
=
max
(
bestQualities
)
minBestQuality
=
min
(
bestQualities
)
...
...
sickrage/core/version_updater.py
View file @
f50a313c
...
...
@@ -197,7 +197,7 @@ class UpdateManager(object):
main_git
=
sickrage
.
srCore
.
srConfig
.
GIT_PATH
or
'git'
sickrage
.
srCore
.
srLogger
.
debug
(
"Checking if we can use git commands: "
+
main_git
+
' '
+
test_cmd
)
_
,
_
,
exit_status
=
self
.
_git_cmd
(
main_git
,
test_cmd
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
main_git
,
test_cmd
)
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Using: "
+
main_git
)
...
...
@@ -221,7 +221,7 @@ class UpdateManager(object):
for
cur_git
in
alternative_git
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Checking if we can use git commands: "
+
cur_git
+
' '
+
test_cmd
)
_
,
_
,
exit_status
=
self
.
_git_cmd
(
cur_git
,
test_cmd
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
cur_git
,
test_cmd
)
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Using: "
+
cur_git
)
...
...
@@ -244,7 +244,7 @@ class UpdateManager(object):
main_pip
=
sickrage
.
srCore
.
srConfig
.
PIP_PATH
or
'pip'
sickrage
.
srCore
.
srLogger
.
debug
(
"Checking if we can use pip commands: "
+
main_pip
+
' '
+
test_cmd
)
_
,
_
,
exit_status
=
self
.
_pip_cmd
(
main_pip
,
test_cmd
)
_
_
,
_
_
,
exit_status
=
self
.
_pip_cmd
(
main_pip
,
test_cmd
)
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Using: "
+
main_pip
)
...
...
@@ -268,7 +268,7 @@ class UpdateManager(object):
for
cur_pip
in
alternative_pip
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Checking if we can use pip commands: "
+
cur_pip
+
' '
+
test_cmd
)
_
,
_
,
exit_status
=
self
.
_pip_cmd
(
cur_pip
,
test_cmd
)
_
_
,
_
_
,
exit_status
=
self
.
_pip_cmd
(
cur_pip
,
test_cmd
)
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
debug
(
"Using: "
+
cur_pip
)
...
...
@@ -379,7 +379,7 @@ class UpdateManager(object):
return
github
.
Github
(
user_agent
=
"SiCKRAGE"
)
def
install_requirements
(
self
):
_
,
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
_
_
,
_
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
'install --no-cache-dir --user -r {}'
.
format
(
sickrage
.
REQS_FILE
))
if
not
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
warning
(
...
...
@@ -415,7 +415,7 @@ class GitUpdateManager(UpdateManager):
Returns: True for success or False for failure
"""
output
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse HEAD'
)
output
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse HEAD'
)
if
exit_status
==
0
and
output
:
cur_commit_hash
=
output
.
strip
()
if
not
re
.
match
(
'^[a-z0-9]+$'
,
cur_commit_hash
):
...
...
@@ -430,13 +430,13 @@ class GitUpdateManager(UpdateManager):
"""
# get all new info from server
output
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'remote update'
)
output
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'remote update'
)
if
not
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
warning
(
"Unable to contact server, can't check for update"
)
return
# get latest commit_hash from remote
output
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse --verify --quiet "@{upstream}"'
)
output
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse --verify --quiet "@{upstream}"'
)
if
exit_status
==
0
and
output
:
return
output
.
strip
()
...
...
@@ -470,7 +470,7 @@ class GitUpdateManager(UpdateManager):
# self.clean() # This is removing user data and backups
self
.
reset
()
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'pull -f {} {}'
.
format
(
sickrage
.
srCore
.
srConfig
.
GIT_REMOTE
,
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'pull -f {} {}'
.
format
(
sickrage
.
srCore
.
srConfig
.
GIT_REMOTE
,
self
.
current_branch
))
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
info
(
"Updating SiCKRAGE from GIT servers"
)
...
...
@@ -485,7 +485,7 @@ class GitUpdateManager(UpdateManager):
Calls git clean to remove all untracked files. Returns a bool depending
on the call's success.
"""
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'clean -df ""'
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'clean -df ""'
)
return
(
False
,
True
)[
exit_status
==
0
]
def
reset
(
self
):
...
...
@@ -493,7 +493,7 @@ class GitUpdateManager(UpdateManager):
Calls git reset --hard to perform a hard reset. Returns a bool depending
on the call's success.
"""
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'reset --hard'
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'reset --hard'
)
return
(
False
,
True
)[
exit_status
==
0
]
def
fetch
(
self
):
...
...
@@ -501,10 +501,10 @@ class GitUpdateManager(UpdateManager):
Calls git fetch to fetch all remote branches
on the call's success.
"""
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'config remote.origin.fetch %s'
%
'+refs/heads/*:refs/remotes/origin/*'
)
if
exit_status
==
0
:
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'fetch --all'
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'fetch --all'
)
return
(
False
,
True
)[
exit_status
==
0
]
def
checkout_branch
(
self
,
branch
):
...
...
@@ -518,7 +518,7 @@ class GitUpdateManager(UpdateManager):
# fetch all branches
self
.
fetch
()
_
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'checkout -f '
+
branch
)
_
_
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'checkout -f '
+
branch
)
if
exit_status
==
0
:
self
.
install_requirements
()
return
True
...
...
@@ -526,7 +526,7 @@ class GitUpdateManager(UpdateManager):
return
False
def
get_remote_url
(
self
):
url
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
url
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'remote get-url {}'
.
format
(
sickrage
.
srCore
.
srConfig
.
GIT_REMOTE
))
return
(
""
,
url
)[
exit_status
==
0
and
url
is
not
None
]
...
...
@@ -537,12 +537,12 @@ class GitUpdateManager(UpdateManager):
@
property
def
current_branch
(
self
):
branch
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse --abbrev-ref HEAD'
)
branch
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'rev-parse --abbrev-ref HEAD'
)
return
(
""
,
branch
)[
exit_status
==
0
and
branch
is
not
None
]
@
property
def
remote_branches
(
self
):
branches
,
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
branches
,
_
_
,
exit_status
=
self
.
_git_cmd
(
self
.
_git_path
,
'ls-remote --heads {}'
.
format
(
sickrage
.
srCore
.
srConfig
.
GIT_REMOTE
))
if
exit_status
==
0
and
branches
:
return
re
.
findall
(
r
'refs/heads/(.*)'
,
branches
)
...
...
@@ -651,7 +651,7 @@ class SourceUpdateManager(UpdateManager):
# walk temp folder and move files to main folder
sickrage
.
srCore
.
srLogger
.
info
(
"Moving files from "
+
content_dir
+
" to "
+
sickrage
.
PROG_DIR
)
for
dirname
,
_
,
filenames
in
os
.
walk
(
content_dir
):
for
dirname
,
_
_
,
filenames
in
os
.
walk
(
content_dir
):
dirname
=
dirname
[
len
(
content_dir
)
+
1
:]
for
curfile
in
filenames
:
old_path
=
os
.
path
.
join
(
content_dir
,
dirname
,
curfile
)
...
...
@@ -706,7 +706,7 @@ class PipUpdateManager(UpdateManager):
sickrage
.
srCore
.
NEWEST_VERSION_STRING
=
error_message
def
_find_installed_version
(
self
):
out
,
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
'show sickrage'
)
out
,
_
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
'show sickrage'
)
if
exit_status
==
0
:
return
out
.
split
(
'
\n
'
)[
1
].
split
()[
1
]
return
""
...
...
@@ -753,7 +753,7 @@ class PipUpdateManager(UpdateManager):
"""
Performs pip upgrade
"""
_
,
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
'install -U --no-cache-dir sickrage'
)
_
_
,
_
_
,
exit_status
=
self
.
_pip_cmd
(
self
.
_pip_path
,
'install -U --no-cache-dir sickrage'
)
if
exit_status
==
0
:
sickrage
.
srCore
.
srLogger
.
info
(
"Updating SiCKRAGE from PyPi servers"
)
srNotifiers
.
notify_version_update
(
self
.
get_newest_version
)
...
...
sickrage/core/webserver/__init__.py
View file @
f50a313c
...
...
@@ -60,7 +60,7 @@ class srWebServer(threading.Thread):
def
run
(
self
):
self
.
started
=
True
# load languages
for tornado web server
# load languages
tornado
.
locale
.
load_gettext_translations
(
sickrage
.
LOCALE_DIR
,
'messages'
)
# clear mako cache folder
...
...
sickrage/core/webserver/gui/default/views/home/status.mako
View file @
f50a313c
...
...
@@ -144,7 +144,7 @@
<td>${ShowQueueActions.names[sickrage.srCore.SHOWQUEUE.currentItem.action_id]}</td>
</tr>
% endif
% for _, _, item in sickrage.srCore.SHOWQUEUE.queue:
% for
_
_,
_
_, item in sickrage.srCore.SHOWQUEUE.queue:
<tr>
% try:
<% showindexerid = item.show.indexerid %>
...
...
sickrage/core/webserver/views.py
View file @
f50a313c
...
...
@@ -754,7 +754,7 @@ class Home(WebHandler):
client
=
getClientIstance
(
torrent_method
)
_
,
accesMsg
=
client
(
host
,
username
,
password
).
testAuthentication
()
_
_
,
accesMsg
=
client
(
host
,
username
,
password
).
testAuthentication
()
return
accesMsg
...
...
@@ -2082,7 +2082,7 @@ class Home(WebHandler):
# return the correct json value
# Find the quality class for the episode
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
_
_
,
ep_quality
=
Quality
.
splitCompositeStatus
(
ep_obj
.
status
)
if
ep_quality
in
Quality
.
cssClassStrings
:
quality_class
=
Quality
.
cssClassStrings
[
ep_quality
]
else
:
...
...
sickrage/libs/trakt/core/http.py
View file @
f50a313c
...
...
@@ -126,7 +126,7 @@ class HttpClient(object):
try
:
response
=
self
.
session
.
send
(
request
,
timeout
=
timeout
)
except
socket
.
gaierror
as
e
:
code
,
_
=
e
code
,
_
_
=
e
if
code
!=
8
:
raise
e
...
...
sickrage/libs/trakt/mapper/core/base.py
View file @
f50a313c
...
...
@@ -92,7 +92,7 @@ class Mapper(object):
@
classmethod
def
construct
(
cls
,
client
,
media
,
item
,
keys
=
None
,
**
kwargs
):
if
keys
is
None
:
_
,
keys
=
cls
.
get_ids
(
media
,
item
)
_
_
,
keys
=
cls
.
get_ids
(
media
,
item
)
if
media
==
'movie'
:
return
Movie
.
_construct
(
client
,
keys
,
item
,
**
kwargs
)
...
...
sickrage/libs/trakt/objects/comment.py
View file @
f50a313c
...
...
@@ -102,7 +102,7 @@ class Comment(object):
if
self
.
pk
is
None
:
return
None
_
,
sid
=
self
.
pk
_
_
,
sid
=
self
.
pk
return
sid
...
...
sickrage/libs/trakt/objects/episode.py
View file @
f50a313c
...
...
@@ -58,7 +58,7 @@ class Episode(Video):
:rtype: :class:`~python:dict`
"""
_
,
number
=
self
.
pk
_
_
,
number
=
self
.
pk
return
{
'number'
:
number
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment