Fix show full changelog on fresh install

This commit is contained in:
JonnyWong16 2018-02-12 17:16:43 -08:00
parent 0010cbe21f
commit dc743ac378

View file

@ -22,6 +22,7 @@ import subprocess
import threading import threading
import datetime import datetime
import uuid import uuid
# Some cut down versions of Python may not include this module and it's not critical for us # Some cut down versions of Python may not include this module and it's not critical for us
try: try:
import webbrowser import webbrowser
@ -213,6 +214,8 @@ def initialize(config_file):
except IOError as e: except IOError as e:
logger.error(u"Unable to read previous version from file '%s': %s" % logger.error(u"Unable to read previous version from file '%s': %s" %
(version_lock_file, e)) (version_lock_file, e))
else:
prev_version = 'cfd30996264b7e9fe4ef87f02d1cc52d1ae8bfca'
# Get the currently installed version. Returns None, 'win32' or the git # Get the currently installed version. Returns None, 'win32' or the git
# hash. # hash.
@ -284,6 +287,7 @@ def initialize(config_file):
_INITIALIZED = True _INITIALIZED = True
return True return True
def daemonize(): def daemonize():
if threading.activeCount() != 1: if threading.activeCount() != 1:
logger.warn( logger.warn(
@ -1080,9 +1084,9 @@ def dbcheck():
) )
c_db.execute( c_db.execute(
'UPDATE session_history_media_info SET transcode_decision = (CASE ' 'UPDATE session_history_media_info SET transcode_decision = (CASE '
'WHEN video_decision = "transcode" OR audio_decision = "transcode" THEN "transcode" ' 'WHEN video_decision = "transcode" OR audio_decision = "transcode" THEN "transcode" '
'WHEN video_decision = "copy" OR audio_decision = "copy" THEN "copy" ' 'WHEN video_decision = "copy" OR audio_decision = "copy" THEN "copy" '
'WHEN video_decision = "direct play" OR audio_decision = "direct play" THEN "direct play" END)' 'WHEN video_decision = "direct play" OR audio_decision = "direct play" THEN "direct play" END)'
) )
# Upgrade session_history_media_info table from earlier versions # Upgrade session_history_media_info table from earlier versions
@ -1241,7 +1245,6 @@ def dbcheck():
'UPDATE session_history_media_info SET subtitle_codec = "" WHERE subtitle_codec IS NULL ' 'UPDATE session_history_media_info SET subtitle_codec = "" WHERE subtitle_codec IS NULL '
) )
# Upgrade session_history_media_info table from earlier versions # Upgrade session_history_media_info table from earlier versions
try: try:
result = c_db.execute('SELECT stream_container FROM session_history_media_info ' result = c_db.execute('SELECT stream_container FROM session_history_media_info '
@ -1598,12 +1601,14 @@ def dbcheck():
conn_db.commit() conn_db.commit()
c_db.close() c_db.close()
def upgrade(): def upgrade():
if CONFIG.UPDATE_NOTIFIERS_DB: if CONFIG.UPDATE_NOTIFIERS_DB:
notifiers.upgrade_config_to_db() notifiers.upgrade_config_to_db()
if CONFIG.UPDATE_LIBRARIES_DB_NOTIFY: if CONFIG.UPDATE_LIBRARIES_DB_NOTIFY:
libraries.update_libraries_db_notify() libraries.update_libraries_db_notify()
def shutdown(restart=False, update=False, checkout=False): def shutdown(restart=False, update=False, checkout=False):
cherrypy.engine.exit() cherrypy.engine.exit()
SCHED.shutdown(wait=False) SCHED.shutdown(wait=False)