diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css
index 0e50486a..384c8f75 100644
--- a/data/interfaces/default/css/plexpy.css
+++ b/data/interfaces/default/css/plexpy.css
@@ -3147,4 +3147,17 @@ a:hover .overlay-refresh-image:hover {
}
.git-group select.form-control {
width: 50%;
+}
+#changelog-modal .modal-body > h2 {
+ margin-bottom: 10px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #444;
+ font-size: 18px;
+}
+#changelog-modal .modal-body > ul {
+ padding-left: 25px;
+ margin-bottom: 30px;
+}
+#changelog-modal ul {
+ padding-left: 20px;
}
\ No newline at end of file
diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html
index 04b11358..914e1412 100644
--- a/data/interfaces/default/index.html
+++ b/data/interfaces/default/index.html
@@ -73,7 +73,7 @@
diff --git a/plexpy/versioncheck.py b/plexpy/versioncheck.py
index ce3affa5..4c3336dc 100644
--- a/plexpy/versioncheck.py
+++ b/plexpy/versioncheck.py
@@ -285,50 +285,58 @@ def checkout_git_branch():
def read_changelog(latest_only=False):
-
changelog_file = os.path.join(plexpy.PROG_DIR, 'CHANGELOG.md')
+ if not os.path.isfile(changelog_file):
+ return '
Missing changelog file
'
+
try:
- logfile = open(changelog_file, "r")
+ output = ''
+ prev_level = 0
+
+ latest_version_found = False
+
+ header_pattern = re.compile(r'(^#+)\s(.+)')
+ list_pattern = re.compile(r'(^[ \t]*\*\s)(.+)')
+
+ with open(changelog_file, "r") as logfile:
+ for line in logfile:
+ line_header_match = re.search(header_pattern, line)
+ line_list_match = re.search(list_pattern, line)
+
+ if line_header_match:
+ header_level = str(len(line_header_match.group(1)))
+ header_text = line_header_match.group(2)
+
+ if header_text.lower() == 'changelog':
+ continue
+
+ if latest_version_found:
+ break
+ elif latest_only:
+ latest_version_found = True
+
+ output += '
' + header_text + ''
+
+ elif line_list_match:
+ line_level = len(line_list_match.group(1)) / 2
+ line_text = line_list_match.group(2)
+
+ if line_level > prev_level:
+ output += '
' * (line_level - prev_level) + '- ' + line_text + '
'
+ elif line_level < prev_level:
+ output += '
' * (prev_level - line_level) + '
' + line_text + ''
+ else:
+ output += '
' + line_text + ''
+
+ prev_level = line_level
+
+ elif line.strip() == '' and prev_level:
+ output += '' * (prev_level)
+ prev_level = 0
+
+ return output
+
except IOError as e:
logger.error('PlexPy Version Checker :: Unable to open changelog file. %s' % e)
return '
Unable to open changelog file
'
-
- if logfile:
- output = ''
- lines = logfile.readlines()
- previous_line = ''
- latest_version_found = False
-
- for line in lines:
- if line[:2] == '# ':
- #output += '
' + line[2:] + '
'
- pass
- elif line[:3] == '## ':
- if latest_version_found:
- break
- elif latest_only:
- output += '
PlexPy ' + line[3:] + '
'
- latest_version_found = True
- else:
- output += '
' + line[3:] + '
'
- elif line[:2] == '* ' and previous_line.strip() == '':
- output += '
- ' + line[2:] + '
'
- elif line[:2] == '* ' and previous_line[:4] == ' * ':
- output += '
' + line[2:] + ''
- elif line[:2] == '* ':
- output += '
' + line[2:] + ''
- elif line[:4] == ' * ' and previous_line[:2] == '* ':
- output += '
- ' + line[4:] + '
'
- elif line[:4] == ' * ':
- output += '- ' + line[4:] + '
'
- elif line.strip() == '' and (previous_line[:2] == '* ' or previous_line[:4] == ' * '):
- output += '
'
- else:
- output += line + ''
-
- previous_line = line
-
- return output
- else:
- return '
No changelog data
'
\ No newline at end of file