Commit c0b5ab85 authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/10.0.25'

parents 721b0d46 cfa84f21
......@@ -2,8 +2,14 @@
 
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
 
#### [10.0.25](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.24...10.0.25)
- Fixed ValueError sickrage.core.searchers.backlog_searcher in _get_wanted [`1633328`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/1633328e43dede0070c144748f5b2dafa10eeffd)
#### [10.0.24](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.23...10.0.24)
 
> 2 August 2021
#### [10.0.23](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.22...10.0.23)
 
> 1 August 2021
......
{
"name": "sickrage",
"version": "10.0.24",
"version": "10.0.25",
"private": true,
"repository": {
"type": "git",
......
[bumpversion]
current_version = 10.0.24
current_version = 10.0.25
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
......
......@@ -19,7 +19,7 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
__version__ = "10.0.24"
__version__ = "10.0.25"
__install_type__ = ""
import argparse
......
sickrage/__init__.py = ca7d2a0835d186c4e76199b20da3fc43
sickrage/__init__.py = ad0b572fff43222402c8bbb7958acbc0
sickrage/checksums.md5 = d41d8cd98f00b204e9800998ecf8427e
sickrage/version.txt = c56d538e76cd69bd0cf391c6705fb530
sickrage/version.txt = 4f41d49f1732abe4c271d2ca8bec355b
sickrage/autoProcessTV/hellaToSiCKRAGE.py = 9bc477abfd456aaba8d6bf46f2c59b1f
sickrage/autoProcessTV/__init__.py = bfa892dee586740a3a618d3c1955156c
sickrage/autoProcessTV/mediaToSiCKRAGE.py = f88a6679a211b1f97126c116e2c33b9c
......@@ -58,7 +58,7 @@ sickrage/core/upnp.py = 51eb609bd1f59baa3c0c346d5ac19787
sickrage/core/ui.py = bc530df3dcdf73126f22b7c5719641be
sickrage/core/announcements.py = 6c3ed44e7ae50c281383ab5f278102c6
sickrage/core/google_drive.py = 0129b53b8a649fa7c55bfe0c5ad11bdb
sickrage/core/__init__.py = ab85a34dabf68e62575bd954636ceb7a
sickrage/core/__init__.py = f93c16e190e49e1a4d84551fb9114716
sickrage/core/process_tv.py = 192c68108d5b5d1d0c84c7865209e21d
sickrage/core/enums.py = 5a8fac089e8c4451a1d6b28c1762e684
sickrage/core/classes.py = ca0d7c07b684b8fe22788346dc755fd8
......@@ -66,7 +66,7 @@ sickrage/core/blackandwhitelist.py = 9d0a8e2aae2353a842306730c2690c2c
sickrage/core/search.py = c8d189e6b61f29e6a364520c5142192e
sickrage/core/nzbSplitter.py = 8bb813262916d2208e905fb53e575284
sickrage/core/traktapi.py = e30a23461b7e5d3af7619ad3e229bc40
sickrage/core/version_updater.py = 1124d1ec66e549dff321bb48f35ea589
sickrage/core/version_updater.py = 437935ddd7decd1d28319453ca6bcfcf
sickrage/core/imdb_popular.py = 4739028ad8dac20901db175ef9df5875
sickrage/core/scene_numbering.py = e517e5232d3b9ca186fe8b33578abd4b
sickrage/core/config/__init__.py = de29a2b668fe871cda8103664adc8853
......@@ -82,7 +82,7 @@ sickrage/core/tv/show/coming_episodes.py = 0d43711e559f1fbda75fc25b3485928f
sickrage/core/tv/show/__init__.py = 35291b3647ef4dbacebc60f2dfe48d39
sickrage/core/tv/show/helpers.py = 7e3bc2e2e744a50ac7188e79e9d98465
sickrage/core/tv/show/history.py = 02a46fa4946cdf7b80915da916f25ca0
sickrage/core/webserver/__init__.py = c64c41ca9a8063f28762ba1e3827fc91
sickrage/core/webserver/__init__.py = bd70e1e71370274f7128400c8d5b0bb0
sickrage/core/webserver/handlers/announcements.py = cca0415f047c367e5b41c0fed6a24dbf
sickrage/core/webserver/handlers/calendar.py = 8053d4d70a574a54d4bb9a0ad88f9f4e
sickrage/core/webserver/handlers/google_drive.py = 98fde470e65096ec71a8e3f1cce2bd44
......@@ -165,8 +165,8 @@ sickrage/core/webserver/static/images/backdrops/manage.jpg = 2e49098c0ed9aacf602
sickrage/core/webserver/static/images/backdrops/addshows.jpg = 7f3e186790208b63dadda09d6b91d334
sickrage/core/webserver/static/images/backdrops/home.jpg = 804dfc976638bbf45df310a3627e2d5c
sickrage/core/webserver/static/images/backdrops/schedule.jpg = 0c0e5f4dcee42bfcfb73de100f1d3015
sickrage/core/webserver/static/js/core.js.map = 4d684f9bf427300282b2ca6e9137ed89
sickrage/core/webserver/static/js/core.min.js = cdd92713f7646980841a73698623f738
sickrage/core/webserver/static/js/core.js.map = d4ce3a80318fdff1182184661da1a56d
sickrage/core/webserver/static/js/core.min.js = 5db6fcd0202fdbc175bb0d762b086440
sickrage/core/webserver/static/fonts/fa-solid-900.eot = 89bd2e38475e441a5cd70f663f921d61
sickrage/core/webserver/static/fonts/fa-regular-400.eot = ad3a7c0d77e09602f4ab73db3660ffd8
sickrage/core/webserver/static/fonts/fa-brands-400.eot = 0fabb6606be4c45acfeedd115d0caca4
......@@ -256,7 +256,7 @@ sickrage/core/caches/image_cache.py = e97a0b7f9d95ad22813b9c2b5f1f9ffd
sickrage/core/caches/tv_cache.py = 9b4d289ac83882d5b682df97b89d5fd3
sickrage/core/caches/__init__.py = bf0bdb641ddd7af015537ca503e49977
sickrage/core/caches/name_cache.py = 8cceca1983838af2e581c6187912b2cc
sickrage/core/amqp/__init__.py = 5aaa81c411a619ae60960e89b99d3fcb
sickrage/core/amqp/__init__.py = cc99abacdc1d2faf46071e03c75af2a0
sickrage/core/databases/__init__.py = b232e45d8996a662866178c2d6d6169b
sickrage/core/databases/config/__init__.py = 2ece97d07008bf50e49aea26f3a50342
sickrage/core/databases/config/schemas.py = fb5ab0a7e0b851bb5fef6f4a7cd55912
......@@ -301,17 +301,17 @@ sickrage/core/databases/main/migrations/versions/016_Merge_Scene_Numbering_Table
sickrage/core/databases/main/migrations/versions/014_Add_Last_XEM_Refresh_Column_To_TVShows_Table.py = 08b3a05209d019db448e05e877ee8af3
sickrage/core/databases/main/migrations/versions/018_Convert_Timestamp_Integer_Columns_To_DateTime_Type_On_TVEpisode_Table.py = 9fe241e2a03db8133f3ab375144c79ee
sickrage/core/databases/main/migrations/versions/004_Rename_Columns_On_TVShow_Table.py = 347e30546823c3f7e0d4577b72a97ec7
sickrage/core/api/__init__.py = 42a0615be5b16e6d3bacaeeda03eee47
sickrage/core/api/__init__.py = 08981481c15c8740ac57c32e9138bc58
sickrage/core/api/exceptions.py = bdac7bcebad3d9ce2809f2d7e65810e0
sickrage/core/updaters/show_updater.py = b4d2e3d6cce803a65bb3f5e8f1f9e6da
sickrage/core/updaters/__init__.py = d41d8cd98f00b204e9800998ecf8427e
sickrage/core/updaters/tz_updater.py = 314f96c3c383541af00ed973c0c613c5
sickrage/core/updaters/rsscache_updater.py = e98788513592ea63c9f0e523b1822028
sickrage/core/searchers/backlog_searcher.py = 5366a699fb27b1fc9843716f83786f51
sickrage/core/searchers/backlog_searcher.py = bfc8a80620ee07b21627cc982d07b2e4
sickrage/core/searchers/__init__.py = 096e3204587cd29aab63926bec3cd7f6
sickrage/core/searchers/trakt_searcher.py = 27331bd87d5cfa83e026896bcc41deef
sickrage/core/searchers/proper_searcher.py = 9cb7e7a56514edc3b2dabe314d209b1d
sickrage/core/searchers/daily_searcher.py = 2670a386644c39555eb67e615ea820c7
sickrage/core/searchers/daily_searcher.py = 5f3e23e80b489528b502be4fc3b3d725
sickrage/core/searchers/failed_snatch_searcher.py = 710c5b9cbcd6552a56c0e7e07a3fcfd4
sickrage/core/searchers/subtitle_searcher.py = 3292b7374cc7ad2e9efaf590e78e4f42
sickrage/core/nameparser/__init__.py = 27c01e5b187d2197b6fdaa418d178f4f
......
......@@ -523,17 +523,6 @@ class Core(object):
id=self.upnp_client.name
)
# add server connections update job
self.scheduler.add_job(
self.api.update_server_connections,
IntervalTrigger(
days=1,
timezone='utc'
),
name=self.api.name,
id=self.api.name
)
# start queues
self.search_queue.start_worker(self.config.general.max_queue_workers)
self.show_queue.start_worker(self.config.general.max_queue_workers)
......@@ -542,12 +531,12 @@ class Core(object):
# start web server
self.wserver.start()
# update server connections
self.scheduler.get_job(self.api.name).modify(next_run_time=datetime.datetime.utcnow())
# start scheduler service
self.scheduler.start()
# perform server checkup
IOLoop.current().add_callback(self.server_checkup)
# load shows
IOLoop.current().add_callback(self.load_shows)
......@@ -563,7 +552,10 @@ class Core(object):
# launch browser
IOLoop.current().add_callback(self.launch_browser)
# shutdown trigger
# perform server checkups every hour
PeriodicCallback(self.server_checkup, 1 * 60 * 60 * 1000).start()
# perform shutdown trigger check every 5 seconds
PeriodicCallback(self.shutdown_trigger, 5 * 1000).start()
# start ioloop
......@@ -602,6 +594,37 @@ class Core(object):
for tag_key, tag_value in sentry_tags.items():
sentry_sdk.set_tag(tag_key, tag_value)
def server_checkup(self):
if self.config.general.server_id:
server_status = self.api.server.get_status(self.config.general.server_id)
if server_status and not server_status['registered']:
# re-register server
server_id = self.api.server.register_server(
ip_addresses=','.join([get_internal_ip()]),
web_protocol=('http', 'https')[self.config.general.enable_https],
web_port=self.config.general.web_port,
web_root=self.config.general.web_root,
server_version=sickrage.version(),
)
if server_id:
self.log.info('Re-registered SiCKRAGE server with SiCKRAGE API')
sentry_sdk.set_tag('server_id', self.config.general.server_id)
self.config.general.server_id = server_id
self.config.save(mark_dirty=True)
else:
self.log.info('Updating SiCKRAGE server data on SiCKRAGE API')
# update server information
self.api.server.update_server(
server_id=self.config.general.server_id,
ip_addresses=','.join([get_internal_ip()]),
web_protocol=('http', 'https')[self.config.general.enable_https],
web_port=self.config.general.web_port,
web_root=self.config.general.web_root,
server_version=sickrage.version(),
)
def load_shows(self):
threading.currentThread().setName('CORE')
......
......@@ -89,7 +89,9 @@ class AMQPClient(object):
return
if sickrage.app.api.token_time_remaining < (int(sickrage.app.api.token['expires_in']) / 2):
sickrage.app.api.refresh_token()
if not sickrage.app.api.refresh_token():
IOLoop.current().call_later(5, self.reconnect)
return
try:
credentials = pika.credentials.PlainCredentials(username='sickrage', password=sickrage.app.api.token["access_token"])
......
......@@ -8,6 +8,7 @@ import oauthlib.oauth2
import requests
import requests.exceptions
from jose import ExpiredSignatureError
from oauthlib.oauth2 import MissingTokenError, InvalidGrantError, InvalidClientIdError
from requests_oauthlib import OAuth2Session
from sqlalchemy import orm
......@@ -60,17 +61,6 @@ class API(object):
def alexa(self):
return self.AlexaAPI(self)
def update_server_connections(self):
if sickrage.app.config.general.server_id:
self.server.update_server(
server_id=sickrage.app.config.general.server_id,
ip_addresses=','.join([get_internal_ip()]),
web_protocol=('http', 'https')[sickrage.app.config.general.enable_https],
web_port=sickrage.app.config.general.web_port,
web_root=sickrage.app.config.general.web_root,
server_version=sickrage.version(),
)
@property
def session(self):
extra = {
......@@ -180,8 +170,11 @@ class API(object):
try:
client = OAuth2Session(sickrage.app.auth_server.client_id, token=self.token)
self.token = client.refresh_token(self.token_url, **extra)
except requests.exceptions.RequestException:
pass
return True
except (InvalidGrantError, MissingTokenError, InvalidClientIdError, requests.exceptions.RequestException):
return False
return False
def exchange_token(self, access_token, scope='offline_access'):
exchange = {'scope': scope, 'subject_token': access_token}
......@@ -217,7 +210,8 @@ class API(object):
continue
if self.token_time_remaining < (int(self.token['expires_in']) / 2):
self.refresh_token()
if not self.refresh_token():
continue
resp = self.session.request(method, url, timeout=timeout, verify=False, hooks={'response': self.throttle_hook}, **kwargs)
......
......@@ -120,7 +120,7 @@ class BacklogSearcher(object):
continue
elif cur_quality != Qualities.UNKNOWN and cur_quality > max(best_qualities):
continue
else:
elif any_qualities:
if cur_quality in any_qualities:
continue
elif cur_quality != Qualities.UNKNOWN and cur_quality > max(any_qualities):
......
......@@ -108,7 +108,7 @@ class DailySearcher(object):
continue
elif cur_quality != Qualities.UNKNOWN and cur_quality > max(best_qualities):
continue
else:
elif any_qualities:
if cur_quality in any_qualities:
continue
elif cur_quality != Qualities.UNKNOWN and cur_quality > max(any_qualities):
......
......@@ -258,9 +258,9 @@ class UpdateManager(object):
if not self.manual_update:
update_url = f"{sickrage.app.config.general.web_root}/home/update/?pid={sickrage.app.pid}"
message = _(f'New SiCKRAGE {self.current_branch} update available, version {latest_version} &mdash; <a href=\"{update_url}\">Update Now</a>')
message = _(f'New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version} &mdash; <a href=\"{update_url}\">Update Now</a>')
else:
message = _(f"New SiCKRAGE {self.current_branch} update available, version {latest_version}, please manually update!")
message = _(f"New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version}, please manually update!")
sickrage.app.latest_version_string = message
......
......@@ -484,8 +484,6 @@ class WebServer(object):
# HTTPS Cert/Key object
ssl_ctx = None
if sickrage.app.config.general.enable_https:
tornado.autoreload.watch(sickrage.app.config.general.https_cert)
tornado.autoreload.start()
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_ctx.load_cert_chain(sickrage.app.config.general.https_cert, sickrage.app.config.general.https_key)
......@@ -526,6 +524,9 @@ class WebServer(object):
sickrage.app.log.info("Loaded SSL certificate successfully")
if self.server:
sickrage.app.shutdown(restart=True)
return True
def certificate_needs_renewal(self):
......
10.0.24
\ No newline at end of file
10.0.25
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment