Skip to content

Commit

Permalink
Fixed post process when there is no file
Browse files Browse the repository at this point in the history
  • Loading branch information
05sonicblue committed May 8, 2015
1 parent 39297d5 commit 9634af9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Binary file modified GamezServer.db
Binary file not shown.
7 changes: 5 additions & 2 deletions GamezServer/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def PostProcess(self,folder,gameId):

if(platformName == "Microsoft Xbox 360"):
failedFile = False
fileCount = 0
abgxEnabled = dao.GetSiteMasterData("abgx360Enabled")
abgxPath = dao.GetSiteMasterData("abgx360Path")
abgxRegion = dao.GetSiteMasterData("abgx360Region")
Expand Down Expand Up @@ -90,19 +91,21 @@ def PostProcess(self,folder,gameId):
if(processFile and gameName != "" and validSs and validDmi):
result = result + 'Copying file: ' + file + '\n'
extension = os.path.splitext(fileToProcess)[len(os.path.splitext(fileToProcess))-1]
finalFileName = os.path.join(destFolderGame,gameName + extension)
finalFileName = os.path.join(destFolderGame,gameName)
if(discNumber != None):
finalFileName = finalFileName + ' - ' + str(discNumber)
finalFileName = finalFileName + extension
buffer_size = 1024
with open(fileToProcess, 'rb') as fsrc:
with open(finalFileName, 'wb') as fdest:
shutil.copyfileobj(fsrc, fdest, buffer_size)
fileCount = fileCount + 1
else:
failedFile = True
result = result + 'Unable to verify. Skipping file: ' + file + '\n'
genericProcessing = False

if(fileCount == 0):
failedFile = True
if(genericProcessing):
result = result + "No specific processing defined. Just copying files\n"
if(os.path.exists(folder)):
Expand Down
Binary file modified GamezServer/Task.pyc
Binary file not shown.

0 comments on commit 9634af9

Please sign in to comment.