From 1d0f04e5d9468bc47123af916375f7a5f2f564c3 Mon Sep 17 00:00:00 2001 From: joncrall Date: Thu, 12 Sep 2024 16:44:22 -0400 Subject: [PATCH] Add add_media_library --- jellyfin_apiclient_python/api.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/jellyfin_apiclient_python/api.py b/jellyfin_apiclient_python/api.py index a61e936..372322b 100644 --- a/jellyfin_apiclient_python/api.py +++ b/jellyfin_apiclient_python/api.py @@ -146,6 +146,31 @@ def refresh_library(self): """ return self._post("Library/Refresh") + def add_media_library(self, name, collectionType, paths, refreshLibrary=True): + """ + Create a new media library. + + Args: + name (str): name of the new library + + collectionType (str): one of "movies" "tvshows" "music" "musicvideos" + "homevideos" "boxsets" "books" "mixed" + + paths (List[str]): + paths on the server to use in the media library + + References: + ..[AddVirtualFolder] https://api.jellyfin.org/#tag/LibraryStructure/operation/AddVirtualFolder + """ + params = { + 'name': name, + 'collectionType': collectionType, + 'paths': paths, + 'refreshLibrary': refreshLibrary, + + } + return self.virtual_folders('POST', params=params) + def items(self, handler="", action="GET", params=None, json=None): if action == "POST": return self._post("Items%s" % handler, json, params)