Skip to content

Commit

Permalink
Merge pull request #39 from Erotemic/media-folder-api
Browse files Browse the repository at this point in the history
Media folder api
  • Loading branch information
iwalton3 authored Jan 21, 2024
2 parents 913322c + 1bd3ab6 commit 2fba159
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions jellyfin_apiclient_python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,33 @@ def users(self, handler="", action="GET", params=None, json=None):
else:
return self._get("Users/{UserId}%s" % handler, params)

def media_folders(self, params=None):
return self._get("Library/MediaFolders/", params)

def virtual_folders(self, action="GET", params=None, json=None):
if action == "POST":
return self._post("Library/VirtualFolders", json, params)
elif action == "DELETE":
return self._delete("Library/VirtualFolders", params)
else:
return self._get("Library/VirtualFolders", params)

def physical_paths(self, params=None):
return self._get("Library/PhysicalPaths/", params)

def folder_contents(self, abspath="/", params=None, json=None):
params = {} if params is None else params.copy()
params['path'] = abspath
params['includeFiles'] = params.get('includeFiles', True)
params['includeDirectories'] = params.get('includeDirectories', True)
return self._get("Environment/DirectoryContents", params)

def refresh_library(self):
"""
Starts a library scan.
"""
return self._post("Library/Refresh")

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 2fba159

Please sign in to comment.