Skip to content

Commit

Permalink
Added updating of version on folder processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Dlesk committed Jan 15, 2012
1 parent a4c63f2 commit e62fb73
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
Binary file modified Gamez.db
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/Constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def VersionNumber():
return "1.1.14.0"
return "1.1.15.0"
Binary file modified lib/Constants.pyc
Binary file not shown.
10 changes: 10 additions & 0 deletions lib/DBFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,16 @@ def CheckForSameGame(game_name):
else:
return True

def UpdateStatusForFolderProcessing(game_name,system,status):
db_path = os.path.join(os.path.abspath(""),"Gamez.db")
sql = "update requested_games set status='" + status + "' where game_name='" + game_name + "' and system='" + system + "'"
connection = sqlite3.connect(db_path)
cursor = connection.cursor()
cursor.execute(sql)
connection.commit()
cursor.close()
return

def ApiGetGamesFromTerm(term,system):
db_path = os.path.join(os.path.abspath(""),"Gamez.db")
sql = "SELECT GAME_NAME,SYSTEM,COVER FROM GAMES where game_name like '%" + term.replace("'","''") + "%' AND SYSTEM LIKE '%" + system + "%' ORDER BY GAME_NAME ASC"
Expand Down
Binary file modified lib/DBFunctions.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion lib/FolderFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ def ProcessFolder(folderPath):
dest = destPath + os.sep + newFileName
src = subdir + os.sep + file
LogEvent("Moving File " + src + " to " + dest)
shutil.move(src,dest)
try:
shutil.move(src,dest)
#Update status to wanted
if(game_name <> "" and system <> ""):
UpdateStatusForFolderProcessing(game_name,system,'Downloaded')
except:
LogEvent("Error Moving File")
LogEvent(game_name + " Processed Successfully")
else:
LogEvent("Destination Folder Not Set")
Expand Down
Binary file modified lib/FolderFunctions.pyc
Binary file not shown.

0 comments on commit e62fb73

Please sign in to comment.