diff --git a/Gamez.db b/Gamez.db index e99a60a..6e1a39f 100644 Binary files a/Gamez.db and b/Gamez.db differ diff --git a/Gamez.ini b/Gamez.ini index f36592b..18ea4eb 100644 --- a/Gamez.ini +++ b/Gamez.ini @@ -3,18 +3,18 @@ server.socket_host = "127.0.0.1" server.socket_port = 8085 [NZBMatrix] -username = "" -api_key = "" +username = +api_key = [Newznab] -api_key = "" +api_key = wii_category_id = "1030" xbox360_category_id = "1050" -host = "" +host = port = [Sabnzbd] -api_key = "" +api_key = host = "127.0.0.1" port = 8081 @@ -26,3 +26,6 @@ is_to_ignore_update = 0 ignored_version = api_key = "ikzFRzA1Y8I1UajNJAOQ803TbTYk1vLB64A9SxrAxAw" +[Notifications] +prowl__api = "" + diff --git a/cherrypy/__init__.pyc b/cherrypy/__init__.pyc index c3ffd34..074ac4b 100644 Binary files a/cherrypy/__init__.pyc and b/cherrypy/__init__.pyc differ diff --git a/cherrypy/_cpchecker.pyc b/cherrypy/_cpchecker.pyc index f1103c7..09aaaf8 100644 Binary files a/cherrypy/_cpchecker.pyc and b/cherrypy/_cpchecker.pyc differ diff --git a/cherrypy/_cpcompat.pyc b/cherrypy/_cpcompat.pyc index 855f610..4903aae 100644 Binary files a/cherrypy/_cpcompat.pyc and b/cherrypy/_cpcompat.pyc differ diff --git a/cherrypy/_cpconfig.pyc b/cherrypy/_cpconfig.pyc index 393c29b..abc7f5a 100644 Binary files a/cherrypy/_cpconfig.pyc and b/cherrypy/_cpconfig.pyc differ diff --git a/cherrypy/_cpdispatch.pyc b/cherrypy/_cpdispatch.pyc index 8e884cf..30ea712 100644 Binary files a/cherrypy/_cpdispatch.pyc and b/cherrypy/_cpdispatch.pyc differ diff --git a/cherrypy/_cperror.pyc b/cherrypy/_cperror.pyc index 4c8706f..2400775 100644 Binary files a/cherrypy/_cperror.pyc and b/cherrypy/_cperror.pyc differ diff --git a/cherrypy/_cplogging.pyc b/cherrypy/_cplogging.pyc index 6e9be62..b56c5dc 100644 Binary files a/cherrypy/_cplogging.pyc and b/cherrypy/_cplogging.pyc differ diff --git a/cherrypy/_cpreqbody.pyc b/cherrypy/_cpreqbody.pyc index c827cc4..279ca60 100644 Binary files a/cherrypy/_cpreqbody.pyc and b/cherrypy/_cpreqbody.pyc differ diff --git a/cherrypy/_cprequest.pyc b/cherrypy/_cprequest.pyc index cdc0c22..945f149 100644 Binary files a/cherrypy/_cprequest.pyc and b/cherrypy/_cprequest.pyc differ diff --git a/cherrypy/_cpserver.pyc b/cherrypy/_cpserver.pyc index 63e8d90..4d2dbab 100644 Binary files a/cherrypy/_cpserver.pyc and b/cherrypy/_cpserver.pyc differ diff --git a/cherrypy/_cptools.pyc b/cherrypy/_cptools.pyc index 024b1d2..5b5102c 100644 Binary files a/cherrypy/_cptools.pyc and b/cherrypy/_cptools.pyc differ diff --git a/cherrypy/_cptree.pyc b/cherrypy/_cptree.pyc index 43264b3..0c3dc4b 100644 Binary files a/cherrypy/_cptree.pyc and b/cherrypy/_cptree.pyc differ diff --git a/cherrypy/_cpwsgi.pyc b/cherrypy/_cpwsgi.pyc index 90b7b08..4270099 100644 Binary files a/cherrypy/_cpwsgi.pyc and b/cherrypy/_cpwsgi.pyc differ diff --git a/cherrypy/_cpwsgi_server.pyc b/cherrypy/_cpwsgi_server.pyc index 86f6897..9f358f7 100644 Binary files a/cherrypy/_cpwsgi_server.pyc and b/cherrypy/_cpwsgi_server.pyc differ diff --git a/cherrypy/lib/__init__.pyc b/cherrypy/lib/__init__.pyc index 99607db..816ea37 100644 Binary files a/cherrypy/lib/__init__.pyc and b/cherrypy/lib/__init__.pyc differ diff --git a/cherrypy/lib/auth.pyc b/cherrypy/lib/auth.pyc index 37ad376..941ef39 100644 Binary files a/cherrypy/lib/auth.pyc and b/cherrypy/lib/auth.pyc differ diff --git a/cherrypy/lib/auth_basic.pyc b/cherrypy/lib/auth_basic.pyc index 989a48b..049d7be 100644 Binary files a/cherrypy/lib/auth_basic.pyc and b/cherrypy/lib/auth_basic.pyc differ diff --git a/cherrypy/lib/auth_digest.pyc b/cherrypy/lib/auth_digest.pyc index 6226453..c56cf72 100644 Binary files a/cherrypy/lib/auth_digest.pyc and b/cherrypy/lib/auth_digest.pyc differ diff --git a/cherrypy/lib/caching.pyc b/cherrypy/lib/caching.pyc index 27648d9..44a370e 100644 Binary files a/cherrypy/lib/caching.pyc and b/cherrypy/lib/caching.pyc differ diff --git a/cherrypy/lib/cptools.pyc b/cherrypy/lib/cptools.pyc index f07b847..519a228 100644 Binary files a/cherrypy/lib/cptools.pyc and b/cherrypy/lib/cptools.pyc differ diff --git a/cherrypy/lib/encoding.pyc b/cherrypy/lib/encoding.pyc index 6a90bc1..19bd1a3 100644 Binary files a/cherrypy/lib/encoding.pyc and b/cherrypy/lib/encoding.pyc differ diff --git a/cherrypy/lib/httpauth.pyc b/cherrypy/lib/httpauth.pyc index 8a2fbc0..c107cd9 100644 Binary files a/cherrypy/lib/httpauth.pyc and b/cherrypy/lib/httpauth.pyc differ diff --git a/cherrypy/lib/httputil.pyc b/cherrypy/lib/httputil.pyc index ecc80c4..004a7fa 100644 Binary files a/cherrypy/lib/httputil.pyc and b/cherrypy/lib/httputil.pyc differ diff --git a/cherrypy/lib/jsontools.pyc b/cherrypy/lib/jsontools.pyc index 56bd133..904a73b 100644 Binary files a/cherrypy/lib/jsontools.pyc and b/cherrypy/lib/jsontools.pyc differ diff --git a/cherrypy/lib/reprconf.pyc b/cherrypy/lib/reprconf.pyc index 425a557..359115a 100644 Binary files a/cherrypy/lib/reprconf.pyc and b/cherrypy/lib/reprconf.pyc differ diff --git a/cherrypy/lib/sessions.pyc b/cherrypy/lib/sessions.pyc index ce3d4a0..fb553a2 100644 Binary files a/cherrypy/lib/sessions.pyc and b/cherrypy/lib/sessions.pyc differ diff --git a/cherrypy/lib/static.pyc b/cherrypy/lib/static.pyc index 8f8f938..a24814b 100644 Binary files a/cherrypy/lib/static.pyc and b/cherrypy/lib/static.pyc differ diff --git a/cherrypy/lib/xmlrpcutil.pyc b/cherrypy/lib/xmlrpcutil.pyc index ed5ca4b..a2653f3 100644 Binary files a/cherrypy/lib/xmlrpcutil.pyc and b/cherrypy/lib/xmlrpcutil.pyc differ diff --git a/cherrypy/process/__init__.pyc b/cherrypy/process/__init__.pyc index c12cfd8..ef8813d 100644 Binary files a/cherrypy/process/__init__.pyc and b/cherrypy/process/__init__.pyc differ diff --git a/cherrypy/process/plugins.pyc b/cherrypy/process/plugins.pyc index 4cf4239..c0a5d49 100644 Binary files a/cherrypy/process/plugins.pyc and b/cherrypy/process/plugins.pyc differ diff --git a/cherrypy/process/servers.pyc b/cherrypy/process/servers.pyc index 01ac444..50fccc3 100644 Binary files a/cherrypy/process/servers.pyc and b/cherrypy/process/servers.pyc differ diff --git a/cherrypy/process/win32.pyc b/cherrypy/process/win32.pyc index f1fcb0b..1d02c21 100644 Binary files a/cherrypy/process/win32.pyc and b/cherrypy/process/win32.pyc differ diff --git a/cherrypy/process/wspbus.pyc b/cherrypy/process/wspbus.pyc index 9d30656..5652c7e 100644 Binary files a/cherrypy/process/wspbus.pyc and b/cherrypy/process/wspbus.pyc differ diff --git a/cherrypy/wsgiserver/__init__.pyc b/cherrypy/wsgiserver/__init__.pyc index 212f0f4..8c3ba31 100644 Binary files a/cherrypy/wsgiserver/__init__.pyc and b/cherrypy/wsgiserver/__init__.pyc differ diff --git a/cherrypy/wsgiserver/wsgiserver2.pyc b/cherrypy/wsgiserver/wsgiserver2.pyc index c50fc1e..7aafcaf 100644 Binary files a/cherrypy/wsgiserver/wsgiserver2.pyc and b/cherrypy/wsgiserver/wsgiserver2.pyc differ diff --git a/lib/ConfigFunctions.py b/lib/ConfigFunctions.py index c24335d..2d5dd23 100644 --- a/lib/ConfigFunctions.py +++ b/lib/ConfigFunctions.py @@ -34,6 +34,10 @@ def CheckConfigForAllKeys(app_path): config.add_section('Newznab') changesMade = True + if(config.has_section('Notifications') == False): + config.add_section('Notifications') + changesMade = True + if(config.has_option('global','server.socket_host') == False): config.set('global','server.socket_host','"127.0.0.1"') changesMade = True @@ -99,6 +103,10 @@ def CheckConfigForAllKeys(app_path): config.set('Newznab','port','') changesMade = True + if(config.has_option('Notifications','prowl_api') == False): + config.set('Notifications','prowl__api','""') + changesMade = True + if(changesMade): with open(configFilePath,'wb') as configFile: config.write(configFile) diff --git a/lib/ConfigFunctions.pyc b/lib/ConfigFunctions.pyc index b30f720..ee007cf 100644 Binary files a/lib/ConfigFunctions.pyc and b/lib/ConfigFunctions.pyc differ diff --git a/lib/Constants.py b/lib/Constants.py index de59495..d81589f 100644 --- a/lib/Constants.py +++ b/lib/Constants.py @@ -1,2 +1,2 @@ def VersionNumber(): - return "1.1.2.0" + return "1.1.3.0" diff --git a/lib/Constants.pyc b/lib/Constants.pyc index 54f2b9e..48ca09c 100644 Binary files a/lib/Constants.pyc and b/lib/Constants.pyc differ diff --git a/lib/DBFunctions.py b/lib/DBFunctions.py index cbfa7a1..ae54e2b 100644 --- a/lib/DBFunctions.py +++ b/lib/DBFunctions.py @@ -29,7 +29,7 @@ def GetGamesFromTerm(term): def GetGameDataFromTerm(term): db_path = os.path.join(os.path.abspath(""),"Gamez.db") - sql = "SELECT game_name,game_type,id,system FROM games where game_name like '%" + term.replace("'","''") + "%' order by game_name asc" + sql = "SELECT game_name,game_type,id,system,cover FROM games where game_name like '%" + term.replace("'","''") + "%' order by game_name asc" data = '' connection = sqlite3.connect(db_path) cursor = connection.cursor() @@ -41,7 +41,8 @@ def GetGameDataFromTerm(term): game_type = str(record[1]) db_id = str(record[2]) system = str(record[3]) - rowdata = "Download" + game_name + "" + game_type + "" + system + "" + cover = str(record[4]) + rowdata = "Download" + game_name + "" + game_type + "" + system + "" data = data + rowdata except: continue @@ -51,7 +52,7 @@ def GetGameDataFromTerm(term): def AddGameToDb(db_id,status): LogEvent("Adding game in 'Wanted' status") db_path = os.path.join(os.path.abspath(""),"Gamez.db") - sql = "select game_name,system,game_type from games where ID = '" + db_id + "'" + sql = "select game_name,system,game_type,cover from games where ID = '" + db_id + "'" connection = sqlite3.connect(db_path) cursor = connection.cursor() cursor.execute(sql) @@ -59,8 +60,9 @@ def AddGameToDb(db_id,status): game_name = str(result[0]) system = str(result[1]) game_type = str(result[2]) + cover = str(result[3]) cursor.close() - sql = "insert into requested_games(GAME_NAME,SYSTEM,GAME_TYPE,status) values('" + game_name.replace("'","''") + "','" + system + "','" + game_type + "','" + status + "')" + sql = "insert into requested_games(GAME_NAME,SYSTEM,GAME_TYPE,status,cover) values('" + game_name.replace("'","''") + "','" + system + "','" + game_type + "','" + status + "','" + cover + "')" connection = sqlite3.connect(db_path) cursor = connection.cursor() cursor.execute(sql) @@ -70,7 +72,7 @@ def AddGameToDb(db_id,status): def GetRequestedGames(): db_path = os.path.join(os.path.abspath(""),"Gamez.db") - sql = "SELECT id,game_name,game_type,status,system FROM requested_games order by game_name asc" + sql = "SELECT id,game_name,game_type,status,system,cover FROM requested_games order by game_name asc" data = '' connection = sqlite3.connect(db_path) cursor = connection.cursor() @@ -83,7 +85,8 @@ def GetRequestedGames(): game_type = str(record[2]) status = str(record[3]) system = str(record[4]) - rowdata = "Delete" + game_name + "" + game_type + "" + system + "" + status + "" if(status == "Snatched"): rowdata = rowdata + "" elif(status == "Downloaded"): @@ -127,6 +130,8 @@ def UpdateStatus(game_id,status): cursor.execute(sql) connection.commit() cursor.close() + + Notifications.HandleNotifications(game_id,status) return def ValidateDB(): @@ -176,7 +181,7 @@ def ValidateDB(): cursor.execute(sql) connection.commit() cursor.close() - sql = "CREATE TABLE REQUESTED_GAMES (ID INTEGER PRIMARY KEY,GAME_NAME TEXT,SYSTEM TEXT,GAME_TYPE TEXT,STATUS TEXT)" + sql = "CREATE TABLE REQUESTED_GAMES (ID INTEGER PRIMARY KEY,GAME_NAME TEXT,SYSTEM TEXT,GAME_TYPE TEXT,STATUS TEXT,COVER TEXT)" connection = sqlite3.connect(db_path) cursor = connection.cursor() cursor.execute(sql) @@ -200,7 +205,7 @@ def ValidateDB(): cursor.execute(sql) connection.commit() cursor.close() - sql = "CREATE TABLE GAMES (ID INTEGER PRIMARY KEY,GAME_NAME TEXT,SYSTEM TEXT,GAME_TYPE TEXT)" + sql = "CREATE TABLE GAMES (ID INTEGER PRIMARY KEY,GAME_NAME TEXT,SYSTEM TEXT,GAME_TYPE TEXT,COVER TEXT)" connection = sqlite3.connect(db_path) cursor = connection.cursor() cursor.execute(sql) @@ -208,7 +213,44 @@ def ValidateDB(): cursor.close() AddWiiGamesIfMissing() print "Database upgrade complete" - + + try: + sql = "alter table games add column cover text" + connection = sqlite3.connect(db_path) + cursor = connection.cursor() + cursor.execute(sql) + connection.commit() + cursor.close() + except: + status = "Do Nothing" + + try: + sql = "alter table requested_games add column cover text" + connection = sqlite3.connect(db_path) + cursor = connection.cursor() + cursor.execute(sql) + connection.commit() + cursor.close() + except: + status = "Do Nothing" + + #loop requested games where cover is null + sql = "select game_name,cover,system from requested_games where cover is null" + connection = sqlite3.connect(db_path) + cursor = connection.cursor() + cursor.execute(sql) + result = cursor.fetchall() + cursor.close() + for record in result: + game_name = str(record[0]) + cover = str(record[1]) + system = str(record[2]) + sql = "update requested_games set cover = (Select cover from games where game_name = '" + game_name + "' and system = '" + system + "') 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 AddEventToDB(message): @@ -277,6 +319,7 @@ def AddWiiGamesIfMissing(): for data in json_data: game_name = data['GameTitle'] game_type = data['GameType'] + game_cover = data['GameCover'] db_path = os.path.join(os.path.abspath(""),"Gamez.db") sql = "SELECT count(ID) from games where game_name = '" + game_name.replace("'","''") + "' AND system='Wii'" connection = sqlite3.connect(db_path) @@ -287,7 +330,7 @@ def AddWiiGamesIfMissing(): cursor.close() if(str(recordCount) == "0"): LogEvent("Adding Wii Game [" + game_name.replace("'","''") + "] to Game List") - sql = "INSERT INTO games (game_name,game_type,system) values('" + game_name.replace("'","''") + "','" + game_type + "','Wii')" + sql = "INSERT INTO games (game_name,game_type,system,cover) values('" + game_name.replace("'","''") + "','" + game_type + "','Wii','" + game_cover + "')" cursor = connection.cursor() cursor.execute(sql) connection.commit() @@ -309,6 +352,7 @@ def AddXbox360GamesIfMissing(): for data in json_data: game_name = data['GameTitle'] game_type = data['GameType'] + game_cover = data['GameCover'] db_path = os.path.join(os.path.abspath(""),"Gamez.db") sql = "SELECT count(ID) from games where game_name = '" + game_name.replace("'","''") + "' AND system='Xbox360'" connection = sqlite3.connect(db_path) @@ -319,7 +363,7 @@ def AddXbox360GamesIfMissing(): cursor.close() if(str(recordCount) == "0"): LogEvent("Adding XBOX 360 Game [" + game_name.replace("'","''") + "] to Game List") - sql = "INSERT INTO games (game_name,game_type,system) values('" + game_name.replace("'","''") + "','" + game_type + "','Xbox360')" + sql = "INSERT INTO games (game_name,game_type,system,cover) values('" + game_name.replace("'","''") + "','" + game_type + "','Xbox360','" + game_cover + "')" cursor = connection.cursor() cursor.execute(sql) connection.commit() @@ -338,7 +382,7 @@ def ApiGetGamesFromTerm(term,system): try: game_name = str(record[0]) system = str(record[1]) - rowdata = '{"GameTitle":"' + game_name + '","System":"' + system + '"},' + rowdata = '{"GameTitle":"' + game_name + '","System":"' + system + '","GameCover":"' + cover + '"},' data = data + rowdata except: continue diff --git a/lib/DBFunctions.pyc b/lib/DBFunctions.pyc index 6e1c363..1e4ffa0 100644 Binary files a/lib/DBFunctions.pyc and b/lib/DBFunctions.pyc differ diff --git a/lib/GameTasks.pyc b/lib/GameTasks.pyc index d41110c..11079bb 100644 Binary files a/lib/GameTasks.pyc and b/lib/GameTasks.pyc differ diff --git a/lib/Logger.pyc b/lib/Logger.pyc index 85940ae..793a10a 100644 Binary files a/lib/Logger.pyc and b/lib/Logger.pyc differ diff --git a/lib/Notifications.py b/lib/Notifications.py new file mode 100644 index 0000000..e53db6b --- /dev/null +++ b/lib/Notifications.py @@ -0,0 +1,9 @@ +import DBFunctions + +def LogEvent(message): + DBFunctions.AddEventToDB(message) + return + +def ClearLog(): + ClearDBLog() + return \ No newline at end of file diff --git a/lib/UpgradeFunctions.pyc b/lib/UpgradeFunctions.pyc index 52ca417..4790201 100644 Binary files a/lib/UpgradeFunctions.pyc and b/lib/UpgradeFunctions.pyc differ diff --git a/lib/WebRoot.py b/lib/WebRoot.py index e3cb740..e00cdbc 100644 --- a/lib/WebRoot.py +++ b/lib/WebRoot.py @@ -104,6 +104,7 @@ def index(self,status_message='',version=''): Actions + Cover Game Name Game Type System @@ -206,6 +207,7 @@ def search(self,term=''): Download + Cover Game Name Game Type System @@ -353,7 +355,14 @@ def settings(self): - + +

