Skip to content

Commit

Permalink
Add API calls for log files
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 12, 2024
1 parent 9a9acac commit 01e252b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions jellyfin_apiclient_python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,34 @@ def favorite(self, item_id, option=True):
def get_system_info(self):
return self._get("System/Configuration")

def get_server_logs(self):
"""
Returns:
List[Dict] - list of information about available log files
References:
.. [GetServerLogs] https://api.jellyfin.org/#tag/System/operation/GetServerLogs
"""
return self._get("System/Logs")

def get_log_entries(self, startIndex=None, limit=None, minDate=None, hasUserId=None):
"""
Returns a list of recent log entries
Returns:
Dict: with main key "Items"
"""
params = {}
if limit is not None:
params['limit'] = limit
if startIndex is not None:
params['startIndex'] = startIndex
if minDate is not None:
params['minDate'] = minDate
if hasUserId is not None:
params['hasUserId'] = hasUserId
return self._get("System/ActivityLog/Entries", params=params)

def post_capabilities(self, data):
return self.sessions("/Capabilities/Full", "POST", json=data)

Expand Down

0 comments on commit 01e252b

Please sign in to comment.