Skip to content

Commit

Permalink
Update 020121 1
Browse files Browse the repository at this point in the history
Add back emu_visibility options
Change default downloader to NONE to avoid logging in when not needed
  • Loading branch information
zach-morris committed Feb 1, 2021
1 parent ecdcc75 commit 7c5b1d5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
1 change: 1 addition & 0 deletions clear_IAGL_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ok_ret = current_dialog.ok(loc_str(30202),loc_str(30306)%{'game_list_id':'All Lists and Games'})
del current_dialog
iagl_addon.clear_all_mem_cache()
xbmc.executebuiltin('Container.Refresh')
clear_mem_cache('iagl_script_started')
xbmc.log(msg='IAGL: Clear cache script completed', level=xbmc.LOGDEBUG)
else:
Expand Down
4 changes: 4 additions & 0 deletions resources/language/English/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,10 @@ msgctxt "#30380"
msgid "Waiting for game to exit..."
msgstr "Waiting for game to exit...
msgctxt "#30381"
msgid "All game lists set to visible"
msgstr "All game lists set to visible"

#
#Context Menus
#
Expand Down
6 changes: 4 additions & 2 deletions resources/lib/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def set_downloader(self,downloader='archive_org'):
xbmc.log(msg='IAGL: Downloader set to Local File Source',level=xbmc.LOGDEBUG)
self.downloader = self.local_source(settings=self.settings,directory=self.directory,game_list=self.game_list,game=self.game)
else:
xbmc.log(msg='IAGL: Downloader %(downloader)s is unknown, defaulting to archive.org'%{'downloader':downloader},level=xbmc.LOGDEBUG)
self.downloader = self.archive_org(settings=self.settings,directory=self.directory,game_list=self.game_list,game=self.game,show_login_progress=False)
xbmc.log(msg='IAGL: Downloader %(downloader)s is unknown, defaulting to NONE'%{'downloader':downloader},level=xbmc.LOGDEBUG)
self.downloader = None #Default downloader to NONE unless otherwise specified, saves unecessary login attempt
downloader = 'Unknown'
# self.downloader = self.archive_org(settings=self.settings,directory=self.directory,game_list=self.game_list,game=self.game,show_login_progress=False) #Default to archive.org unless otherwise specified
self.current_downloader = downloader

def download_game(self,show_progress=True):
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def get_database_listitem(dict_in,media_type='video'):

def get_game_list_listitem(dict_in,filter_in=None,media_type='video'):
li=None
if dict_in.get('properties').get('emu_visibility') != 'hidden' and filter_in is None or (all([filter_in.get('info').get(kk) in dict_in.get('info').get(kk) if dict_in.get('info').get(kk) else False for kk in filter_in.get('info').keys()]) and all([filter_in.get('properties').get(kk) in dict_in.get('properties').get(kk) if dict_in.get('properties').get(kk) else False for kk in filter_in.get('properties').keys()])):
if dict_in.get('properties').get('emu_visibility') != 'hidden' and (filter_in is None or (all([filter_in.get('info').get(kk) in dict_in.get('info').get(kk) if dict_in.get('info').get(kk) else False for kk in filter_in.get('info').keys()]) and all([filter_in.get('properties').get(kk) in dict_in.get('properties').get(kk) if dict_in.get('properties').get(kk) else False for kk in filter_in.get('properties').keys()]))):
li = xbmcgui.ListItem(label=dict_in.get('values').get('label'),label2=dict_in.get('values').get('label2'),offscreen=True)
li.setInfo(media_type,dict_in.get('info'))
li.setArt(dict_in.get('art'))
Expand Down
24 changes: 24 additions & 0 deletions unhide_all_archives.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import xbmc, xbmcgui, xbmcvfs
from resources.lib.utils import loc_str, get_mem_cache, set_mem_cache, clear_mem_cache
from resources.lib.main import iagl_addon
iagl_addon = iagl_addon()
clear_mem_cache('iagl_script_started')
if not get_mem_cache('iagl_script_started'):
set_mem_cache('iagl_script_started','true')
xbmc.log(msg='IAGL: Set game lists to visible script started', level=xbmc.LOGDEBUG)
for ii,hh in enumerate(iagl_addon.directory.get('userdata').get('dat_files').get('header')):
if hh and hh.get('emu_visibility') and hh.get('emu_visibility') == 'hidden':
current_fn = iagl_addon.directory.get('userdata').get('dat_files').get('files')[ii]
game_list_id = current_fn.name.replace(current_fn.suffix,'')
success = iagl_addon.game_lists.update_game_list_header(game_list_id,header_key='emu_visibility',header_value='visible',confirm_update=False)
if iagl_addon.clear_list_cache_folder():
current_dialog = xbmcgui.Dialog()
ok_ret = current_dialog.ok(loc_str(30202),loc_str(30381))
del current_dialog
iagl_addon.clear_all_mem_cache()
xbmc.executebuiltin('Container.Refresh')
clear_mem_cache('iagl_script_started')
xbmc.log(msg='IAGL: Set game lists to visible script completed', level=xbmc.LOGDEBUG)
else:
xbmc.log(msg='IAGL: Script already running', level=xbmc.LOGDEBUG)
del iagl_addon, loc_str, get_mem_cache, set_mem_cache, clear_mem_cache

0 comments on commit 7c5b1d5

Please sign in to comment.