Skip to content

Commit 24528ed

Browse files
committed
fix backup for local system
1 parent 2ef5ad4 commit 24528ed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

default.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,11 @@ def tvh():
17051705
icon_update_save = requests.get(icon_update_url)
17061706
if sel_tvh == 7:
17071707
dialog.ok("Tvheadend Userdata Backup", "The Tvheadend service will be stopped to start the backup.", "The Tvheadend client may show a connection error during the process.")
1708+
if tvh_url == "127.0.0.1":
1709+
tvh_addon = xbmcaddon.Addon(id='service.tvheadend42')
1710+
tvh_userdata_path = xbmc.translatePath(tvh_addon.getAddonInfo('profile'))
1711+
else:
1712+
tvh_userdata_path = '//' + tvh_url + '/userdata/addon_data/service.tvheadend42'
17081713
try:
17091714
tvh_json_url = 'http://' + tvh_url + ':8080/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Addons.SetAddonEnabled","params":{"addonid":"service.tvheadend42","enabled":false}}'
17101715
tvh_json_load = requests.get(tvh_json_url).json()
@@ -1713,11 +1718,6 @@ def tvh():
17131718
dialog.ok("Tvheadend Service Still Running!", "Unable to stop the Tvheadend service.", "Unable to complete backup.")
17141719
return
17151720
if tvh_stop == "OK":
1716-
if tvh_url == "127.0.0.1":
1717-
tvh_addon = xbmcaddon.Addon(id='service.tvheadend42')
1718-
tvh_userdata_path = xbmc.translatePath(tvh_addon.getAddonInfo('profile'))
1719-
else:
1720-
tvh_userdata_path = '//' + tvh_url + '/userdata/addon_data/service.tvheadend42'
17211721
output_path = dialog.browse(3, "Where would you like to save the Tvheadend Backup file?", "files")
17221722
output_name = output_path + "service.tvheadend42-backup-" + str(datetime.datetime.today())
17231723
if dialog.yesno('Backup Tvheadend Userdata to Zip File', 'Zip file will be created in the following location:', str(output_path), 'Select YES to create backup.'):

0 commit comments

Comments
 (0)