Package com.lariflix.jemm.core
Class LoadItems
java.lang.Object
com.lariflix.jemm.core.LoadItems
This class is responsible for loading items from the Jellyfin server.
- Since:
- 1.0
- Author:
- Cesar Bianchi
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoadItems
(JellyfinParameters typeOfItems) Default constructor for the LoadItems class.LoadItems
(String jellyfinURL, String apiToken, String cAdminID, String cParID, JellyfinParameters typeOfItems) Constructor for the LoadItems class. -
Method Summary
Modifier and TypeMethodDescriptionGets the API token.Gets the ID of the parent item.Gets the ID of the admin user.Constructs the full URL for accessing the items on the Jellyfin server.Retrieves the type of items that this LoadItems instance is configured to load.Gets the Jellyfin instance URL.Requests items from the Jellyfin server.void
setApiToken
(String apiToken) Sets the API token.void
setcParentID
(String cParentID) Sets the ID of the parent item.void
setcUserAdminID
(String cUserAdminID) Sets the ID of the admin user.void
setItemsType
(JellyfinParameters itemsType) Sets the type of items that this LoadItems instance is configured to load.void
setJellyfinInstanceUrl
(String jellyfinInstanceUrl) Sets the Jellyfin instance URL.
-
Constructor Details
-
LoadItems
Default constructor for the LoadItems class.- Parameters:
typeOfItems
- A JellyfinParameters object representing the type of items to load. This could be any of the types defined in the JellyfinParameters class.- Since:
- 1.1
-
LoadItems
public LoadItems(String jellyfinURL, String apiToken, String cAdminID, String cParID, JellyfinParameters typeOfItems) Constructor for the LoadItems class.- Parameters:
jellyfinURL
- The URL of the Jellyfin server. This should be a valid URL, including the protocol (http or https) and the domain name or IP address of the Jellyfin server. It may also include a port number if the server is not running on the default port.apiToken
- The API token for accessing the Jellyfin server. This should be a valid API token provided by the Jellyfin server.cAdminID
- The ID of the admin user. This should be a valid user ID for a user with admin privileges on the Jellyfin server.cParID
- The ID of the parent item. This should be a valid item ID for an item on the Jellyfin server.typeOfItems
- A JellyfinParameters object representing the type of items to load. This could be any of the types defined in the JellyfinParameters class.- Since:
- 1.1
-
-
Method Details
-
requestItems
public JellyfinItems requestItems() throws MalformedURLException, IOException, org.json.simple.parser.ParseExceptionRequests items from the Jellyfin server.- Returns:
- A JellyfinItems object containing the items.
- Throws:
MalformedURLException
- If the provided URL is not valid.IOException
- If an I/O error occurs.org.json.simple.parser.ParseException
- If there is an error parsing the server's response.- Since:
- 1.0
-
getJellyfinInstanceUrl
Gets the Jellyfin instance URL.- Returns:
- The Jellyfin instance URL.
- Since:
- 1.0
-
setJellyfinInstanceUrl
Sets the Jellyfin instance URL.- Parameters:
jellyfinInstanceUrl
- The Jellyfin instance URL.- Since:
- 1.0
-
getApiToken
Gets the API token.- Returns:
- The API token.
- Since:
- 1.0
-
setApiToken
Sets the API token.- Parameters:
apiToken
- The API token.- Since:
- 1.0
-
getcUserAdminID
Gets the ID of the admin user.- Returns:
- The ID of the admin user.
- Since:
- 1.0
-
setcUserAdminID
Sets the ID of the admin user.- Parameters:
cUserAdminID
- The ID of the admin user.- Since:
- 1.0
-
getcParentID
Gets the ID of the parent item.- Returns:
- The ID of the parent item.
- Since:
- 1.0
-
setcParentID
Sets the ID of the parent item.- Parameters:
cParentID
- The ID of the parent item.- Since:
- 1.0
-
getFullURL
Constructs the full URL for accessing the items on the Jellyfin server. The URL is constructed based on the Jellyfin instance URL, the admin user ID, the parent ID, the API token, and the type of items to retrieve.- Returns:
- The full URL as a string. The URL includes the base Jellyfin instance URL, the path to the items endpoint, the parent ID, the user ID, the API token, and any necessary filters based on the type of items to retrieve.
- Since:
- 1.0
-
getItemsType
Retrieves the type of items that this LoadItems instance is configured to load.- Returns:
- A JellyfinParameters object representing the type of items to load. This could be any of the types defined in the JellyfinParameters class.
- Since:
- 1.1
-
setItemsType
Sets the type of items that this LoadItems instance is configured to load.- Parameters:
itemsType
- A JellyfinParameters object representing the type of items to load. This could be any of the types defined in the JellyfinParameters class.- Since:
- 1.1
-