Skip to content

Commit

Permalink
Music lists that list no length for a track may be loaded again (are …
Browse files Browse the repository at this point in the history
…assumed to not loop)
  • Loading branch information
Chrezm committed Apr 30, 2020
1 parent ea3f514 commit 054a88f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,6 @@

### 200428a (4.2.3-post9)
* Fixed incorrect error messages being sent in case the server's system fails to open an area list or music list file.

### 200430a (4.2.3-post10)
* Reverted backwards incompatible change that prevented music lists that did not list length for a track (meaning they did not want them to be looped) from being loaded.
9 changes: 6 additions & 3 deletions server/tsuserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def __init__(self, protocol=None, client_manager=None, in_test=False):
self.release = 4
self.major_version = 2
self.minor_version = 3
self.segment_version = 'post9'
self.internal_version = '200428a'
self.segment_version = 'post10'
self.internal_version = '200430a'
version_string = self.get_version_string()
self.software = 'TsuserverDR {}'.format(version_string)
self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version)
Expand Down Expand Up @@ -548,7 +548,10 @@ def prepare_music_list(self, c=None, specific_music_list=None):
for item in specific_music_list:
prepared_music_list.append(item['category'])
for song in item['songs']:
name, length = song['name'], song['length']
if 'length' not in song:
name, length = song['name'], -1
else:
name, length = song['name'], song['length']

# Check that length is a number, and if not, abort.
if not isinstance(length, (int, float)):
Expand Down

0 comments on commit 054a88f

Please sign in to comment.