mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Return error result for delete_synced_item
This commit is contained in:
parent
775616b52d
commit
0868fa749d
2 changed files with 8 additions and 4 deletions
|
@ -387,11 +387,11 @@ class PlexTV(object):
|
||||||
|
|
||||||
return request
|
return request
|
||||||
|
|
||||||
def delete_plextv_sync(self, client_id='', sync_id='', output_format=''):
|
def delete_plextv_sync(self, client_id='', sync_id=''):
|
||||||
uri = '/devices/%s/sync_items/%s' % (client_id, sync_id)
|
uri = '/devices/%s/sync_items/%s' % (client_id, sync_id)
|
||||||
request = self.request_handler.make_request(uri=uri,
|
request = self.request_handler.make_request(uri=uri,
|
||||||
request_type='DELETE',
|
request_type='DELETE',
|
||||||
output_format=output_format)
|
return_response=True)
|
||||||
|
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
@ -649,7 +649,8 @@ class PlexTV(object):
|
||||||
|
|
||||||
def delete_sync(self, client_id, sync_id):
|
def delete_sync(self, client_id, sync_id):
|
||||||
logger.info("Tautulli PlexTV :: Deleting sync item '%s'." % sync_id)
|
logger.info("Tautulli PlexTV :: Deleting sync item '%s'." % sync_id)
|
||||||
self.delete_plextv_sync(client_id=client_id, sync_id=sync_id)
|
response = self.delete_plextv_sync(client_id=client_id, sync_id=sync_id)
|
||||||
|
return response.ok
|
||||||
|
|
||||||
def get_server_connections(self, pms_identifier='', pms_ip='', pms_port=32400, include_https=True):
|
def get_server_connections(self, pms_identifier='', pms_ip='', pms_port=32400, include_https=True):
|
||||||
|
|
||||||
|
|
|
@ -2669,7 +2669,10 @@ class WebInterface(object):
|
||||||
if client_id and sync_id:
|
if client_id and sync_id:
|
||||||
plex_tv = plextv.PlexTV()
|
plex_tv = plextv.PlexTV()
|
||||||
delete_row = plex_tv.delete_sync(client_id=client_id, sync_id=sync_id)
|
delete_row = plex_tv.delete_sync(client_id=client_id, sync_id=sync_id)
|
||||||
return {'result': 'success', 'message': 'Synced item deleted successfully.'}
|
if delete_row:
|
||||||
|
return {'result': 'success', 'message': 'Synced item deleted successfully.'}
|
||||||
|
else:
|
||||||
|
return {'result': 'error', 'message': 'Failed to delete synced item.'}
|
||||||
else:
|
else:
|
||||||
return {'result': 'error', 'message': 'Missing client ID and sync ID.'}
|
return {'result': 'error', 'message': 'Missing client ID and sync ID.'}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue