Skip to content

Commit

Permalink
Add add_media_library
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 12, 2024
1 parent 01e252b commit 34f76c1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions jellyfin_apiclient_python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34f76c1

Please sign in to comment.