mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2024-11-16 17:00:14 +00:00
wait for refresh to complete
This commit is contained in:
parent
1837f9776b
commit
02629fe090
@ -30,6 +30,8 @@ class Library:
|
||||
|
||||
def validate_series(self) -> None:
|
||||
"""validate all series"""
|
||||
collection_id: str = self._get_collection()
|
||||
self.refresh_collection(collection_id)
|
||||
all_shows: list[JFShow] = self._get_all_series()["Items"]
|
||||
for show in all_shows:
|
||||
show_handler = Show(show)
|
||||
@ -38,7 +40,6 @@ class Library:
|
||||
if folders:
|
||||
show_handler.delete_folders(folders)
|
||||
|
||||
collection_id: str = self._get_collection()
|
||||
self.set_collection_art(collection_id)
|
||||
self.refresh_collection(collection_id)
|
||||
|
||||
@ -71,6 +72,18 @@ class Library:
|
||||
path: str = f"Items/{collection_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
||||
Jellyfin().post(path, False)
|
||||
|
||||
for _ in range(12):
|
||||
response = Jellyfin().get("Library/VirtualFolders")
|
||||
for folder in response:
|
||||
if not folder["ItemId"] == collection_id:
|
||||
continue
|
||||
|
||||
if folder["RefreshStatus"] == "Idle":
|
||||
return
|
||||
|
||||
print("waiting for library refresh")
|
||||
sleep(5)
|
||||
|
||||
|
||||
class Show:
|
||||
"""interact with a single show"""
|
||||
|
Loading…
Reference in New Issue
Block a user