test
This commit is contained in:
parent
e8b5843731
commit
7cac5fd957
770
DBRepair.sh
770
DBRepair.sh
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
import pathlib
|
||||
import subprocess
|
||||
import requests
|
||||
@ -47,18 +46,22 @@ class PLEX_INFO():
|
||||
return '%s%s:%s' % (self.proto, self.address, str(self.port))
|
||||
|
||||
|
||||
print("Gathering local Plex information.")
|
||||
plex_info = PLEX_INFO()
|
||||
print("Plex server is running at %s and using token %s" % (plex_info.url, plex_info.token))
|
||||
|
||||
sess = requests.Session()
|
||||
sess.verify = False
|
||||
print("Connecting to Plex server API.")
|
||||
plex = PlexServer(plex_info.url, plex_info.token, session=sess)
|
||||
|
||||
print(plex_info.token)
|
||||
print(plex_info.url)
|
||||
|
||||
#sess = requests.Session()
|
||||
#sess.verify = False
|
||||
#plex = PlexServer(plex_info.url, plex_info.token, session=sess)
|
||||
|
||||
#all_libraries = plex.library.sections()
|
||||
#for library in all_libraries:
|
||||
# for collection in library.search(libtype="collection"):
|
||||
# if collection.childCount == 0:
|
||||
# collection.delete()
|
||||
all_libraries = plex.library.sections()
|
||||
print("Checking %s libraries" % len(all_libraries))
|
||||
for library in all_libraries:
|
||||
print("Checking library: %s" % library)
|
||||
collection_delete_count = 0
|
||||
for collection in library.search(libtype="collection"):
|
||||
if collection.childCount == 0:
|
||||
collection.delete()
|
||||
collection_delete_count += 1
|
||||
print("Deleted %s collections from %s library" % (collection_delete_count, library))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user