diff --git a/core/include/JellyfinQt/loader/http/apikey.h b/core/include/JellyfinQt/loader/http/apikey.h index ee5c7c7..af7fa9f 100644 --- a/core/include/JellyfinQt/loader/http/apikey.h +++ b/core/include/JellyfinQt/loader/http/apikey.h @@ -61,6 +61,34 @@ protected: QByteArray body(const GetKeysParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Create a new api key. + */ + +class CreateKeyLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CreateKeyLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CreateKeyParams& parameters) const override; + QUrlQuery query(const CreateKeyParams& parameters) const override; + QByteArray body(const CreateKeyParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Remove an api key. + */ + +class RevokeKeyLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RevokeKeyLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RevokeKeyParams& parameters) const override; + QUrlQuery query(const RevokeKeyParams& parameters) const override; + QByteArray body(const RevokeKeyParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/branding.h b/core/include/JellyfinQt/loader/http/branding.h index fdfa68c..e584088 100644 --- a/core/include/JellyfinQt/loader/http/branding.h +++ b/core/include/JellyfinQt/loader/http/branding.h @@ -65,7 +65,7 @@ protected: * @brief Gets branding css. */ -class GetBrandingCssLoader : public Jellyfin::Support::HttpLoader { +class GetBrandingCssLoader : public Jellyfin::Support::HttpLoader { public: explicit GetBrandingCssLoader(ApiClient *apiClient = nullptr); @@ -79,7 +79,7 @@ protected: * @brief Gets branding css. */ -class GetBrandingCss_2Loader : public Jellyfin::Support::HttpLoader { +class GetBrandingCss_2Loader : public Jellyfin::Support::HttpLoader { public: explicit GetBrandingCss_2Loader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/collection.h b/core/include/JellyfinQt/loader/http/collection.h index fc2c7af..545ac3e 100644 --- a/core/include/JellyfinQt/loader/http/collection.h +++ b/core/include/JellyfinQt/loader/http/collection.h @@ -61,6 +61,34 @@ protected: QByteArray body(const CreateCollectionParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Adds items to a collection. + */ + +class AddToCollectionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AddToCollectionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AddToCollectionParams& parameters) const override; + QUrlQuery query(const AddToCollectionParams& parameters) const override; + QByteArray body(const AddToCollectionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Removes items from a collection. + */ + +class RemoveFromCollectionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RemoveFromCollectionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RemoveFromCollectionParams& parameters) const override; + QUrlQuery query(const RemoveFromCollectionParams& parameters) const override; + QByteArray body(const RemoveFromCollectionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/configuration.h b/core/include/JellyfinQt/loader/http/configuration.h index d66d18a..f2636e7 100644 --- a/core/include/JellyfinQt/loader/http/configuration.h +++ b/core/include/JellyfinQt/loader/http/configuration.h @@ -62,6 +62,20 @@ protected: QByteArray body(const GetConfigurationParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Updates application configuration. + */ + +class UpdateConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateConfigurationParams& parameters) const override; + QUrlQuery query(const UpdateConfigurationParams& parameters) const override; + QByteArray body(const UpdateConfigurationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a named configuration. */ @@ -76,6 +90,20 @@ protected: QByteArray body(const GetNamedConfigurationParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Updates named configuration. + */ + +class UpdateNamedConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateNamedConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateNamedConfigurationParams& parameters) const override; + QUrlQuery query(const UpdateNamedConfigurationParams& parameters) const override; + QByteArray body(const UpdateNamedConfigurationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a default MetadataOptions object. */ @@ -90,6 +118,20 @@ protected: QByteArray body(const GetDefaultMetadataOptionsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Updates the path to the media encoder. + */ + +class UpdateMediaEncoderPathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateMediaEncoderPathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateMediaEncoderPathParams& parameters) const override; + QUrlQuery query(const UpdateMediaEncoderPathParams& parameters) const override; + QByteArray body(const UpdateMediaEncoderPathParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/devices.h b/core/include/JellyfinQt/loader/http/devices.h index 0b8dfe5..54c6bdc 100644 --- a/core/include/JellyfinQt/loader/http/devices.h +++ b/core/include/JellyfinQt/loader/http/devices.h @@ -63,6 +63,20 @@ protected: QByteArray body(const GetDevicesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Deletes a device. + */ + +class DeleteDeviceLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteDeviceLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteDeviceParams& parameters) const override; + QUrlQuery query(const DeleteDeviceParams& parameters) const override; + QByteArray body(const DeleteDeviceParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Get info for a device. */ @@ -91,6 +105,20 @@ protected: QByteArray body(const GetDeviceOptionsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Update device options. + */ + +class UpdateDeviceOptionsLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateDeviceOptionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateDeviceOptionsParams& parameters) const override; + QUrlQuery query(const UpdateDeviceOptionsParams& parameters) const override; + QByteArray body(const UpdateDeviceOptionsParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/displaypreferences.h b/core/include/JellyfinQt/loader/http/displaypreferences.h index 8493181..f1eb715 100644 --- a/core/include/JellyfinQt/loader/http/displaypreferences.h +++ b/core/include/JellyfinQt/loader/http/displaypreferences.h @@ -61,6 +61,20 @@ protected: QByteArray body(const GetDisplayPreferencesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Update Display Preferences. + */ + +class UpdateDisplayPreferencesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateDisplayPreferencesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateDisplayPreferencesParams& parameters) const override; + QUrlQuery query(const UpdateDisplayPreferencesParams& parameters) const override; + QByteArray body(const UpdateDisplayPreferencesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/dlna.h b/core/include/JellyfinQt/loader/http/dlna.h index 38a3c2c..67f1b80 100644 --- a/core/include/JellyfinQt/loader/http/dlna.h +++ b/core/include/JellyfinQt/loader/http/dlna.h @@ -63,6 +63,20 @@ protected: QByteArray body(const GetProfileInfosParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Creates a profile. + */ + +class CreateProfileLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CreateProfileLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CreateProfileParams& parameters) const override; + QUrlQuery query(const CreateProfileParams& parameters) const override; + QByteArray body(const CreateProfileParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a single profile. */ @@ -77,6 +91,34 @@ protected: QByteArray body(const GetProfileParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Deletes a profile. + */ + +class DeleteProfileLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteProfileLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteProfileParams& parameters) const override; + QUrlQuery query(const DeleteProfileParams& parameters) const override; + QByteArray body(const DeleteProfileParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a profile. + */ + +class UpdateProfileLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateProfileLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateProfileParams& parameters) const override; + QUrlQuery query(const UpdateProfileParams& parameters) const override; + QByteArray body(const UpdateProfileParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the default profile. */ diff --git a/core/include/JellyfinQt/loader/http/environment.h b/core/include/JellyfinQt/loader/http/environment.h index 74e38d1..02ed78e 100644 --- a/core/include/JellyfinQt/loader/http/environment.h +++ b/core/include/JellyfinQt/loader/http/environment.h @@ -120,6 +120,20 @@ protected: QByteArray body(const GetParentPathParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Validates path. + */ + +class ValidatePathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ValidatePathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ValidatePathParams& parameters) const override; + QUrlQuery query(const ValidatePathParams& parameters) const override; + QByteArray body(const ValidatePathParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/hlssegment.h b/core/include/JellyfinQt/loader/http/hlssegment.h index cff457c..14dfcf8 100644 --- a/core/include/JellyfinQt/loader/http/hlssegment.h +++ b/core/include/JellyfinQt/loader/http/hlssegment.h @@ -46,6 +46,20 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Stops an active encoding. + */ + +class StopEncodingProcessLoader : public Jellyfin::Support::HttpLoader { +public: + explicit StopEncodingProcessLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const StopEncodingProcessParams& parameters) const override; + QUrlQuery query(const StopEncodingProcessParams& parameters) const override; + QByteArray body(const StopEncodingProcessParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/image.h b/core/include/JellyfinQt/loader/http/image.h index eeb808b..0bb28f6 100644 --- a/core/include/JellyfinQt/loader/http/image.h +++ b/core/include/JellyfinQt/loader/http/image.h @@ -61,6 +61,132 @@ protected: QByteArray body(const GetItemImageInfosParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Delete an item's image. + */ + +class DeleteItemImageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteItemImageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteItemImageParams& parameters) const override; + QUrlQuery query(const DeleteItemImageParams& parameters) const override; + QByteArray body(const DeleteItemImageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Set item image. + */ + +class SetItemImageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetItemImageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetItemImageParams& parameters) const override; + QUrlQuery query(const SetItemImageParams& parameters) const override; + QByteArray body(const SetItemImageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Delete an item's image. + */ + +class DeleteItemImageByIndexLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteItemImageByIndexLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteItemImageByIndexParams& parameters) const override; + QUrlQuery query(const DeleteItemImageByIndexParams& parameters) const override; + QByteArray body(const DeleteItemImageByIndexParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Set item image. + */ + +class SetItemImageByIndexLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetItemImageByIndexLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetItemImageByIndexParams& parameters) const override; + QUrlQuery query(const SetItemImageByIndexParams& parameters) const override; + QByteArray body(const SetItemImageByIndexParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates the index for an item image. + */ + +class UpdateItemImageIndexLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateItemImageIndexLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateItemImageIndexParams& parameters) const override; + QUrlQuery query(const UpdateItemImageIndexParams& parameters) const override; + QByteArray body(const UpdateItemImageIndexParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Sets the user image. + */ + +class PostUserImageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostUserImageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostUserImageParams& parameters) const override; + QUrlQuery query(const PostUserImageParams& parameters) const override; + QByteArray body(const PostUserImageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Delete the user's image. + */ + +class DeleteUserImageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteUserImageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteUserImageParams& parameters) const override; + QUrlQuery query(const DeleteUserImageParams& parameters) const override; + QByteArray body(const DeleteUserImageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Sets the user image. + */ + +class PostUserImageByIndexLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostUserImageByIndexLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostUserImageByIndexParams& parameters) const override; + QUrlQuery query(const PostUserImageByIndexParams& parameters) const override; + QByteArray body(const PostUserImageByIndexParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Delete the user's image. + */ + +class DeleteUserImageByIndexLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteUserImageByIndexLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteUserImageByIndexParams& parameters) const override; + QUrlQuery query(const DeleteUserImageByIndexParams& parameters) const override; + QByteArray body(const DeleteUserImageByIndexParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/itemlookup.h b/core/include/JellyfinQt/loader/http/itemlookup.h index 63c4d89..442ea79 100644 --- a/core/include/JellyfinQt/loader/http/itemlookup.h +++ b/core/include/JellyfinQt/loader/http/itemlookup.h @@ -70,6 +70,20 @@ protected: QByteArray body(const GetExternalIdInfosParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Applies search criteria to an item and refreshes metadata. + */ + +class ApplySearchCriteriaLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ApplySearchCriteriaLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ApplySearchCriteriaParams& parameters) const override; + QUrlQuery query(const ApplySearchCriteriaParams& parameters) const override; + QByteArray body(const ApplySearchCriteriaParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Get book remote search. */ diff --git a/core/include/JellyfinQt/loader/http/itemrefresh.h b/core/include/JellyfinQt/loader/http/itemrefresh.h index 3489f50..61ec6be 100644 --- a/core/include/JellyfinQt/loader/http/itemrefresh.h +++ b/core/include/JellyfinQt/loader/http/itemrefresh.h @@ -46,6 +46,20 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Refreshes metadata for an item. + */ + +class PostLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostParams& parameters) const override; + QUrlQuery query(const PostParams& parameters) const override; + QByteArray body(const PostParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/itemupdate.h b/core/include/JellyfinQt/loader/http/itemupdate.h index b594f18..19a59d0 100644 --- a/core/include/JellyfinQt/loader/http/itemupdate.h +++ b/core/include/JellyfinQt/loader/http/itemupdate.h @@ -47,6 +47,34 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Updates an item. + */ + +class UpdateItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateItemParams& parameters) const override; + QUrlQuery query(const UpdateItemParams& parameters) const override; + QByteArray body(const UpdateItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates an item's content type. + */ + +class UpdateItemContentTypeLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateItemContentTypeLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateItemContentTypeParams& parameters) const override; + QUrlQuery query(const UpdateItemContentTypeParams& parameters) const override; + QByteArray body(const UpdateItemContentTypeParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets metadata editor info for an item. */ diff --git a/core/include/JellyfinQt/loader/http/library.h b/core/include/JellyfinQt/loader/http/library.h index a56c1b7..b2df897 100644 --- a/core/include/JellyfinQt/loader/http/library.h +++ b/core/include/JellyfinQt/loader/http/library.h @@ -61,6 +61,34 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Deletes items from the library and filesystem. + */ + +class DeleteItemsLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteItemsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteItemsParams& parameters) const override; + QUrlQuery query(const DeleteItemsParams& parameters) const override; + QByteArray body(const DeleteItemsParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Deletes an item from the library and filesystem. + */ + +class DeleteItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteItemParams& parameters) const override; + QUrlQuery query(const DeleteItemParams& parameters) const override; + QByteArray body(const DeleteItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets similar items. */ @@ -201,6 +229,20 @@ protected: QByteArray body(const GetLibraryOptionsInfoParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Reports that new movies have been added by an external source. + */ + +class PostUpdatedMediaLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostUpdatedMediaLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostUpdatedMediaParams& parameters) const override; + QUrlQuery query(const PostUpdatedMediaParams& parameters) const override; + QByteArray body(const PostUpdatedMediaParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets all user media folders. */ @@ -215,6 +257,34 @@ protected: QByteArray body(const GetMediaFoldersParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Reports that new movies have been added by an external source. + */ + +class PostAddedMoviesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostAddedMoviesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostAddedMoviesParams& parameters) const override; + QUrlQuery query(const PostAddedMoviesParams& parameters) const override; + QByteArray body(const PostAddedMoviesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that new movies have been added by an external source. + */ + +class PostUpdatedMoviesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostUpdatedMoviesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostUpdatedMoviesParams& parameters) const override; + QUrlQuery query(const PostUpdatedMoviesParams& parameters) const override; + QByteArray body(const PostUpdatedMoviesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a list of physical paths from virtual folders. */ @@ -229,6 +299,48 @@ protected: QByteArray body(const GetPhysicalPathsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Starts a library scan. + */ + +class RefreshLibraryLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RefreshLibraryLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RefreshLibraryParams& parameters) const override; + QUrlQuery query(const RefreshLibraryParams& parameters) const override; + QByteArray body(const RefreshLibraryParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that new episodes of a series have been added by an external source. + */ + +class PostAddedSeriesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostAddedSeriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostAddedSeriesParams& parameters) const override; + QUrlQuery query(const PostAddedSeriesParams& parameters) const override; + QByteArray body(const PostAddedSeriesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that new episodes of a series have been added by an external source. + */ + +class PostUpdatedSeriesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostUpdatedSeriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostUpdatedSeriesParams& parameters) const override; + QUrlQuery query(const PostUpdatedSeriesParams& parameters) const override; + QByteArray body(const PostUpdatedSeriesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets similar items. */ diff --git a/core/include/JellyfinQt/loader/http/librarystructure.h b/core/include/JellyfinQt/loader/http/librarystructure.h index 201356e..5a2f50b 100644 --- a/core/include/JellyfinQt/loader/http/librarystructure.h +++ b/core/include/JellyfinQt/loader/http/librarystructure.h @@ -61,6 +61,104 @@ protected: QByteArray body(const GetVirtualFoldersParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Adds a virtual folder. + */ + +class AddVirtualFolderLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AddVirtualFolderLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AddVirtualFolderParams& parameters) const override; + QUrlQuery query(const AddVirtualFolderParams& parameters) const override; + QByteArray body(const AddVirtualFolderParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Removes a virtual folder. + */ + +class RemoveVirtualFolderLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RemoveVirtualFolderLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RemoveVirtualFolderParams& parameters) const override; + QUrlQuery query(const RemoveVirtualFolderParams& parameters) const override; + QByteArray body(const RemoveVirtualFolderParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Update library options. + */ + +class UpdateLibraryOptionsLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateLibraryOptionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateLibraryOptionsParams& parameters) const override; + QUrlQuery query(const UpdateLibraryOptionsParams& parameters) const override; + QByteArray body(const UpdateLibraryOptionsParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Renames a virtual folder. + */ + +class RenameVirtualFolderLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RenameVirtualFolderLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RenameVirtualFolderParams& parameters) const override; + QUrlQuery query(const RenameVirtualFolderParams& parameters) const override; + QByteArray body(const RenameVirtualFolderParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Add a media path to a library. + */ + +class AddMediaPathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AddMediaPathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AddMediaPathParams& parameters) const override; + QUrlQuery query(const AddMediaPathParams& parameters) const override; + QByteArray body(const AddMediaPathParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Remove a media path. + */ + +class RemoveMediaPathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RemoveMediaPathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RemoveMediaPathParams& parameters) const override; + QUrlQuery query(const RemoveMediaPathParams& parameters) const override; + QByteArray body(const RemoveMediaPathParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a media path. + */ + +class UpdateMediaPathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateMediaPathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateMediaPathParams& parameters) const override; + QUrlQuery query(const UpdateMediaPathParams& parameters) const override; + QByteArray body(const UpdateMediaPathParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/livetv.h b/core/include/JellyfinQt/loader/http/livetv.h index d154807..7f172de 100644 --- a/core/include/JellyfinQt/loader/http/livetv.h +++ b/core/include/JellyfinQt/loader/http/livetv.h @@ -171,6 +171,20 @@ protected: QByteArray body(const AddListingProviderParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Delete listing provider. + */ + +class DeleteListingProviderLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteListingProviderLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteListingProviderParams& parameters) const override; + QUrlQuery query(const DeleteListingProviderParams& parameters) const override; + QByteArray body(const DeleteListingProviderParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets default listings provider info. */ @@ -297,6 +311,20 @@ protected: QByteArray body(const GetRecordingParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Deletes a live tv recording. + */ + +class DeleteRecordingLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteRecordingLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteRecordingParams& parameters) const override; + QUrlQuery query(const DeleteRecordingParams& parameters) const override; + QByteArray body(const DeleteRecordingParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets recording folders. */ @@ -353,6 +381,20 @@ protected: QByteArray body(const GetSeriesTimersParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Creates a live tv series timer. + */ + +class CreateSeriesTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CreateSeriesTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CreateSeriesTimerParams& parameters) const override; + QUrlQuery query(const CreateSeriesTimerParams& parameters) const override; + QByteArray body(const CreateSeriesTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a live tv series timer. */ @@ -367,6 +409,34 @@ protected: QByteArray body(const GetSeriesTimerParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Cancels a live tv series timer. + */ + +class CancelSeriesTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CancelSeriesTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CancelSeriesTimerParams& parameters) const override; + QUrlQuery query(const CancelSeriesTimerParams& parameters) const override; + QByteArray body(const CancelSeriesTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a live tv series timer. + */ + +class UpdateSeriesTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateSeriesTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateSeriesTimerParams& parameters) const override; + QUrlQuery query(const UpdateSeriesTimerParams& parameters) const override; + QByteArray body(const UpdateSeriesTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the live tv timers. */ @@ -381,6 +451,20 @@ protected: QByteArray body(const GetTimersParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Creates a live tv timer. + */ + +class CreateTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CreateTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CreateTimerParams& parameters) const override; + QUrlQuery query(const CreateTimerParams& parameters) const override; + QByteArray body(const CreateTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a timer. */ @@ -395,6 +479,34 @@ protected: QByteArray body(const GetTimerParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Cancels a live tv timer. + */ + +class CancelTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CancelTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CancelTimerParams& parameters) const override; + QUrlQuery query(const CancelTimerParams& parameters) const override; + QByteArray body(const CancelTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a live tv timer. + */ + +class UpdateTimerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateTimerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateTimerParams& parameters) const override; + QUrlQuery query(const UpdateTimerParams& parameters) const override; + QByteArray body(const UpdateTimerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the default values for a new timer. */ @@ -423,6 +535,20 @@ protected: QByteArray body(const AddTunerHostParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Deletes a tuner host. + */ + +class DeleteTunerHostLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteTunerHostLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteTunerHostParams& parameters) const override; + QUrlQuery query(const DeleteTunerHostParams& parameters) const override; + QByteArray body(const DeleteTunerHostParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Get tuner host types. */ @@ -437,6 +563,20 @@ protected: QByteArray body(const GetTunerHostTypesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Resets a tv tuner. + */ + +class ResetTunerLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ResetTunerLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ResetTunerParams& parameters) const override; + QUrlQuery query(const ResetTunerParams& parameters) const override; + QByteArray body(const ResetTunerParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Discover tuners. */ diff --git a/core/include/JellyfinQt/loader/http/mediainfo.h b/core/include/JellyfinQt/loader/http/mediainfo.h index 6249094..9270b45 100644 --- a/core/include/JellyfinQt/loader/http/mediainfo.h +++ b/core/include/JellyfinQt/loader/http/mediainfo.h @@ -77,6 +77,20 @@ protected: QByteArray body(const GetPostedPlaybackInfoParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Closes a media source. + */ + +class CloseLiveStreamLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CloseLiveStreamLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CloseLiveStreamParams& parameters) const override; + QUrlQuery query(const CloseLiveStreamParams& parameters) const override; + QByteArray body(const CloseLiveStreamParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Opens a media source. */ diff --git a/core/include/JellyfinQt/loader/http/notifications.h b/core/include/JellyfinQt/loader/http/notifications.h index c17d92e..6ce32df 100644 --- a/core/include/JellyfinQt/loader/http/notifications.h +++ b/core/include/JellyfinQt/loader/http/notifications.h @@ -64,6 +64,20 @@ protected: QByteArray body(const GetNotificationsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets notifications as read. + */ + +class SetReadLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetReadLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetReadParams& parameters) const override; + QUrlQuery query(const SetReadParams& parameters) const override; + QByteArray body(const SetReadParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets a user's notification summary. */ @@ -78,6 +92,34 @@ protected: QByteArray body(const GetNotificationsSummaryParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets notifications as unread. + */ + +class SetUnreadLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetUnreadLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetUnreadParams& parameters) const override; + QUrlQuery query(const SetUnreadParams& parameters) const override; + QByteArray body(const SetUnreadParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Sends a notification to all admins. + */ + +class CreateAdminNotificationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CreateAdminNotificationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CreateAdminNotificationParams& parameters) const override; + QUrlQuery query(const CreateAdminNotificationParams& parameters) const override; + QByteArray body(const CreateAdminNotificationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets notification services. */ diff --git a/core/include/JellyfinQt/loader/http/package.h b/core/include/JellyfinQt/loader/http/package.h index b715612..cd1d42a 100644 --- a/core/include/JellyfinQt/loader/http/package.h +++ b/core/include/JellyfinQt/loader/http/package.h @@ -77,6 +77,34 @@ protected: QByteArray body(const GetPackageInfoParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Installs a package. + */ + +class InstallPackageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit InstallPackageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const InstallPackageParams& parameters) const override; + QUrlQuery query(const InstallPackageParams& parameters) const override; + QByteArray body(const InstallPackageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Cancels a package installation. + */ + +class CancelPackageInstallationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CancelPackageInstallationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CancelPackageInstallationParams& parameters) const override; + QUrlQuery query(const CancelPackageInstallationParams& parameters) const override; + QByteArray body(const CancelPackageInstallationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets all package repositories. */ @@ -91,6 +119,20 @@ protected: QByteArray body(const GetRepositoriesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets the enabled and existing package repositories. + */ + +class SetRepositoriesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetRepositoriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetRepositoriesParams& parameters) const override; + QUrlQuery query(const SetRepositoriesParams& parameters) const override; + QByteArray body(const SetRepositoriesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/playlists.h b/core/include/JellyfinQt/loader/http/playlists.h index bd58284..8df3078 100644 --- a/core/include/JellyfinQt/loader/http/playlists.h +++ b/core/include/JellyfinQt/loader/http/playlists.h @@ -62,6 +62,34 @@ protected: QByteArray body(const CreatePlaylistParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Adds items to a playlist. + */ + +class AddToPlaylistLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AddToPlaylistLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AddToPlaylistParams& parameters) const override; + QUrlQuery query(const AddToPlaylistParams& parameters) const override; + QByteArray body(const AddToPlaylistParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Removes items from a playlist. + */ + +class RemoveFromPlaylistLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RemoveFromPlaylistLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RemoveFromPlaylistParams& parameters) const override; + QUrlQuery query(const RemoveFromPlaylistParams& parameters) const override; + QByteArray body(const RemoveFromPlaylistParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the original items of a playlist. */ @@ -76,6 +104,20 @@ protected: QByteArray body(const GetPlaylistItemsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Moves a playlist item. + */ + +class MoveItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit MoveItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const MoveItemParams& parameters) const override; + QUrlQuery query(const MoveItemParams& parameters) const override; + QByteArray body(const MoveItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/playstate.h b/core/include/JellyfinQt/loader/http/playstate.h index 6dc6e39..1c981fa 100644 --- a/core/include/JellyfinQt/loader/http/playstate.h +++ b/core/include/JellyfinQt/loader/http/playstate.h @@ -48,6 +48,62 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Reports playback has started within a session. + */ + +class ReportPlaybackStartLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ReportPlaybackStartLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ReportPlaybackStartParams& parameters) const override; + QUrlQuery query(const ReportPlaybackStartParams& parameters) const override; + QByteArray body(const ReportPlaybackStartParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Pings a playback session. + */ + +class PingPlaybackSessionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PingPlaybackSessionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PingPlaybackSessionParams& parameters) const override; + QUrlQuery query(const PingPlaybackSessionParams& parameters) const override; + QByteArray body(const PingPlaybackSessionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports playback progress within a session. + */ + +class ReportPlaybackProgressLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ReportPlaybackProgressLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ReportPlaybackProgressParams& parameters) const override; + QUrlQuery query(const ReportPlaybackProgressParams& parameters) const override; + QByteArray body(const ReportPlaybackProgressParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports playback has stopped within a session. + */ + +class ReportPlaybackStoppedLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ReportPlaybackStoppedLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ReportPlaybackStoppedParams& parameters) const override; + QUrlQuery query(const ReportPlaybackStoppedParams& parameters) const override; + QByteArray body(const ReportPlaybackStoppedParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Marks an item as played for user. */ @@ -76,6 +132,48 @@ protected: QByteArray body(const MarkUnplayedItemParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Reports that a user has begun playing an item. + */ + +class OnPlaybackStartLoader : public Jellyfin::Support::HttpLoader { +public: + explicit OnPlaybackStartLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const OnPlaybackStartParams& parameters) const override; + QUrlQuery query(const OnPlaybackStartParams& parameters) const override; + QByteArray body(const OnPlaybackStartParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that a user has stopped playing an item. + */ + +class OnPlaybackStoppedLoader : public Jellyfin::Support::HttpLoader { +public: + explicit OnPlaybackStoppedLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const OnPlaybackStoppedParams& parameters) const override; + QUrlQuery query(const OnPlaybackStoppedParams& parameters) const override; + QByteArray body(const OnPlaybackStoppedParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports a user's playback progress. + */ + +class OnPlaybackProgressLoader : public Jellyfin::Support::HttpLoader { +public: + explicit OnPlaybackProgressLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const OnPlaybackProgressParams& parameters) const override; + QUrlQuery query(const OnPlaybackProgressParams& parameters) const override; + QByteArray body(const OnPlaybackProgressParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/plugins.h b/core/include/JellyfinQt/loader/http/plugins.h index 8a1cdb1..9931970 100644 --- a/core/include/JellyfinQt/loader/http/plugins.h +++ b/core/include/JellyfinQt/loader/http/plugins.h @@ -62,6 +62,62 @@ protected: QByteArray body(const GetPluginsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Uninstalls a plugin. + */ + +class UninstallPluginLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UninstallPluginLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UninstallPluginParams& parameters) const override; + QUrlQuery query(const UninstallPluginParams& parameters) const override; + QByteArray body(const UninstallPluginParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Uninstalls a plugin by version. + */ + +class UninstallPluginByVersionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UninstallPluginByVersionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UninstallPluginByVersionParams& parameters) const override; + QUrlQuery query(const UninstallPluginByVersionParams& parameters) const override; + QByteArray body(const UninstallPluginByVersionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Disable a plugin. + */ + +class DisablePluginLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DisablePluginLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DisablePluginParams& parameters) const override; + QUrlQuery query(const DisablePluginParams& parameters) const override; + QByteArray body(const DisablePluginParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Enables a disabled plugin. + */ + +class EnablePluginLoader : public Jellyfin::Support::HttpLoader { +public: + explicit EnablePluginLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const EnablePluginParams& parameters) const override; + QUrlQuery query(const EnablePluginParams& parameters) const override; + QByteArray body(const EnablePluginParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets plugin configuration. */ @@ -76,6 +132,48 @@ protected: QByteArray body(const GetPluginConfigurationParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Updates plugin configuration. + */ + +class UpdatePluginConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdatePluginConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdatePluginConfigurationParams& parameters) const override; + QUrlQuery query(const UpdatePluginConfigurationParams& parameters) const override; + QByteArray body(const UpdatePluginConfigurationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Gets a plugin's manifest. + */ + +class GetPluginManifestLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetPluginManifestLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPluginManifestParams& parameters) const override; + QUrlQuery query(const GetPluginManifestParams& parameters) const override; + QByteArray body(const GetPluginManifestParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates plugin security info. + */ + +class UpdatePluginSecurityInfoLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdatePluginSecurityInfoLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdatePluginSecurityInfoParams& parameters) const override; + QUrlQuery query(const UpdatePluginSecurityInfoParams& parameters) const override; + QByteArray body(const UpdatePluginSecurityInfoParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/quickconnect.h b/core/include/JellyfinQt/loader/http/quickconnect.h index 7397fd8..1478958 100644 --- a/core/include/JellyfinQt/loader/http/quickconnect.h +++ b/core/include/JellyfinQt/loader/http/quickconnect.h @@ -49,6 +49,20 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Temporarily activates quick connect for five minutes. + */ + +class ActivateLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ActivateLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ActivateParams& parameters) const override; + QUrlQuery query(const ActivateParams& parameters) const override; + QByteArray body(const ActivateParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Authorizes a pending quick connect request. */ @@ -63,6 +77,20 @@ protected: QByteArray body(const AuthorizeParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Enables or disables quick connect. + */ + +class AvailableLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AvailableLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AvailableParams& parameters) const override; + QUrlQuery query(const AvailableParams& parameters) const override; + QByteArray body(const AvailableParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Attempts to retrieve authentication information. */ diff --git a/core/include/JellyfinQt/loader/http/remoteimage.h b/core/include/JellyfinQt/loader/http/remoteimage.h index 61ab76b..a0e8546 100644 --- a/core/include/JellyfinQt/loader/http/remoteimage.h +++ b/core/include/JellyfinQt/loader/http/remoteimage.h @@ -62,6 +62,20 @@ protected: QByteArray body(const GetRemoteImagesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Downloads a remote image for an item. + */ + +class DownloadRemoteImageLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DownloadRemoteImageLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DownloadRemoteImageParams& parameters) const override; + QUrlQuery query(const DownloadRemoteImageParams& parameters) const override; + QByteArray body(const DownloadRemoteImageParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets available remote image providers for an item. */ diff --git a/core/include/JellyfinQt/loader/http/scheduledtasks.h b/core/include/JellyfinQt/loader/http/scheduledtasks.h index e5523d2..42761db 100644 --- a/core/include/JellyfinQt/loader/http/scheduledtasks.h +++ b/core/include/JellyfinQt/loader/http/scheduledtasks.h @@ -76,6 +76,48 @@ protected: QByteArray body(const GetTaskParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Update specified task triggers. + */ + +class UpdateTaskLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateTaskLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateTaskParams& parameters) const override; + QUrlQuery query(const UpdateTaskParams& parameters) const override; + QByteArray body(const UpdateTaskParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Start specified task. + */ + +class StartTaskLoader : public Jellyfin::Support::HttpLoader { +public: + explicit StartTaskLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const StartTaskParams& parameters) const override; + QUrlQuery query(const StartTaskParams& parameters) const override; + QByteArray body(const StartTaskParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Stop specified task. + */ + +class StopTaskLoader : public Jellyfin::Support::HttpLoader { +public: + explicit StopTaskLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const StopTaskParams& parameters) const override; + QUrlQuery query(const StopTaskParams& parameters) const override; + QByteArray body(const StopTaskParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/session.h b/core/include/JellyfinQt/loader/http/session.h index 35fd2cc..ffd5a6b 100644 --- a/core/include/JellyfinQt/loader/http/session.h +++ b/core/include/JellyfinQt/loader/http/session.h @@ -91,6 +91,188 @@ protected: QByteArray body(const GetSessionsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Issues a full general command to a client. + */ + +class SendFullGeneralCommandLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SendFullGeneralCommandLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SendFullGeneralCommandParams& parameters) const override; + QUrlQuery query(const SendFullGeneralCommandParams& parameters) const override; + QByteArray body(const SendFullGeneralCommandParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Issues a general command to a client. + */ + +class SendGeneralCommandLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SendGeneralCommandLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SendGeneralCommandParams& parameters) const override; + QUrlQuery query(const SendGeneralCommandParams& parameters) const override; + QByteArray body(const SendGeneralCommandParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Issues a command to a client to display a message to the user. + */ + +class SendMessageCommandLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SendMessageCommandLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SendMessageCommandParams& parameters) const override; + QUrlQuery query(const SendMessageCommandParams& parameters) const override; + QByteArray body(const SendMessageCommandParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Instructs a session to play an item. + */ + +class PlayLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PlayLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PlayParams& parameters) const override; + QUrlQuery query(const PlayParams& parameters) const override; + QByteArray body(const PlayParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Issues a playstate command to a client. + */ + +class SendPlaystateCommandLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SendPlaystateCommandLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SendPlaystateCommandParams& parameters) const override; + QUrlQuery query(const SendPlaystateCommandParams& parameters) const override; + QByteArray body(const SendPlaystateCommandParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Issues a system command to a client. + */ + +class SendSystemCommandLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SendSystemCommandLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SendSystemCommandParams& parameters) const override; + QUrlQuery query(const SendSystemCommandParams& parameters) const override; + QByteArray body(const SendSystemCommandParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Adds an additional user to a session. + */ + +class AddUserToSessionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AddUserToSessionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AddUserToSessionParams& parameters) const override; + QUrlQuery query(const AddUserToSessionParams& parameters) const override; + QByteArray body(const AddUserToSessionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Removes an additional user from a session. + */ + +class RemoveUserFromSessionLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RemoveUserFromSessionLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RemoveUserFromSessionParams& parameters) const override; + QUrlQuery query(const RemoveUserFromSessionParams& parameters) const override; + QByteArray body(const RemoveUserFromSessionParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Instructs a session to browse to an item or view. + */ + +class DisplayContentLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DisplayContentLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DisplayContentParams& parameters) const override; + QUrlQuery query(const DisplayContentParams& parameters) const override; + QByteArray body(const DisplayContentParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates capabilities for a device. + */ + +class PostCapabilitiesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostCapabilitiesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostCapabilitiesParams& parameters) const override; + QUrlQuery query(const PostCapabilitiesParams& parameters) const override; + QByteArray body(const PostCapabilitiesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates capabilities for a device. + */ + +class PostFullCapabilitiesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostFullCapabilitiesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostFullCapabilitiesParams& parameters) const override; + QUrlQuery query(const PostFullCapabilitiesParams& parameters) const override; + QByteArray body(const PostFullCapabilitiesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that a session has ended. + */ + +class ReportSessionEndedLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ReportSessionEndedLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ReportSessionEndedParams& parameters) const override; + QUrlQuery query(const ReportSessionEndedParams& parameters) const override; + QByteArray body(const ReportSessionEndedParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Reports that a session is viewing an item. + */ + +class ReportViewingLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ReportViewingLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ReportViewingParams& parameters) const override; + QUrlQuery query(const ReportViewingParams& parameters) const override; + QByteArray body(const ReportViewingParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/startup.h b/core/include/JellyfinQt/loader/http/startup.h index b9d3bf8..e074a5e 100644 --- a/core/include/JellyfinQt/loader/http/startup.h +++ b/core/include/JellyfinQt/loader/http/startup.h @@ -49,6 +49,20 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Completes the startup wizard. + */ + +class CompleteWizardLoader : public Jellyfin::Support::HttpLoader { +public: + explicit CompleteWizardLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const CompleteWizardParams& parameters) const override; + QUrlQuery query(const CompleteWizardParams& parameters) const override; + QByteArray body(const CompleteWizardParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the initial startup wizard configuration. */ @@ -63,6 +77,20 @@ protected: QByteArray body(const GetStartupConfigurationParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets the initial startup wizard configuration. + */ + +class UpdateInitialConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateInitialConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateInitialConfigurationParams& parameters) const override; + QUrlQuery query(const UpdateInitialConfigurationParams& parameters) const override; + QByteArray body(const UpdateInitialConfigurationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the first user. */ @@ -77,6 +105,20 @@ protected: QByteArray body(const GetFirstUser_2Params& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets remote access and UPnP. + */ + +class SetRemoteAccessLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SetRemoteAccessLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SetRemoteAccessParams& parameters) const override; + QUrlQuery query(const SetRemoteAccessParams& parameters) const override; + QByteArray body(const SetRemoteAccessParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets the first user. */ @@ -91,6 +133,20 @@ protected: QByteArray body(const GetFirstUserParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Sets the user name and password. + */ + +class UpdateStartupUserLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateStartupUserLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateStartupUserParams& parameters) const override; + QUrlQuery query(const UpdateStartupUserParams& parameters) const override; + QByteArray body(const UpdateStartupUserParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/subtitle.h b/core/include/JellyfinQt/loader/http/subtitle.h index 069724f..88ecf79 100644 --- a/core/include/JellyfinQt/loader/http/subtitle.h +++ b/core/include/JellyfinQt/loader/http/subtitle.h @@ -76,6 +76,48 @@ protected: QByteArray body(const SearchRemoteSubtitlesParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Downloads a remote subtitle. + */ + +class DownloadRemoteSubtitlesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DownloadRemoteSubtitlesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DownloadRemoteSubtitlesParams& parameters) const override; + QUrlQuery query(const DownloadRemoteSubtitlesParams& parameters) const override; + QByteArray body(const DownloadRemoteSubtitlesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Upload an external subtitle file. + */ + +class UploadSubtitleLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UploadSubtitleLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UploadSubtitleParams& parameters) const override; + QUrlQuery query(const UploadSubtitleParams& parameters) const override; + QByteArray body(const UploadSubtitleParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Deletes an external subtitle file. + */ + +class DeleteSubtitleLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteSubtitleLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteSubtitleParams& parameters) const override; + QUrlQuery query(const DeleteSubtitleParams& parameters) const override; + QByteArray body(const DeleteSubtitleParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/syncplay.h b/core/include/JellyfinQt/loader/http/syncplay.h index a121798..d4cc834 100644 --- a/core/include/JellyfinQt/loader/http/syncplay.h +++ b/core/include/JellyfinQt/loader/http/syncplay.h @@ -47,6 +47,48 @@ namespace HTTP { using namespace Jellyfin::DTO; +/** + * @brief Notify SyncPlay group that member is buffering. + */ + +class SyncPlayBufferingLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayBufferingLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayBufferingParams& parameters) const override; + QUrlQuery query(const SyncPlayBufferingParams& parameters) const override; + QByteArray body(const SyncPlayBufferingParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Join an existing SyncPlay group. + */ + +class SyncPlayJoinGroupLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayJoinGroupLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayJoinGroupParams& parameters) const override; + QUrlQuery query(const SyncPlayJoinGroupParams& parameters) const override; + QByteArray body(const SyncPlayJoinGroupParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Leave the joined SyncPlay group. + */ + +class SyncPlayLeaveGroupLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayLeaveGroupLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayLeaveGroupParams& parameters) const override; + QUrlQuery query(const SyncPlayLeaveGroupParams& parameters) const override; + QByteArray body(const SyncPlayLeaveGroupParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets all SyncPlay groups. */ @@ -61,6 +103,244 @@ protected: QByteArray body(const SyncPlayGetGroupsParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Request to move an item in the playlist in SyncPlay group. + */ + +class SyncPlayMovePlaylistItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayMovePlaylistItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayMovePlaylistItemParams& parameters) const override; + QUrlQuery query(const SyncPlayMovePlaylistItemParams& parameters) const override; + QByteArray body(const SyncPlayMovePlaylistItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Create a new SyncPlay group. + */ + +class SyncPlayCreateGroupLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayCreateGroupLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayCreateGroupParams& parameters) const override; + QUrlQuery query(const SyncPlayCreateGroupParams& parameters) const override; + QByteArray body(const SyncPlayCreateGroupParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request next item in SyncPlay group. + */ + +class SyncPlayNextItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayNextItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayNextItemParams& parameters) const override; + QUrlQuery query(const SyncPlayNextItemParams& parameters) const override; + QByteArray body(const SyncPlayNextItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request pause in SyncPlay group. + */ + +class SyncPlayPauseLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayPauseLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayPauseParams& parameters) const override; + QUrlQuery query(const SyncPlayPauseParams& parameters) const override; + QByteArray body(const SyncPlayPauseParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Update session ping. + */ + +class SyncPlayPingLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayPingLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayPingParams& parameters) const override; + QUrlQuery query(const SyncPlayPingParams& parameters) const override; + QByteArray body(const SyncPlayPingParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request previous item in SyncPlay group. + */ + +class SyncPlayPreviousItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayPreviousItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayPreviousItemParams& parameters) const override; + QUrlQuery query(const SyncPlayPreviousItemParams& parameters) const override; + QByteArray body(const SyncPlayPreviousItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to queue items to the playlist of a SyncPlay group. + */ + +class SyncPlayQueueLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayQueueLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayQueueParams& parameters) const override; + QUrlQuery query(const SyncPlayQueueParams& parameters) const override; + QByteArray body(const SyncPlayQueueParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Notify SyncPlay group that member is ready for playback. + */ + +class SyncPlayReadyLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayReadyLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayReadyParams& parameters) const override; + QUrlQuery query(const SyncPlayReadyParams& parameters) const override; + QByteArray body(const SyncPlayReadyParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to remove items from the playlist in SyncPlay group. + */ + +class SyncPlayRemoveFromPlaylistLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayRemoveFromPlaylistLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayRemoveFromPlaylistParams& parameters) const override; + QUrlQuery query(const SyncPlayRemoveFromPlaylistParams& parameters) const override; + QByteArray body(const SyncPlayRemoveFromPlaylistParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request seek in SyncPlay group. + */ + +class SyncPlaySeekLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySeekLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySeekParams& parameters) const override; + QUrlQuery query(const SyncPlaySeekParams& parameters) const override; + QByteArray body(const SyncPlaySeekParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request SyncPlay group to ignore member during group-wait. + */ + +class SyncPlaySetIgnoreWaitLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySetIgnoreWaitLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySetIgnoreWaitParams& parameters) const override; + QUrlQuery query(const SyncPlaySetIgnoreWaitParams& parameters) const override; + QByteArray body(const SyncPlaySetIgnoreWaitParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to set new playlist in SyncPlay group. + */ + +class SyncPlaySetNewQueueLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySetNewQueueLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySetNewQueueParams& parameters) const override; + QUrlQuery query(const SyncPlaySetNewQueueParams& parameters) const override; + QByteArray body(const SyncPlaySetNewQueueParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to change playlist item in SyncPlay group. + */ + +class SyncPlaySetPlaylistItemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySetPlaylistItemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySetPlaylistItemParams& parameters) const override; + QUrlQuery query(const SyncPlaySetPlaylistItemParams& parameters) const override; + QByteArray body(const SyncPlaySetPlaylistItemParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to set repeat mode in SyncPlay group. + */ + +class SyncPlaySetRepeatModeLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySetRepeatModeLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySetRepeatModeParams& parameters) const override; + QUrlQuery query(const SyncPlaySetRepeatModeParams& parameters) const override; + QByteArray body(const SyncPlaySetRepeatModeParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request to set shuffle mode in SyncPlay group. + */ + +class SyncPlaySetShuffleModeLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlaySetShuffleModeLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlaySetShuffleModeParams& parameters) const override; + QUrlQuery query(const SyncPlaySetShuffleModeParams& parameters) const override; + QByteArray body(const SyncPlaySetShuffleModeParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request stop in SyncPlay group. + */ + +class SyncPlayStopLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayStopLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayStopParams& parameters) const override; + QUrlQuery query(const SyncPlayStopParams& parameters) const override; + QByteArray body(const SyncPlayStopParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Request unpause in SyncPlay group. + */ + +class SyncPlayUnpauseLoader : public Jellyfin::Support::HttpLoader { +public: + explicit SyncPlayUnpauseLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayUnpauseParams& parameters) const override; + QUrlQuery query(const SyncPlayUnpauseParams& parameters) const override; + QByteArray body(const SyncPlayUnpauseParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/system.h b/core/include/JellyfinQt/loader/http/system.h index dc5ce1c..a709c3e 100644 --- a/core/include/JellyfinQt/loader/http/system.h +++ b/core/include/JellyfinQt/loader/http/system.h @@ -135,6 +135,34 @@ protected: QByteArray body(const PostPingSystemParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Restarts the application. + */ + +class RestartApplicationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit RestartApplicationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const RestartApplicationParams& parameters) const override; + QUrlQuery query(const RestartApplicationParams& parameters) const override; + QByteArray body(const RestartApplicationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Shuts down the application. + */ + +class ShutdownApplicationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit ShutdownApplicationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const ShutdownApplicationParams& parameters) const override; + QUrlQuery query(const ShutdownApplicationParams& parameters) const override; + QByteArray body(const ShutdownApplicationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Gets wake on lan information. */ diff --git a/core/include/JellyfinQt/loader/http/user.h b/core/include/JellyfinQt/loader/http/user.h index b927587..bd3f319 100644 --- a/core/include/JellyfinQt/loader/http/user.h +++ b/core/include/JellyfinQt/loader/http/user.h @@ -84,6 +84,34 @@ protected: QByteArray body(const GetUserByIdParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Deletes a user. + */ + +class DeleteUserLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteUserLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteUserParams& parameters) const override; + QUrlQuery query(const DeleteUserParams& parameters) const override; + QByteArray body(const DeleteUserParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a user. + */ + +class UpdateUserLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateUserLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateUserParams& parameters) const override; + QUrlQuery query(const UpdateUserParams& parameters) const override; + QByteArray body(const UpdateUserParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Authenticates a user. */ @@ -98,6 +126,62 @@ protected: QByteArray body(const AuthenticateUserParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Updates a user configuration. + */ + +class UpdateUserConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateUserConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateUserConfigurationParams& parameters) const override; + QUrlQuery query(const UpdateUserConfigurationParams& parameters) const override; + QByteArray body(const UpdateUserConfigurationParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a user's easy password. + */ + +class UpdateUserEasyPasswordLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateUserEasyPasswordLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateUserEasyPasswordParams& parameters) const override; + QUrlQuery query(const UpdateUserEasyPasswordParams& parameters) const override; + QByteArray body(const UpdateUserEasyPasswordParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a user's password. + */ + +class UpdateUserPasswordLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateUserPasswordLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateUserPasswordParams& parameters) const override; + QUrlQuery query(const UpdateUserPasswordParams& parameters) const override; + QByteArray body(const UpdateUserPasswordParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Updates a user policy. + */ + +class UpdateUserPolicyLoader : public Jellyfin::Support::HttpLoader { +public: + explicit UpdateUserPolicyLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const UpdateUserPolicyParams& parameters) const override; + QUrlQuery query(const UpdateUserPolicyParams& parameters) const override; + QByteArray body(const UpdateUserPolicyParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; /** * @brief Authenticates a user by name. */ diff --git a/core/include/JellyfinQt/loader/http/videos.h b/core/include/JellyfinQt/loader/http/videos.h index 8cbc415..6ac74e3 100644 --- a/core/include/JellyfinQt/loader/http/videos.h +++ b/core/include/JellyfinQt/loader/http/videos.h @@ -61,6 +61,34 @@ protected: QByteArray body(const GetAdditionalPartParams& parameters) const override; QNetworkAccessManager::Operation operation() const override; }; +/** + * @brief Removes alternate video sources. + */ + +class DeleteAlternateSourcesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeleteAlternateSourcesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeleteAlternateSourcesParams& parameters) const override; + QUrlQuery query(const DeleteAlternateSourcesParams& parameters) const override; + QByteArray body(const DeleteAlternateSourcesParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; +/** + * @brief Merges videos into a single record. + */ + +class MergeVersionsLoader : public Jellyfin::Support::HttpLoader { +public: + explicit MergeVersionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const MergeVersionsParams& parameters) const override; + QUrlQuery query(const MergeVersionsParams& parameters) const override; + QByteArray body(const MergeVersionsParams& parameters) const override; + QNetworkAccessManager::Operation operation() const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/support/loader.h b/core/include/JellyfinQt/support/loader.h index 0487d10..df09ccf 100644 --- a/core/include/JellyfinQt/support/loader.h +++ b/core/include/JellyfinQt/support/loader.h @@ -62,40 +62,11 @@ static const int HTTP_TIMEOUT = 30000; // 30 seconds; */ class LoaderBase : public QObject { Q_OBJECT -signals: - /** - * @brief Emitted when an error has occurred during loading and no result - * is available. - */ - void error(QString message = QString()); - /** - * @brief Emitted when data was successfully loaded. - */ - void ready(); -}; - -/** - * Interface describing a way to load items. Used to abstract away - * the difference between loading from a cache or loading over the network. - * - * To implement this class, implement prepareLoad() and load(). These are always called - * in the same order, but prepareLoad() must always be called on the same thread as the - * m_apiClient, while load() may be called on another thread. - * - * @note: Loaders should NEVER call load() again while load() is running on another - * thread or change the apiClient while running. This will result in undefined behaviour. - * Please use a Mutex to enforce this. - * - * @tparam R the type of data that should be fetched, R for result. - * @tparam P the type of paramaters given, to determine which resource should - * be loaded. - */ -template -class Loader : public LoaderBase { -public: - explicit Loader(ApiClient *apiClient) +protected: + explicit LoaderBase(ApiClient *apiClient) : m_apiClient(apiClient) {} +public: /** * @brief load Loads the given resource asynchronously. */ @@ -103,19 +74,6 @@ public: throw LoadException(QStringLiteral("Loader not set")); } - /** - * @brief Retrieves the loaded resource. Only valid after the ready signal has been emitted. - * - * @return The loaded resource. - */ - R result() const { - return m_result.value(); - } - - bool hasResult() const { - return m_result; - } - /** * @returns whether this loader is already fetching a resource */ @@ -136,6 +94,61 @@ public: void setApiClient(ApiClient *newApiClient) { m_apiClient = newApiClient; } ApiClient *apiClient() const { return m_apiClient; } +signals: + /** + * @brief Emitted when an error has occurred during loading and no result + * is available. + */ + void error(QString message = QString()); + /** + * @brief Emitted when data was successfully loaded. + */ + void ready(); +protected: + Jellyfin::ApiClient *m_apiClient; + bool m_isRunning = false; + + void stopWithError(QString message = QString()) { + m_isRunning = false; + emit this->error(message); + } +}; + +/** + * Interface describing a way to load items. Used to abstract away + * the difference between loading from a cache or loading over the network. + * + * To implement this class, implement prepareLoad() and load(). These are always called + * in the same order, but prepareLoad() must always be called on the same thread as the + * m_apiClient, while load() may be called on another thread. + * + * @note: Loaders should NEVER call load() again while load() is running on another + * thread or change the apiClient while running. This will result in undefined behaviour. + * Please use a Mutex to enforce this. + * + * @tparam R the type of data that should be fetched, R for result. + * @tparam P the type of paramaters given, to determine which resource should + * be loaded. + */ +template +class Loader : public LoaderBase { +public: + using ResultType = std::optional; + explicit Loader(ApiClient *apiClient) + : LoaderBase(apiClient) {} + + /** + * @brief Retrieves the loaded resource. Only valid after the ready signal has been emitted. + * + * @return The loaded resource. + */ + R result() const { + return m_result.value(); + } + + bool hasResult() const { + return m_result; + } /** * @brief Sets the parameters for this loader. * @param parameters The parameters to set @@ -146,26 +159,112 @@ public: void setParameters(const P ¶meters) { m_parameters = parameters; } -protected: - Jellyfin::ApiClient *m_apiClient; - std::optional

m_parameters; - std::optional m_result; - bool m_isRunning = false; - void stopWithError(QString message = QString()) { - m_isRunning = false; - emit this->error(message); +protected: + std::optional

m_parameters; + ResultType m_result; + + ResultType createFailureResult() { + return std::nullopt; + } + + ResultType createSuccessResult(R &&result) { + return std::make_optional(result); + } + + static R createDummyResponse() { + return fromJsonValue(QJsonValue()); + } + +}; + +template +class Loader : public LoaderBase { +public: + using ResultType = bool; + explicit Loader(ApiClient *apiClient) + : LoaderBase(apiClient) {} + + void result() const { } + + bool hasResult() const { + return m_result; + } + /** + * @brief Sets the parameters for this loader. + * @param parameters The parameters to set + * + * This method will copy the parameters. The parameters must have a + * copy constructor. + */ + void setParameters(const P ¶meters) { + m_parameters = parameters; + } + +protected: + std::optional

m_parameters; + ResultType m_result; + + ResultType createFailureResult() { + return false; + } + + ResultType createSuccessResult(void) { + return true; + } + + static void createDummyResponse() { } +}; + +template +class HttpLoaderBase : public Loader { +public: + explicit HttpLoaderBase(Jellyfin::ApiClient *apiClient) + : Loader (apiClient) {} + + typename Loader::ResultType parseResponse(int /*statusCode*/, QByteArray response) { + QJsonParseError error; + QJsonDocument document = QJsonDocument::fromJson(response, &error); + if (error.error != QJsonParseError::NoError) { + qWarning() << response; + this->stopWithError(error.errorString().toLocal8Bit().constData()); + } + if (document.isNull() || document.isEmpty()) { + this->stopWithError(QStringLiteral("Unexpected empty JSON response")); + return this->createFailureResult(); + } else if (document.isArray()) { + return this->createSuccessResult(fromJsonValue(document.array())); + } else if (document.isObject()){ + return this->createSuccessResult(fromJsonValue(document.object())); + } else { + this->stopWithError(QStringLiteral("Unexpected JSON response")); + return this->createFailureResult(); + } + } + +}; + +// Specialisation for void result +template +class HttpLoaderBase : public Loader { +public: + explicit HttpLoaderBase(Jellyfin::ApiClient *apiClient) + : Loader (apiClient) {} + + typename Loader::ResultType parseResponse(int statusCode, QByteArray response) { + return statusCode == 204; } }; + /** * Implementation of Loader that loads Items over HTTP */ template -class HttpLoader : public Loader { +class HttpLoader : public HttpLoaderBase { public: explicit HttpLoader(Jellyfin::ApiClient *apiClient) - : Loader (apiClient) { + : HttpLoaderBase (apiClient) { this->connect(&m_parsedWatcher, &QFutureWatcher>::finished, this, &HttpLoader::onResponseParsed); } @@ -221,7 +320,7 @@ protected: virtual QNetworkAccessManager::Operation operation() const = 0; private: QNetworkReply *m_reply = nullptr; - QFutureWatcher> m_parsedWatcher; + QFutureWatcher::ResultType> m_parsedWatcher; void onRequestFinished() { if (m_reply->error() != QNetworkReply::NoError) { @@ -229,38 +328,32 @@ private: m_parsedWatcher.cancel(); //: An HTTP has occurred. First argument is replaced by QNetworkReply->errorString() this->stopWithError(QStringLiteral("HTTP error: %1").arg(m_reply->errorString())); + return; } QByteArray array = m_reply->readAll(); + int statusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); m_reply->deleteLater(); m_reply = nullptr; - m_parsedWatcher.setFuture(QtConcurrent::run(this, &HttpLoader::parseResponse, array)); - } - - std::optional parseResponse(QByteArray response) { - QJsonParseError error; - QJsonDocument document = QJsonDocument::fromJson(response, &error); - if (error.error != QJsonParseError::NoError) { - qWarning() << response; - this->stopWithError(error.errorString().toLocal8Bit().constData()); - } - if (document.isNull() || document.isEmpty()) { - this->stopWithError(QStringLiteral("Unexpected empty JSON response")); - return std::nullopt; - } else if (document.isArray()) { - return std::make_optional(fromJsonValue(document.array())); - } else if (document.isObject()){ - return std::make_optional(fromJsonValue(document.object())); - } else { - this->stopWithError(QStringLiteral("Unexpected JSON response")); - return std::nullopt; - } + /*m_parsedWatcher.setFuture(QtConcurrent::run([this, statusCode, array]() { + return this->parseResponse(statusCode, array); + }));*/ + m_parsedWatcher.setFuture( + QtConcurrent::run::ResultType, // Result + HttpLoader, // class + int, int, // Argument 1 + QByteArray, QByteArray> // Argument 2 + (this, &HttpLoader::parseResponse, statusCode, array) + ); } void onResponseParsed() { Q_ASSERT(m_parsedWatcher.isFinished()); try { - if (m_parsedWatcher.result().has_value()) { - this->m_result = m_parsedWatcher.result().value(); + /* In case the result is an optional, it invokes the bool cast of std::optional, checking + if it has a value. + In case the result is a boolean, it just checks the boolean */ + if (m_parsedWatcher.result()) { + this->m_result = m_parsedWatcher.result(); this->m_isRunning = false; emit this->ready(); } else { diff --git a/core/openapigenerator.d b/core/openapigenerator.d index 34861c5..87cb560 100755 --- a/core/openapigenerator.d +++ b/core/openapigenerator.d @@ -457,7 +457,11 @@ void generateFileForEndpoints(ref const Node[] endpointNodes, } } } - } + } + if (codeNo == 204 /* No content */) { + endpoint.resultType = "void"; + endpoint.hasSuccessResponse = true; + } } if ("requestBody" in endpointNode) { diff --git a/core/src/loader/http/apikey.cpp b/core/src/loader/http/apikey.cpp index e5a3f06..3fa5e65 100644 --- a/core/src/loader/http/apikey.cpp +++ b/core/src/loader/http/apikey.cpp @@ -64,6 +64,65 @@ QNetworkAccessManager::Operation GetKeysLoader::operation() const { } +CreateKeyLoader::CreateKeyLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CreateKeyLoader::path(const CreateKeyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Auth/Keys"); +} + +QUrlQuery CreateKeyLoader::query(const CreateKeyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("app", Support::toString(params.app())); + + // Optional parameters + + return result; +} + +QByteArray CreateKeyLoader::body(const CreateKeyParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CreateKeyLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RevokeKeyLoader::RevokeKeyLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RevokeKeyLoader::path(const RevokeKeyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Auth/Keys/") + Support::toString< QString>(params.key()) ; +} + +QUrlQuery RevokeKeyLoader::query(const RevokeKeyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray RevokeKeyLoader::body(const RevokeKeyParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RevokeKeyLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/branding.cpp b/core/src/loader/http/branding.cpp index cea8aeb..cde1e76 100644 --- a/core/src/loader/http/branding.cpp +++ b/core/src/loader/http/branding.cpp @@ -65,7 +65,7 @@ QNetworkAccessManager::Operation GetBrandingOptionsLoader::operation() const { } GetBrandingCssLoader::GetBrandingCssLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetBrandingCssLoader::path(const GetBrandingCssParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -94,7 +94,7 @@ QNetworkAccessManager::Operation GetBrandingCssLoader::operation() const { } GetBrandingCss_2Loader::GetBrandingCss_2Loader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetBrandingCss_2Loader::path(const GetBrandingCss_2Params ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/collection.cpp b/core/src/loader/http/collection.cpp index 72bdc86..e21af1c 100644 --- a/core/src/loader/http/collection.cpp +++ b/core/src/loader/http/collection.cpp @@ -76,6 +76,66 @@ QNetworkAccessManager::Operation CreateCollectionLoader::operation() const { } +AddToCollectionLoader::AddToCollectionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AddToCollectionLoader::path(const AddToCollectionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Collections/") + Support::toString< QString>(params.collectionId()) + QStringLiteral("/Items"); +} + +QUrlQuery AddToCollectionLoader::query(const AddToCollectionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("ids", Support::toString(params.ids())); + + // Optional parameters + + return result; +} + +QByteArray AddToCollectionLoader::body(const AddToCollectionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation AddToCollectionLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RemoveFromCollectionLoader::RemoveFromCollectionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RemoveFromCollectionLoader::path(const RemoveFromCollectionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Collections/") + Support::toString< QString>(params.collectionId()) + QStringLiteral("/Items"); +} + +QUrlQuery RemoveFromCollectionLoader::query(const RemoveFromCollectionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("ids", Support::toString(params.ids())); + + // Optional parameters + + return result; +} + +QByteArray RemoveFromCollectionLoader::body(const RemoveFromCollectionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RemoveFromCollectionLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/configuration.cpp b/core/src/loader/http/configuration.cpp index f61fbb1..77dadc3 100644 --- a/core/src/loader/http/configuration.cpp +++ b/core/src/loader/http/configuration.cpp @@ -64,6 +64,35 @@ QNetworkAccessManager::Operation GetConfigurationLoader::operation() const { } +UpdateConfigurationLoader::UpdateConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateConfigurationLoader::path(const UpdateConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Configuration"); +} + +QUrlQuery UpdateConfigurationLoader::query(const UpdateConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateConfigurationLoader::body(const UpdateConfigurationParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateConfigurationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetNamedConfigurationLoader::GetNamedConfigurationLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -93,6 +122,35 @@ QNetworkAccessManager::Operation GetNamedConfigurationLoader::operation() const } +UpdateNamedConfigurationLoader::UpdateNamedConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateNamedConfigurationLoader::path(const UpdateNamedConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Configuration/") + Support::toString< QString>(params.key()) ; +} + +QUrlQuery UpdateNamedConfigurationLoader::query(const UpdateNamedConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateNamedConfigurationLoader::body(const UpdateNamedConfigurationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UpdateNamedConfigurationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetDefaultMetadataOptionsLoader::GetDefaultMetadataOptionsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -122,6 +180,35 @@ QNetworkAccessManager::Operation GetDefaultMetadataOptionsLoader::operation() co } +UpdateMediaEncoderPathLoader::UpdateMediaEncoderPathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateMediaEncoderPathLoader::path(const UpdateMediaEncoderPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/MediaEncoder/Path"); +} + +QUrlQuery UpdateMediaEncoderPathLoader::query(const UpdateMediaEncoderPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateMediaEncoderPathLoader::body(const UpdateMediaEncoderPathParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateMediaEncoderPathLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/devices.cpp b/core/src/loader/http/devices.cpp index 4a46437..9941836 100644 --- a/core/src/loader/http/devices.cpp +++ b/core/src/loader/http/devices.cpp @@ -70,6 +70,36 @@ QNetworkAccessManager::Operation GetDevicesLoader::operation() const { } +DeleteDeviceLoader::DeleteDeviceLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteDeviceLoader::path(const DeleteDeviceParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Devices"); +} + +QUrlQuery DeleteDeviceLoader::query(const DeleteDeviceParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("id", Support::toString(params.jellyfinId())); + + // Optional parameters + + return result; +} + +QByteArray DeleteDeviceLoader::body(const DeleteDeviceParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteDeviceLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetDeviceInfoLoader::GetDeviceInfoLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -130,6 +160,36 @@ QNetworkAccessManager::Operation GetDeviceOptionsLoader::operation() const { } +UpdateDeviceOptionsLoader::UpdateDeviceOptionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateDeviceOptionsLoader::path(const UpdateDeviceOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Devices/Options"); +} + +QUrlQuery UpdateDeviceOptionsLoader::query(const UpdateDeviceOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("id", Support::toString(params.jellyfinId())); + + // Optional parameters + + return result; +} + +QByteArray UpdateDeviceOptionsLoader::body(const UpdateDeviceOptionsParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateDeviceOptionsLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/displaypreferences.cpp b/core/src/loader/http/displaypreferences.cpp index 5032340..73bb14f 100644 --- a/core/src/loader/http/displaypreferences.cpp +++ b/core/src/loader/http/displaypreferences.cpp @@ -66,6 +66,37 @@ QNetworkAccessManager::Operation GetDisplayPreferencesLoader::operation() const } +UpdateDisplayPreferencesLoader::UpdateDisplayPreferencesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateDisplayPreferencesLoader::path(const UpdateDisplayPreferencesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/DisplayPreferences/") + Support::toString< QString>(params.displayPreferencesId()) ; +} + +QUrlQuery UpdateDisplayPreferencesLoader::query(const UpdateDisplayPreferencesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("client", Support::toString(params.client())); + + // Optional parameters + + return result; +} + +QByteArray UpdateDisplayPreferencesLoader::body(const UpdateDisplayPreferencesParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateDisplayPreferencesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/dlna.cpp b/core/src/loader/http/dlna.cpp index 76ff119..76add46 100644 --- a/core/src/loader/http/dlna.cpp +++ b/core/src/loader/http/dlna.cpp @@ -64,6 +64,35 @@ QNetworkAccessManager::Operation GetProfileInfosLoader::operation() const { } +CreateProfileLoader::CreateProfileLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CreateProfileLoader::path(const CreateProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Dlna/Profiles"); +} + +QUrlQuery CreateProfileLoader::query(const CreateProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CreateProfileLoader::body(const CreateProfileParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation CreateProfileLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetProfileLoader::GetProfileLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -93,6 +122,64 @@ QNetworkAccessManager::Operation GetProfileLoader::operation() const { } +DeleteProfileLoader::DeleteProfileLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteProfileLoader::path(const DeleteProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Dlna/Profiles/") + Support::toString< QString>(params.profileId()) ; +} + +QUrlQuery DeleteProfileLoader::query(const DeleteProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteProfileLoader::body(const DeleteProfileParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteProfileLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateProfileLoader::UpdateProfileLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateProfileLoader::path(const UpdateProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Dlna/Profiles/") + Support::toString< QString>(params.profileId()) ; +} + +QUrlQuery UpdateProfileLoader::query(const UpdateProfileParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateProfileLoader::body(const UpdateProfileParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateProfileLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetDefaultProfileLoader::GetDefaultProfileLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/environment.cpp b/core/src/loader/http/environment.cpp index 148be92..a2c8e52 100644 --- a/core/src/loader/http/environment.cpp +++ b/core/src/loader/http/environment.cpp @@ -188,6 +188,35 @@ QNetworkAccessManager::Operation GetParentPathLoader::operation() const { } +ValidatePathLoader::ValidatePathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ValidatePathLoader::path(const ValidatePathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Environment/ValidatePath"); +} + +QUrlQuery ValidatePathLoader::query(const ValidatePathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ValidatePathLoader::body(const ValidatePathParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation ValidatePathLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/hlssegment.cpp b/core/src/loader/http/hlssegment.cpp index e3a9db8..cb0354f 100644 --- a/core/src/loader/http/hlssegment.cpp +++ b/core/src/loader/http/hlssegment.cpp @@ -35,6 +35,41 @@ namespace HTTP { using namespace Jellyfin::DTO; +StopEncodingProcessLoader::StopEncodingProcessLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString StopEncodingProcessLoader::path(const StopEncodingProcessParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Videos/ActiveEncodings"); +} + +QUrlQuery StopEncodingProcessLoader::query(const StopEncodingProcessParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.deviceIdNull()) { + result.addQueryItem("deviceId", Support::toString(params.deviceId())); + } + if (!params.playSessionIdNull()) { + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + } + + return result; +} + +QByteArray StopEncodingProcessLoader::body(const StopEncodingProcessParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation StopEncodingProcessLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/image.cpp b/core/src/loader/http/image.cpp index 8cc075f..e17ac3d 100644 --- a/core/src/loader/http/image.cpp +++ b/core/src/loader/http/image.cpp @@ -64,6 +64,279 @@ QNetworkAccessManager::Operation GetItemImageInfosLoader::operation() const { } +DeleteItemImageLoader::DeleteItemImageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteItemImageLoader::path(const DeleteItemImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) ; +} + +QUrlQuery DeleteItemImageLoader::query(const DeleteItemImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.imageIndexNull()) { + result.addQueryItem("imageIndex", Support::toString>(params.imageIndex())); + } + + return result; +} + +QByteArray DeleteItemImageLoader::body(const DeleteItemImageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteItemImageLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +SetItemImageLoader::SetItemImageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetItemImageLoader::path(const SetItemImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) ; +} + +QUrlQuery SetItemImageLoader::query(const SetItemImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetItemImageLoader::body(const SetItemImageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SetItemImageLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +DeleteItemImageByIndexLoader::DeleteItemImageByIndexLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteItemImageByIndexLoader::path(const DeleteItemImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) + QStringLiteral("/") + Support::toString< qint32>(params.imageIndex()) ; +} + +QUrlQuery DeleteItemImageByIndexLoader::query(const DeleteItemImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteItemImageByIndexLoader::body(const DeleteItemImageByIndexParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteItemImageByIndexLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +SetItemImageByIndexLoader::SetItemImageByIndexLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetItemImageByIndexLoader::path(const SetItemImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) + QStringLiteral("/") + Support::toString< qint32>(params.imageIndex()) ; +} + +QUrlQuery SetItemImageByIndexLoader::query(const SetItemImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetItemImageByIndexLoader::body(const SetItemImageByIndexParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SetItemImageByIndexLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdateItemImageIndexLoader::UpdateItemImageIndexLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateItemImageIndexLoader::path(const UpdateItemImageIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) + QStringLiteral("/") + Support::toString< qint32>(params.imageIndex()) + QStringLiteral("/Index"); +} + +QUrlQuery UpdateItemImageIndexLoader::query(const UpdateItemImageIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.newIndexNull()) { + result.addQueryItem("newIndex", Support::toString>(params.newIndex())); + } + + return result; +} + +QByteArray UpdateItemImageIndexLoader::body(const UpdateItemImageIndexParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UpdateItemImageIndexLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PostUserImageLoader::PostUserImageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostUserImageLoader::path(const PostUserImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) ; +} + +QUrlQuery PostUserImageLoader::query(const PostUserImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.indexNull()) { + result.addQueryItem("index", Support::toString>(params.index())); + } + + return result; +} + +QByteArray PostUserImageLoader::body(const PostUserImageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostUserImageLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +DeleteUserImageLoader::DeleteUserImageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteUserImageLoader::path(const DeleteUserImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) ; +} + +QUrlQuery DeleteUserImageLoader::query(const DeleteUserImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.indexNull()) { + result.addQueryItem("index", Support::toString>(params.index())); + } + + return result; +} + +QByteArray DeleteUserImageLoader::body(const DeleteUserImageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteUserImageLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +PostUserImageByIndexLoader::PostUserImageByIndexLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostUserImageByIndexLoader::path(const PostUserImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) + QStringLiteral("/") + Support::toString< qint32>(params.index()) ; +} + +QUrlQuery PostUserImageByIndexLoader::query(const PostUserImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray PostUserImageByIndexLoader::body(const PostUserImageByIndexParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostUserImageByIndexLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +DeleteUserImageByIndexLoader::DeleteUserImageByIndexLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteUserImageByIndexLoader::path(const DeleteUserImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Images/") + Support::toString< ImageType>(params.imageType()) + QStringLiteral("/") + Support::toString< qint32>(params.index()) ; +} + +QUrlQuery DeleteUserImageByIndexLoader::query(const DeleteUserImageByIndexParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteUserImageByIndexLoader::body(const DeleteUserImageByIndexParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteUserImageByIndexLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/itemlookup.cpp b/core/src/loader/http/itemlookup.cpp index 983d177..0e26dec 100644 --- a/core/src/loader/http/itemlookup.cpp +++ b/core/src/loader/http/itemlookup.cpp @@ -64,6 +64,38 @@ QNetworkAccessManager::Operation GetExternalIdInfosLoader::operation() const { } +ApplySearchCriteriaLoader::ApplySearchCriteriaLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ApplySearchCriteriaLoader::path(const ApplySearchCriteriaParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Apply/") + Support::toString< QString>(params.itemId()) ; +} + +QUrlQuery ApplySearchCriteriaLoader::query(const ApplySearchCriteriaParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.replaceAllImagesNull()) { + result.addQueryItem("replaceAllImages", Support::toString>(params.replaceAllImages())); + } + + return result; +} + +QByteArray ApplySearchCriteriaLoader::body(const ApplySearchCriteriaParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation ApplySearchCriteriaLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetBookRemoteSearchResultsLoader::GetBookRemoteSearchResultsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetBookRemoteSearchResultsParams>(apiClient) {} diff --git a/core/src/loader/http/itemrefresh.cpp b/core/src/loader/http/itemrefresh.cpp index 8131f15..5be3700 100644 --- a/core/src/loader/http/itemrefresh.cpp +++ b/core/src/loader/http/itemrefresh.cpp @@ -35,6 +35,47 @@ namespace HTTP { using namespace Jellyfin::DTO; +PostLoader::PostLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostLoader::path(const PostParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Refresh"); +} + +QUrlQuery PostLoader::query(const PostParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.metadataRefreshModeNull()) { + result.addQueryItem("metadataRefreshMode", Support::toString(params.metadataRefreshMode())); + } + if (!params.imageRefreshModeNull()) { + result.addQueryItem("imageRefreshMode", Support::toString(params.imageRefreshMode())); + } + if (!params.replaceAllMetadataNull()) { + result.addQueryItem("replaceAllMetadata", Support::toString>(params.replaceAllMetadata())); + } + if (!params.replaceAllImagesNull()) { + result.addQueryItem("replaceAllImages", Support::toString>(params.replaceAllImages())); + } + + return result; +} + +QByteArray PostLoader::body(const PostParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/itemupdate.cpp b/core/src/loader/http/itemupdate.cpp index d186ff3..17644ff 100644 --- a/core/src/loader/http/itemupdate.cpp +++ b/core/src/loader/http/itemupdate.cpp @@ -35,6 +35,67 @@ namespace HTTP { using namespace Jellyfin::DTO; +UpdateItemLoader::UpdateItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateItemLoader::path(const UpdateItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) ; +} + +QUrlQuery UpdateItemLoader::query(const UpdateItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateItemLoader::body(const UpdateItemParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdateItemContentTypeLoader::UpdateItemContentTypeLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateItemContentTypeLoader::path(const UpdateItemContentTypeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/ContentType"); +} + +QUrlQuery UpdateItemContentTypeLoader::query(const UpdateItemContentTypeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.contentTypeNull()) { + result.addQueryItem("contentType", Support::toString(params.contentType())); + } + + return result; +} + +QByteArray UpdateItemContentTypeLoader::body(const UpdateItemContentTypeParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UpdateItemContentTypeLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetMetadataEditorInfoLoader::GetMetadataEditorInfoLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/library.cpp b/core/src/loader/http/library.cpp index 70fec6f..c53dbe8 100644 --- a/core/src/loader/http/library.cpp +++ b/core/src/loader/http/library.cpp @@ -35,6 +35,67 @@ namespace HTTP { using namespace Jellyfin::DTO; +DeleteItemsLoader::DeleteItemsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteItemsLoader::path(const DeleteItemsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items"); +} + +QUrlQuery DeleteItemsLoader::query(const DeleteItemsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.idsNull()) { + result.addQueryItem("ids", Support::toString(params.ids())); + } + + return result; +} + +QByteArray DeleteItemsLoader::body(const DeleteItemsParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteItemsLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +DeleteItemLoader::DeleteItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteItemLoader::path(const DeleteItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) ; +} + +QUrlQuery DeleteItemLoader::query(const DeleteItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteItemLoader::body(const DeleteItemParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteItemLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetSimilarAlbumsLoader::GetSimilarAlbumsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -394,6 +455,35 @@ QNetworkAccessManager::Operation GetLibraryOptionsInfoLoader::operation() const } +PostUpdatedMediaLoader::PostUpdatedMediaLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostUpdatedMediaLoader::path(const PostUpdatedMediaParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Media/Updated"); +} + +QUrlQuery PostUpdatedMediaLoader::query(const PostUpdatedMediaParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray PostUpdatedMediaLoader::body(const PostUpdatedMediaParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation PostUpdatedMediaLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetMediaFoldersLoader::GetMediaFoldersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -426,6 +516,76 @@ QNetworkAccessManager::Operation GetMediaFoldersLoader::operation() const { } +PostAddedMoviesLoader::PostAddedMoviesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostAddedMoviesLoader::path(const PostAddedMoviesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Movies/Added"); +} + +QUrlQuery PostAddedMoviesLoader::query(const PostAddedMoviesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.tmdbIdNull()) { + result.addQueryItem("tmdbId", Support::toString(params.tmdbId())); + } + if (!params.imdbIdNull()) { + result.addQueryItem("imdbId", Support::toString(params.imdbId())); + } + + return result; +} + +QByteArray PostAddedMoviesLoader::body(const PostAddedMoviesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostAddedMoviesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PostUpdatedMoviesLoader::PostUpdatedMoviesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostUpdatedMoviesLoader::path(const PostUpdatedMoviesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Movies/Updated"); +} + +QUrlQuery PostUpdatedMoviesLoader::query(const PostUpdatedMoviesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.tmdbIdNull()) { + result.addQueryItem("tmdbId", Support::toString(params.tmdbId())); + } + if (!params.imdbIdNull()) { + result.addQueryItem("imdbId", Support::toString(params.imdbId())); + } + + return result; +} + +QByteArray PostUpdatedMoviesLoader::body(const PostUpdatedMoviesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostUpdatedMoviesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetPhysicalPathsLoader::GetPhysicalPathsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -455,6 +615,99 @@ QNetworkAccessManager::Operation GetPhysicalPathsLoader::operation() const { } +RefreshLibraryLoader::RefreshLibraryLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RefreshLibraryLoader::path(const RefreshLibraryParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Refresh"); +} + +QUrlQuery RefreshLibraryLoader::query(const RefreshLibraryParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray RefreshLibraryLoader::body(const RefreshLibraryParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RefreshLibraryLoader::operation() const { + // HTTP method Get + return QNetworkAccessManager::GetOperation; + +} + +PostAddedSeriesLoader::PostAddedSeriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostAddedSeriesLoader::path(const PostAddedSeriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Series/Added"); +} + +QUrlQuery PostAddedSeriesLoader::query(const PostAddedSeriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.tvdbIdNull()) { + result.addQueryItem("tvdbId", Support::toString(params.tvdbId())); + } + + return result; +} + +QByteArray PostAddedSeriesLoader::body(const PostAddedSeriesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostAddedSeriesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PostUpdatedSeriesLoader::PostUpdatedSeriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostUpdatedSeriesLoader::path(const PostUpdatedSeriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/Series/Updated"); +} + +QUrlQuery PostUpdatedSeriesLoader::query(const PostUpdatedSeriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.tvdbIdNull()) { + result.addQueryItem("tvdbId", Support::toString(params.tvdbId())); + } + + return result; +} + +QByteArray PostUpdatedSeriesLoader::body(const PostUpdatedSeriesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostUpdatedSeriesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetSimilarMoviesLoader::GetSimilarMoviesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/librarystructure.cpp b/core/src/loader/http/librarystructure.cpp index 9549d97..17898b7 100644 --- a/core/src/loader/http/librarystructure.cpp +++ b/core/src/loader/http/librarystructure.cpp @@ -64,6 +64,251 @@ QNetworkAccessManager::Operation GetVirtualFoldersLoader::operation() const { } +AddVirtualFolderLoader::AddVirtualFolderLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AddVirtualFolderLoader::path(const AddVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders"); +} + +QUrlQuery AddVirtualFolderLoader::query(const AddVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + if (!params.collectionTypeNull()) { + result.addQueryItem("collectionType", Support::toString(params.collectionType())); + } + if (!params.pathsNull()) { + result.addQueryItem("paths", Support::toString(params.paths())); + } + if (!params.refreshLibraryNull()) { + result.addQueryItem("refreshLibrary", Support::toString>(params.refreshLibrary())); + } + + return result; +} + +QByteArray AddVirtualFolderLoader::body(const AddVirtualFolderParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation AddVirtualFolderLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RemoveVirtualFolderLoader::RemoveVirtualFolderLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RemoveVirtualFolderLoader::path(const RemoveVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders"); +} + +QUrlQuery RemoveVirtualFolderLoader::query(const RemoveVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + if (!params.refreshLibraryNull()) { + result.addQueryItem("refreshLibrary", Support::toString>(params.refreshLibrary())); + } + + return result; +} + +QByteArray RemoveVirtualFolderLoader::body(const RemoveVirtualFolderParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RemoveVirtualFolderLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateLibraryOptionsLoader::UpdateLibraryOptionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateLibraryOptionsLoader::path(const UpdateLibraryOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders/LibraryOptions"); +} + +QUrlQuery UpdateLibraryOptionsLoader::query(const UpdateLibraryOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateLibraryOptionsLoader::body(const UpdateLibraryOptionsParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateLibraryOptionsLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RenameVirtualFolderLoader::RenameVirtualFolderLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RenameVirtualFolderLoader::path(const RenameVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders/Name"); +} + +QUrlQuery RenameVirtualFolderLoader::query(const RenameVirtualFolderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + if (!params.newNameNull()) { + result.addQueryItem("newName", Support::toString(params.newName())); + } + if (!params.refreshLibraryNull()) { + result.addQueryItem("refreshLibrary", Support::toString>(params.refreshLibrary())); + } + + return result; +} + +QByteArray RenameVirtualFolderLoader::body(const RenameVirtualFolderParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RenameVirtualFolderLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +AddMediaPathLoader::AddMediaPathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AddMediaPathLoader::path(const AddMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders/Paths"); +} + +QUrlQuery AddMediaPathLoader::query(const AddMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.refreshLibraryNull()) { + result.addQueryItem("refreshLibrary", Support::toString>(params.refreshLibrary())); + } + + return result; +} + +QByteArray AddMediaPathLoader::body(const AddMediaPathParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation AddMediaPathLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RemoveMediaPathLoader::RemoveMediaPathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RemoveMediaPathLoader::path(const RemoveMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders/Paths"); +} + +QUrlQuery RemoveMediaPathLoader::query(const RemoveMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + if (!params.pathNull()) { + result.addQueryItem("path", Support::toString(params.path())); + } + if (!params.refreshLibraryNull()) { + result.addQueryItem("refreshLibrary", Support::toString>(params.refreshLibrary())); + } + + return result; +} + +QByteArray RemoveMediaPathLoader::body(const RemoveMediaPathParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RemoveMediaPathLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateMediaPathLoader::UpdateMediaPathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateMediaPathLoader::path(const UpdateMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders/Paths/Update"); +} + +QUrlQuery UpdateMediaPathLoader::query(const UpdateMediaPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + + return result; +} + +QByteArray UpdateMediaPathLoader::body(const UpdateMediaPathParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateMediaPathLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/livetv.cpp b/core/src/loader/http/livetv.cpp index 3963c07..dfce054 100644 --- a/core/src/loader/http/livetv.cpp +++ b/core/src/loader/http/livetv.cpp @@ -316,6 +316,38 @@ QNetworkAccessManager::Operation AddListingProviderLoader::operation() const { } +DeleteListingProviderLoader::DeleteListingProviderLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteListingProviderLoader::path(const DeleteListingProviderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/ListingProviders"); +} + +QUrlQuery DeleteListingProviderLoader::query(const DeleteListingProviderParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.jellyfinIdNull()) { + result.addQueryItem("id", Support::toString(params.jellyfinId())); + } + + return result; +} + +QByteArray DeleteListingProviderLoader::body(const DeleteListingProviderParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteListingProviderLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetDefaultListingProviderLoader::GetDefaultListingProviderLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -781,6 +813,35 @@ QNetworkAccessManager::Operation GetRecordingLoader::operation() const { } +DeleteRecordingLoader::DeleteRecordingLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteRecordingLoader::path(const DeleteRecordingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Recordings/") + Support::toString< QString>(params.recordingId()) ; +} + +QUrlQuery DeleteRecordingLoader::query(const DeleteRecordingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteRecordingLoader::body(const DeleteRecordingParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteRecordingLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetRecordingFoldersLoader::GetRecordingFoldersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -951,6 +1012,35 @@ QNetworkAccessManager::Operation GetSeriesTimersLoader::operation() const { } +CreateSeriesTimerLoader::CreateSeriesTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CreateSeriesTimerLoader::path(const CreateSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/SeriesTimers"); +} + +QUrlQuery CreateSeriesTimerLoader::query(const CreateSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CreateSeriesTimerLoader::body(const CreateSeriesTimerParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation CreateSeriesTimerLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetSeriesTimerLoader::GetSeriesTimerLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -980,6 +1070,64 @@ QNetworkAccessManager::Operation GetSeriesTimerLoader::operation() const { } +CancelSeriesTimerLoader::CancelSeriesTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CancelSeriesTimerLoader::path(const CancelSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/SeriesTimers/") + Support::toString< QString>(params.timerId()) ; +} + +QUrlQuery CancelSeriesTimerLoader::query(const CancelSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CancelSeriesTimerLoader::body(const CancelSeriesTimerParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CancelSeriesTimerLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateSeriesTimerLoader::UpdateSeriesTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateSeriesTimerLoader::path(const UpdateSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/SeriesTimers/") + Support::toString< QString>(params.timerId()) ; +} + +QUrlQuery UpdateSeriesTimerLoader::query(const UpdateSeriesTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateSeriesTimerLoader::body(const UpdateSeriesTimerParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateSeriesTimerLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetTimersLoader::GetTimersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -1021,6 +1169,35 @@ QNetworkAccessManager::Operation GetTimersLoader::operation() const { } +CreateTimerLoader::CreateTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CreateTimerLoader::path(const CreateTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Timers"); +} + +QUrlQuery CreateTimerLoader::query(const CreateTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CreateTimerLoader::body(const CreateTimerParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation CreateTimerLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetTimerLoader::GetTimerLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -1050,6 +1227,64 @@ QNetworkAccessManager::Operation GetTimerLoader::operation() const { } +CancelTimerLoader::CancelTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CancelTimerLoader::path(const CancelTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Timers/") + Support::toString< QString>(params.timerId()) ; +} + +QUrlQuery CancelTimerLoader::query(const CancelTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CancelTimerLoader::body(const CancelTimerParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CancelTimerLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateTimerLoader::UpdateTimerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateTimerLoader::path(const UpdateTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Timers/") + Support::toString< QString>(params.timerId()) ; +} + +QUrlQuery UpdateTimerLoader::query(const UpdateTimerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateTimerLoader::body(const UpdateTimerParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateTimerLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetDefaultTimerLoader::GetDefaultTimerLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -1111,6 +1346,38 @@ QNetworkAccessManager::Operation AddTunerHostLoader::operation() const { } +DeleteTunerHostLoader::DeleteTunerHostLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteTunerHostLoader::path(const DeleteTunerHostParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/TunerHosts"); +} + +QUrlQuery DeleteTunerHostLoader::query(const DeleteTunerHostParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.jellyfinIdNull()) { + result.addQueryItem("id", Support::toString(params.jellyfinId())); + } + + return result; +} + +QByteArray DeleteTunerHostLoader::body(const DeleteTunerHostParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteTunerHostLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetTunerHostTypesLoader::GetTunerHostTypesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetTunerHostTypesParams>(apiClient) {} @@ -1140,6 +1407,35 @@ QNetworkAccessManager::Operation GetTunerHostTypesLoader::operation() const { } +ResetTunerLoader::ResetTunerLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ResetTunerLoader::path(const ResetTunerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Tuners/") + Support::toString< QString>(params.tunerId()) + QStringLiteral("/Reset"); +} + +QUrlQuery ResetTunerLoader::query(const ResetTunerParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ResetTunerLoader::body(const ResetTunerParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation ResetTunerLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + DiscoverTunersLoader::DiscoverTunersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, DiscoverTunersParams>(apiClient) {} diff --git a/core/src/loader/http/mediainfo.cpp b/core/src/loader/http/mediainfo.cpp index 69c944e..c2aaf46 100644 --- a/core/src/loader/http/mediainfo.cpp +++ b/core/src/loader/http/mediainfo.cpp @@ -136,6 +136,36 @@ QNetworkAccessManager::Operation GetPostedPlaybackInfoLoader::operation() const } +CloseLiveStreamLoader::CloseLiveStreamLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CloseLiveStreamLoader::path(const CloseLiveStreamParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveStreams/Close"); +} + +QUrlQuery CloseLiveStreamLoader::query(const CloseLiveStreamParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); + + // Optional parameters + + return result; +} + +QByteArray CloseLiveStreamLoader::body(const CloseLiveStreamParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CloseLiveStreamLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + OpenLiveStreamLoader::OpenLiveStreamLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/notifications.cpp b/core/src/loader/http/notifications.cpp index c1c2ca1..5041bce 100644 --- a/core/src/loader/http/notifications.cpp +++ b/core/src/loader/http/notifications.cpp @@ -64,6 +64,35 @@ QNetworkAccessManager::Operation GetNotificationsLoader::operation() const { } +SetReadLoader::SetReadLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetReadLoader::path(const SetReadParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Notifications/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Read"); +} + +QUrlQuery SetReadLoader::query(const SetReadParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetReadLoader::body(const SetReadParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SetReadLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetNotificationsSummaryLoader::GetNotificationsSummaryLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -93,6 +122,76 @@ QNetworkAccessManager::Operation GetNotificationsSummaryLoader::operation() cons } +SetUnreadLoader::SetUnreadLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetUnreadLoader::path(const SetUnreadParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Notifications/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Unread"); +} + +QUrlQuery SetUnreadLoader::query(const SetUnreadParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetUnreadLoader::body(const SetUnreadParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SetUnreadLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +CreateAdminNotificationLoader::CreateAdminNotificationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CreateAdminNotificationLoader::path(const CreateAdminNotificationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Notifications/Admin"); +} + +QUrlQuery CreateAdminNotificationLoader::query(const CreateAdminNotificationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.urlNull()) { + result.addQueryItem("url", Support::toString(params.url())); + } + if (!params.levelNull()) { + result.addQueryItem("level", Support::toString(params.level())); + } + if (!params.nameNull()) { + result.addQueryItem("name", Support::toString(params.name())); + } + if (!params.descriptionNull()) { + result.addQueryItem("description", Support::toString(params.description())); + } + + return result; +} + +QByteArray CreateAdminNotificationLoader::body(const CreateAdminNotificationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CreateAdminNotificationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetNotificationServicesLoader::GetNotificationServicesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetNotificationServicesParams>(apiClient) {} diff --git a/core/src/loader/http/package.cpp b/core/src/loader/http/package.cpp index b8da359..285ab24 100644 --- a/core/src/loader/http/package.cpp +++ b/core/src/loader/http/package.cpp @@ -96,6 +96,73 @@ QNetworkAccessManager::Operation GetPackageInfoLoader::operation() const { } +InstallPackageLoader::InstallPackageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString InstallPackageLoader::path(const InstallPackageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Packages/Installed/") + Support::toString< QString>(params.name()) ; +} + +QUrlQuery InstallPackageLoader::query(const InstallPackageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.assemblyGuidNull()) { + result.addQueryItem("assemblyGuid", Support::toString(params.assemblyGuid())); + } + if (!params.versionNull()) { + result.addQueryItem("version", Support::toString(params.version())); + } + if (!params.repositoryUrlNull()) { + result.addQueryItem("repositoryUrl", Support::toString(params.repositoryUrl())); + } + + return result; +} + +QByteArray InstallPackageLoader::body(const InstallPackageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation InstallPackageLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +CancelPackageInstallationLoader::CancelPackageInstallationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CancelPackageInstallationLoader::path(const CancelPackageInstallationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Packages/Installing/") + Support::toString< QString>(params.packageId()) ; +} + +QUrlQuery CancelPackageInstallationLoader::query(const CancelPackageInstallationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CancelPackageInstallationLoader::body(const CancelPackageInstallationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CancelPackageInstallationLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetRepositoriesLoader::GetRepositoriesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetRepositoriesParams>(apiClient) {} @@ -125,6 +192,35 @@ QNetworkAccessManager::Operation GetRepositoriesLoader::operation() const { } +SetRepositoriesLoader::SetRepositoriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetRepositoriesLoader::path(const SetRepositoriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Repositories"); +} + +QUrlQuery SetRepositoriesLoader::query(const SetRepositoriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetRepositoriesLoader::body(const SetRepositoriesParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SetRepositoriesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/playlists.cpp b/core/src/loader/http/playlists.cpp index 9465683..dc7f2db 100644 --- a/core/src/loader/http/playlists.cpp +++ b/core/src/loader/http/playlists.cpp @@ -76,6 +76,73 @@ QNetworkAccessManager::Operation CreatePlaylistLoader::operation() const { } +AddToPlaylistLoader::AddToPlaylistLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AddToPlaylistLoader::path(const AddToPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Playlists/") + Support::toString< QString>(params.playlistId()) + QStringLiteral("/Items"); +} + +QUrlQuery AddToPlaylistLoader::query(const AddToPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.idsNull()) { + result.addQueryItem("ids", Support::toString(params.ids())); + } + if (!params.userIdNull()) { + result.addQueryItem("userId", Support::toString(params.userId())); + } + + return result; +} + +QByteArray AddToPlaylistLoader::body(const AddToPlaylistParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation AddToPlaylistLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RemoveFromPlaylistLoader::RemoveFromPlaylistLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RemoveFromPlaylistLoader::path(const RemoveFromPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Playlists/") + Support::toString< QString>(params.playlistId()) + QStringLiteral("/Items"); +} + +QUrlQuery RemoveFromPlaylistLoader::query(const RemoveFromPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.entryIdsNull()) { + result.addQueryItem("entryIds", Support::toString(params.entryIds())); + } + + return result; +} + +QByteArray RemoveFromPlaylistLoader::body(const RemoveFromPlaylistParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RemoveFromPlaylistLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + GetPlaylistItemsLoader::GetPlaylistItemsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -127,6 +194,35 @@ QNetworkAccessManager::Operation GetPlaylistItemsLoader::operation() const { } +MoveItemLoader::MoveItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString MoveItemLoader::path(const MoveItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Playlists/") + Support::toString< QString>(params.playlistId()) + QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Move/") + Support::toString< qint32>(params.newIndex()) ; +} + +QUrlQuery MoveItemLoader::query(const MoveItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray MoveItemLoader::body(const MoveItemParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation MoveItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/playstate.cpp b/core/src/loader/http/playstate.cpp index e0bf7b7..abd37d1 100644 --- a/core/src/loader/http/playstate.cpp +++ b/core/src/loader/http/playstate.cpp @@ -35,6 +35,125 @@ namespace HTTP { using namespace Jellyfin::DTO; +ReportPlaybackStartLoader::ReportPlaybackStartLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ReportPlaybackStartLoader::path(const ReportPlaybackStartParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Playing"); +} + +QUrlQuery ReportPlaybackStartLoader::query(const ReportPlaybackStartParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ReportPlaybackStartLoader::body(const ReportPlaybackStartParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation ReportPlaybackStartLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PingPlaybackSessionLoader::PingPlaybackSessionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PingPlaybackSessionLoader::path(const PingPlaybackSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Playing/Ping"); +} + +QUrlQuery PingPlaybackSessionLoader::query(const PingPlaybackSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.playSessionIdNull()) { + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + } + + return result; +} + +QByteArray PingPlaybackSessionLoader::body(const PingPlaybackSessionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PingPlaybackSessionLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +ReportPlaybackProgressLoader::ReportPlaybackProgressLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ReportPlaybackProgressLoader::path(const ReportPlaybackProgressParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Playing/Progress"); +} + +QUrlQuery ReportPlaybackProgressLoader::query(const ReportPlaybackProgressParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ReportPlaybackProgressLoader::body(const ReportPlaybackProgressParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation ReportPlaybackProgressLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +ReportPlaybackStoppedLoader::ReportPlaybackStoppedLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ReportPlaybackStoppedLoader::path(const ReportPlaybackStoppedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Playing/Stopped"); +} + +QUrlQuery ReportPlaybackStoppedLoader::query(const ReportPlaybackStoppedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ReportPlaybackStoppedLoader::body(const ReportPlaybackStoppedParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation ReportPlaybackStoppedLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + MarkPlayedItemLoader::MarkPlayedItemLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -96,6 +215,162 @@ QNetworkAccessManager::Operation MarkUnplayedItemLoader::operation() const { } +OnPlaybackStartLoader::OnPlaybackStartLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString OnPlaybackStartLoader::path(const OnPlaybackStartParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/PlayingItems/") + Support::toString< QString>(params.itemId()) ; +} + +QUrlQuery OnPlaybackStartLoader::query(const OnPlaybackStartParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.mediaSourceIdNull()) { + result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); + } + if (!params.audioStreamIndexNull()) { + result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); + } + if (!params.subtitleStreamIndexNull()) { + result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); + } + if (!params.playMethodNull()) { + result.addQueryItem("playMethod", Support::toString(params.playMethod())); + } + if (!params.liveStreamIdNull()) { + result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); + } + if (!params.playSessionIdNull()) { + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + } + if (!params.canSeekNull()) { + result.addQueryItem("canSeek", Support::toString>(params.canSeek())); + } + + return result; +} + +QByteArray OnPlaybackStartLoader::body(const OnPlaybackStartParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation OnPlaybackStartLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +OnPlaybackStoppedLoader::OnPlaybackStoppedLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString OnPlaybackStoppedLoader::path(const OnPlaybackStoppedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/PlayingItems/") + Support::toString< QString>(params.itemId()) ; +} + +QUrlQuery OnPlaybackStoppedLoader::query(const OnPlaybackStoppedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.mediaSourceIdNull()) { + result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); + } + if (!params.nextMediaTypeNull()) { + result.addQueryItem("nextMediaType", Support::toString(params.nextMediaType())); + } + if (!params.positionTicksNull()) { + result.addQueryItem("positionTicks", Support::toString>(params.positionTicks())); + } + if (!params.liveStreamIdNull()) { + result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); + } + if (!params.playSessionIdNull()) { + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + } + + return result; +} + +QByteArray OnPlaybackStoppedLoader::body(const OnPlaybackStoppedParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation OnPlaybackStoppedLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +OnPlaybackProgressLoader::OnPlaybackProgressLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString OnPlaybackProgressLoader::path(const OnPlaybackProgressParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/PlayingItems/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Progress"); +} + +QUrlQuery OnPlaybackProgressLoader::query(const OnPlaybackProgressParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.mediaSourceIdNull()) { + result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); + } + if (!params.positionTicksNull()) { + result.addQueryItem("positionTicks", Support::toString>(params.positionTicks())); + } + if (!params.audioStreamIndexNull()) { + result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); + } + if (!params.subtitleStreamIndexNull()) { + result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); + } + if (!params.volumeLevelNull()) { + result.addQueryItem("volumeLevel", Support::toString>(params.volumeLevel())); + } + if (!params.playMethodNull()) { + result.addQueryItem("playMethod", Support::toString(params.playMethod())); + } + if (!params.liveStreamIdNull()) { + result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); + } + if (!params.playSessionIdNull()) { + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + } + if (!params.repeatModeNull()) { + result.addQueryItem("repeatMode", Support::toString(params.repeatMode())); + } + if (!params.isPausedNull()) { + result.addQueryItem("isPaused", Support::toString>(params.isPaused())); + } + if (!params.isMutedNull()) { + result.addQueryItem("isMuted", Support::toString>(params.isMuted())); + } + + return result; +} + +QByteArray OnPlaybackProgressLoader::body(const OnPlaybackProgressParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation OnPlaybackProgressLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/plugins.cpp b/core/src/loader/http/plugins.cpp index 6928943..6a813b7 100644 --- a/core/src/loader/http/plugins.cpp +++ b/core/src/loader/http/plugins.cpp @@ -64,6 +64,122 @@ QNetworkAccessManager::Operation GetPluginsLoader::operation() const { } +UninstallPluginLoader::UninstallPluginLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UninstallPluginLoader::path(const UninstallPluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) ; +} + +QUrlQuery UninstallPluginLoader::query(const UninstallPluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UninstallPluginLoader::body(const UninstallPluginParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UninstallPluginLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UninstallPluginByVersionLoader::UninstallPluginByVersionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UninstallPluginByVersionLoader::path(const UninstallPluginByVersionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/") + Support::toString< QSharedPointer>(params.version()) ; +} + +QUrlQuery UninstallPluginByVersionLoader::query(const UninstallPluginByVersionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UninstallPluginByVersionLoader::body(const UninstallPluginByVersionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UninstallPluginByVersionLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +DisablePluginLoader::DisablePluginLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DisablePluginLoader::path(const DisablePluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/") + Support::toString< QSharedPointer>(params.version()) + QStringLiteral("/Disable"); +} + +QUrlQuery DisablePluginLoader::query(const DisablePluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DisablePluginLoader::body(const DisablePluginParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DisablePluginLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +EnablePluginLoader::EnablePluginLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString EnablePluginLoader::path(const EnablePluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/") + Support::toString< QSharedPointer>(params.version()) + QStringLiteral("/Enable"); +} + +QUrlQuery EnablePluginLoader::query(const EnablePluginParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray EnablePluginLoader::body(const EnablePluginParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation EnablePluginLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetPluginConfigurationLoader::GetPluginConfigurationLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -93,6 +209,93 @@ QNetworkAccessManager::Operation GetPluginConfigurationLoader::operation() const } +UpdatePluginConfigurationLoader::UpdatePluginConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdatePluginConfigurationLoader::path(const UpdatePluginConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/Configuration"); +} + +QUrlQuery UpdatePluginConfigurationLoader::query(const UpdatePluginConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdatePluginConfigurationLoader::body(const UpdatePluginConfigurationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation UpdatePluginConfigurationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +GetPluginManifestLoader::GetPluginManifestLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetPluginManifestLoader::path(const GetPluginManifestParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/Manifest"); +} + +QUrlQuery GetPluginManifestLoader::query(const GetPluginManifestParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray GetPluginManifestLoader::body(const GetPluginManifestParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation GetPluginManifestLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdatePluginSecurityInfoLoader::UpdatePluginSecurityInfoLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdatePluginSecurityInfoLoader::path(const UpdatePluginSecurityInfoParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins/SecurityInfo"); +} + +QUrlQuery UpdatePluginSecurityInfoLoader::query(const UpdatePluginSecurityInfoParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdatePluginSecurityInfoLoader::body(const UpdatePluginSecurityInfoParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdatePluginSecurityInfoLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/quickconnect.cpp b/core/src/loader/http/quickconnect.cpp index 2286447..48c98b8 100644 --- a/core/src/loader/http/quickconnect.cpp +++ b/core/src/loader/http/quickconnect.cpp @@ -35,6 +35,35 @@ namespace HTTP { using namespace Jellyfin::DTO; +ActivateLoader::ActivateLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ActivateLoader::path(const ActivateParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/QuickConnect/Activate"); +} + +QUrlQuery ActivateLoader::query(const ActivateParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ActivateLoader::body(const ActivateParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation ActivateLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + AuthorizeLoader::AuthorizeLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -65,6 +94,38 @@ QNetworkAccessManager::Operation AuthorizeLoader::operation() const { } +AvailableLoader::AvailableLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AvailableLoader::path(const AvailableParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/QuickConnect/Available"); +} + +QUrlQuery AvailableLoader::query(const AvailableParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.statusNull()) { + result.addQueryItem("status", Support::toString(params.status())); + } + + return result; +} + +QByteArray AvailableLoader::body(const AvailableParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation AvailableLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + ConnectLoader::ConnectLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/remoteimage.cpp b/core/src/loader/http/remoteimage.cpp index ed2e59a..e092c75 100644 --- a/core/src/loader/http/remoteimage.cpp +++ b/core/src/loader/http/remoteimage.cpp @@ -79,6 +79,39 @@ QNetworkAccessManager::Operation GetRemoteImagesLoader::operation() const { } +DownloadRemoteImageLoader::DownloadRemoteImageLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DownloadRemoteImageLoader::path(const DownloadRemoteImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/RemoteImages/Download"); +} + +QUrlQuery DownloadRemoteImageLoader::query(const DownloadRemoteImageParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("type", Support::toString(params.type())); + + // Optional parameters + if (!params.imageUrlNull()) { + result.addQueryItem("imageUrl", Support::toString(params.imageUrl())); + } + + return result; +} + +QByteArray DownloadRemoteImageLoader::body(const DownloadRemoteImageParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DownloadRemoteImageLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetRemoteImageProvidersLoader::GetRemoteImageProvidersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetRemoteImageProvidersParams>(apiClient) {} diff --git a/core/src/loader/http/scheduledtasks.cpp b/core/src/loader/http/scheduledtasks.cpp index 0319518..c1ae9f9 100644 --- a/core/src/loader/http/scheduledtasks.cpp +++ b/core/src/loader/http/scheduledtasks.cpp @@ -99,6 +99,93 @@ QNetworkAccessManager::Operation GetTaskLoader::operation() const { } +UpdateTaskLoader::UpdateTaskLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateTaskLoader::path(const UpdateTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/ScheduledTasks/") + Support::toString< QString>(params.taskId()) + QStringLiteral("/Triggers"); +} + +QUrlQuery UpdateTaskLoader::query(const UpdateTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateTaskLoader::body(const UpdateTaskParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateTaskLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +StartTaskLoader::StartTaskLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString StartTaskLoader::path(const StartTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/ScheduledTasks/Running/") + Support::toString< QString>(params.taskId()) ; +} + +QUrlQuery StartTaskLoader::query(const StartTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray StartTaskLoader::body(const StartTaskParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation StartTaskLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +StopTaskLoader::StopTaskLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString StopTaskLoader::path(const StopTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/ScheduledTasks/Running/") + Support::toString< QString>(params.taskId()) ; +} + +QUrlQuery StopTaskLoader::query(const StopTaskParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray StopTaskLoader::body(const StopTaskParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation StopTaskLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/session.cpp b/core/src/loader/http/session.cpp index 498a14b..69ca54c 100644 --- a/core/src/loader/http/session.cpp +++ b/core/src/loader/http/session.cpp @@ -131,6 +131,429 @@ QNetworkAccessManager::Operation GetSessionsLoader::operation() const { } +SendFullGeneralCommandLoader::SendFullGeneralCommandLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SendFullGeneralCommandLoader::path(const SendFullGeneralCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Command"); +} + +QUrlQuery SendFullGeneralCommandLoader::query(const SendFullGeneralCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SendFullGeneralCommandLoader::body(const SendFullGeneralCommandParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SendFullGeneralCommandLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SendGeneralCommandLoader::SendGeneralCommandLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SendGeneralCommandLoader::path(const SendGeneralCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Command/") + Support::toString< GeneralCommandType>(params.command()) ; +} + +QUrlQuery SendGeneralCommandLoader::query(const SendGeneralCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SendGeneralCommandLoader::body(const SendGeneralCommandParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SendGeneralCommandLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SendMessageCommandLoader::SendMessageCommandLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SendMessageCommandLoader::path(const SendMessageCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Message"); +} + +QUrlQuery SendMessageCommandLoader::query(const SendMessageCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("text", Support::toString(params.text())); + + // Optional parameters + if (!params.headerNull()) { + result.addQueryItem("header", Support::toString(params.header())); + } + if (!params.timeoutMsNull()) { + result.addQueryItem("timeoutMs", Support::toString>(params.timeoutMs())); + } + + return result; +} + +QByteArray SendMessageCommandLoader::body(const SendMessageCommandParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SendMessageCommandLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PlayLoader::PlayLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PlayLoader::path(const PlayParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Playing"); +} + +QUrlQuery PlayLoader::query(const PlayParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("playCommand", Support::toString(params.playCommand())); + result.addQueryItem("itemIds", Support::toString(params.itemIds())); + + // Optional parameters + if (!params.startPositionTicksNull()) { + result.addQueryItem("startPositionTicks", Support::toString>(params.startPositionTicks())); + } + + return result; +} + +QByteArray PlayLoader::body(const PlayParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PlayLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SendPlaystateCommandLoader::SendPlaystateCommandLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SendPlaystateCommandLoader::path(const SendPlaystateCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Playing/") + Support::toString< PlaystateCommand>(params.command()) ; +} + +QUrlQuery SendPlaystateCommandLoader::query(const SendPlaystateCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.seekPositionTicksNull()) { + result.addQueryItem("seekPositionTicks", Support::toString>(params.seekPositionTicks())); + } + if (!params.controllingUserIdNull()) { + result.addQueryItem("controllingUserId", Support::toString(params.controllingUserId())); + } + + return result; +} + +QByteArray SendPlaystateCommandLoader::body(const SendPlaystateCommandParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SendPlaystateCommandLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SendSystemCommandLoader::SendSystemCommandLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SendSystemCommandLoader::path(const SendSystemCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/System/") + Support::toString< GeneralCommandType>(params.command()) ; +} + +QUrlQuery SendSystemCommandLoader::query(const SendSystemCommandParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SendSystemCommandLoader::body(const SendSystemCommandParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SendSystemCommandLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +AddUserToSessionLoader::AddUserToSessionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AddUserToSessionLoader::path(const AddUserToSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/User/") + Support::toString< QString>(params.userId()) ; +} + +QUrlQuery AddUserToSessionLoader::query(const AddUserToSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray AddUserToSessionLoader::body(const AddUserToSessionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation AddUserToSessionLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +RemoveUserFromSessionLoader::RemoveUserFromSessionLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RemoveUserFromSessionLoader::path(const RemoveUserFromSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/User/") + Support::toString< QString>(params.userId()) ; +} + +QUrlQuery RemoveUserFromSessionLoader::query(const RemoveUserFromSessionParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray RemoveUserFromSessionLoader::body(const RemoveUserFromSessionParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RemoveUserFromSessionLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +DisplayContentLoader::DisplayContentLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DisplayContentLoader::path(const DisplayContentParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Viewing"); +} + +QUrlQuery DisplayContentLoader::query(const DisplayContentParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("itemType", Support::toString(params.itemType())); + result.addQueryItem("itemId", Support::toString(params.itemId())); + result.addQueryItem("itemName", Support::toString(params.itemName())); + + // Optional parameters + + return result; +} + +QByteArray DisplayContentLoader::body(const DisplayContentParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DisplayContentLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PostCapabilitiesLoader::PostCapabilitiesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostCapabilitiesLoader::path(const PostCapabilitiesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Capabilities"); +} + +QUrlQuery PostCapabilitiesLoader::query(const PostCapabilitiesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.jellyfinIdNull()) { + result.addQueryItem("id", Support::toString(params.jellyfinId())); + } + if (!params.playableMediaTypesNull()) { + result.addQueryItem("playableMediaTypes", Support::toString(params.playableMediaTypes())); + } + if (!params.supportedCommandsNull()) { + result.addQueryItem("supportedCommands", Support::toString>(params.supportedCommands())); + } + if (!params.supportsMediaControlNull()) { + result.addQueryItem("supportsMediaControl", Support::toString>(params.supportsMediaControl())); + } + if (!params.supportsSyncNull()) { + result.addQueryItem("supportsSync", Support::toString>(params.supportsSync())); + } + if (!params.supportsPersistentIdentifierNull()) { + result.addQueryItem("supportsPersistentIdentifier", Support::toString>(params.supportsPersistentIdentifier())); + } + + return result; +} + +QByteArray PostCapabilitiesLoader::body(const PostCapabilitiesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation PostCapabilitiesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +PostFullCapabilitiesLoader::PostFullCapabilitiesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostFullCapabilitiesLoader::path(const PostFullCapabilitiesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Capabilities/Full"); +} + +QUrlQuery PostFullCapabilitiesLoader::query(const PostFullCapabilitiesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.jellyfinIdNull()) { + result.addQueryItem("id", Support::toString(params.jellyfinId())); + } + + return result; +} + +QByteArray PostFullCapabilitiesLoader::body(const PostFullCapabilitiesParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation PostFullCapabilitiesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +ReportSessionEndedLoader::ReportSessionEndedLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ReportSessionEndedLoader::path(const ReportSessionEndedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Logout"); +} + +QUrlQuery ReportSessionEndedLoader::query(const ReportSessionEndedParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ReportSessionEndedLoader::body(const ReportSessionEndedParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation ReportSessionEndedLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +ReportViewingLoader::ReportViewingLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ReportViewingLoader::path(const ReportViewingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions/Viewing"); +} + +QUrlQuery ReportViewingLoader::query(const ReportViewingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("itemId", Support::toString(params.itemId())); + + // Optional parameters + if (!params.sessionIdNull()) { + result.addQueryItem("sessionId", Support::toString(params.sessionId())); + } + + return result; +} + +QByteArray ReportViewingLoader::body(const ReportViewingParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation ReportViewingLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/startup.cpp b/core/src/loader/http/startup.cpp index aecf547..ba544c6 100644 --- a/core/src/loader/http/startup.cpp +++ b/core/src/loader/http/startup.cpp @@ -35,6 +35,35 @@ namespace HTTP { using namespace Jellyfin::DTO; +CompleteWizardLoader::CompleteWizardLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString CompleteWizardLoader::path(const CompleteWizardParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Startup/Complete"); +} + +QUrlQuery CompleteWizardLoader::query(const CompleteWizardParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray CompleteWizardLoader::body(const CompleteWizardParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation CompleteWizardLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetStartupConfigurationLoader::GetStartupConfigurationLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -64,6 +93,35 @@ QNetworkAccessManager::Operation GetStartupConfigurationLoader::operation() cons } +UpdateInitialConfigurationLoader::UpdateInitialConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateInitialConfigurationLoader::path(const UpdateInitialConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Startup/Configuration"); +} + +QUrlQuery UpdateInitialConfigurationLoader::query(const UpdateInitialConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateInitialConfigurationLoader::body(const UpdateInitialConfigurationParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateInitialConfigurationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetFirstUser_2Loader::GetFirstUser_2Loader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -93,6 +151,35 @@ QNetworkAccessManager::Operation GetFirstUser_2Loader::operation() const { } +SetRemoteAccessLoader::SetRemoteAccessLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SetRemoteAccessLoader::path(const SetRemoteAccessParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Startup/RemoteAccess"); +} + +QUrlQuery SetRemoteAccessLoader::query(const SetRemoteAccessParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SetRemoteAccessLoader::body(const SetRemoteAccessParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SetRemoteAccessLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetFirstUserLoader::GetFirstUserLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -122,6 +209,35 @@ QNetworkAccessManager::Operation GetFirstUserLoader::operation() const { } +UpdateStartupUserLoader::UpdateStartupUserLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateStartupUserLoader::path(const UpdateStartupUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Startup/User"); +} + +QUrlQuery UpdateStartupUserLoader::query(const UpdateStartupUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateStartupUserLoader::body(const UpdateStartupUserParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateStartupUserLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/subtitle.cpp b/core/src/loader/http/subtitle.cpp index c8b7121..5239484 100644 --- a/core/src/loader/http/subtitle.cpp +++ b/core/src/loader/http/subtitle.cpp @@ -96,6 +96,93 @@ QNetworkAccessManager::Operation SearchRemoteSubtitlesLoader::operation() const } +DownloadRemoteSubtitlesLoader::DownloadRemoteSubtitlesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DownloadRemoteSubtitlesLoader::path(const DownloadRemoteSubtitlesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/RemoteSearch/Subtitles/") + Support::toString< QString>(params.subtitleId()) ; +} + +QUrlQuery DownloadRemoteSubtitlesLoader::query(const DownloadRemoteSubtitlesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DownloadRemoteSubtitlesLoader::body(const DownloadRemoteSubtitlesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DownloadRemoteSubtitlesLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UploadSubtitleLoader::UploadSubtitleLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UploadSubtitleLoader::path(const UploadSubtitleParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Videos/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Subtitles"); +} + +QUrlQuery UploadSubtitleLoader::query(const UploadSubtitleParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UploadSubtitleLoader::body(const UploadSubtitleParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UploadSubtitleLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +DeleteSubtitleLoader::DeleteSubtitleLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteSubtitleLoader::path(const DeleteSubtitleParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Videos/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Subtitles/") + Support::toString< qint32>(params.index()) ; +} + +QUrlQuery DeleteSubtitleLoader::query(const DeleteSubtitleParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteSubtitleLoader::body(const DeleteSubtitleParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteSubtitleLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/syncplay.cpp b/core/src/loader/http/syncplay.cpp index 8632133..3fdd0b2 100644 --- a/core/src/loader/http/syncplay.cpp +++ b/core/src/loader/http/syncplay.cpp @@ -35,6 +35,93 @@ namespace HTTP { using namespace Jellyfin::DTO; +SyncPlayBufferingLoader::SyncPlayBufferingLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayBufferingLoader::path(const SyncPlayBufferingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Buffering"); +} + +QUrlQuery SyncPlayBufferingLoader::query(const SyncPlayBufferingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayBufferingLoader::body(const SyncPlayBufferingParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayBufferingLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayJoinGroupLoader::SyncPlayJoinGroupLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayJoinGroupLoader::path(const SyncPlayJoinGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Join"); +} + +QUrlQuery SyncPlayJoinGroupLoader::query(const SyncPlayJoinGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayJoinGroupLoader::body(const SyncPlayJoinGroupParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayJoinGroupLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayLeaveGroupLoader::SyncPlayLeaveGroupLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayLeaveGroupLoader::path(const SyncPlayLeaveGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Leave"); +} + +QUrlQuery SyncPlayLeaveGroupLoader::query(const SyncPlayLeaveGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayLeaveGroupLoader::body(const SyncPlayLeaveGroupParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SyncPlayLeaveGroupLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + SyncPlayGetGroupsLoader::SyncPlayGetGroupsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, SyncPlayGetGroupsParams>(apiClient) {} @@ -64,6 +151,499 @@ QNetworkAccessManager::Operation SyncPlayGetGroupsLoader::operation() const { } +SyncPlayMovePlaylistItemLoader::SyncPlayMovePlaylistItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayMovePlaylistItemLoader::path(const SyncPlayMovePlaylistItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/MovePlaylistItem"); +} + +QUrlQuery SyncPlayMovePlaylistItemLoader::query(const SyncPlayMovePlaylistItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayMovePlaylistItemLoader::body(const SyncPlayMovePlaylistItemParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayMovePlaylistItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayCreateGroupLoader::SyncPlayCreateGroupLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayCreateGroupLoader::path(const SyncPlayCreateGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/New"); +} + +QUrlQuery SyncPlayCreateGroupLoader::query(const SyncPlayCreateGroupParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayCreateGroupLoader::body(const SyncPlayCreateGroupParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayCreateGroupLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayNextItemLoader::SyncPlayNextItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayNextItemLoader::path(const SyncPlayNextItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/NextItem"); +} + +QUrlQuery SyncPlayNextItemLoader::query(const SyncPlayNextItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayNextItemLoader::body(const SyncPlayNextItemParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayNextItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayPauseLoader::SyncPlayPauseLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayPauseLoader::path(const SyncPlayPauseParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Pause"); +} + +QUrlQuery SyncPlayPauseLoader::query(const SyncPlayPauseParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayPauseLoader::body(const SyncPlayPauseParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SyncPlayPauseLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayPingLoader::SyncPlayPingLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayPingLoader::path(const SyncPlayPingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Ping"); +} + +QUrlQuery SyncPlayPingLoader::query(const SyncPlayPingParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayPingLoader::body(const SyncPlayPingParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayPingLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayPreviousItemLoader::SyncPlayPreviousItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayPreviousItemLoader::path(const SyncPlayPreviousItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/PreviousItem"); +} + +QUrlQuery SyncPlayPreviousItemLoader::query(const SyncPlayPreviousItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayPreviousItemLoader::body(const SyncPlayPreviousItemParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayPreviousItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayQueueLoader::SyncPlayQueueLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayQueueLoader::path(const SyncPlayQueueParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Queue"); +} + +QUrlQuery SyncPlayQueueLoader::query(const SyncPlayQueueParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayQueueLoader::body(const SyncPlayQueueParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayQueueLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayReadyLoader::SyncPlayReadyLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayReadyLoader::path(const SyncPlayReadyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Ready"); +} + +QUrlQuery SyncPlayReadyLoader::query(const SyncPlayReadyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayReadyLoader::body(const SyncPlayReadyParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayReadyLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayRemoveFromPlaylistLoader::SyncPlayRemoveFromPlaylistLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayRemoveFromPlaylistLoader::path(const SyncPlayRemoveFromPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/RemoveFromPlaylist"); +} + +QUrlQuery SyncPlayRemoveFromPlaylistLoader::query(const SyncPlayRemoveFromPlaylistParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayRemoveFromPlaylistLoader::body(const SyncPlayRemoveFromPlaylistParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlayRemoveFromPlaylistLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySeekLoader::SyncPlaySeekLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySeekLoader::path(const SyncPlaySeekParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Seek"); +} + +QUrlQuery SyncPlaySeekLoader::query(const SyncPlaySeekParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySeekLoader::body(const SyncPlaySeekParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySeekLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySetIgnoreWaitLoader::SyncPlaySetIgnoreWaitLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySetIgnoreWaitLoader::path(const SyncPlaySetIgnoreWaitParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/SetIgnoreWait"); +} + +QUrlQuery SyncPlaySetIgnoreWaitLoader::query(const SyncPlaySetIgnoreWaitParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySetIgnoreWaitLoader::body(const SyncPlaySetIgnoreWaitParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySetIgnoreWaitLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySetNewQueueLoader::SyncPlaySetNewQueueLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySetNewQueueLoader::path(const SyncPlaySetNewQueueParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/SetNewQueue"); +} + +QUrlQuery SyncPlaySetNewQueueLoader::query(const SyncPlaySetNewQueueParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySetNewQueueLoader::body(const SyncPlaySetNewQueueParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySetNewQueueLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySetPlaylistItemLoader::SyncPlaySetPlaylistItemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySetPlaylistItemLoader::path(const SyncPlaySetPlaylistItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/SetPlaylistItem"); +} + +QUrlQuery SyncPlaySetPlaylistItemLoader::query(const SyncPlaySetPlaylistItemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySetPlaylistItemLoader::body(const SyncPlaySetPlaylistItemParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySetPlaylistItemLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySetRepeatModeLoader::SyncPlaySetRepeatModeLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySetRepeatModeLoader::path(const SyncPlaySetRepeatModeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/SetRepeatMode"); +} + +QUrlQuery SyncPlaySetRepeatModeLoader::query(const SyncPlaySetRepeatModeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySetRepeatModeLoader::body(const SyncPlaySetRepeatModeParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySetRepeatModeLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlaySetShuffleModeLoader::SyncPlaySetShuffleModeLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlaySetShuffleModeLoader::path(const SyncPlaySetShuffleModeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/SetShuffleMode"); +} + +QUrlQuery SyncPlaySetShuffleModeLoader::query(const SyncPlaySetShuffleModeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlaySetShuffleModeLoader::body(const SyncPlaySetShuffleModeParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation SyncPlaySetShuffleModeLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayStopLoader::SyncPlayStopLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayStopLoader::path(const SyncPlayStopParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Stop"); +} + +QUrlQuery SyncPlayStopLoader::query(const SyncPlayStopParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayStopLoader::body(const SyncPlayStopParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SyncPlayStopLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +SyncPlayUnpauseLoader::SyncPlayUnpauseLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString SyncPlayUnpauseLoader::path(const SyncPlayUnpauseParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/Unpause"); +} + +QUrlQuery SyncPlayUnpauseLoader::query(const SyncPlayUnpauseParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray SyncPlayUnpauseLoader::body(const SyncPlayUnpauseParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation SyncPlayUnpauseLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/system.cpp b/core/src/loader/http/system.cpp index 6ecc09d..ddfddfc 100644 --- a/core/src/loader/http/system.cpp +++ b/core/src/loader/http/system.cpp @@ -209,6 +209,64 @@ QNetworkAccessManager::Operation PostPingSystemLoader::operation() const { } +RestartApplicationLoader::RestartApplicationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString RestartApplicationLoader::path(const RestartApplicationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Restart"); +} + +QUrlQuery RestartApplicationLoader::query(const RestartApplicationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray RestartApplicationLoader::body(const RestartApplicationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation RestartApplicationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +ShutdownApplicationLoader::ShutdownApplicationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString ShutdownApplicationLoader::path(const ShutdownApplicationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Shutdown"); +} + +QUrlQuery ShutdownApplicationLoader::query(const ShutdownApplicationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray ShutdownApplicationLoader::body(const ShutdownApplicationParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation ShutdownApplicationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + GetWakeOnLanInfoLoader::GetWakeOnLanInfoLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetWakeOnLanInfoParams>(apiClient) {} diff --git a/core/src/loader/http/user.cpp b/core/src/loader/http/user.cpp index 2b203ff..1bef710 100644 --- a/core/src/loader/http/user.cpp +++ b/core/src/loader/http/user.cpp @@ -99,6 +99,64 @@ QNetworkAccessManager::Operation GetUserByIdLoader::operation() const { } +DeleteUserLoader::DeleteUserLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteUserLoader::path(const DeleteUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) ; +} + +QUrlQuery DeleteUserLoader::query(const DeleteUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteUserLoader::body(const DeleteUserParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteUserLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +UpdateUserLoader::UpdateUserLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateUserLoader::path(const UpdateUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) ; +} + +QUrlQuery UpdateUserLoader::query(const UpdateUserParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateUserLoader::body(const UpdateUserParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateUserLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + AuthenticateUserLoader::AuthenticateUserLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} @@ -132,6 +190,122 @@ QNetworkAccessManager::Operation AuthenticateUserLoader::operation() const { } +UpdateUserConfigurationLoader::UpdateUserConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateUserConfigurationLoader::path(const UpdateUserConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Configuration"); +} + +QUrlQuery UpdateUserConfigurationLoader::query(const UpdateUserConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateUserConfigurationLoader::body(const UpdateUserConfigurationParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateUserConfigurationLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdateUserEasyPasswordLoader::UpdateUserEasyPasswordLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateUserEasyPasswordLoader::path(const UpdateUserEasyPasswordParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/EasyPassword"); +} + +QUrlQuery UpdateUserEasyPasswordLoader::query(const UpdateUserEasyPasswordParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateUserEasyPasswordLoader::body(const UpdateUserEasyPasswordParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateUserEasyPasswordLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdateUserPasswordLoader::UpdateUserPasswordLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateUserPasswordLoader::path(const UpdateUserPasswordParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Password"); +} + +QUrlQuery UpdateUserPasswordLoader::query(const UpdateUserPasswordParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateUserPasswordLoader::body(const UpdateUserPasswordParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateUserPasswordLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + +UpdateUserPolicyLoader::UpdateUserPolicyLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString UpdateUserPolicyLoader::path(const UpdateUserPolicyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Policy"); +} + +QUrlQuery UpdateUserPolicyLoader::query(const UpdateUserPolicyParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray UpdateUserPolicyLoader::body(const UpdateUserPolicyParams ¶ms) const { + return Support::toString>(params.body()).toUtf8(); +} + +QNetworkAccessManager::Operation UpdateUserPolicyLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + AuthenticateUserByNameLoader::AuthenticateUserByNameLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} diff --git a/core/src/loader/http/videos.cpp b/core/src/loader/http/videos.cpp index 2f3770e..c78b33b 100644 --- a/core/src/loader/http/videos.cpp +++ b/core/src/loader/http/videos.cpp @@ -67,6 +67,65 @@ QNetworkAccessManager::Operation GetAdditionalPartLoader::operation() const { } +DeleteAlternateSourcesLoader::DeleteAlternateSourcesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeleteAlternateSourcesLoader::path(const DeleteAlternateSourcesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Videos/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/AlternateSources"); +} + +QUrlQuery DeleteAlternateSourcesLoader::query(const DeleteAlternateSourcesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + +QByteArray DeleteAlternateSourcesLoader::body(const DeleteAlternateSourcesParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation DeleteAlternateSourcesLoader::operation() const { + // HTTP method Delete + return QNetworkAccessManager::DeleteOperation; + +} + +MergeVersionsLoader::MergeVersionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString MergeVersionsLoader::path(const MergeVersionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Videos/MergeVersions"); +} + +QUrlQuery MergeVersionsLoader::query(const MergeVersionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("ids", Support::toString(params.ids())); + + // Optional parameters + + return result; +} + +QByteArray MergeVersionsLoader::body(const MergeVersionsParams ¶ms) const { + return QByteArray(); +} + +QNetworkAccessManager::Operation MergeVersionsLoader::operation() const { + // HTTP method Post + return QNetworkAccessManager::PostOperation; + +} + } // NS HTTP } // NS Loader