Beispiel #1
0
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
from resources.lib.download import iagl_download

iagl_addon = iagl_addon()
if not get_mem_cache('iagl_script_started'):
    set_mem_cache('iagl_script_started', 'true')
    xbmc.log(msg='IAGL:  Check archive.org login script started',
             level=xbmc.LOGDEBUG)
    iagl_download = iagl_download(settings=iagl_addon.settings,
                                  directory=iagl_addon.directory,
                                  game_list=None,
                                  game=None)
    iagl_download.downloader.login()
    if iagl_download.downloader.logged_in:
        current_dialog = xbmcgui.Dialog()
        ok_ret = current_dialog.ok(loc_str(30202), loc_str(30584))
        del current_dialog
        xbmc.log(msg='IAGL:  Login check was successful', level=xbmc.LOGINFO)
    else:
        current_dialog = xbmcgui.Dialog()
        ok_ret = current_dialog.ok(loc_str(30203), loc_str(30585))
        del current_dialog
        xbmc.log(msg='IAGL:  Login check failed', level=xbmc.LOGINFO)
    clear_mem_cache('iagl_script_started')
    xbmc.log(msg='IAGL:  Check archive.org login script completed',
             level=xbmc.LOGDEBUG)
else:
    xbmc.log(msg='IAGL:  Script already running', level=xbmc.LOGDEBUG)
del iagl_addon, iagl_download, loc_str, get_mem_cache, set_mem_cache, clear_mem_cache
Beispiel #2
0
import xbmc, xbmcgui, xbmcvfs, os
from pathlib import Path
from resources.lib.utils import loc_str, get_mem_cache, set_mem_cache, clear_mem_cache, check_if_file_exists, get_xml_games, get_xml_header_path_et_fromstring, write_text_to_file
from resources.lib import xmltodict
from resources.lib.main import iagl_addon
iagl_addon_handle = iagl_addon()
if not get_mem_cache('iagl_script_started'):
    set_mem_cache('iagl_script_started', 'true')
    xbmc.log(msg='IAGL:  Convert old favorites format script started',
             level=xbmc.LOGDEBUG)
    success = False
    current_dialog = xbmcgui.Dialog()
    old_file = current_dialog.browse(1, loc_str(30618), '')
    if old_file:
        old_file_path = Path(old_file)
        games = None
        if check_if_file_exists(old_file_path):
            games = get_xml_games(old_file_path)
            games_header = get_xml_header_path_et_fromstring(old_file_path)
            for gg in games:
                if gg.get('rom') and gg.get('rom').get('@name'):
                    gg['route'] = gg.get('rom').get('@name').replace(
                        'plugin://plugin.program.iagl/game/', '').split('/')[0]
                    gg.pop('rom', None)
            new_file_path = iagl_addon_handle.directory.get('userdata').get(
                'dat_files').get('path').joinpath(old_file_path.name)
            if not check_if_file_exists(new_file_path):
                xml_out = xmltodict.unparse(
                    {
                        'datafile': {
                            'header': games_header
Beispiel #3
0
 current_dialog = xbmcgui.Dialog()
 current_game_list_options = sorted([
     x for x in zip(iagl_addon_handle.game_lists.list_game_lists(), [(
         iagl_addon_handle.game_lists.get_game_list(x).get('emu_name'),
         iagl_addon_handle.game_lists.get_game_list(x).get('emu_visibility')
     ) for x in iagl_addon_handle.game_lists.list_game_lists()])
     if x[1][1] == 'hidden'
 ],
                                    key=lambda x: x[1][0])
 if current_game_list_options:
     current_game_list_ids = ['All'
                              ] + [x[0] for x in current_game_list_options]
     current_game_list_titles = ['All'] + [
         x[1][0] for x in current_game_list_options
     ]
     new_value = current_dialog.multiselect(loc_str(30360),
                                            current_game_list_titles, 0)
     if new_value:
         if 0 in new_value:
             lists_to_unhide = current_game_list_ids[1:]
         else:
             lists_to_unhide = [
                 x for ii, x in enumerate(current_game_list_ids)
                 if ii in new_value
             ]
     if lists_to_unhide:
         for ltu in lists_to_unhide:
             current_game_crc = iagl_addon_handle.game_lists.get_crc(ltu)
             update_success = iagl_addon_handle.game_lists.update_game_list_header(
                 ltu,
                 header_key='emu_visibility',
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()
if not get_mem_cache('iagl_script_started'):
    set_mem_cache('iagl_script_started', 'true')
    xbmc.log(msg='IAGL:  Clear cache script started', level=xbmc.LOGDEBUG)
    if iagl_addon.clear_list_cache_folder(
    ) and iagl_addon.clear_game_cache_folder():
        current_dialog = xbmcgui.Dialog()
        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:
    xbmc.log(msg='IAGL:  Script already running', level=xbmc.LOGDEBUG)
del iagl_addon, loc_str, get_mem_cache, set_mem_cache, clear_mem_cache