Commit de8804b1 authored by echel0n's avatar echel0n
Browse files

View Changelog now reads changelog.md file

parent 4a12c794
# Changelog
- * 25aaefe - 2018-05-03: Pre-Release v9.3.18.dev3
- * 52b892b - 2018-05-03: View Changelog now reads changelog.md file
- * 4a12c79 - 2018-05-03: Pre-Release v9.3.18.dev3
- * 2a46cba - 2018-05-03: Pre-Release v9.3.18.dev2
- * 821cc99 - 2018-05-03: Refactoring of provider code
- * f85ba73 - 2018-05-03: Pre-Release v9.3.18.dev1
......
......@@ -37,6 +37,7 @@ PROG_DIR = os.path.abspath(os.path.realpath(os.path.expanduser(os.path.dirname(_
LOCALE_DIR = os.path.join(PROG_DIR, 'locale')
LIBS_DIR = os.path.join(PROG_DIR, 'libs')
REQS_FILE = os.path.join(MAIN_DIR, 'requirements.txt')
CHANGELOG_FILE = os.path.join(MAIN_DIR, 'changelog.md')
class Daemon(object):
......@@ -190,6 +191,12 @@ def version():
return f.read()
def changelog():
# Get the version number
with io.open(CHANGELOG_FILE) as f:
return f.read()
def main():
global app
......
......@@ -113,7 +113,6 @@ class Core(object):
self.naming_sep_type = (" - ", " ")
self.naming_sep_type_text = (" - ", "space")
self.changelog_url = "https://cdn.sickrage.ca/changelog/?q={branch}"
self.user_agent = 'SiCKRAGE.CE.1/({};{};{})'.format(platform.system(), platform.release(), str(uuid.uuid1()))
self.languages = [language for language in os.listdir(sickrage.LOCALE_DIR) if '_' in language]
self.sys_encoding = get_sys_encoding()
......
......@@ -81,7 +81,6 @@ from sickrage.core.tv.show.history import History as HistoryTool
from sickrage.core.updaters import tz_updater
from sickrage.core.webserver import ApiHandler
from sickrage.core.webserver.routes import Route
from sickrage.core.websession import WebSession
from sickrage.indexers import IndexerApi
from sickrage.notifiers import Notifiers
from sickrage.providers import NewznabProvider, TorrentRssProvider
......@@ -2260,21 +2259,9 @@ class changelog(WebHandler):
super(changelog, self).__init__(*args, **kwargs)
def index(self):
url = sickrage.app.changelog_url.format(branch=sickrage.app.version_updater.branch)
try:
changes = WebSession().get(url).text
except Exception:
sickrage.app.log.debug('Could not load changes from repo, giving a link!')
changes = _('Could not load changes from the repo. [Click here for CHANGES.md]({})').format(url)
data = markdown2.markdown(
changes if changes else _("The was a problem connecting to the server, please refresh and try again"),
extras=['header-ids'])
data = markdown2.markdown(sickrage.changelog(), extras=['header-ids'])
sickrage.app.config.view_changelog = False
sickrage.app.config.save()
return data
......
Supports Markdown
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