Package com.lariflix.jemm.core
Class ConnectJellyfinAPI
java.lang.Object
com.lariflix.jemm.core.ConnectJellyfinAPI
This class is used to establish a connection with the Jellyfin API.
- Since:
- 1.0
- Author:
- Cesar Bianchi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the admin user from the Jellyfin server.Returns the base URL for the Jellyfin API.Returns the token for the Jellyfin API.getFolderMetadata
(String cFolderID) Retrieves metadata for a specific folder from the Jellyfin server.getFolders
(JellyfinParameters typeOfFolders) Retrieves all folders from the Jellyfin server.Retrieves all genres from the Jellyfin server.Retrieves all items from a specific parent folder from the Jellyfin server.Retrieves all people from the Jellyfin server.Retrieves all info about connected Jellyfin server.Retrieves all studios from the Jellyfin server.getUsers()
Retrieves all users from the Jellyfin server.int
postUpdate
(String cFolderID, String cItemID, JellyfinInstanceDetails instanceDetails, JellyfinParameters jemmParameters) Posts an update to a specific item in a specific folder on the Jellyfin server.void
setcBaseURL
(String cBaseURL) Sets the base URL for the Jellyfin API.void
setcTokenApi
(String cTokenApi) Sets the token for the Jellyfin API.
-
Constructor Details
-
ConnectJellyfinAPI
public ConnectJellyfinAPI()Constructor for the ConnectJellyfinAPI class.- Since:
- 1.0
-
-
Method Details
-
getcBaseURL
Returns the base URL for the Jellyfin API.- Returns:
- The base URL for the Jellyfin API.
- Since:
- 1.0
-
setcBaseURL
Sets the base URL for the Jellyfin API.- Parameters:
cBaseURL
- The new base URL for the Jellyfin API.- Since:
- 1.0
-
getcTokenApi
Returns the token for the Jellyfin API.- Returns:
- The token for the Jellyfin API.
- Since:
- 1.0
-
setcTokenApi
Sets the token for the Jellyfin API.- Parameters:
cTokenApi
- The new token for the Jellyfin API.- Since:
- 1.0
-
getUsers
public JellyfinUsers getUsers() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves all users from the Jellyfin server.- Returns:
- A JellyfinUsers object containing all users.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getFolders
public JellyfinFolders getFolders(JellyfinParameters typeOfFolders) throws IOException, MalformedURLException, org.json.simple.parser.ParseException Retrieves all folders from the Jellyfin server.- Parameters:
typeOfFolders
- A JellyfinParameters object that specifies the type of folders to retrieve.- Returns:
- A JellyfinFolders object containing all folders.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getFolderMetadata
public JellyfinFolderMetadata getFolderMetadata(String cFolderID) throws IOException, MalformedURLException, org.json.simple.parser.ParseException Retrieves metadata for a specific folder from the Jellyfin server.- Parameters:
cFolderID
- The ID of the folder for which to retrieve metadata. This is a string that represents the unique identifier of the folder in the Jellyfin server.- Returns:
- A JellyfinFolderMetadata object containing the folder's metadata.
- Throws:
IOException
- If an I/O error occurs. This can happen if there's a problem with the network connection, the server, or the local machine.MalformedURLException
- If the provided URL is not valid. This can happen if the base URL or the constructed URL for the API request is not a valid URL.org.json.simple.parser.ParseException
- If there is an error parsing the server's response. This can happen if the server's response does not match the expected format.- Since:
- 1.0
-
getItems
public JellyfinItems getItems(String cParentID) throws IOException, MalformedURLException, org.json.simple.parser.ParseException Retrieves all items from a specific parent folder from the Jellyfin server.- Parameters:
cParentID
- The ID of the parent folder from which to retrieve items.- Returns:
- A JellyfinItems object containing all items from the specified parent folder.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getPeople
public JellyfinCadPeopleItems getPeople() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves all people from the Jellyfin server.- Returns:
- A JellyfinCadPeopleItems object containing all people.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getGenres
public JellyfinCadGenresItems getGenres() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves all genres from the Jellyfin server.- Returns:
- A JellyfinCadGenresItems object containing all genres.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getStudios
public JellyfinCadStudioItems getStudios() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves all studios from the Jellyfin server.- Returns:
- A JellyfinCadStudioItems object containing all studios.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getServerInfo
public JellyfinServerInfo getServerInfo() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves all info about connected Jellyfin server.- Returns:
- A JellyfinServerInfo object containing all server Info.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.2.0
-
getAdminUser
public JellyfinUser getAdminUser() throws IOException, MalformedURLException, org.json.simple.parser.ParseExceptionRetrieves the admin user from the Jellyfin server.- Returns:
- A JellyfinUser object representing the admin user.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
postUpdate
public int postUpdate(String cFolderID, String cItemID, JellyfinInstanceDetails instanceDetails, JellyfinParameters jemmParameters) throws IOException, MalformedURLException, org.json.simple.parser.ParseException Posts an update to a specific item in a specific folder on the Jellyfin server.- Parameters:
cFolderID
- The ID of the folder containing the item to be updated.cItemID
- The ID of the item to be updated.instanceDetails
- The details of the Jellyfin instance.nOPC
- The operation code for the update.- Returns:
- The response code from the server.
- Throws:
IOException
- If an I/O error occurs.MalformedURLException
- If the provided URL is not valid.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-