fix searchwindow first time use

pull/15/head
Kingul 2017-01-08 11:34:26 +02:00
parent 76702025ef
commit 97470089b9
1 changed files with 3 additions and 0 deletions

View File

@ -237,6 +237,9 @@ class SearchWindow(pyxbmct.AddonDialogWindow):
if not xbmcvfs.exists(__tmppath__): if not xbmcvfs.exists(__tmppath__):
xbmcvfs.mkdirs(__tmppath__) xbmcvfs.mkdirs(__tmppath__)
navi_file = os.path.join(__tmppath__, 'navi.txt') navi_file = os.path.join(__tmppath__, 'navi.txt')
if not xbmcvfs.exists(navi_file):
nav_content = '{"last_link": null, "last_query": null, "filesList": [], "last_addtime": null, "last_top_button": 5, "route": [{"params": {}, "last_listing_item": 0, "mode": "close"}, {"last_listing_item": 0, "params": {}, "mode": "history"}], "contentList": [], "last_right_button": 1, "searchersList": []}'
with open(xbmc.translatePath(navi_file), 'wb') as f: f.write(nav_content)
read = xbmcvfs.File(navi_file, 'r') read = xbmcvfs.File(navi_file, 'r')
navi = read.read() navi = read.read()
read.close() read.close()