Ejemplo n.º 1
0
def auto_weekly_clean_on_off():
    if kodi.get_setting("clearday") == '7':
        if xbmcgui.Dialog().yesno(
                AddonName,
                'Please confirm that you wish to enable weekly automated maintenance.'
        ):
            kodi.set_setting("clearday", datetime.datetime.today().weekday())
            kodi.openSettings(addon_id, id1=5, id2=3)
            available_space, total_space = get_free_space_mb(
                xbmc.translatePath('special://home'))
            mb_settings = (0, 25, 50, 75, 100)
            while True:
                allotted_space = 0
                for value in ('cachemb', 'thumbsmb', 'packagesmb'):
                    allotted_space += mb_settings[int(
                        kodi.get_setting(value))] * 10**6
                if (allotted_space >=
                        available_space) and not kodi.get_setting("automb"):
                    xbmcgui.Dialog().ok(
                        "Your settings sizes for Kodi to use are larger than the available drive space",
                        'Please try lower settings, uninstall uneeded apps and addons,',
                        'or set kodi size to "Auto" to use the automated settings based on free space'
                    )
                    kodi.openSettings(addon_id, id1=5, id2=3)
                else:
                    break
    else:
        if xbmcgui.Dialog().yesno(
                AddonName,
                'Please confirm that you wish to disable weekly automated maintenance.'
        ):
            kodi.set_setting("clearday", '7')
    xbmc.executebuiltin("Container.Refresh")
Ejemplo n.º 2
0
def auto_weekly_clean_on_off():
    if kodi.get_setting("clearday") == '7':
        if xbmcgui.Dialog().yesno(AddonName, 'Please confirm that you wish to enable weekly automated maintenance.'):
            kodi.set_setting("clearday", datetime.datetime.today().weekday())
            kodi.openSettings(addon_id, id1=5, id2=3)
            available_space, total_space = get_free_space_mb(xbmc.translatePath('special://home'))
            if str(available_space) == '0 B Free' and str(total_space) == '0 B Total':
                xbmcgui.Dialog().ok('Auto Maintenance Error',
                                    'Auto Maintenance encountered a problem and can not be run',
                                    'Maintenace can still be done individually')
                return
            mb_settings = (0, 25, 50, 75, 100)
            while True:
                allotted_space = 0
                for value in ('cachemb', 'thumbsmb', 'packagesmb'):
                    allotted_space += mb_settings[int(kodi.get_setting(value))] * 10**6
                if (allotted_space >= available_space) and not kodi.get_setting("automb"):
                    xbmcgui.Dialog().ok("Your settings sizes for Kodi to use are larger than the available drive space",
                                        'Please try lower settings, uninstall uneeded apps and addons,',
                                        'or set kodi size to "Auto" to use the automated settings based on free space')
                    kodi.openSettings(addon_id, id1=5, id2=3)
                else:
                    break
    else:
        if xbmcgui.Dialog().yesno(AddonName, 'Please confirm that you wish to disable weekly automated maintenance.'):
            kodi.set_setting("clearday", '7')
    xbmc.executebuiltin("Container.Refresh")
Ejemplo n.º 3
0
def check_path():
    if zip_setting == "Click Here":
        kodi.openSettings(addon_id, id1=0, id2=0)
        sys.exit(0)
    if home_path in zip_path:
        dialog.ok(AddonTitle, 'Invalid backup path. The selected path may be removed during backup '
                              'and cause an error. Please pick another path that is not in the Kodi directory')
        kodi.openSettings(addon_id, id1=0, id2=0)
        sys.exit(0)
Ejemplo n.º 4
0
def check_path():
    if zip_setting == "Click Here":
        kodi.openSettings(addon_id, id1=0, id2=0)
        sys.exit(0)
    if home_path in zip_path:
        dialog.ok(AddonTitle, 'Invalid backup path. The selected path may be removed during backup '
                              'and cause an error. Please pick another path that is not in the Kodi directory')
        kodi.openSettings(addon_id, id1=0, id2=0)
        sys.exit(0)
Ejemplo n.º 5
0
def check_path():

    if zip ==  "Click Here":
        kodi.openSettings(addon_id,id1=0,id2=0)
        sys.exit(0)
    if HOME in USB:
        dialog = xbmcgui.Dialog()
        dialog.ok(AddonTitle, "Invalid backup path. The selected path will may be removed during backup and cause an error. Please pick another path that is not in the Kodi directory")
        kodi.openSettings(addon_id,id1=0,id2=0)
        sys.exit(0)
Ejemplo n.º 6
0
    addon_able.setall_enable()

elif mode == 'teststuff':
    freshstart.remove_db()
#######################################
elif mode == 'backup_restore':
    backup.BACKUPMENU()

elif mode == 'full_backup':
    backup.FullBackup()

elif mode == 'small_backup':
    backup.Backup()

elif mode == 'do_backup_restore':
    backup.Restore()

elif mode == 'display_backup_settings':
    kodi.openSettings(addon_id, id1=0, id2=0)

elif mode == 'read_zip':
    backup.READ_ZIP(url)

elif mode == 'del_backup':
    backup.ListBackDel()

elif mode == 'do_del_backup':
    backup.DeleteBackup(url)

xbmcplugin.endOfDirectory(int(sys.argv[1]))
Ejemplo n.º 7
0
elif mode == 'teststuff':
    freshstart.remove_db()
#######################################

elif mode == 'backup_restore':
    backup.backup_menu()

elif mode == 'full_backup':
    backup.full_backup()

elif mode == 'small_backup':
    backup.no_data_backup()

elif mode == 'do_backup_restore':
    backup.restore()

elif mode == 'display_backup_settings':
    kodi.openSettings(addon_id,id1=0,id2=0)

elif mode == 'read_zip':
    backup.read_zip(url)

elif mode == 'del_backup':
    backup.ListBackDel()

elif mode == 'do_del_backup':
    backup.DeleteBackup(url)

xbmcplugin.endOfDirectory(int(sys.argv[1]))