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
059e4cc8
Commit
059e4cc8
authored
Jun 25, 2015
by
Dustyn Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Network timezones loaded from git submodule
parent
ec20cb9a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sickbeard/network_timezones.py
+23
-18
23 additions, 18 deletions
sickbeard/network_timezones.py
sickbeard/scene_numbering.py
+1
-1
1 addition, 1 deletion
sickbeard/scene_numbering.py
with
24 additions
and
19 deletions
sickbeard/network_timezones.py
+
23
−
18
View file @
059e4cc8
...
...
@@ -22,6 +22,7 @@ from sickbeard import db
from
sickbeard
import
helpers
from
sickbeard
import
logger
from
sickbeard
import
encodingKludge
as
ek
from
sickbeard.exceptions
import
ex
from
os.path
import
basename
,
join
,
isfile
import
os
import
re
...
...
@@ -72,31 +73,34 @@ def _update_zoneinfo():
global
sb_timezone
sb_timezone
=
tz
.
tzlocal
()
# now check if the zoneinfo needs update
url_zv
=
'
http://sickragetv.github.io/sb_network_timezones/zoneinfo.txt
'
# TODO `git submodule update`
# now check if the zoneinfo needs update form the git submodule
loc_zv
=
'
lib/network_timezones/zoneinfo.txt
'
# Read version file
try
:
url_data
=
helpers
.
getURL
(
url_zv
)
if
not
url_data
:
with
open
(
loc_zv
,
'
r
'
)
as
file
:
data
=
file
.
read
()
if
not
data
:
raise
# Filename of existing zoneinfo
if
lib
.
dateutil
.
zoneinfo
.
ZONEINFOFILE
is
not
None
:
cur_zoneinfo
=
ek
.
ek
(
basename
,
lib
.
dateutil
.
zoneinfo
.
ZONEINFOFILE
)
else
:
cur_zoneinfo
=
None
(
new_zoneinfo
,
zoneinfo_md5
)
=
url_data
.
decode
(
'
utf-8
'
).
strip
().
rsplit
(
u
'
'
)
except
:
# When urlData is None, trouble connecting to github
logger
.
log
(
u
'
Loading zoneinfo.txt failed, this can happen from time to time. Unable to get URL: %s
'
%
url_zv
,
logger
.
WARNING
)
# Filename and hash of new zoneinfo
(
new_zoneinfo
,
zoneinfo_md5
)
=
data
.
decode
(
'
utf-8
'
).
strip
().
rsplit
(
u
'
'
)
except
Exception
as
e
:
logger
.
log
(
u
'
Crazy problem with zoneinfo: %s
'
%
ex
(
e
),
logger
.
ERROR
)
return
if
(
cur_zoneinfo
is
not
None
)
and
(
new_zoneinfo
==
cur_zoneinfo
):
return
# now load the new zoneinfo
url
_tar
=
u
'
http://sickragetv.github.io/sb_
network_timezones/%s
'
%
new_zoneinfo
loc
_tar
=
u
'
lib/
network_timezones/%s
'
%
new_zoneinfo
zonefile
=
helpers
.
real_path
(
ek
.
ek
(
join
,
ek
.
ek
(
os
.
path
.
dirname
,
lib
.
dateutil
.
zoneinfo
.
__file__
),
new_zoneinfo
))
zonefile_tmp
=
re
.
sub
(
r
'
\.tar\.gz$
'
,
'
.tmp
'
,
zonefile
)
...
...
@@ -108,7 +112,7 @@ def _update_zoneinfo():
logger
.
log
(
u
'
Unable to delete: %s
'
%
zonefile_tmp
,
logger
.
ERROR
)
return
if
not
helpers
.
download_f
ile
(
url
_tar
,
zonefile_tmp
):
if
not
helpers
.
copyF
ile
(
loc
_tar
,
zonefile_tmp
):
return
if
not
ek
.
ek
(
os
.
path
.
exists
,
zonefile_tmp
):
...
...
@@ -147,18 +151,19 @@ def update_network_dict():
d
=
{}
# network timezones are stored on github pages
url
=
'
http://sickragetv.github.io/sb_network_timezones/network_timezones.txt
'
# network timezones are stored in a git submodule
loc
=
'
lib/network_timezones/network_timezones.txt
'
with
open
(
loc
,
'
r
'
)
as
file
:
data
=
file
.
read
()
url_data
=
helpers
.
getURL
(
url
)
if
url_data
is
None
:
# When urlData is None, trouble connecting to github
logger
.
log
(
u
'
Updating network timezones failed, this can happen from time to time. URL: %s
'
%
url
,
logger
.
WARNING
)
if
data
is
None
:
logger
.
log
(
u
'
Updating network timezones failed
'
,
logger
.
ERROR
)
load_network_dict
()
return
try
:
for
line
in
url_
data
.
splitlines
():
for
line
in
data
.
splitlines
():
(
key
,
val
)
=
line
.
decode
(
'
utf-8
'
).
strip
().
rsplit
(
u
'
:
'
,
1
)
if
key
is
None
or
val
is
None
:
continue
...
...
This diff is collapsed.
Click to expand it.
sickbeard/scene_numbering.py
+
1
−
1
View file @
059e4cc8
...
...
@@ -486,7 +486,7 @@ def xem_refresh(indexer_id, indexer, force=False):
if
refresh
or
force
:
logger
.
log
(
u
'
Looking up XEM scene mapping
using
for show %s on %s
'
%
(
indexer_id
,
sickbeard
.
indexerApi
(
indexer
).
name
,),
u
'
Looking up XEM scene mapping for show %s on %s
'
%
(
indexer_id
,
sickbeard
.
indexerApi
(
indexer
).
name
,),
logger
.
DEBUG
)
# mark refreshed
...
...
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