From 97470089b931d24906a6ab09609d155c7fbb698e Mon Sep 17 00:00:00 2001 From: Kingul Date: Sun, 8 Jan 2017 11:34:26 +0200 Subject: [PATCH] fix searchwindow first time use --- searchwindow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/searchwindow.py b/searchwindow.py index 6103b5c..266fbd5 100644 --- a/searchwindow.py +++ b/searchwindow.py @@ -237,6 +237,9 @@ class SearchWindow(pyxbmct.AddonDialogWindow): if not xbmcvfs.exists(__tmppath__): xbmcvfs.mkdirs(__tmppath__) 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') navi = read.read() read.close()