Skip to content

Commit

Permalink
fixed listing published folders with incorrect naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-Duduf committed Jan 27, 2023
1 parent 4a8b868 commit 9131f29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions ramses/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,23 @@ def _publishVersionFoldersSorter( f ):
folderNameList = folderName.split('_')
numBlocks = len(folderNameList)
# Invalid, return the lowest value
if numBlocks == 0 or numBlocks > 3: return float('-inf')
if numBlocks == 0 or numBlocks > 3:
return float('-inf')
# Single or dual block, should be a number
if numBlocks == 1 or numBlocks == 2: return int(folderNameList[0])
if numBlocks == 1 or numBlocks == 2:
# naming could be faulty
try:
n = int(folderNameList[0])
except ValueError:
n = float('-inf')
return n
# Triple block, there's a resource, we return the version
# -resourceId + version
resourceBytes = folderNameList[0].encode('utf_8', 'replace')
resourceInt = - int( codecs.encode( resourceBytes, 'hex' ), 16 ) * 1000
return resourceInt + int( folderNameList[1] )
# naming could be faulty
try:
n = int(folderNameList[1])
except ValueError:
n = float('-inf')
return resourceInt + n
2 changes: 1 addition & 1 deletion ramses/ram_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .constants import FolderNames, LogLevel
from .logger import log

theVersion = "0.8.0-Beta"
theVersion = "0.8.1-Beta"

class RamSettings( object ):
"""Gets and saves settings used by Ramses.
Expand Down

0 comments on commit 9131f29

Please sign in to comment.