mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 03:33:08 +00:00
Remove test sync client in teardown
This commit is contained in:
parent
8e531537fd
commit
2a31fe3329
2 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import time
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
from os import environ
|
||||
|
|
|
@ -11,11 +11,21 @@ from plexapi import X_PLEX_IDENTIFIER
|
|||
if __name__ == '__main__':
|
||||
myplex = MyPlexAccount()
|
||||
plex = PlexServer(token=myplex.authenticationToken)
|
||||
|
||||
# Remove the test server
|
||||
for device in plex.myPlexAccount().devices():
|
||||
if device.clientIdentifier == plex.machineIdentifier:
|
||||
print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier))
|
||||
device.delete()
|
||||
|
||||
# Remove the test sync client
|
||||
sync_client_identifier = 'sync-client-%s' % X_PLEX_IDENTIFIER
|
||||
for device in plex.myPlexAccount().devices():
|
||||
if device.clientIdentifier == sync_client_identifier:
|
||||
print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier))
|
||||
device.delete()
|
||||
break
|
||||
|
||||
# If we suddenly remove the client first we wouldn't be able to authenticate to delete the server
|
||||
for device in plex.myPlexAccount().devices():
|
||||
if device.clientIdentifier == X_PLEX_IDENTIFIER:
|
||||
|
|
Loading…
Reference in a new issue