Notifications

+ + + + + +
@@ -509,7 +518,7 @@ def upgradetolatestversion(self,verification): raise cherrypy.InternalRedirect("/?status_message=" + status) @cherrypy.expose - def savesettings(self,cherrypyHost='', nzbMatrixUsername='', downloadInterval=3600, sabPort='', nzbMatrixApi='', sabApi='', cherrypyPort='', sabHost='',gamezApiKey='',newznabHost='',newznabPort='',newznabApi='',newznabWiiCat='',newznabXbox360Cat=''): + def savesettings(self,cherrypyHost='', nzbMatrixUsername='', downloadInterval=3600, sabPort='', nzbMatrixApi='', sabApi='', cherrypyPort='', sabHost='',gamezApiKey='',newznabHost='',newznabPort='',newznabApi='',newznabWiiCat='',newznabXbox360Cat='',prowlApi=''): cherrypyHost = '"' + cherrypyHost + '"' nzbMatrixUsername = '"' + nzbMatrixUsername + '"' nzbMatrixApi = '"' + nzbMatrixApi + '"' @@ -520,6 +529,7 @@ def savesettings(self,cherrypyHost='', nzbMatrixUsername='', downloadInterval=36 newznabApi = '"' + newznabApi + '"' newznabWiiCat = '"' + newznabWiiCat + '"' newznabXbox360Cat = '"' + newznabXbox360Cat + '"' + prowlApi = '"' + prowlApi + '"' config = ConfigParser.RawConfigParser() configFilePath = os.path.join(WebRoot.appPath,'Gamez.ini') config.read(configFilePath) @@ -537,6 +547,7 @@ def savesettings(self,cherrypyHost='', nzbMatrixUsername='', downloadInterval=36 config.set('Newznab','wii_category_id',newznabWiiCat) config.set('Newznab','xbox360_category_id',newznabXbox360Cat) config.set('Newznab','api_key',newznabApi) + config.set('Notifications','prowl_api',prowlApi) with open(configFilePath,'wb') as configFile: config.write(configFile) status = "Application Settings Updated Successfully. Gamez is restarting. If after 5 seconds, Gamez isn't working, update the Gamez.ini file and re-launch Gamez" diff --git a/lib/WebRoot.pyc b/lib/WebRoot.pyc index 3b1275e..2fefea1 100644 Binary files a/lib/WebRoot.pyc and b/lib/WebRoot.pyc differ diff --git a/lib/__init__.pyc b/lib/__init__.pyc index d58598f..39721fd 100644 Binary files a/lib/__init__.pyc and b/lib/__init__.pyc differ