From 729e3436611d2344f6ed282ae3b2b5f425ade2b1 Mon Sep 17 00:00:00 2001 From: Chris Josten Date: Sun, 28 Mar 2021 04:00:00 +0200 Subject: [PATCH] WIP: HttpLoader seems to work, Model still borked --- core/CMakeLists.txt | 10 +- core/codegen/enum_header.hbs | 15 +- core/codegen/enum_implementation.hbs | 19 +- core/codegen/loader_header.hbs | 6 +- core/codegen/loader_implementation.hbs | 8 +- core/codegen/object_header.hbs | 15 +- core/codegen/object_implementation.hbs | 11 +- core/include/JellyfinQt/apiclient.h | 8 +- core/include/JellyfinQt/apimodel.h | 237 ++- core/include/JellyfinQt/dto/accessschedule.h | 18 +- .../include/JellyfinQt/dto/activitylogentry.h | 18 +- .../dto/activitylogentryqueryresult.h | 18 +- .../JellyfinQt/dto/addvirtualfolderdto.h | 18 +- core/include/JellyfinQt/dto/albuminfo.h | 30 +- .../dto/albuminforemotesearchquery.h | 18 +- .../JellyfinQt/dto/allthememediaresult.h | 18 +- core/include/JellyfinQt/dto/architecture.h | 18 +- core/include/JellyfinQt/dto/artistinfo.h | 24 +- .../dto/artistinforemotesearchquery.h | 18 +- .../JellyfinQt/dto/authenticateuserbyname.h | 18 +- .../JellyfinQt/dto/authenticationinfo.h | 18 +- .../dto/authenticationinfoqueryresult.h | 18 +- .../JellyfinQt/dto/authenticationresult.h | 18 +- core/include/JellyfinQt/dto/baseitem.h | 18 +- core/include/JellyfinQt/dto/baseitemdto.h | 36 +- .../JellyfinQt/dto/baseitemdtoqueryresult.h | 18 +- core/include/JellyfinQt/dto/baseitemperson.h | 24 +- .../JellyfinQt/dto/basepluginconfiguration.h | 4 + core/include/JellyfinQt/dto/bookinfo.h | 24 +- .../dto/bookinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/boxsetinfo.h | 24 +- .../dto/boxsetinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/brandingoptions.h | 18 +- .../include/JellyfinQt/dto/bufferrequestdto.h | 18 +- core/include/JellyfinQt/dto/channelfeatures.h | 18 +- .../JellyfinQt/dto/channelitemsortfield.h | 18 +- .../JellyfinQt/dto/channelmappingoptionsdto.h | 18 +- .../JellyfinQt/dto/channelmediacontenttype.h | 18 +- .../include/JellyfinQt/dto/channelmediatype.h | 18 +- core/include/JellyfinQt/dto/channeltype.h | 18 +- core/include/JellyfinQt/dto/chapterinfo.h | 18 +- .../JellyfinQt/dto/clientcapabilities.h | 18 +- .../JellyfinQt/dto/clientcapabilitiesdto.h | 18 +- core/include/JellyfinQt/dto/codecprofile.h | 18 +- core/include/JellyfinQt/dto/codectype.h | 18 +- .../JellyfinQt/dto/collectioncreationresult.h | 18 +- .../JellyfinQt/dto/configurationpageinfo.h | 18 +- .../JellyfinQt/dto/configurationpagetype.h | 18 +- .../include/JellyfinQt/dto/containerprofile.h | 18 +- core/include/JellyfinQt/dto/controlresponse.h | 24 +- core/include/JellyfinQt/dto/countryinfo.h | 18 +- .../JellyfinQt/dto/createplaylistdto.h | 18 +- .../include/JellyfinQt/dto/createuserbyname.h | 18 +- core/include/JellyfinQt/dto/culturedto.h | 18 +- core/include/JellyfinQt/dto/dayofweek.h | 18 +- core/include/JellyfinQt/dto/daypattern.h | 18 +- .../dto/defaultdirectorybrowserinfodto.h | 18 +- .../JellyfinQt/dto/deviceidentification.h | 18 +- core/include/JellyfinQt/dto/deviceinfo.h | 18 +- .../JellyfinQt/dto/deviceinfoqueryresult.h | 18 +- core/include/JellyfinQt/dto/deviceoptions.h | 18 +- core/include/JellyfinQt/dto/deviceprofile.h | 18 +- .../JellyfinQt/dto/deviceprofileinfo.h | 18 +- .../JellyfinQt/dto/deviceprofiletype.h | 18 +- .../JellyfinQt/dto/directplayprofile.h | 18 +- .../JellyfinQt/dto/displaypreferencesdto.h | 24 +- core/include/JellyfinQt/dto/dlnaprofiletype.h | 18 +- .../include/JellyfinQt/dto/dynamicdayofweek.h | 18 +- core/include/JellyfinQt/dto/encodingcontext.h | 18 +- core/include/JellyfinQt/dto/endpointinfo.h | 18 +- core/include/JellyfinQt/dto/externalidinfo.h | 18 +- .../JellyfinQt/dto/externalidmediatype.h | 18 +- core/include/JellyfinQt/dto/externalurl.h | 18 +- core/include/JellyfinQt/dto/ffmpeglocation.h | 18 +- .../JellyfinQt/dto/filesystementryinfo.h | 18 +- .../JellyfinQt/dto/filesystementrytype.h | 18 +- core/include/JellyfinQt/dto/fontfile.h | 18 +- .../JellyfinQt/dto/forgotpasswordaction.h | 18 +- .../JellyfinQt/dto/forgotpassworddto.h | 18 +- .../JellyfinQt/dto/forgotpasswordresult.h | 18 +- core/include/JellyfinQt/dto/generalcommand.h | 24 +- .../JellyfinQt/dto/generalcommandtype.h | 18 +- core/include/JellyfinQt/dto/getprogramsdto.h | 18 +- core/include/JellyfinQt/dto/groupinfodto.h | 18 +- core/include/JellyfinQt/dto/groupqueuemode.h | 18 +- core/include/JellyfinQt/dto/grouprepeatmode.h | 18 +- .../include/JellyfinQt/dto/groupshufflemode.h | 18 +- core/include/JellyfinQt/dto/groupstatetype.h | 18 +- core/include/JellyfinQt/dto/groupupdatetype.h | 18 +- core/include/JellyfinQt/dto/guideinfo.h | 18 +- core/include/JellyfinQt/dto/headermatchtype.h | 18 +- core/include/JellyfinQt/dto/httpheaderinfo.h | 18 +- .../JellyfinQt/dto/ignorewaitrequestdto.h | 18 +- core/include/JellyfinQt/dto/imagebynameinfo.h | 18 +- core/include/JellyfinQt/dto/imageformat.h | 18 +- core/include/JellyfinQt/dto/imageinfo.h | 18 +- core/include/JellyfinQt/dto/imageoption.h | 18 +- .../include/JellyfinQt/dto/imageorientation.h | 18 +- .../JellyfinQt/dto/imageproviderinfo.h | 18 +- .../JellyfinQt/dto/imagesavingconvention.h | 18 +- core/include/JellyfinQt/dto/imagetype.h | 18 +- .../include/JellyfinQt/dto/installationinfo.h | 18 +- core/include/JellyfinQt/dto/iplugin.h | 18 +- core/include/JellyfinQt/dto/isotype.h | 18 +- core/include/JellyfinQt/dto/itemcounts.h | 18 +- core/include/JellyfinQt/dto/itemfields.h | 18 +- core/include/JellyfinQt/dto/itemfilter.h | 18 +- .../JellyfinQt/dto/joingrouprequestdto.h | 18 +- core/include/JellyfinQt/dto/keepuntil.h | 18 +- .../JellyfinQt/dto/libraryoptioninfodto.h | 18 +- core/include/JellyfinQt/dto/libraryoptions.h | 18 +- .../JellyfinQt/dto/libraryoptionsresultdto.h | 18 +- .../JellyfinQt/dto/librarytypeoptionsdto.h | 18 +- .../JellyfinQt/dto/libraryupdateinfo.h | 18 +- .../JellyfinQt/dto/listingsproviderinfo.h | 18 +- .../JellyfinQt/dto/livestreamresponse.h | 18 +- core/include/JellyfinQt/dto/livetvinfo.h | 18 +- .../JellyfinQt/dto/livetvserviceinfo.h | 18 +- .../JellyfinQt/dto/livetvservicestatus.h | 18 +- .../JellyfinQt/dto/localizationoption.h | 18 +- core/include/JellyfinQt/dto/locationtype.h | 18 +- core/include/JellyfinQt/dto/logfile.h | 18 +- core/include/JellyfinQt/dto/loglevel.h | 18 +- core/include/JellyfinQt/dto/mediaattachment.h | 18 +- .../JellyfinQt/dto/mediaencoderpathdto.h | 18 +- core/include/JellyfinQt/dto/mediapathdto.h | 18 +- core/include/JellyfinQt/dto/mediapathinfo.h | 18 +- core/include/JellyfinQt/dto/mediaprotocol.h | 18 +- core/include/JellyfinQt/dto/mediasourceinfo.h | 24 +- core/include/JellyfinQt/dto/mediasourcetype.h | 18 +- core/include/JellyfinQt/dto/mediastream.h | 18 +- core/include/JellyfinQt/dto/mediastreamtype.h | 18 +- .../JellyfinQt/dto/mediaupdateinfodto.h | 18 +- core/include/JellyfinQt/dto/mediaurl.h | 18 +- .../JellyfinQt/dto/metadataeditorinfo.h | 18 +- core/include/JellyfinQt/dto/metadatafield.h | 18 +- core/include/JellyfinQt/dto/metadataoptions.h | 18 +- .../JellyfinQt/dto/metadatarefreshmode.h | 18 +- .../dto/moveplaylistitemrequestdto.h | 18 +- core/include/JellyfinQt/dto/movieinfo.h | 24 +- .../dto/movieinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/musicvideoinfo.h | 24 +- .../dto/musicvideoinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/nameguidpair.h | 18 +- core/include/JellyfinQt/dto/nameidpair.h | 18 +- core/include/JellyfinQt/dto/namevaluepair.h | 18 +- .../JellyfinQt/dto/newgrouprequestdto.h | 18 +- .../JellyfinQt/dto/nextitemrequestdto.h | 18 +- core/include/JellyfinQt/dto/notificationdto.h | 18 +- .../JellyfinQt/dto/notificationlevel.h | 18 +- .../JellyfinQt/dto/notificationresultdto.h | 18 +- .../JellyfinQt/dto/notificationssummarydto.h | 18 +- .../JellyfinQt/dto/notificationtypeinfo.h | 18 +- .../JellyfinQt/dto/objectgroupupdate.h | 18 +- .../JellyfinQt/dto/openlivestreamdto.h | 18 +- core/include/JellyfinQt/dto/packageinfo.h | 18 +- core/include/JellyfinQt/dto/parentalrating.h | 18 +- .../include/JellyfinQt/dto/pathsubstitution.h | 18 +- .../include/JellyfinQt/dto/personlookupinfo.h | 24 +- .../dto/personlookupinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/pingrequestdto.h | 18 +- core/include/JellyfinQt/dto/pinredeemresult.h | 18 +- core/include/JellyfinQt/dto/playaccess.h | 18 +- .../JellyfinQt/dto/playbackerrorcode.h | 18 +- core/include/JellyfinQt/dto/playbackinfodto.h | 18 +- .../JellyfinQt/dto/playbackinforesponse.h | 18 +- .../JellyfinQt/dto/playbackprogressinfo.h | 18 +- .../JellyfinQt/dto/playbackstartinfo.h | 18 +- .../include/JellyfinQt/dto/playbackstopinfo.h | 18 +- core/include/JellyfinQt/dto/playcommand.h | 18 +- core/include/JellyfinQt/dto/playerstateinfo.h | 18 +- .../JellyfinQt/dto/playlistcreationresult.h | 18 +- core/include/JellyfinQt/dto/playmethod.h | 18 +- core/include/JellyfinQt/dto/playrequest.h | 18 +- core/include/JellyfinQt/dto/playrequestdto.h | 18 +- .../include/JellyfinQt/dto/playstatecommand.h | 18 +- .../include/JellyfinQt/dto/playstaterequest.h | 18 +- core/include/JellyfinQt/dto/plugininfo.h | 18 +- .../JellyfinQt/dto/pluginsecurityinfo.h | 18 +- core/include/JellyfinQt/dto/pluginstatus.h | 18 +- .../JellyfinQt/dto/previousitemrequestdto.h | 18 +- core/include/JellyfinQt/dto/problemdetails.h | 18 +- .../include/JellyfinQt/dto/profilecondition.h | 18 +- .../JellyfinQt/dto/profileconditiontype.h | 18 +- .../JellyfinQt/dto/profileconditionvalue.h | 18 +- core/include/JellyfinQt/dto/programaudio.h | 18 +- .../include/JellyfinQt/dto/publicsysteminfo.h | 18 +- core/include/JellyfinQt/dto/queryfilters.h | 18 +- .../JellyfinQt/dto/queryfilterslegacy.h | 18 +- core/include/JellyfinQt/dto/queueitem.h | 18 +- core/include/JellyfinQt/dto/queuerequestdto.h | 18 +- core/include/JellyfinQt/dto/quickconnectdto.h | 18 +- .../JellyfinQt/dto/quickconnectresult.h | 18 +- .../JellyfinQt/dto/quickconnectstate.h | 18 +- core/include/JellyfinQt/dto/ratingtype.h | 18 +- core/include/JellyfinQt/dto/readyrequestdto.h | 18 +- .../JellyfinQt/dto/recommendationdto.h | 18 +- .../JellyfinQt/dto/recommendationtype.h | 18 +- core/include/JellyfinQt/dto/recordingstatus.h | 18 +- core/include/JellyfinQt/dto/remoteimageinfo.h | 18 +- .../JellyfinQt/dto/remoteimageresult.h | 18 +- .../JellyfinQt/dto/remotesearchresult.h | 24 +- .../JellyfinQt/dto/remotesubtitleinfo.h | 18 +- .../dto/removefromplaylistrequestdto.h | 18 +- core/include/JellyfinQt/dto/repeatmode.h | 18 +- core/include/JellyfinQt/dto/repositoryinfo.h | 18 +- core/include/JellyfinQt/dto/responseprofile.h | 18 +- core/include/JellyfinQt/dto/scrolldirection.h | 18 +- core/include/JellyfinQt/dto/searchhint.h | 18 +- .../include/JellyfinQt/dto/searchhintresult.h | 18 +- core/include/JellyfinQt/dto/seekrequestdto.h | 18 +- core/include/JellyfinQt/dto/sendcommand.h | 18 +- core/include/JellyfinQt/dto/sendcommandtype.h | 18 +- core/include/JellyfinQt/dto/seriesinfo.h | 24 +- .../dto/seriesinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/seriesstatus.h | 18 +- .../JellyfinQt/dto/seriestimerinfodto.h | 24 +- .../dto/seriestimerinfodtoqueryresult.h | 18 +- .../JellyfinQt/dto/serverconfiguration.h | 18 +- core/include/JellyfinQt/dto/sessioninfo.h | 18 +- core/include/JellyfinQt/dto/sessionuserinfo.h | 18 +- .../JellyfinQt/dto/setchannelmappingdto.h | 18 +- .../dto/setplaylistitemrequestdto.h | 18 +- .../JellyfinQt/dto/setrepeatmoderequestdto.h | 18 +- .../JellyfinQt/dto/setshufflemoderequestdto.h | 18 +- core/include/JellyfinQt/dto/songinfo.h | 24 +- core/include/JellyfinQt/dto/sortorder.h | 18 +- .../JellyfinQt/dto/specialviewoptiondto.h | 18 +- .../JellyfinQt/dto/startupconfigurationdto.h | 18 +- .../JellyfinQt/dto/startupremoteaccessdto.h | 18 +- core/include/JellyfinQt/dto/startupuserdto.h | 18 +- .../JellyfinQt/dto/subtitledeliverymethod.h | 18 +- .../JellyfinQt/dto/subtitleplaybackmode.h | 18 +- core/include/JellyfinQt/dto/subtitleprofile.h | 18 +- .../JellyfinQt/dto/syncplayuseraccesstype.h | 18 +- core/include/JellyfinQt/dto/systeminfo.h | 18 +- .../JellyfinQt/dto/taskcompletionstatus.h | 18 +- core/include/JellyfinQt/dto/taskinfo.h | 18 +- core/include/JellyfinQt/dto/taskresult.h | 18 +- core/include/JellyfinQt/dto/taskstate.h | 18 +- core/include/JellyfinQt/dto/tasktriggerinfo.h | 18 +- .../include/JellyfinQt/dto/thememediaresult.h | 18 +- core/include/JellyfinQt/dto/timereventinfo.h | 18 +- core/include/JellyfinQt/dto/timerinfodto.h | 18 +- .../JellyfinQt/dto/timerinfodtoqueryresult.h | 18 +- core/include/JellyfinQt/dto/trailerinfo.h | 24 +- .../dto/trailerinforemotesearchquery.h | 18 +- core/include/JellyfinQt/dto/transcodereason.h | 18 +- .../JellyfinQt/dto/transcodeseekinfo.h | 18 +- core/include/JellyfinQt/dto/transcodinginfo.h | 18 +- .../JellyfinQt/dto/transcodingprofile.h | 18 +- .../JellyfinQt/dto/transportstreamtimestamp.h | 18 +- .../JellyfinQt/dto/tunerchannelmapping.h | 18 +- core/include/JellyfinQt/dto/tunerhostinfo.h | 18 +- core/include/JellyfinQt/dto/typeoptions.h | 18 +- core/include/JellyfinQt/dto/unrateditem.h | 18 +- .../JellyfinQt/dto/updatelibraryoptionsdto.h | 18 +- .../JellyfinQt/dto/updateusereasypassword.h | 18 +- .../JellyfinQt/dto/updateuserpassword.h | 18 +- .../JellyfinQt/dto/uploadsubtitledto.h | 18 +- .../JellyfinQt/dto/userconfiguration.h | 18 +- core/include/JellyfinQt/dto/userdto.h | 18 +- core/include/JellyfinQt/dto/useritemdatadto.h | 18 +- core/include/JellyfinQt/dto/userpolicy.h | 18 +- core/include/JellyfinQt/dto/utctimeresponse.h | 18 +- core/include/JellyfinQt/dto/validatepathdto.h | 18 +- core/include/JellyfinQt/dto/version.h | 18 +- core/include/JellyfinQt/dto/versioninfo.h | 18 +- core/include/JellyfinQt/dto/video3dformat.h | 18 +- core/include/JellyfinQt/dto/videotype.h | 18 +- .../JellyfinQt/dto/virtualfolderinfo.h | 18 +- core/include/JellyfinQt/dto/wakeonlaninfo.h | 18 +- core/include/JellyfinQt/dto/xmlattribute.h | 18 +- .../include/JellyfinQt/loader/http/activate.h | 5 +- .../loader/http/addlistingprovider.h | 10 +- .../JellyfinQt/loader/http/addmediapath.h | 5 +- .../JellyfinQt/loader/http/addtocollection.h | 5 +- .../JellyfinQt/loader/http/addtoplaylist.h | 5 +- .../JellyfinQt/loader/http/addtunerhost.h | 10 +- .../JellyfinQt/loader/http/addusertosession.h | 5 +- .../JellyfinQt/loader/http/addvirtualfolder.h | 5 +- .../loader/http/applysearchcriteria.h | 5 +- .../JellyfinQt/loader/http/authenticateuser.h | 10 +- .../loader/http/authenticateuserbyname.h | 10 +- .../http/authenticatewithquickconnect.h | 10 +- .../JellyfinQt/loader/http/authorize.h | 18 +- .../JellyfinQt/loader/http/available.h | 5 +- .../loader/http/cancelpackageinstallation.h | 5 +- .../loader/http/cancelseriestimer.h | 5 +- .../JellyfinQt/loader/http/canceltimer.h | 5 +- .../JellyfinQt/loader/http/closelivestream.h | 5 +- .../JellyfinQt/loader/http/completewizard.h | 5 +- core/include/JellyfinQt/loader/http/connect.h | 10 +- .../loader/http/createadminnotification.h | 5 +- .../JellyfinQt/loader/http/createcollection.h | 10 +- .../JellyfinQt/loader/http/createkey.h | 5 +- .../JellyfinQt/loader/http/createplaylist.h | 10 +- .../JellyfinQt/loader/http/createprofile.h | 5 +- .../loader/http/createseriestimer.h | 5 +- .../JellyfinQt/loader/http/createtimer.h | 5 +- .../JellyfinQt/loader/http/createuserbyname.h | 10 +- .../JellyfinQt/loader/http/deauthorize.h | 18 +- .../loader/http/deletealternatesources.h | 5 +- .../JellyfinQt/loader/http/deletedevice.h | 5 +- .../JellyfinQt/loader/http/deleteitem.h | 5 +- .../JellyfinQt/loader/http/deleteitemimage.h | 5 +- .../loader/http/deleteitemimagebyindex.h | 5 +- .../JellyfinQt/loader/http/deleteitems.h | 5 +- .../loader/http/deletelistingprovider.h | 5 +- .../JellyfinQt/loader/http/deleteprofile.h | 5 +- .../JellyfinQt/loader/http/deleterecording.h | 5 +- .../JellyfinQt/loader/http/deletesubtitle.h | 5 +- .../JellyfinQt/loader/http/deletetunerhost.h | 5 +- .../JellyfinQt/loader/http/deleteuser.h | 5 +- .../JellyfinQt/loader/http/deleteuserimage.h | 5 +- .../loader/http/deleteuserimagebyindex.h | 5 +- .../loader/http/deleteuseritemrating.h | 10 +- .../JellyfinQt/loader/http/disableplugin.h | 5 +- .../JellyfinQt/loader/http/discovertuners.h | 19 +- .../JellyfinQt/loader/http/discvovertuners.h | 19 +- .../JellyfinQt/loader/http/displaycontent.h | 5 +- .../loader/http/downloadremoteimage.h | 5 +- .../loader/http/downloadremotesubtitles.h | 5 +- .../JellyfinQt/loader/http/enableplugin.h | 5 +- .../JellyfinQt/loader/http/forgotpassword.h | 10 +- .../loader/http/forgotpasswordpin.h | 10 +- core/include/JellyfinQt/loader/http/get.h | 10 +- .../loader/http/getadditionalpart.h | 10 +- .../JellyfinQt/loader/http/getalbumartists.h | 10 +- .../loader/http/getallchannelfeatures.h | 19 +- .../JellyfinQt/loader/http/getancestors.h | 19 +- .../JellyfinQt/loader/http/getartistbyname.h | 10 +- .../JellyfinQt/loader/http/getartistimage.h | 5 +- .../JellyfinQt/loader/http/getartists.h | 10 +- .../JellyfinQt/loader/http/getattachment.h | 5 +- .../JellyfinQt/loader/http/getaudiostream.h | 5 +- .../loader/http/getaudiostreambycontainer.h | 5 +- .../JellyfinQt/loader/http/getauthproviders.h | 19 +- .../loader/http/getbitratetestbytes.h | 5 +- .../loader/http/getbookremotesearchresults.h | 19 +- .../http/getboxsetremotesearchresults.h | 19 +- .../JellyfinQt/loader/http/getbrandingcss.h | 18 +- .../JellyfinQt/loader/http/getbrandingcss_2.h | 18 +- .../loader/http/getbrandingoptions.h | 10 +- .../JellyfinQt/loader/http/getchannel.h | 10 +- .../loader/http/getchannelfeatures.h | 10 +- .../JellyfinQt/loader/http/getchannelitems.h | 10 +- .../loader/http/getchannelmappingoptions.h | 10 +- .../JellyfinQt/loader/http/getchannels.h | 10 +- .../JellyfinQt/loader/http/getconfiguration.h | 10 +- .../loader/http/getconfigurationpages.h | 19 +- .../loader/http/getconnectionmanager.h | 5 +- .../loader/http/getconnectionmanager_2.h | 5 +- .../loader/http/getconnectionmanager_3.h | 5 +- .../loader/http/getcontentdirectory.h | 5 +- .../loader/http/getcontentdirectory_2.h | 5 +- .../loader/http/getcontentdirectory_3.h | 5 +- .../JellyfinQt/loader/http/getcountries.h | 19 +- .../JellyfinQt/loader/http/getcriticreviews.h | 10 +- .../JellyfinQt/loader/http/getcultures.h | 19 +- .../JellyfinQt/loader/http/getcurrentuser.h | 10 +- .../http/getdashboardconfigurationpage.h | 5 +- .../loader/http/getdefaultdirectorybrowser.h | 10 +- .../loader/http/getdefaultlistingprovider.h | 10 +- .../loader/http/getdefaultmetadataoptions.h | 10 +- .../loader/http/getdefaultprofile.h | 10 +- .../JellyfinQt/loader/http/getdefaulttimer.h | 10 +- .../loader/http/getdescriptionxml.h | 5 +- .../loader/http/getdescriptionxml_2.h | 5 +- .../JellyfinQt/loader/http/getdeviceinfo.h | 10 +- .../JellyfinQt/loader/http/getdeviceoptions.h | 10 +- .../JellyfinQt/loader/http/getdevices.h | 10 +- .../loader/http/getdirectorycontents.h | 19 +- .../loader/http/getdisplaypreferences.h | 10 +- .../JellyfinQt/loader/http/getdownload.h | 5 +- .../JellyfinQt/loader/http/getdrives.h | 19 +- .../JellyfinQt/loader/http/getendpointinfo.h | 10 +- .../JellyfinQt/loader/http/getepisodes.h | 10 +- .../loader/http/getexternalidinfos.h | 19 +- .../JellyfinQt/loader/http/getfallbackfont.h | 5 +- .../loader/http/getfallbackfontlist.h | 19 +- core/include/JellyfinQt/loader/http/getfile.h | 5 +- .../JellyfinQt/loader/http/getfirstuser.h | 10 +- .../JellyfinQt/loader/http/getfirstuser_2.h | 10 +- .../JellyfinQt/loader/http/getgeneralimage.h | 5 +- .../JellyfinQt/loader/http/getgeneralimages.h | 19 +- .../include/JellyfinQt/loader/http/getgenre.h | 10 +- .../JellyfinQt/loader/http/getgenreimage.h | 5 +- .../loader/http/getgenreimagebyindex.h | 5 +- .../JellyfinQt/loader/http/getgenres.h | 10 +- .../loader/http/getgroupingoptions.h | 19 +- .../JellyfinQt/loader/http/getguideinfo.h | 10 +- .../loader/http/gethlsaudiosegment.h | 5 +- .../loader/http/gethlsaudiosegmentlegacyaac.h | 5 +- .../loader/http/gethlsaudiosegmentlegacymp3.h | 5 +- .../loader/http/gethlsplaylistlegacy.h | 5 +- .../loader/http/gethlsvideosegment.h | 5 +- .../loader/http/gethlsvideosegmentlegacy.h | 5 +- core/include/JellyfinQt/loader/http/geticon.h | 5 +- .../JellyfinQt/loader/http/geticonid.h | 5 +- .../loader/http/getinstantmixfromalbum.h | 10 +- .../loader/http/getinstantmixfromartists.h | 10 +- .../loader/http/getinstantmixfromitem.h | 10 +- .../loader/http/getinstantmixfrommusicgenre.h | 10 +- .../http/getinstantmixfrommusicgenres.h | 10 +- .../loader/http/getinstantmixfromplaylist.h | 10 +- .../loader/http/getinstantmixfromsong.h | 10 +- .../JellyfinQt/loader/http/getintros.h | 10 +- core/include/JellyfinQt/loader/http/getitem.h | 10 +- .../JellyfinQt/loader/http/getitemcounts.h | 10 +- .../JellyfinQt/loader/http/getitemimage.h | 5 +- .../JellyfinQt/loader/http/getitemimage2.h | 5 +- .../loader/http/getitemimagebyindex.h | 5 +- .../loader/http/getitemimageinfos.h | 19 +- .../include/JellyfinQt/loader/http/getitems.h | 10 +- .../JellyfinQt/loader/http/getitemsbyuserid.h | 10 +- core/include/JellyfinQt/loader/http/getkeys.h | 10 +- .../loader/http/getlatestchannelitems.h | 10 +- .../JellyfinQt/loader/http/getlatestmedia.h | 19 +- .../loader/http/getlibraryoptionsinfo.h | 10 +- .../JellyfinQt/loader/http/getlineups.h | 19 +- .../JellyfinQt/loader/http/getlivehlsstream.h | 5 +- .../loader/http/getliverecordingfile.h | 5 +- .../loader/http/getlivestreamfile.h | 5 +- .../loader/http/getlivetvchannels.h | 10 +- .../JellyfinQt/loader/http/getlivetvinfo.h | 10 +- .../loader/http/getlivetvprograms.h | 10 +- .../loader/http/getlocalizationoptions.h | 19 +- .../JellyfinQt/loader/http/getlocaltrailers.h | 19 +- .../JellyfinQt/loader/http/getlogentries.h | 10 +- .../JellyfinQt/loader/http/getlogfile.h | 5 +- .../loader/http/getmasterhlsaudioplaylist.h | 5 +- .../loader/http/getmasterhlsvideoplaylist.h | 5 +- .../JellyfinQt/loader/http/getmediafolders.h | 10 +- .../loader/http/getmediainfoimage.h | 5 +- .../loader/http/getmediainfoimages.h | 19 +- .../loader/http/getmediareceiverregistrar.h | 5 +- .../loader/http/getmediareceiverregistrar_2.h | 5 +- .../loader/http/getmediareceiverregistrar_3.h | 5 +- .../loader/http/getmetadataeditorinfo.h | 10 +- .../loader/http/getmovierecommendations.h | 19 +- .../loader/http/getmovieremotesearchresults.h | 19 +- .../http/getmusicalbumremotesearchresults.h | 19 +- .../http/getmusicartistremotesearchresults.h | 19 +- .../JellyfinQt/loader/http/getmusicgenre.h | 10 +- .../loader/http/getmusicgenreimage.h | 5 +- .../loader/http/getmusicgenreimagebyindex.h | 5 +- .../JellyfinQt/loader/http/getmusicgenres.h | 10 +- .../http/getmusicvideoremotesearchresults.h | 19 +- .../loader/http/getnamedconfiguration.h | 18 +- .../JellyfinQt/loader/http/getnetworkshares.h | 19 +- .../JellyfinQt/loader/http/getnextup.h | 10 +- .../JellyfinQt/loader/http/getnotifications.h | 10 +- .../loader/http/getnotificationservices.h | 19 +- .../loader/http/getnotificationssummary.h | 10 +- .../loader/http/getnotificationtypes.h | 19 +- .../JellyfinQt/loader/http/getpackageinfo.h | 10 +- .../JellyfinQt/loader/http/getpackages.h | 19 +- .../loader/http/getparentalratings.h | 19 +- .../JellyfinQt/loader/http/getparentpath.h | 18 +- .../loader/http/getpasswordresetproviders.h | 19 +- .../JellyfinQt/loader/http/getperson.h | 10 +- .../JellyfinQt/loader/http/getpersonimage.h | 5 +- .../loader/http/getpersonimagebyindex.h | 5 +- .../http/getpersonremotesearchresults.h | 19 +- .../JellyfinQt/loader/http/getpersons.h | 10 +- .../JellyfinQt/loader/http/getphysicalpaths.h | 19 +- .../JellyfinQt/loader/http/getpingsystem.h | 18 +- .../JellyfinQt/loader/http/getplaybackinfo.h | 10 +- .../JellyfinQt/loader/http/getplaylistitems.h | 10 +- .../loader/http/getpluginconfiguration.h | 10 +- .../JellyfinQt/loader/http/getpluginimage.h | 5 +- .../loader/http/getpluginmanifest.h | 5 +- .../JellyfinQt/loader/http/getplugins.h | 19 +- .../loader/http/getpostedplaybackinfo.h | 10 +- .../JellyfinQt/loader/http/getprofile.h | 10 +- .../JellyfinQt/loader/http/getprofileinfos.h | 19 +- .../JellyfinQt/loader/http/getprogram.h | 10 +- .../JellyfinQt/loader/http/getprograms.h | 10 +- .../loader/http/getpublicsysteminfo.h | 10 +- .../JellyfinQt/loader/http/getpublicusers.h | 19 +- .../JellyfinQt/loader/http/getqueryfilters.h | 10 +- .../loader/http/getqueryfilterslegacy.h | 10 +- .../JellyfinQt/loader/http/getratingimage.h | 5 +- .../JellyfinQt/loader/http/getratingimages.h | 19 +- .../loader/http/getrecommendedprograms.h | 10 +- .../JellyfinQt/loader/http/getrecording.h | 10 +- .../loader/http/getrecordingfolders.h | 10 +- .../loader/http/getrecordinggroup.h | 5 +- .../loader/http/getrecordinggroups.h | 10 +- .../JellyfinQt/loader/http/getrecordings.h | 10 +- .../loader/http/getrecordingsseries.h | 10 +- .../JellyfinQt/loader/http/getremoteimage.h | 5 +- .../loader/http/getremoteimageproviders.h | 19 +- .../JellyfinQt/loader/http/getremoteimages.h | 10 +- .../loader/http/getremotesearchimage.h | 5 +- .../loader/http/getremotesubtitles.h | 5 +- .../JellyfinQt/loader/http/getrepositories.h | 19 +- .../JellyfinQt/loader/http/getresumeitems.h | 10 +- .../JellyfinQt/loader/http/getrootfolder.h | 10 +- .../loader/http/getschedulesdirectcountries.h | 18 +- .../JellyfinQt/loader/http/getseasons.h | 10 +- .../http/getseriesremotesearchresults.h | 19 +- .../JellyfinQt/loader/http/getseriestimer.h | 10 +- .../JellyfinQt/loader/http/getseriestimers.h | 10 +- .../JellyfinQt/loader/http/getserverlogs.h | 19 +- .../JellyfinQt/loader/http/getsessions.h | 19 +- .../JellyfinQt/loader/http/getsimilaralbums.h | 10 +- .../loader/http/getsimilarartists.h | 10 +- .../JellyfinQt/loader/http/getsimilaritems.h | 10 +- .../JellyfinQt/loader/http/getsimilarmovies.h | 10 +- .../JellyfinQt/loader/http/getsimilarshows.h | 10 +- .../loader/http/getsimilartrailers.h | 10 +- .../loader/http/getspecialfeatures.h | 19 +- .../loader/http/getstartupconfiguration.h | 10 +- .../JellyfinQt/loader/http/getstatus.h | 10 +- .../JellyfinQt/loader/http/getstudio.h | 10 +- .../JellyfinQt/loader/http/getstudioimage.h | 5 +- .../loader/http/getstudioimagebyindex.h | 5 +- .../JellyfinQt/loader/http/getstudios.h | 10 +- .../JellyfinQt/loader/http/getsubtitle.h | 5 +- .../loader/http/getsubtitleplaylist.h | 5 +- .../loader/http/getsubtitlewithticks.h | 5 +- .../JellyfinQt/loader/http/getsuggestions.h | 10 +- .../JellyfinQt/loader/http/getsysteminfo.h | 10 +- core/include/JellyfinQt/loader/http/gettask.h | 10 +- .../include/JellyfinQt/loader/http/gettasks.h | 19 +- .../JellyfinQt/loader/http/getthememedia.h | 10 +- .../JellyfinQt/loader/http/getthemesongs.h | 10 +- .../JellyfinQt/loader/http/getthemevideos.h | 10 +- .../include/JellyfinQt/loader/http/gettimer.h | 10 +- .../JellyfinQt/loader/http/gettimers.h | 10 +- .../http/gettrailerremotesearchresults.h | 19 +- .../JellyfinQt/loader/http/gettrailers.h | 10 +- .../loader/http/gettunerhosttypes.h | 19 +- .../loader/http/getuniversalaudiostream.h | 5 +- .../loader/http/getupcomingepisodes.h | 10 +- .../JellyfinQt/loader/http/getuserbyid.h | 10 +- .../JellyfinQt/loader/http/getuserimage.h | 5 +- .../loader/http/getuserimagebyindex.h | 5 +- .../include/JellyfinQt/loader/http/getusers.h | 19 +- .../JellyfinQt/loader/http/getuserviews.h | 10 +- .../JellyfinQt/loader/http/getutctime.h | 10 +- .../loader/http/getvarianthlsaudioplaylist.h | 5 +- .../loader/http/getvarianthlsvideoplaylist.h | 5 +- .../JellyfinQt/loader/http/getvideostream.h | 5 +- .../loader/http/getvideostreambycontainer.h | 5 +- .../loader/http/getvirtualfolders.h | 19 +- .../JellyfinQt/loader/http/getwakeonlaninfo.h | 19 +- core/include/JellyfinQt/loader/http/getyear.h | 10 +- .../include/JellyfinQt/loader/http/getyears.h | 10 +- .../JellyfinQt/loader/http/headartistimage.h | 5 +- .../JellyfinQt/loader/http/headaudiostream.h | 5 +- .../loader/http/headaudiostreambycontainer.h | 5 +- .../JellyfinQt/loader/http/headgenreimage.h | 5 +- .../loader/http/headgenreimagebyindex.h | 5 +- .../JellyfinQt/loader/http/headitemimage.h | 5 +- .../JellyfinQt/loader/http/headitemimage2.h | 5 +- .../loader/http/headitemimagebyindex.h | 5 +- .../loader/http/headmasterhlsaudioplaylist.h | 5 +- .../loader/http/headmasterhlsvideoplaylist.h | 5 +- .../loader/http/headmusicgenreimage.h | 5 +- .../loader/http/headmusicgenreimagebyindex.h | 5 +- .../JellyfinQt/loader/http/headpersonimage.h | 5 +- .../loader/http/headpersonimagebyindex.h | 5 +- .../JellyfinQt/loader/http/headstudioimage.h | 5 +- .../loader/http/headstudioimagebyindex.h | 5 +- .../loader/http/headuniversalaudiostream.h | 5 +- .../JellyfinQt/loader/http/headuserimage.h | 5 +- .../loader/http/headuserimagebyindex.h | 5 +- .../JellyfinQt/loader/http/headvideostream.h | 5 +- .../loader/http/headvideostreambycontainer.h | 5 +- .../include/JellyfinQt/loader/http/initiate.h | 10 +- .../JellyfinQt/loader/http/installpackage.h | 5 +- .../JellyfinQt/loader/http/markfavoriteitem.h | 10 +- .../JellyfinQt/loader/http/markplayeditem.h | 10 +- .../JellyfinQt/loader/http/markunplayeditem.h | 10 +- .../JellyfinQt/loader/http/mergeversions.h | 5 +- .../include/JellyfinQt/loader/http/moveitem.h | 5 +- .../loader/http/onplaybackprogress.h | 5 +- .../JellyfinQt/loader/http/onplaybackstart.h | 5 +- .../loader/http/onplaybackstopped.h | 5 +- .../JellyfinQt/loader/http/openlivestream.h | 10 +- .../loader/http/pingplaybacksession.h | 5 +- core/include/JellyfinQt/loader/http/play.h | 5 +- core/include/JellyfinQt/loader/http/post.h | 5 +- .../JellyfinQt/loader/http/postaddedmovies.h | 5 +- .../JellyfinQt/loader/http/postaddedseries.h | 5 +- .../JellyfinQt/loader/http/postcapabilities.h | 5 +- .../loader/http/postfullcapabilities.h | 5 +- .../JellyfinQt/loader/http/postpingsystem.h | 18 +- .../JellyfinQt/loader/http/postupdatedmedia.h | 5 +- .../loader/http/postupdatedmovies.h | 5 +- .../loader/http/postupdatedseries.h | 5 +- .../JellyfinQt/loader/http/postuserimage.h | 5 +- .../loader/http/postuserimagebyindex.h | 5 +- .../processconnectionmanagercontrolrequest.h | 5 +- .../processcontentdirectorycontrolrequest.h | 5 +- ...cessmediareceiverregistrarcontrolrequest.h | 5 +- .../JellyfinQt/loader/http/refreshlibrary.h | 5 +- .../loader/http/removefromcollection.h | 5 +- .../loader/http/removefromplaylist.h | 5 +- .../JellyfinQt/loader/http/removemediapath.h | 5 +- .../loader/http/removeuserfromsession.h | 5 +- .../loader/http/removevirtualfolder.h | 5 +- .../loader/http/renamevirtualfolder.h | 5 +- .../loader/http/reportplaybackprogress.h | 5 +- .../loader/http/reportplaybackstart.h | 5 +- .../loader/http/reportplaybackstopped.h | 5 +- .../loader/http/reportsessionended.h | 5 +- .../JellyfinQt/loader/http/reportviewing.h | 5 +- .../JellyfinQt/loader/http/resettuner.h | 5 +- .../loader/http/restartapplication.h | 5 +- .../JellyfinQt/loader/http/revokekey.h | 5 +- .../loader/http/searchremotesubtitles.h | 19 +- .../loader/http/sendfullgeneralcommand.h | 5 +- .../loader/http/sendgeneralcommand.h | 5 +- .../loader/http/sendmessagecommand.h | 5 +- .../loader/http/sendplaystatecommand.h | 5 +- .../loader/http/sendsystemcommand.h | 5 +- .../loader/http/setchannelmapping.h | 10 +- .../JellyfinQt/loader/http/setitemimage.h | 5 +- .../loader/http/setitemimagebyindex.h | 5 +- core/include/JellyfinQt/loader/http/setread.h | 5 +- .../JellyfinQt/loader/http/setremoteaccess.h | 5 +- .../JellyfinQt/loader/http/setrepositories.h | 5 +- .../JellyfinQt/loader/http/setunread.h | 5 +- .../loader/http/shutdownapplication.h | 5 +- .../JellyfinQt/loader/http/starttask.h | 5 +- .../loader/http/stopencodingprocess.h | 5 +- .../include/JellyfinQt/loader/http/stoptask.h | 5 +- .../loader/http/syncplaybuffering.h | 5 +- .../loader/http/syncplaycreategroup.h | 5 +- .../loader/http/syncplaygetgroups.h | 19 +- .../loader/http/syncplayjoingroup.h | 5 +- .../loader/http/syncplayleavegroup.h | 5 +- .../loader/http/syncplaymoveplaylistitem.h | 5 +- .../JellyfinQt/loader/http/syncplaynextitem.h | 5 +- .../JellyfinQt/loader/http/syncplaypause.h | 5 +- .../JellyfinQt/loader/http/syncplayping.h | 5 +- .../loader/http/syncplaypreviousitem.h | 5 +- .../JellyfinQt/loader/http/syncplayqueue.h | 5 +- .../JellyfinQt/loader/http/syncplayready.h | 5 +- .../loader/http/syncplayremovefromplaylist.h | 5 +- .../JellyfinQt/loader/http/syncplayseek.h | 5 +- .../loader/http/syncplaysetignorewait.h | 5 +- .../loader/http/syncplaysetnewqueue.h | 5 +- .../loader/http/syncplaysetplaylistitem.h | 5 +- .../loader/http/syncplaysetrepeatmode.h | 5 +- .../loader/http/syncplaysetshufflemode.h | 5 +- .../JellyfinQt/loader/http/syncplaystop.h | 5 +- .../JellyfinQt/loader/http/syncplayunpause.h | 5 +- .../JellyfinQt/loader/http/uninstallplugin.h | 5 +- .../loader/http/uninstallpluginbyversion.h | 5 +- .../loader/http/unmarkfavoriteitem.h | 10 +- .../loader/http/updateconfiguration.h | 5 +- .../loader/http/updatedeviceoptions.h | 5 +- .../loader/http/updatedisplaypreferences.h | 5 +- .../loader/http/updateinitialconfiguration.h | 5 +- .../JellyfinQt/loader/http/updateitem.h | 5 +- .../loader/http/updateitemcontenttype.h | 5 +- .../loader/http/updateitemimageindex.h | 5 +- .../loader/http/updatelibraryoptions.h | 5 +- .../loader/http/updatemediaencoderpath.h | 5 +- .../JellyfinQt/loader/http/updatemediapath.h | 5 +- .../loader/http/updatenamedconfiguration.h | 5 +- .../loader/http/updatepluginconfiguration.h | 5 +- .../loader/http/updatepluginsecurityinfo.h | 5 +- .../JellyfinQt/loader/http/updateprofile.h | 5 +- .../loader/http/updateseriestimer.h | 5 +- .../loader/http/updatestartupuser.h | 5 +- .../JellyfinQt/loader/http/updatetask.h | 5 +- .../JellyfinQt/loader/http/updatetimer.h | 5 +- .../JellyfinQt/loader/http/updateuser.h | 5 +- .../loader/http/updateuserconfiguration.h | 5 +- .../loader/http/updateusereasypassword.h | 5 +- .../loader/http/updateuseritemrating.h | 10 +- .../loader/http/updateuserpassword.h | 5 +- .../JellyfinQt/loader/http/updateuserpolicy.h | 5 +- .../JellyfinQt/loader/http/uploadsubtitle.h | 5 +- .../JellyfinQt/loader/http/validatepath.h | 5 +- core/include/JellyfinQt/loader/requesttypes.h | 38 +- .../JellyfinQt/{ => model}/deviceprofile.h | 8 +- core/include/JellyfinQt/support/jsonconv.h | 95 +- core/include/JellyfinQt/support/loader.h | 108 +- core/include/JellyfinQt/viewmodel/itemmodel.h | 3 + core/include/JellyfinQt/viewmodel/loader.h | 9 +- core/openapigenerator.d | 60 +- core/src/DTO/accessschedule.cpp | 109 -- core/src/DTO/activitylogentry.cpp | 149 -- core/src/DTO/activitylogentryqueryresult.cpp | 93 -- core/src/DTO/addvirtualfolderdto.cpp | 77 - core/src/DTO/albuminfo.cpp | 173 --- core/src/DTO/albuminforemotesearchquery.cpp | 101 -- core/src/DTO/allthememediaresult.cpp | 93 -- core/src/DTO/architecture.cpp | 69 - core/src/DTO/artistinfo.cpp | 157 -- core/src/DTO/artistinforemotesearchquery.cpp | 101 -- core/src/DTO/authenticateuserbyname.cpp | 93 -- core/src/DTO/authenticationinfo.cpp | 165 --- .../src/DTO/authenticationinfoqueryresult.cpp | 93 -- core/src/DTO/authenticationresult.cpp | 101 -- core/src/DTO/baseitem.cpp | 157 -- core/src/DTO/baseitemdto.cpp | 1277 ----------------- core/src/DTO/baseitemdtoqueryresult.cpp | 93 -- core/src/DTO/baseitemperson.cpp | 117 -- core/src/DTO/basepluginconfiguration.cpp | 0 core/src/DTO/bookinfo.cpp | 157 -- core/src/DTO/bookinforemotesearchquery.cpp | 101 -- core/src/DTO/boxsetinfo.cpp | 149 -- core/src/DTO/boxsetinforemotesearchquery.cpp | 101 -- core/src/DTO/brandingoptions.cpp | 85 -- core/src/DTO/bufferrequestdto.cpp | 101 -- core/src/DTO/channelfeatures.cpp | 165 --- core/src/DTO/channelitemsortfield.cpp | 75 - core/src/DTO/channelmappingoptionsdto.cpp | 101 -- core/src/DTO/channelmediacontenttype.cpp | 78 - core/src/DTO/channelmediatype.cpp | 63 - core/src/DTO/channeltype.cpp | 60 - core/src/DTO/chapterinfo.cpp | 109 -- core/src/DTO/clientcapabilities.cpp | 149 -- core/src/DTO/clientcapabilitiesdto.cpp | 149 -- core/src/DTO/codecprofile.cpp | 109 -- core/src/DTO/codectype.cpp | 63 - core/src/DTO/collectioncreationresult.cpp | 77 - core/src/DTO/configurationpageinfo.cpp | 125 -- core/src/DTO/configurationpagetype.cpp | 60 - core/src/DTO/containerprofile.cpp | 93 -- core/src/DTO/controlresponse.cpp | 93 -- core/src/DTO/countryinfo.cpp | 101 -- core/src/DTO/createplaylistdto.cpp | 101 -- core/src/DTO/createuserbyname.cpp | 85 -- core/src/DTO/culturedto.cpp | 109 -- core/src/DTO/dayofweek.cpp | 75 - core/src/DTO/daypattern.cpp | 63 - .../DTO/defaultdirectorybrowserinfodto.cpp | 77 - core/src/DTO/deviceidentification.cpp | 141 -- core/src/DTO/deviceinfo.cpp | 141 -- core/src/DTO/deviceinfoqueryresult.cpp | 93 -- core/src/DTO/deviceoptions.cpp | 77 - core/src/DTO/deviceprofile.cpp | 381 ----- core/src/DTO/deviceprofileinfo.cpp | 93 -- core/src/DTO/deviceprofiletype.cpp | 60 - core/src/DTO/directplayprofile.cpp | 101 -- core/src/DTO/displaypreferencesdto.cpp | 181 --- core/src/DTO/dlnaprofiletype.cpp | 63 - core/src/DTO/dynamicdayofweek.cpp | 84 -- core/src/DTO/encodingcontext.cpp | 60 - core/src/DTO/endpointinfo.cpp | 85 -- core/src/DTO/externalidinfo.cpp | 101 -- core/src/DTO/externalidmediatype.cpp | 90 -- core/src/DTO/externalurl.cpp | 85 -- core/src/DTO/ffmpeglocation.cpp | 66 - core/src/DTO/filesystementryinfo.cpp | 93 -- core/src/DTO/filesystementrytype.cpp | 66 - core/src/DTO/fontfile.cpp | 101 -- core/src/DTO/forgotpasswordaction.cpp | 63 - core/src/DTO/forgotpassworddto.cpp | 77 - core/src/DTO/forgotpasswordresult.cpp | 93 -- core/src/DTO/generalcommand.cpp | 93 -- core/src/DTO/generalcommandtype.cpp | 177 --- core/src/DTO/getprogramsdto.cpp | 285 ---- core/src/DTO/groupinfodto.cpp | 109 -- core/src/DTO/groupqueuemode.cpp | 60 - core/src/DTO/grouprepeatmode.cpp | 63 - core/src/DTO/groupshufflemode.cpp | 60 - core/src/DTO/groupstatetype.cpp | 66 - core/src/DTO/groupupdatetype.cpp | 87 -- core/src/DTO/guideinfo.cpp | 85 -- core/src/DTO/headermatchtype.cpp | 63 - core/src/DTO/httpheaderinfo.cpp | 93 -- core/src/DTO/ignorewaitrequestdto.cpp | 77 - core/src/DTO/imagebynameinfo.cpp | 109 -- core/src/DTO/imageformat.cpp | 69 - core/src/DTO/imageinfo.cpp | 133 -- core/src/DTO/imageoption.cpp | 93 -- core/src/DTO/imageorientation.cpp | 78 - core/src/DTO/imageproviderinfo.cpp | 85 -- core/src/DTO/imagesavingconvention.cpp | 60 - core/src/DTO/imagetype.cpp | 93 -- core/src/DTO/installationinfo.cpp | 117 -- core/src/DTO/iplugin.cpp | 125 -- core/src/DTO/isotype.cpp | 60 - core/src/DTO/itemcounts.cpp | 165 --- core/src/DTO/itemfields.cpp | 237 --- core/src/DTO/itemfilter.cpp | 81 -- core/src/DTO/joingrouprequestdto.cpp | 77 - core/src/DTO/keepuntil.cpp | 66 - core/src/DTO/libraryoptioninfodto.cpp | 85 -- core/src/DTO/libraryoptions.cpp | 269 ---- core/src/DTO/libraryoptionsresultdto.cpp | 101 -- core/src/DTO/librarytypeoptionsdto.cpp | 109 -- core/src/DTO/libraryupdateinfo.cpp | 125 -- core/src/DTO/listingsproviderinfo.cpp | 213 --- core/src/DTO/livestreamresponse.cpp | 77 - core/src/DTO/livetvinfo.cpp | 93 -- core/src/DTO/livetvserviceinfo.cpp | 133 -- core/src/DTO/livetvservicestatus.cpp | 60 - core/src/DTO/localizationoption.cpp | 85 -- core/src/DTO/locationtype.cpp | 66 - core/src/DTO/logfile.cpp | 101 -- core/src/DTO/loglevel.cpp | 75 - core/src/DTO/mediaattachment.cpp | 125 -- core/src/DTO/mediaencoderpathdto.cpp | 85 -- core/src/DTO/mediapathdto.cpp | 93 -- core/src/DTO/mediapathinfo.cpp | 85 -- core/src/DTO/mediaprotocol.cpp | 75 - core/src/DTO/mediasourceinfo.cpp | 405 ------ core/src/DTO/mediasourcetype.cpp | 63 - core/src/DTO/mediastream.cpp | 445 ------ core/src/DTO/mediastreamtype.cpp | 66 - core/src/DTO/mediaupdateinfodto.cpp | 85 -- core/src/DTO/mediaurl.cpp | 85 -- core/src/DTO/metadataeditorinfo.cpp | 117 -- core/src/DTO/metadatafield.cpp | 81 -- core/src/DTO/metadataoptions.cpp | 125 -- core/src/DTO/metadatarefreshmode.cpp | 66 - core/src/DTO/moveplaylistitemrequestdto.cpp | 85 -- core/src/DTO/movieinfo.cpp | 149 -- core/src/DTO/movieinforemotesearchquery.cpp | 101 -- core/src/DTO/musicvideoinfo.cpp | 157 -- .../DTO/musicvideoinforemotesearchquery.cpp | 101 -- core/src/DTO/nameguidpair.cpp | 85 -- core/src/DTO/nameidpair.cpp | 85 -- core/src/DTO/namevaluepair.cpp | 85 -- core/src/DTO/newgrouprequestdto.cpp | 77 - core/src/DTO/nextitemrequestdto.cpp | 77 - core/src/DTO/notificationdto.cpp | 133 -- core/src/DTO/notificationlevel.cpp | 63 - core/src/DTO/notificationresultdto.cpp | 85 -- core/src/DTO/notificationssummarydto.cpp | 85 -- core/src/DTO/notificationtypeinfo.cpp | 109 -- core/src/DTO/objectgroupupdate.cpp | 93 -- core/src/DTO/openlivestreamdto.cpp | 173 --- core/src/DTO/packageinfo.cpp | 133 -- core/src/DTO/parentalrating.cpp | 85 -- core/src/DTO/pathsubstitution.cpp | 85 -- core/src/DTO/personlookupinfo.cpp | 149 -- .../DTO/personlookupinforemotesearchquery.cpp | 101 -- core/src/DTO/pingrequestdto.cpp | 77 - core/src/DTO/pinredeemresult.cpp | 85 -- core/src/DTO/playaccess.cpp | 60 - core/src/DTO/playbackerrorcode.cpp | 63 - core/src/DTO/playbackinfodto.cpp | 189 --- core/src/DTO/playbackinforesponse.cpp | 93 -- core/src/DTO/playbackprogressinfo.cpp | 229 --- core/src/DTO/playbackstartinfo.cpp | 229 --- core/src/DTO/playbackstopinfo.cpp | 157 -- core/src/DTO/playcommand.cpp | 69 - core/src/DTO/playerstateinfo.cpp | 149 -- core/src/DTO/playlistcreationresult.cpp | 77 - core/src/DTO/playmethod.cpp | 63 - core/src/DTO/playrequest.cpp | 133 -- core/src/DTO/playrequestdto.cpp | 93 -- core/src/DTO/playstatecommand.cpp | 81 -- core/src/DTO/playstaterequest.cpp | 93 -- core/src/DTO/plugininfo.cpp | 133 -- core/src/DTO/pluginsecurityinfo.cpp | 85 -- core/src/DTO/pluginstatus.cpp | 75 - core/src/DTO/previousitemrequestdto.cpp | 77 - core/src/DTO/problemdetails.cpp | 109 -- core/src/DTO/profilecondition.cpp | 101 -- core/src/DTO/profileconditiontype.cpp | 69 - core/src/DTO/profileconditionvalue.cpp | 123 -- core/src/DTO/programaudio.cpp | 72 - core/src/DTO/publicsysteminfo.cpp | 125 -- core/src/DTO/queryfilters.cpp | 85 -- core/src/DTO/queryfilterslegacy.cpp | 101 -- core/src/DTO/queueitem.cpp | 85 -- core/src/DTO/queuerequestdto.cpp | 85 -- core/src/DTO/quickconnectdto.cpp | 77 - core/src/DTO/quickconnectresult.cpp | 117 -- core/src/DTO/quickconnectstate.cpp | 63 - core/src/DTO/ratingtype.cpp | 60 - core/src/DTO/readyrequestdto.cpp | 101 -- core/src/DTO/recommendationdto.cpp | 101 -- core/src/DTO/recommendationtype.cpp | 72 - core/src/DTO/recordingstatus.cpp | 75 - core/src/DTO/remoteimageinfo.cpp | 149 -- core/src/DTO/remoteimageresult.cpp | 93 -- core/src/DTO/remotesearchresult.cpp | 165 --- core/src/DTO/remotesubtitleinfo.cpp | 157 -- core/src/DTO/removefromplaylistrequestdto.cpp | 77 - core/src/DTO/repeatmode.cpp | 63 - core/src/DTO/repositoryinfo.cpp | 93 -- core/src/DTO/responseprofile.cpp | 125 -- core/src/DTO/scrolldirection.cpp | 60 - core/src/DTO/searchhint.cpp | 301 ---- core/src/DTO/searchhintresult.cpp | 85 -- core/src/DTO/seekrequestdto.cpp | 77 - core/src/DTO/sendcommand.cpp | 117 -- core/src/DTO/sendcommandtype.cpp | 66 - core/src/DTO/seriesinfo.cpp | 149 -- core/src/DTO/seriesinforemotesearchquery.cpp | 101 -- core/src/DTO/seriesstatus.cpp | 60 - core/src/DTO/seriestimerinfodto.cpp | 349 ----- .../src/DTO/seriestimerinfodtoqueryresult.cpp | 93 -- core/src/DTO/serverconfiguration.cpp | 749 ---------- core/src/DTO/sessioninfo.cpp | 293 ---- core/src/DTO/sessionuserinfo.cpp | 85 -- core/src/DTO/setchannelmappingdto.cpp | 93 -- core/src/DTO/setplaylistitemrequestdto.cpp | 77 - core/src/DTO/setrepeatmoderequestdto.cpp | 77 - core/src/DTO/setshufflemoderequestdto.cpp | 77 - core/src/DTO/songinfo.cpp | 173 --- core/src/DTO/sortorder.cpp | 60 - core/src/DTO/specialviewoptiondto.cpp | 85 -- core/src/DTO/startupconfigurationdto.cpp | 93 -- core/src/DTO/startupremoteaccessdto.cpp | 85 -- core/src/DTO/startupuserdto.cpp | 85 -- core/src/DTO/subtitledeliverymethod.cpp | 66 - core/src/DTO/subtitleplaybackmode.cpp | 69 - core/src/DTO/subtitleprofile.cpp | 109 -- core/src/DTO/syncplayuseraccesstype.cpp | 63 - core/src/DTO/systeminfo.cpp | 277 ---- core/src/DTO/taskcompletionstatus.cpp | 66 - core/src/DTO/taskinfo.cpp | 149 -- core/src/DTO/taskresult.cpp | 133 -- core/src/DTO/taskstate.cpp | 63 - core/src/DTO/tasktriggerinfo.cpp | 109 -- core/src/DTO/thememediaresult.cpp | 101 -- core/src/DTO/timereventinfo.cpp | 85 -- core/src/DTO/timerinfodto.cpp | 293 ---- core/src/DTO/timerinfodtoqueryresult.cpp | 93 -- core/src/DTO/trailerinfo.cpp | 149 -- core/src/DTO/trailerinforemotesearchquery.cpp | 101 -- core/src/DTO/transcodereason.cpp | 123 -- core/src/DTO/transcodeseekinfo.cpp | 60 - core/src/DTO/transcodinginfo.cpp | 165 --- core/src/DTO/transcodingprofile.cpp | 189 --- core/src/DTO/transportstreamtimestamp.cpp | 63 - core/src/DTO/tunerchannelmapping.cpp | 101 -- core/src/DTO/tunerhostinfo.cpp | 157 -- core/src/DTO/typeoptions.cpp | 117 -- core/src/DTO/unrateditem.cpp | 81 -- core/src/DTO/updatelibraryoptionsdto.cpp | 85 -- core/src/DTO/updateusereasypassword.cpp | 93 -- core/src/DTO/updateuserpassword.cpp | 101 -- core/src/DTO/uploadsubtitledto.cpp | 101 -- core/src/DTO/userconfiguration.cpp | 189 --- core/src/DTO/userdto.cpp | 181 --- core/src/DTO/useritemdatadto.cpp | 157 -- core/src/DTO/userpolicy.cpp | 381 ----- core/src/DTO/utctimeresponse.cpp | 85 -- core/src/DTO/validatepathdto.cpp | 93 -- core/src/DTO/version.cpp | 117 -- core/src/DTO/versioninfo.cpp | 141 -- core/src/DTO/video3dformat.cpp | 69 - core/src/DTO/videotype.cpp | 66 - core/src/DTO/virtualfolderinfo.cpp | 133 -- core/src/DTO/wakeonlaninfo.cpp | 85 -- core/src/DTO/xmlattribute.cpp | 85 -- core/src/apiclient.cpp | 11 +- core/src/apimodel.cpp | 6 +- core/src/dto/accessschedule.cpp | 11 +- core/src/dto/activitylogentry.cpp | 11 +- core/src/dto/activitylogentryqueryresult.cpp | 11 +- core/src/dto/addvirtualfolderdto.cpp | 11 +- core/src/dto/albuminfo.cpp | 35 +- core/src/dto/albuminforemotesearchquery.cpp | 11 +- core/src/dto/allthememediaresult.cpp | 11 +- core/src/dto/architecture.cpp | 23 +- core/src/dto/artistinfo.cpp | 23 +- core/src/dto/artistinforemotesearchquery.cpp | 11 +- core/src/dto/authenticateuserbyname.cpp | 11 +- core/src/dto/authenticationinfo.cpp | 11 +- .../src/dto/authenticationinfoqueryresult.cpp | 11 +- core/src/dto/authenticationresult.cpp | 11 +- core/src/dto/baseitem.cpp | 11 +- core/src/dto/baseitemdto.cpp | 47 +- core/src/dto/baseitemdtoqueryresult.cpp | 11 +- core/src/dto/baseitemperson.cpp | 23 +- core/src/dto/bookinfo.cpp | 23 +- core/src/dto/bookinforemotesearchquery.cpp | 11 +- core/src/dto/boxsetinfo.cpp | 23 +- core/src/dto/boxsetinforemotesearchquery.cpp | 11 +- core/src/dto/brandingoptions.cpp | 11 +- core/src/dto/bufferrequestdto.cpp | 11 +- core/src/dto/channelfeatures.cpp | 11 +- core/src/dto/channelitemsortfield.cpp | 27 +- core/src/dto/channelmappingoptionsdto.cpp | 11 +- core/src/dto/channelmediacontenttype.cpp | 29 +- core/src/dto/channelmediatype.cpp | 19 +- core/src/dto/channeltype.cpp | 17 +- core/src/dto/chapterinfo.cpp | 11 +- core/src/dto/clientcapabilities.cpp | 11 +- core/src/dto/clientcapabilitiesdto.cpp | 11 +- core/src/dto/codecprofile.cpp | 11 +- core/src/dto/codectype.cpp | 19 +- core/src/dto/collectioncreationresult.cpp | 11 +- core/src/dto/configurationpageinfo.cpp | 11 +- core/src/dto/configurationpagetype.cpp | 17 +- core/src/dto/containerprofile.cpp | 11 +- core/src/dto/controlresponse.cpp | 23 +- core/src/dto/countryinfo.cpp | 11 +- core/src/dto/createplaylistdto.cpp | 11 +- core/src/dto/createuserbyname.cpp | 11 +- core/src/dto/culturedto.cpp | 11 +- core/src/dto/dayofweek.cpp | 27 +- core/src/dto/daypattern.cpp | 19 +- .../dto/defaultdirectorybrowserinfodto.cpp | 11 +- core/src/dto/deviceidentification.cpp | 11 +- core/src/dto/deviceinfo.cpp | 11 +- core/src/dto/deviceinfoqueryresult.cpp | 11 +- core/src/dto/deviceoptions.cpp | 11 +- core/src/dto/deviceprofile.cpp | 11 +- core/src/dto/deviceprofileinfo.cpp | 11 +- core/src/dto/deviceprofiletype.cpp | 17 +- core/src/dto/directplayprofile.cpp | 11 +- core/src/dto/displaypreferencesdto.cpp | 23 +- core/src/dto/dlnaprofiletype.cpp | 19 +- core/src/dto/dynamicdayofweek.cpp | 33 +- core/src/dto/encodingcontext.cpp | 17 +- core/src/dto/endpointinfo.cpp | 11 +- core/src/dto/externalidinfo.cpp | 11 +- core/src/dto/externalidmediatype.cpp | 37 +- core/src/dto/externalurl.cpp | 11 +- core/src/dto/ffmpeglocation.cpp | 21 +- core/src/dto/filesystementryinfo.cpp | 11 +- core/src/dto/filesystementrytype.cpp | 21 +- core/src/dto/fontfile.cpp | 11 +- core/src/dto/forgotpasswordaction.cpp | 19 +- core/src/dto/forgotpassworddto.cpp | 11 +- core/src/dto/forgotpasswordresult.cpp | 11 +- core/src/dto/generalcommand.cpp | 23 +- core/src/dto/generalcommandtype.cpp | 95 +- core/src/dto/getprogramsdto.cpp | 11 +- core/src/dto/groupinfodto.cpp | 11 +- core/src/dto/groupqueuemode.cpp | 17 +- core/src/dto/grouprepeatmode.cpp | 19 +- core/src/dto/groupshufflemode.cpp | 17 +- core/src/dto/groupstatetype.cpp | 21 +- core/src/dto/groupupdatetype.cpp | 35 +- core/src/dto/guideinfo.cpp | 11 +- core/src/dto/headermatchtype.cpp | 19 +- core/src/dto/httpheaderinfo.cpp | 11 +- core/src/dto/ignorewaitrequestdto.cpp | 11 +- core/src/dto/imagebynameinfo.cpp | 11 +- core/src/dto/imageformat.cpp | 23 +- core/src/dto/imageinfo.cpp | 11 +- core/src/dto/imageoption.cpp | 11 +- core/src/dto/imageorientation.cpp | 29 +- core/src/dto/imageproviderinfo.cpp | 11 +- core/src/dto/imagesavingconvention.cpp | 17 +- core/src/dto/imagetype.cpp | 39 +- core/src/dto/installationinfo.cpp | 11 +- core/src/dto/iplugin.cpp | 11 +- core/src/dto/isotype.cpp | 17 +- core/src/dto/itemcounts.cpp | 11 +- core/src/dto/itemfields.cpp | 135 +- core/src/dto/itemfilter.cpp | 31 +- core/src/dto/joingrouprequestdto.cpp | 11 +- core/src/dto/keepuntil.cpp | 21 +- core/src/dto/libraryoptioninfodto.cpp | 11 +- core/src/dto/libraryoptions.cpp | 11 +- core/src/dto/libraryoptionsresultdto.cpp | 11 +- core/src/dto/librarytypeoptionsdto.cpp | 11 +- core/src/dto/libraryupdateinfo.cpp | 11 +- core/src/dto/listingsproviderinfo.cpp | 11 +- core/src/dto/livestreamresponse.cpp | 11 +- core/src/dto/livetvinfo.cpp | 11 +- core/src/dto/livetvserviceinfo.cpp | 11 +- core/src/dto/livetvservicestatus.cpp | 17 +- core/src/dto/localizationoption.cpp | 11 +- core/src/dto/locationtype.cpp | 21 +- core/src/dto/logfile.cpp | 11 +- core/src/dto/loglevel.cpp | 27 +- core/src/dto/mediaattachment.cpp | 11 +- core/src/dto/mediaencoderpathdto.cpp | 11 +- core/src/dto/mediapathdto.cpp | 11 +- core/src/dto/mediapathinfo.cpp | 11 +- core/src/dto/mediaprotocol.cpp | 27 +- core/src/dto/mediasourceinfo.cpp | 23 +- core/src/dto/mediasourcetype.cpp | 19 +- core/src/dto/mediastream.cpp | 11 +- core/src/dto/mediastreamtype.cpp | 21 +- core/src/dto/mediaupdateinfodto.cpp | 11 +- core/src/dto/mediaurl.cpp | 11 +- core/src/dto/metadataeditorinfo.cpp | 11 +- core/src/dto/metadatafield.cpp | 31 +- core/src/dto/metadataoptions.cpp | 11 +- core/src/dto/metadatarefreshmode.cpp | 21 +- core/src/dto/moveplaylistitemrequestdto.cpp | 11 +- core/src/dto/movieinfo.cpp | 23 +- core/src/dto/movieinforemotesearchquery.cpp | 11 +- core/src/dto/musicvideoinfo.cpp | 23 +- .../dto/musicvideoinforemotesearchquery.cpp | 11 +- core/src/dto/nameguidpair.cpp | 11 +- core/src/dto/nameidpair.cpp | 11 +- core/src/dto/namevaluepair.cpp | 11 +- core/src/dto/newgrouprequestdto.cpp | 11 +- core/src/dto/nextitemrequestdto.cpp | 11 +- core/src/dto/notificationdto.cpp | 11 +- core/src/dto/notificationlevel.cpp | 19 +- core/src/dto/notificationresultdto.cpp | 11 +- core/src/dto/notificationssummarydto.cpp | 11 +- core/src/dto/notificationtypeinfo.cpp | 11 +- core/src/dto/objectgroupupdate.cpp | 11 +- core/src/dto/openlivestreamdto.cpp | 11 +- core/src/dto/packageinfo.cpp | 11 +- core/src/dto/parentalrating.cpp | 11 +- core/src/dto/pathsubstitution.cpp | 11 +- core/src/dto/personlookupinfo.cpp | 23 +- .../dto/personlookupinforemotesearchquery.cpp | 11 +- core/src/dto/pingrequestdto.cpp | 11 +- core/src/dto/pinredeemresult.cpp | 11 +- core/src/dto/playaccess.cpp | 17 +- core/src/dto/playbackerrorcode.cpp | 19 +- core/src/dto/playbackinfodto.cpp | 11 +- core/src/dto/playbackinforesponse.cpp | 11 +- core/src/dto/playbackprogressinfo.cpp | 11 +- core/src/dto/playbackstartinfo.cpp | 11 +- core/src/dto/playbackstopinfo.cpp | 11 +- core/src/dto/playcommand.cpp | 23 +- core/src/dto/playerstateinfo.cpp | 11 +- core/src/dto/playlistcreationresult.cpp | 11 +- core/src/dto/playmethod.cpp | 19 +- core/src/dto/playrequest.cpp | 11 +- core/src/dto/playrequestdto.cpp | 11 +- core/src/dto/playstatecommand.cpp | 31 +- core/src/dto/playstaterequest.cpp | 11 +- core/src/dto/plugininfo.cpp | 11 +- core/src/dto/pluginsecurityinfo.cpp | 11 +- core/src/dto/pluginstatus.cpp | 27 +- core/src/dto/previousitemrequestdto.cpp | 11 +- core/src/dto/problemdetails.cpp | 11 +- core/src/dto/profilecondition.cpp | 11 +- core/src/dto/profileconditiontype.cpp | 23 +- core/src/dto/profileconditionvalue.cpp | 59 +- core/src/dto/programaudio.cpp | 25 +- core/src/dto/publicsysteminfo.cpp | 11 +- core/src/dto/queryfilters.cpp | 11 +- core/src/dto/queryfilterslegacy.cpp | 11 +- core/src/dto/queueitem.cpp | 11 +- core/src/dto/queuerequestdto.cpp | 11 +- core/src/dto/quickconnectdto.cpp | 11 +- core/src/dto/quickconnectresult.cpp | 11 +- core/src/dto/quickconnectstate.cpp | 19 +- core/src/dto/ratingtype.cpp | 17 +- core/src/dto/readyrequestdto.cpp | 11 +- core/src/dto/recommendationdto.cpp | 11 +- core/src/dto/recommendationtype.cpp | 25 +- core/src/dto/recordingstatus.cpp | 27 +- core/src/dto/remoteimageinfo.cpp | 11 +- core/src/dto/remoteimageresult.cpp | 11 +- core/src/dto/remotesearchresult.cpp | 23 +- core/src/dto/remotesubtitleinfo.cpp | 11 +- core/src/dto/removefromplaylistrequestdto.cpp | 11 +- core/src/dto/repeatmode.cpp | 19 +- core/src/dto/repositoryinfo.cpp | 11 +- core/src/dto/responseprofile.cpp | 11 +- core/src/dto/scrolldirection.cpp | 17 +- core/src/dto/searchhint.cpp | 11 +- core/src/dto/searchhintresult.cpp | 11 +- core/src/dto/seekrequestdto.cpp | 11 +- core/src/dto/sendcommand.cpp | 11 +- core/src/dto/sendcommandtype.cpp | 21 +- core/src/dto/seriesinfo.cpp | 23 +- core/src/dto/seriesinforemotesearchquery.cpp | 11 +- core/src/dto/seriesstatus.cpp | 17 +- core/src/dto/seriestimerinfodto.cpp | 23 +- .../src/dto/seriestimerinfodtoqueryresult.cpp | 11 +- core/src/dto/serverconfiguration.cpp | 11 +- core/src/dto/sessioninfo.cpp | 11 +- core/src/dto/sessionuserinfo.cpp | 11 +- core/src/dto/setchannelmappingdto.cpp | 11 +- core/src/dto/setplaylistitemrequestdto.cpp | 11 +- core/src/dto/setrepeatmoderequestdto.cpp | 11 +- core/src/dto/setshufflemoderequestdto.cpp | 11 +- core/src/dto/songinfo.cpp | 23 +- core/src/dto/sortorder.cpp | 17 +- core/src/dto/specialviewoptiondto.cpp | 11 +- core/src/dto/startupconfigurationdto.cpp | 11 +- core/src/dto/startupremoteaccessdto.cpp | 11 +- core/src/dto/startupuserdto.cpp | 11 +- core/src/dto/subtitledeliverymethod.cpp | 21 +- core/src/dto/subtitleplaybackmode.cpp | 23 +- core/src/dto/subtitleprofile.cpp | 11 +- core/src/dto/syncplayuseraccesstype.cpp | 19 +- core/src/dto/systeminfo.cpp | 11 +- core/src/dto/taskcompletionstatus.cpp | 21 +- core/src/dto/taskinfo.cpp | 11 +- core/src/dto/taskresult.cpp | 11 +- core/src/dto/taskstate.cpp | 19 +- core/src/dto/tasktriggerinfo.cpp | 11 +- core/src/dto/thememediaresult.cpp | 11 +- core/src/dto/timereventinfo.cpp | 11 +- core/src/dto/timerinfodto.cpp | 11 +- core/src/dto/timerinfodtoqueryresult.cpp | 11 +- core/src/dto/trailerinfo.cpp | 23 +- core/src/dto/trailerinforemotesearchquery.cpp | 11 +- core/src/dto/transcodereason.cpp | 59 +- core/src/dto/transcodeseekinfo.cpp | 17 +- core/src/dto/transcodinginfo.cpp | 11 +- core/src/dto/transcodingprofile.cpp | 11 +- core/src/dto/transportstreamtimestamp.cpp | 19 +- core/src/dto/tunerchannelmapping.cpp | 11 +- core/src/dto/tunerhostinfo.cpp | 11 +- core/src/dto/typeoptions.cpp | 11 +- core/src/dto/unrateditem.cpp | 31 +- core/src/dto/updatelibraryoptionsdto.cpp | 11 +- core/src/dto/updateusereasypassword.cpp | 11 +- core/src/dto/updateuserpassword.cpp | 11 +- core/src/dto/uploadsubtitledto.cpp | 11 +- core/src/dto/userconfiguration.cpp | 11 +- core/src/dto/userdto.cpp | 11 +- core/src/dto/useritemdatadto.cpp | 11 +- core/src/dto/userpolicy.cpp | 11 +- core/src/dto/utctimeresponse.cpp | 11 +- core/src/dto/validatepathdto.cpp | 11 +- core/src/dto/version.cpp | 11 +- core/src/dto/versioninfo.cpp | 11 +- core/src/dto/video3dformat.cpp | 23 +- core/src/dto/videotype.cpp | 21 +- core/src/dto/virtualfolderinfo.cpp | 11 +- core/src/dto/wakeonlaninfo.cpp | 11 +- core/src/dto/xmlattribute.cpp | 11 +- core/src/jellyfin.cpp | 1 + core/src/loader/http/addlistingprovider.cpp | 9 +- core/src/loader/http/addtunerhost.cpp | 3 +- core/src/loader/http/authenticateuser.cpp | 9 +- .../loader/http/authenticateuserbyname.cpp | 3 +- .../http/authenticatewithquickconnect.cpp | 3 +- core/src/loader/http/authorize.cpp | 21 + core/src/loader/http/connect.cpp | 5 +- core/src/loader/http/createcollection.cpp | 11 +- core/src/loader/http/createplaylist.cpp | 11 +- core/src/loader/http/createuserbyname.cpp | 3 +- core/src/loader/http/deauthorize.cpp | 20 + core/src/loader/http/deleteuseritemrating.cpp | 5 +- core/src/loader/http/discovertuners.cpp | 23 + core/src/loader/http/discvovertuners.cpp | 23 + core/src/loader/http/forgotpassword.cpp | 3 +- core/src/loader/http/forgotpasswordpin.cpp | 3 +- core/src/loader/http/get.cpp | 39 +- core/src/loader/http/getadditionalpart.cpp | 7 +- core/src/loader/http/getalbumartists.cpp | 63 +- .../src/loader/http/getallchannelfeatures.cpp | 20 + core/src/loader/http/getancestors.cpp | 23 + core/src/loader/http/getartistbyname.cpp | 7 +- core/src/loader/http/getartists.cpp | 63 +- core/src/loader/http/getauthproviders.cpp | 20 + .../http/getbookremotesearchresults.cpp | 20 + .../http/getboxsetremotesearchresults.cpp | 20 + core/src/loader/http/getbrandingcss.cpp | 20 + core/src/loader/http/getbrandingcss_2.cpp | 20 + core/src/loader/http/getbrandingoptions.cpp | 3 +- core/src/loader/http/getchannel.cpp | 7 +- core/src/loader/http/getchannelfeatures.cpp | 5 +- core/src/loader/http/getchannelitems.cpp | 21 +- .../loader/http/getchannelmappingoptions.cpp | 5 +- core/src/loader/http/getchannels.cpp | 15 +- core/src/loader/http/getconfiguration.cpp | 3 +- .../src/loader/http/getconfigurationpages.cpp | 26 + core/src/loader/http/getcountries.cpp | 20 + core/src/loader/http/getcriticreviews.cpp | 5 +- core/src/loader/http/getcultures.cpp | 20 + core/src/loader/http/getcurrentuser.cpp | 3 +- .../http/getdefaultdirectorybrowser.cpp | 3 +- .../loader/http/getdefaultlistingprovider.cpp | 3 +- .../loader/http/getdefaultmetadataoptions.cpp | 3 +- core/src/loader/http/getdefaultprofile.cpp | 3 +- core/src/loader/http/getdefaulttimer.cpp | 5 +- core/src/loader/http/getdeviceinfo.cpp | 5 +- core/src/loader/http/getdeviceoptions.cpp | 5 +- core/src/loader/http/getdevices.cpp | 7 +- core/src/loader/http/getdirectorycontents.cpp | 27 + .../src/loader/http/getdisplaypreferences.cpp | 9 +- core/src/loader/http/getdrives.cpp | 20 + core/src/loader/http/getendpointinfo.cpp | 3 +- core/src/loader/http/getepisodes.cpp | 33 +- core/src/loader/http/getexternalidinfos.cpp | 20 + core/src/loader/http/getfallbackfontlist.cpp | 20 + core/src/loader/http/getfirstuser.cpp | 3 +- core/src/loader/http/getfirstuser_2.cpp | 3 +- core/src/loader/http/getgeneralimages.cpp | 20 + core/src/loader/http/getgenre.cpp | 7 +- core/src/loader/http/getgenres.cpp | 35 +- core/src/loader/http/getgroupingoptions.cpp | 20 + core/src/loader/http/getguideinfo.cpp | 3 +- .../loader/http/getinstantmixfromalbum.cpp | 19 +- .../loader/http/getinstantmixfromartists.cpp | 19 +- .../src/loader/http/getinstantmixfromitem.cpp | 19 +- .../http/getinstantmixfrommusicgenre.cpp | 19 +- .../http/getinstantmixfrommusicgenres.cpp | 19 +- .../loader/http/getinstantmixfromplaylist.cpp | 19 +- .../src/loader/http/getinstantmixfromsong.cpp | 19 +- core/src/loader/http/getintros.cpp | 5 +- core/src/loader/http/getitem.cpp | 5 +- core/src/loader/http/getitemcounts.cpp | 7 +- core/src/loader/http/getitemimageinfos.cpp | 20 + core/src/loader/http/getitems.cpp | 163 +-- core/src/loader/http/getitemsbyuserid.cpp | 163 +-- core/src/loader/http/getkeys.cpp | 3 +- .../src/loader/http/getlatestchannelitems.cpp | 15 +- core/src/loader/http/getlatestmedia.cpp | 50 + .../src/loader/http/getlibraryoptionsinfo.cpp | 7 +- core/src/loader/http/getlineups.cpp | 32 + core/src/loader/http/getlivetvchannels.cpp | 45 +- core/src/loader/http/getlivetvinfo.cpp | 3 +- core/src/loader/http/getlivetvprograms.cpp | 57 +- .../loader/http/getlocalizationoptions.cpp | 20 + core/src/loader/http/getlocaltrailers.cpp | 20 + core/src/loader/http/getlogentries.cpp | 11 +- core/src/loader/http/getmediafolders.cpp | 5 +- core/src/loader/http/getmediainfoimages.cpp | 20 + .../src/loader/http/getmetadataeditorinfo.cpp | 5 +- .../loader/http/getmovierecommendations.cpp | 35 + .../http/getmovieremotesearchresults.cpp | 20 + .../http/getmusicalbumremotesearchresults.cpp | 20 + .../getmusicartistremotesearchresults.cpp | 20 + core/src/loader/http/getmusicgenre.cpp | 7 +- core/src/loader/http/getmusicgenres.cpp | 35 +- .../http/getmusicvideoremotesearchresults.cpp | 20 + .../src/loader/http/getnamedconfiguration.cpp | 20 + core/src/loader/http/getnetworkshares.cpp | 20 + core/src/loader/http/getnextup.cpp | 27 +- core/src/loader/http/getnotifications.cpp | 5 +- .../loader/http/getnotificationservices.cpp | 20 + .../loader/http/getnotificationssummary.cpp | 5 +- core/src/loader/http/getnotificationtypes.cpp | 20 + core/src/loader/http/getpackageinfo.cpp | 7 +- core/src/loader/http/getpackages.cpp | 20 + core/src/loader/http/getparentalratings.cpp | 20 + core/src/loader/http/getparentpath.cpp | 21 + .../loader/http/getpasswordresetproviders.cpp | 20 + core/src/loader/http/getperson.cpp | 7 +- .../http/getpersonremotesearchresults.cpp | 20 + core/src/loader/http/getpersons.cpp | 29 +- core/src/loader/http/getphysicalpaths.cpp | 20 + core/src/loader/http/getpingsystem.cpp | 20 + core/src/loader/http/getplaybackinfo.cpp | 7 +- core/src/loader/http/getplaylistitems.cpp | 21 +- .../loader/http/getpluginconfiguration.cpp | 5 +- core/src/loader/http/getplugins.cpp | 20 + .../src/loader/http/getpostedplaybackinfo.cpp | 33 +- core/src/loader/http/getprofile.cpp | 5 +- core/src/loader/http/getprofileinfos.cpp | 20 + core/src/loader/http/getprogram.cpp | 7 +- core/src/loader/http/getprograms.cpp | 3 +- core/src/loader/http/getpublicsysteminfo.cpp | 3 +- core/src/loader/http/getpublicusers.cpp | 20 + core/src/loader/http/getqueryfilters.cpp | 23 +- .../src/loader/http/getqueryfilterslegacy.cpp | 11 +- core/src/loader/http/getratingimages.cpp | 20 + .../loader/http/getrecommendedprograms.cpp | 35 +- core/src/loader/http/getrecording.cpp | 7 +- core/src/loader/http/getrecordingfolders.cpp | 5 +- core/src/loader/http/getrecordinggroups.cpp | 5 +- core/src/loader/http/getrecordings.cpp | 41 +- core/src/loader/http/getrecordingsseries.cpp | 31 +- .../loader/http/getremoteimageproviders.cpp | 20 + core/src/loader/http/getremoteimages.cpp | 15 +- core/src/loader/http/getrepositories.cpp | 20 + core/src/loader/http/getresumeitems.cpp | 31 +- core/src/loader/http/getrootfolder.cpp | 5 +- .../http/getschedulesdirectcountries.cpp | 20 + core/src/loader/http/getseasons.cpp | 23 +- .../http/getseriesremotesearchresults.cpp | 20 + core/src/loader/http/getseriestimer.cpp | 5 +- core/src/loader/http/getseriestimers.cpp | 7 +- core/src/loader/http/getserverlogs.cpp | 20 + core/src/loader/http/getsessions.cpp | 29 + core/src/loader/http/getsimilaralbums.cpp | 13 +- core/src/loader/http/getsimilarartists.cpp | 13 +- core/src/loader/http/getsimilaritems.cpp | 13 +- core/src/loader/http/getsimilarmovies.cpp | 13 +- core/src/loader/http/getsimilarshows.cpp | 13 +- core/src/loader/http/getsimilartrailers.cpp | 13 +- core/src/loader/http/getspecialfeatures.cpp | 20 + .../loader/http/getstartupconfiguration.cpp | 3 +- core/src/loader/http/getstatus.cpp | 3 +- core/src/loader/http/getstudio.cpp | 7 +- core/src/loader/http/getstudios.cpp | 37 +- core/src/loader/http/getsuggestions.cpp | 15 +- core/src/loader/http/getsysteminfo.cpp | 3 +- core/src/loader/http/gettask.cpp | 5 +- core/src/loader/http/gettasks.cpp | 26 + core/src/loader/http/getthememedia.cpp | 9 +- core/src/loader/http/getthemesongs.cpp | 9 +- core/src/loader/http/getthemevideos.cpp | 9 +- core/src/loader/http/gettimer.cpp | 5 +- core/src/loader/http/gettimers.cpp | 11 +- .../http/gettrailerremotesearchresults.cpp | 20 + core/src/loader/http/gettrailers.cpp | 161 +-- core/src/loader/http/gettunerhosttypes.cpp | 20 + core/src/loader/http/getupcomingepisodes.cpp | 21 +- core/src/loader/http/getuserbyid.cpp | 5 +- core/src/loader/http/getusers.cpp | 26 + core/src/loader/http/getuserviews.cpp | 11 +- core/src/loader/http/getutctime.cpp | 3 +- core/src/loader/http/getvirtualfolders.cpp | 20 + core/src/loader/http/getwakeonlaninfo.cpp | 20 + core/src/loader/http/getyear.cpp | 7 +- core/src/loader/http/getyears.cpp | 33 +- core/src/loader/http/initiate.cpp | 3 +- core/src/loader/http/markfavoriteitem.cpp | 5 +- core/src/loader/http/markplayeditem.cpp | 7 +- core/src/loader/http/markunplayeditem.cpp | 5 +- core/src/loader/http/openlivestream.cpp | 25 +- core/src/loader/http/postpingsystem.cpp | 20 + .../src/loader/http/searchremotesubtitles.cpp | 23 + core/src/loader/http/setchannelmapping.cpp | 3 +- core/src/loader/http/syncplaygetgroups.cpp | 20 + core/src/loader/http/unmarkfavoriteitem.cpp | 5 +- core/src/loader/http/updateuseritemrating.cpp | 7 +- core/src/loader/requesttypes.cpp | 136 +- core/src/{ => model}/deviceprofile.cpp | 39 +- core/src/support/jsonconv.cpp | 121 +- core/src/viewmodel/itemmodel.cpp | 15 +- qtquick/qml/main.qml | 2 +- qtquick/src/main.cpp | 8 + 1412 files changed, 13967 insertions(+), 33794 deletions(-) rename core/include/JellyfinQt/{ => model}/deviceprofile.h (90%) delete mode 100644 core/src/DTO/accessschedule.cpp delete mode 100644 core/src/DTO/activitylogentry.cpp delete mode 100644 core/src/DTO/activitylogentryqueryresult.cpp delete mode 100644 core/src/DTO/addvirtualfolderdto.cpp delete mode 100644 core/src/DTO/albuminfo.cpp delete mode 100644 core/src/DTO/albuminforemotesearchquery.cpp delete mode 100644 core/src/DTO/allthememediaresult.cpp delete mode 100644 core/src/DTO/architecture.cpp delete mode 100644 core/src/DTO/artistinfo.cpp delete mode 100644 core/src/DTO/artistinforemotesearchquery.cpp delete mode 100644 core/src/DTO/authenticateuserbyname.cpp delete mode 100644 core/src/DTO/authenticationinfo.cpp delete mode 100644 core/src/DTO/authenticationinfoqueryresult.cpp delete mode 100644 core/src/DTO/authenticationresult.cpp delete mode 100644 core/src/DTO/baseitem.cpp delete mode 100644 core/src/DTO/baseitemdto.cpp delete mode 100644 core/src/DTO/baseitemdtoqueryresult.cpp delete mode 100644 core/src/DTO/baseitemperson.cpp delete mode 100644 core/src/DTO/basepluginconfiguration.cpp delete mode 100644 core/src/DTO/bookinfo.cpp delete mode 100644 core/src/DTO/bookinforemotesearchquery.cpp delete mode 100644 core/src/DTO/boxsetinfo.cpp delete mode 100644 core/src/DTO/boxsetinforemotesearchquery.cpp delete mode 100644 core/src/DTO/brandingoptions.cpp delete mode 100644 core/src/DTO/bufferrequestdto.cpp delete mode 100644 core/src/DTO/channelfeatures.cpp delete mode 100644 core/src/DTO/channelitemsortfield.cpp delete mode 100644 core/src/DTO/channelmappingoptionsdto.cpp delete mode 100644 core/src/DTO/channelmediacontenttype.cpp delete mode 100644 core/src/DTO/channelmediatype.cpp delete mode 100644 core/src/DTO/channeltype.cpp delete mode 100644 core/src/DTO/chapterinfo.cpp delete mode 100644 core/src/DTO/clientcapabilities.cpp delete mode 100644 core/src/DTO/clientcapabilitiesdto.cpp delete mode 100644 core/src/DTO/codecprofile.cpp delete mode 100644 core/src/DTO/codectype.cpp delete mode 100644 core/src/DTO/collectioncreationresult.cpp delete mode 100644 core/src/DTO/configurationpageinfo.cpp delete mode 100644 core/src/DTO/configurationpagetype.cpp delete mode 100644 core/src/DTO/containerprofile.cpp delete mode 100644 core/src/DTO/controlresponse.cpp delete mode 100644 core/src/DTO/countryinfo.cpp delete mode 100644 core/src/DTO/createplaylistdto.cpp delete mode 100644 core/src/DTO/createuserbyname.cpp delete mode 100644 core/src/DTO/culturedto.cpp delete mode 100644 core/src/DTO/dayofweek.cpp delete mode 100644 core/src/DTO/daypattern.cpp delete mode 100644 core/src/DTO/defaultdirectorybrowserinfodto.cpp delete mode 100644 core/src/DTO/deviceidentification.cpp delete mode 100644 core/src/DTO/deviceinfo.cpp delete mode 100644 core/src/DTO/deviceinfoqueryresult.cpp delete mode 100644 core/src/DTO/deviceoptions.cpp delete mode 100644 core/src/DTO/deviceprofile.cpp delete mode 100644 core/src/DTO/deviceprofileinfo.cpp delete mode 100644 core/src/DTO/deviceprofiletype.cpp delete mode 100644 core/src/DTO/directplayprofile.cpp delete mode 100644 core/src/DTO/displaypreferencesdto.cpp delete mode 100644 core/src/DTO/dlnaprofiletype.cpp delete mode 100644 core/src/DTO/dynamicdayofweek.cpp delete mode 100644 core/src/DTO/encodingcontext.cpp delete mode 100644 core/src/DTO/endpointinfo.cpp delete mode 100644 core/src/DTO/externalidinfo.cpp delete mode 100644 core/src/DTO/externalidmediatype.cpp delete mode 100644 core/src/DTO/externalurl.cpp delete mode 100644 core/src/DTO/ffmpeglocation.cpp delete mode 100644 core/src/DTO/filesystementryinfo.cpp delete mode 100644 core/src/DTO/filesystementrytype.cpp delete mode 100644 core/src/DTO/fontfile.cpp delete mode 100644 core/src/DTO/forgotpasswordaction.cpp delete mode 100644 core/src/DTO/forgotpassworddto.cpp delete mode 100644 core/src/DTO/forgotpasswordresult.cpp delete mode 100644 core/src/DTO/generalcommand.cpp delete mode 100644 core/src/DTO/generalcommandtype.cpp delete mode 100644 core/src/DTO/getprogramsdto.cpp delete mode 100644 core/src/DTO/groupinfodto.cpp delete mode 100644 core/src/DTO/groupqueuemode.cpp delete mode 100644 core/src/DTO/grouprepeatmode.cpp delete mode 100644 core/src/DTO/groupshufflemode.cpp delete mode 100644 core/src/DTO/groupstatetype.cpp delete mode 100644 core/src/DTO/groupupdatetype.cpp delete mode 100644 core/src/DTO/guideinfo.cpp delete mode 100644 core/src/DTO/headermatchtype.cpp delete mode 100644 core/src/DTO/httpheaderinfo.cpp delete mode 100644 core/src/DTO/ignorewaitrequestdto.cpp delete mode 100644 core/src/DTO/imagebynameinfo.cpp delete mode 100644 core/src/DTO/imageformat.cpp delete mode 100644 core/src/DTO/imageinfo.cpp delete mode 100644 core/src/DTO/imageoption.cpp delete mode 100644 core/src/DTO/imageorientation.cpp delete mode 100644 core/src/DTO/imageproviderinfo.cpp delete mode 100644 core/src/DTO/imagesavingconvention.cpp delete mode 100644 core/src/DTO/imagetype.cpp delete mode 100644 core/src/DTO/installationinfo.cpp delete mode 100644 core/src/DTO/iplugin.cpp delete mode 100644 core/src/DTO/isotype.cpp delete mode 100644 core/src/DTO/itemcounts.cpp delete mode 100644 core/src/DTO/itemfields.cpp delete mode 100644 core/src/DTO/itemfilter.cpp delete mode 100644 core/src/DTO/joingrouprequestdto.cpp delete mode 100644 core/src/DTO/keepuntil.cpp delete mode 100644 core/src/DTO/libraryoptioninfodto.cpp delete mode 100644 core/src/DTO/libraryoptions.cpp delete mode 100644 core/src/DTO/libraryoptionsresultdto.cpp delete mode 100644 core/src/DTO/librarytypeoptionsdto.cpp delete mode 100644 core/src/DTO/libraryupdateinfo.cpp delete mode 100644 core/src/DTO/listingsproviderinfo.cpp delete mode 100644 core/src/DTO/livestreamresponse.cpp delete mode 100644 core/src/DTO/livetvinfo.cpp delete mode 100644 core/src/DTO/livetvserviceinfo.cpp delete mode 100644 core/src/DTO/livetvservicestatus.cpp delete mode 100644 core/src/DTO/localizationoption.cpp delete mode 100644 core/src/DTO/locationtype.cpp delete mode 100644 core/src/DTO/logfile.cpp delete mode 100644 core/src/DTO/loglevel.cpp delete mode 100644 core/src/DTO/mediaattachment.cpp delete mode 100644 core/src/DTO/mediaencoderpathdto.cpp delete mode 100644 core/src/DTO/mediapathdto.cpp delete mode 100644 core/src/DTO/mediapathinfo.cpp delete mode 100644 core/src/DTO/mediaprotocol.cpp delete mode 100644 core/src/DTO/mediasourceinfo.cpp delete mode 100644 core/src/DTO/mediasourcetype.cpp delete mode 100644 core/src/DTO/mediastream.cpp delete mode 100644 core/src/DTO/mediastreamtype.cpp delete mode 100644 core/src/DTO/mediaupdateinfodto.cpp delete mode 100644 core/src/DTO/mediaurl.cpp delete mode 100644 core/src/DTO/metadataeditorinfo.cpp delete mode 100644 core/src/DTO/metadatafield.cpp delete mode 100644 core/src/DTO/metadataoptions.cpp delete mode 100644 core/src/DTO/metadatarefreshmode.cpp delete mode 100644 core/src/DTO/moveplaylistitemrequestdto.cpp delete mode 100644 core/src/DTO/movieinfo.cpp delete mode 100644 core/src/DTO/movieinforemotesearchquery.cpp delete mode 100644 core/src/DTO/musicvideoinfo.cpp delete mode 100644 core/src/DTO/musicvideoinforemotesearchquery.cpp delete mode 100644 core/src/DTO/nameguidpair.cpp delete mode 100644 core/src/DTO/nameidpair.cpp delete mode 100644 core/src/DTO/namevaluepair.cpp delete mode 100644 core/src/DTO/newgrouprequestdto.cpp delete mode 100644 core/src/DTO/nextitemrequestdto.cpp delete mode 100644 core/src/DTO/notificationdto.cpp delete mode 100644 core/src/DTO/notificationlevel.cpp delete mode 100644 core/src/DTO/notificationresultdto.cpp delete mode 100644 core/src/DTO/notificationssummarydto.cpp delete mode 100644 core/src/DTO/notificationtypeinfo.cpp delete mode 100644 core/src/DTO/objectgroupupdate.cpp delete mode 100644 core/src/DTO/openlivestreamdto.cpp delete mode 100644 core/src/DTO/packageinfo.cpp delete mode 100644 core/src/DTO/parentalrating.cpp delete mode 100644 core/src/DTO/pathsubstitution.cpp delete mode 100644 core/src/DTO/personlookupinfo.cpp delete mode 100644 core/src/DTO/personlookupinforemotesearchquery.cpp delete mode 100644 core/src/DTO/pingrequestdto.cpp delete mode 100644 core/src/DTO/pinredeemresult.cpp delete mode 100644 core/src/DTO/playaccess.cpp delete mode 100644 core/src/DTO/playbackerrorcode.cpp delete mode 100644 core/src/DTO/playbackinfodto.cpp delete mode 100644 core/src/DTO/playbackinforesponse.cpp delete mode 100644 core/src/DTO/playbackprogressinfo.cpp delete mode 100644 core/src/DTO/playbackstartinfo.cpp delete mode 100644 core/src/DTO/playbackstopinfo.cpp delete mode 100644 core/src/DTO/playcommand.cpp delete mode 100644 core/src/DTO/playerstateinfo.cpp delete mode 100644 core/src/DTO/playlistcreationresult.cpp delete mode 100644 core/src/DTO/playmethod.cpp delete mode 100644 core/src/DTO/playrequest.cpp delete mode 100644 core/src/DTO/playrequestdto.cpp delete mode 100644 core/src/DTO/playstatecommand.cpp delete mode 100644 core/src/DTO/playstaterequest.cpp delete mode 100644 core/src/DTO/plugininfo.cpp delete mode 100644 core/src/DTO/pluginsecurityinfo.cpp delete mode 100644 core/src/DTO/pluginstatus.cpp delete mode 100644 core/src/DTO/previousitemrequestdto.cpp delete mode 100644 core/src/DTO/problemdetails.cpp delete mode 100644 core/src/DTO/profilecondition.cpp delete mode 100644 core/src/DTO/profileconditiontype.cpp delete mode 100644 core/src/DTO/profileconditionvalue.cpp delete mode 100644 core/src/DTO/programaudio.cpp delete mode 100644 core/src/DTO/publicsysteminfo.cpp delete mode 100644 core/src/DTO/queryfilters.cpp delete mode 100644 core/src/DTO/queryfilterslegacy.cpp delete mode 100644 core/src/DTO/queueitem.cpp delete mode 100644 core/src/DTO/queuerequestdto.cpp delete mode 100644 core/src/DTO/quickconnectdto.cpp delete mode 100644 core/src/DTO/quickconnectresult.cpp delete mode 100644 core/src/DTO/quickconnectstate.cpp delete mode 100644 core/src/DTO/ratingtype.cpp delete mode 100644 core/src/DTO/readyrequestdto.cpp delete mode 100644 core/src/DTO/recommendationdto.cpp delete mode 100644 core/src/DTO/recommendationtype.cpp delete mode 100644 core/src/DTO/recordingstatus.cpp delete mode 100644 core/src/DTO/remoteimageinfo.cpp delete mode 100644 core/src/DTO/remoteimageresult.cpp delete mode 100644 core/src/DTO/remotesearchresult.cpp delete mode 100644 core/src/DTO/remotesubtitleinfo.cpp delete mode 100644 core/src/DTO/removefromplaylistrequestdto.cpp delete mode 100644 core/src/DTO/repeatmode.cpp delete mode 100644 core/src/DTO/repositoryinfo.cpp delete mode 100644 core/src/DTO/responseprofile.cpp delete mode 100644 core/src/DTO/scrolldirection.cpp delete mode 100644 core/src/DTO/searchhint.cpp delete mode 100644 core/src/DTO/searchhintresult.cpp delete mode 100644 core/src/DTO/seekrequestdto.cpp delete mode 100644 core/src/DTO/sendcommand.cpp delete mode 100644 core/src/DTO/sendcommandtype.cpp delete mode 100644 core/src/DTO/seriesinfo.cpp delete mode 100644 core/src/DTO/seriesinforemotesearchquery.cpp delete mode 100644 core/src/DTO/seriesstatus.cpp delete mode 100644 core/src/DTO/seriestimerinfodto.cpp delete mode 100644 core/src/DTO/seriestimerinfodtoqueryresult.cpp delete mode 100644 core/src/DTO/serverconfiguration.cpp delete mode 100644 core/src/DTO/sessioninfo.cpp delete mode 100644 core/src/DTO/sessionuserinfo.cpp delete mode 100644 core/src/DTO/setchannelmappingdto.cpp delete mode 100644 core/src/DTO/setplaylistitemrequestdto.cpp delete mode 100644 core/src/DTO/setrepeatmoderequestdto.cpp delete mode 100644 core/src/DTO/setshufflemoderequestdto.cpp delete mode 100644 core/src/DTO/songinfo.cpp delete mode 100644 core/src/DTO/sortorder.cpp delete mode 100644 core/src/DTO/specialviewoptiondto.cpp delete mode 100644 core/src/DTO/startupconfigurationdto.cpp delete mode 100644 core/src/DTO/startupremoteaccessdto.cpp delete mode 100644 core/src/DTO/startupuserdto.cpp delete mode 100644 core/src/DTO/subtitledeliverymethod.cpp delete mode 100644 core/src/DTO/subtitleplaybackmode.cpp delete mode 100644 core/src/DTO/subtitleprofile.cpp delete mode 100644 core/src/DTO/syncplayuseraccesstype.cpp delete mode 100644 core/src/DTO/systeminfo.cpp delete mode 100644 core/src/DTO/taskcompletionstatus.cpp delete mode 100644 core/src/DTO/taskinfo.cpp delete mode 100644 core/src/DTO/taskresult.cpp delete mode 100644 core/src/DTO/taskstate.cpp delete mode 100644 core/src/DTO/tasktriggerinfo.cpp delete mode 100644 core/src/DTO/thememediaresult.cpp delete mode 100644 core/src/DTO/timereventinfo.cpp delete mode 100644 core/src/DTO/timerinfodto.cpp delete mode 100644 core/src/DTO/timerinfodtoqueryresult.cpp delete mode 100644 core/src/DTO/trailerinfo.cpp delete mode 100644 core/src/DTO/trailerinforemotesearchquery.cpp delete mode 100644 core/src/DTO/transcodereason.cpp delete mode 100644 core/src/DTO/transcodeseekinfo.cpp delete mode 100644 core/src/DTO/transcodinginfo.cpp delete mode 100644 core/src/DTO/transcodingprofile.cpp delete mode 100644 core/src/DTO/transportstreamtimestamp.cpp delete mode 100644 core/src/DTO/tunerchannelmapping.cpp delete mode 100644 core/src/DTO/tunerhostinfo.cpp delete mode 100644 core/src/DTO/typeoptions.cpp delete mode 100644 core/src/DTO/unrateditem.cpp delete mode 100644 core/src/DTO/updatelibraryoptionsdto.cpp delete mode 100644 core/src/DTO/updateusereasypassword.cpp delete mode 100644 core/src/DTO/updateuserpassword.cpp delete mode 100644 core/src/DTO/uploadsubtitledto.cpp delete mode 100644 core/src/DTO/userconfiguration.cpp delete mode 100644 core/src/DTO/userdto.cpp delete mode 100644 core/src/DTO/useritemdatadto.cpp delete mode 100644 core/src/DTO/userpolicy.cpp delete mode 100644 core/src/DTO/utctimeresponse.cpp delete mode 100644 core/src/DTO/validatepathdto.cpp delete mode 100644 core/src/DTO/version.cpp delete mode 100644 core/src/DTO/versioninfo.cpp delete mode 100644 core/src/DTO/video3dformat.cpp delete mode 100644 core/src/DTO/videotype.cpp delete mode 100644 core/src/DTO/virtualfolderinfo.cpp delete mode 100644 core/src/DTO/wakeonlaninfo.cpp delete mode 100644 core/src/DTO/xmlattribute.cpp rename core/src/{ => model}/deviceprofile.cpp (90%) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index da2f6f6..5a36568 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -5,6 +5,7 @@ include(GeneratedSources.cmake) set(JellyfinQt_SOURCES # src/DTO/dto.cpp + src/model/deviceprofile.cpp src/model/item.cpp src/support/jsonconv.cpp src/support/loader.cpp @@ -15,7 +16,6 @@ set(JellyfinQt_SOURCES src/apiclient.cpp src/apimodel.cpp src/credentialmanager.cpp - src/deviceprofile.cpp src/eventbus.cpp src/jellyfin.cpp src/jsonhelper.cpp @@ -25,6 +25,7 @@ set(JellyfinQt_SOURCES list(APPEND JellyfinQt_SOURCES ${openapi_SOURCES}) set(JellyfinQt_HEADERS + include/JellyfinQt/model/deviceprofile.h include/JellyfinQt/model/item.h include/JellyfinQt/support/jsonconv.h include/JellyfinQt/support/loader.h @@ -36,23 +37,26 @@ set(JellyfinQt_HEADERS include/JellyfinQt/apiclient.h include/JellyfinQt/apimodel.h include/JellyfinQt/credentialmanager.h - include/JellyfinQt/deviceprofile.h include/JellyfinQt/eventbus.h include/JellyfinQt/jellyfin.h include/JellyfinQt/jsonhelper.h include/JellyfinQt/serverdiscoverymodel.h include/JellyfinQt/websocket.h) -list(APPEND JellyfinQt_SOURCES ${openapi_HEADERS}) +list(APPEND JellyfinQt_HEADERS ${openapi_HEADERS}) add_definitions(-DSAILFIN_VERSION=\"${SAILFIN_VERSION}\") + if (PLATFORM_SAILFISHOS) add_definitions(-DPLATFORM_SAILFISHOS=1) endif() + add_library(JellyfinQt ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS}) + if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") # target_precompile_headers(JellyfinQt PRIVATE ${JellyfinQt_HEADERS}) endif() + target_include_directories(JellyfinQt PUBLIC "include") target_link_libraries(JellyfinQt PUBLIC Qt5::Core Qt5::Multimedia Qt5::Network Qt5::Qml Qt5::WebSockets) set_target_properties(JellyfinQt PROPERTIES CXX_VISIBILITY_PRESET default) diff --git a/core/codegen/enum_header.hbs b/core/codegen/enum_header.hbs index a247228..64da1b4 100644 --- a/core/codegen/enum_header.hbs +++ b/core/codegen/enum_header.hbs @@ -14,4 +14,17 @@ private: explicit {{className}}Class(); }; -typedef {{className}}Class::Value {{className}}; +using {{className}} = {{className}}Class::Value; + +} // NS DTO + +namespace Support { + +using {{className}} = Jellyfin::DTO::{{className}}; + +template <> + +{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>); + +template <> +QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>); diff --git a/core/codegen/enum_implementation.hbs b/core/codegen/enum_implementation.hbs index cb8cc6c..582e10f 100644 --- a/core/codegen/enum_implementation.hbs +++ b/core/codegen/enum_implementation.hbs @@ -1,6 +1,5 @@ {{className}}Class::{{className}}Class() {} - } // NS DTO namespace Support { @@ -9,7 +8,7 @@ using {{className}} = Jellyfin::DTO::{{className}}; template <> -{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) { +{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>) { if (!source.isString()) return {{className}}::EnumNotSet; QString str = source.toString(); @@ -23,3 +22,19 @@ template <> return {{className}}::EnumNotSet; } + +template <> +QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>) { + switch(source) { + + {{#each values as |value|}} + case {{className}}::{{value}}: + return QStringLiteral("{{value}}"); + + {{/each}} + + case {{className}}::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} diff --git a/core/codegen/loader_header.hbs b/core/codegen/loader_header.hbs index f5788c7..aa764c4 100644 --- a/core/codegen/loader_header.hbs +++ b/core/codegen/loader_header.hbs @@ -1,4 +1,7 @@ {{#if endpoint.hasSuccessResponse}} + +using namespace {{dtoNamespace}}; + {{#if endpoint.description.length > 0}} /** * @brief {{endpoint.description}} @@ -6,7 +9,8 @@ */ {{/if}} -class {{className}}Loader : public {{supportNamespace}}::HttpLoader<{{dtoNamespace}}::{{endpoint.resultType}}, {{endpoint.parameterType}}> { + +class {{className}}Loader : public {{supportNamespace}}::HttpLoader<{{endpoint.resultType}}, {{endpoint.parameterType}}> { public: explicit {{className}}Loader(ApiClient *apiClient = nullptr); diff --git a/core/codegen/loader_implementation.hbs b/core/codegen/loader_implementation.hbs index a9f876a..27cb06a 100644 --- a/core/codegen/loader_implementation.hbs +++ b/core/codegen/loader_implementation.hbs @@ -1,7 +1,9 @@ {{#if endpoint.hasSuccessResponse}} +using namespace {{dtoNamespace}}; + {{className}}Loader::{{className}}Loader(ApiClient *apiClient) - : {{supportNamespace}}::HttpLoader<{{dtoNamespace}}::{{endpoint.resultType}}, {{endpoint.parameterType}}>(apiClient) {} + : {{supportNamespace}}::HttpLoader<{{endpoint.resultType}}, {{endpoint.parameterType}}>(apiClient) {} QString {{className}}Loader::path(const {{endpoint.parameterType}} ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -15,7 +17,7 @@ QUrlQuery {{className}}Loader::query(const {{endpoint.parameterType}} ¶ms) c QUrlQuery result; {{#each endpoint.requiredQueryParameters as |p|}} - result.addQueryItem("{{p.name}}", params.{{p.type.name}}()); + result.addQueryItem("{{p.name}}", Support::toString<{{p.type.typeNameWithQualifiers}}>(params.{{p.type.name}}())); {{/each}} @@ -23,7 +25,7 @@ QUrlQuery {{className}}Loader::query(const {{endpoint.parameterType}} ¶ms) c {{#each endpoint.optionalQueryParameters as |p|}} if (!params.{{p.type.name}}Null()) { - result.addQueryItem("{{p.name}}", Support::toString(params.{{p.type.name}}())); + result.addQueryItem("{{p.name}}", Support::toString<{{p.type.typeNameWithQualifiers}}>(params.{{p.type.name}}())); } {{/each}} diff --git a/core/codegen/object_header.hbs b/core/codegen/object_header.hbs index d359c83..6e1f0af 100644 --- a/core/codegen/object_header.hbs +++ b/core/codegen/object_header.hbs @@ -19,7 +19,7 @@ public: static {{className}} fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -61,3 +61,16 @@ protected: {{/each}} }; + +} // NS DTO + +namespace Support { + +using {{className}} = Jellyfin::DTO::{{className}}; + +template <> + +{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>); + +template<> +QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>); diff --git a/core/codegen/object_implementation.hbs b/core/codegen/object_implementation.hbs index fd689da..4ed675c 100644 --- a/core/codegen/object_implementation.hbs +++ b/core/codegen/object_implementation.hbs @@ -41,7 +41,7 @@ void {{className}}::setFromJson(QJsonObject source) { } -QJsonObject {{className}}::toJson() { +QJsonObject {{className}}::toJson() const { QJsonObject result; {{#each properties as |property|}} @@ -83,7 +83,12 @@ using {{className}} = Jellyfin::DTO::{{className}}; template <> -{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return {{className}}::fromJson(source.toObject()); } + +template<> +QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>) { + return source.toJson(); +} diff --git a/core/include/JellyfinQt/apiclient.h b/core/include/JellyfinQt/apiclient.h index 7f92e80..0068f7f 100644 --- a/core/include/JellyfinQt/apiclient.h +++ b/core/include/JellyfinQt/apiclient.h @@ -38,16 +38,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include #include "dto/generalcommandtype.h" -#include "support/jsonconv.h" #include "credentialmanager.h" -#include "deviceprofile.h" +#include "model/deviceprofile.h" #include "eventbus.h" -#include "websocket.h" namespace Jellyfin { -class MediaSource; -class WebSocket; class PlaybackManager; +class WebSocket; namespace DTO { class UserItemDataDto; // Keep it as an opaque pointer @@ -124,6 +121,7 @@ public: UNEXPECTED_STATUS, INVALID_PASSWORD }; + Q_ENUM(ApiError) const QString &baseUrl() const { return this->m_baseUrl; } const QString &userId() const { return m_userId; } diff --git a/core/include/JellyfinQt/apimodel.h b/core/include/JellyfinQt/apimodel.h index c290e60..1729b63 100644 --- a/core/include/JellyfinQt/apimodel.h +++ b/core/include/JellyfinQt/apimodel.h @@ -91,6 +91,11 @@ public: ModelStatus status() const { return m_status; } + /** + * @brief Clears and reloads the model + */ + Q_INVOKABLE virtual void reload() {}; + // QQmlParserStatus interface virtual void classBegin() override; virtual void componentComplete() override; @@ -103,19 +108,33 @@ signals: void limitChanged(int newLimit); void autoReloadChanged(bool newAutoReload); + /** + * @brief Emitted when the model should clear itself + */ + void modelShouldClear(); + /** + * Emitted when new items are loaded. + */ + void itemsLoaded(); void reloadWanted(); +protected slots: + virtual void futureReady() = 0; + protected: // Is this object being parsed by the QML engine bool m_isBeingParsed = false; ApiClient *m_apiClient = nullptr; bool m_autoReload = true; + bool m_needsAuthentication = true; // Query/record controlling properties int m_limit = -1; int m_startIndex = 0; int m_totalRecordCount = 0; const int DEFAULT_LIMIT = 100; + void emitModelShouldClear() { emit modelShouldClear(); } + void emitItemsLoaded() { emit itemsLoaded(); } ModelStatus m_status = ModelStatus::Uninitialised; void setStatus(ModelStatus newStatus) { @@ -127,6 +146,7 @@ protected: } } } + virtual bool canReload() const; }; /** @@ -137,37 +157,56 @@ template class ModelLoader : public BaseModelLoader { public: ModelLoader(QObject *parent = nullptr) - : BaseModelLoader(parent) {} - - QList reload() { - m_startIndex = 0; - m_totalRecordCount = -1; - return loadMore(); + : BaseModelLoader(parent) { } - QList loadMore() { - if (m_startIndex == 0) { - this->setStatus(ModelStatus::Loading); - } else { - this->setStatus(ModelStatus::LoadingMore); + void reload() override { + if (!canReload()) { + qDebug() << "Cannot yet reload ApiModel: canReload() returned false."; + return; } - std::pair, int> result; - try { - result = loadMore(m_startIndex, m_limit); - } catch(Support::LoadException &e) { - qWarning() << "Exception while loading in ModelLoader: " << e.what(); - return QList(); + m_startIndex = 0; + m_totalRecordCount = -1; + this->setStatus(ModelStatus::Loading); + emitModelShouldClear(); + loadMore(0, -1); + } + + void loadMore() { + if (!canReload()) { + qDebug() << "Cannot yet reload ApiModel: canReload() returned false."; + return; } - m_startIndex += result.first.size(); - m_totalRecordCount = result.second; - return result.first; + this->setStatus(ModelStatus::LoadingMore); + loadMore(m_startIndex, m_limit); } virtual bool canLoadMore() const { return m_totalRecordCount == -1 || m_startIndex < m_totalRecordCount; } + + /** + * @brief Holds the result. Moves it result to the caller and therefore can be only called once + * when the itemsLoaded is emitted. + * @return pair containing the items loaded and the integer containing the starting offset. A starting + * offset of -1 means an error has occurred. + */ + std::pair, int> &&result() { return std::move(m_result); } protected: - virtual std::pair, int> loadMore(int offset, int limit) = 0; + /** + * @brief Loads data from the given offset with a maximum count of limit. + * The itemsLoaded() signal is emitted when new data is ready. Call + * getLoadedItems to retrieve the loaded items. + * + * @param offset The offset to start loading items from + * @param limit The maximum amount of items to load. + */ + virtual void loadMore(int offset, int limit) = 0; + void updatePosition(int startIndex, int totalRecordCount) { + m_startIndex = startIndex; + m_totalRecordCount = totalRecordCount; + } + std::pair, int> m_result; }; /** @@ -210,54 +249,66 @@ void setRequestStartIndex(P ¶meters, int startIndex) { template class LoaderModelLoader : public ModelLoader { public: - explicit LoaderModelLoader(Support::Loader loader, QObject *parent = nullptr) - : ModelLoader(parent), m_loader(loader) { } + explicit LoaderModelLoader(Support::Loader *loader, QObject *parent = nullptr) + : ModelLoader(parent), m_loader(QScopedPointer>(loader)) { + QObject::connect(&m_futureWatcher, &QFutureWatcher>::finished, this, &BaseModelLoader::futureReady); + } protected: - std::pair, int> loadMore(int offset, int limit) override { - QMutexLocker(&this->m_mutex); + void loadMore(int offset, int limit) override { + // This method should only be callable on one thread. + // If futureWatcher's future is running, this method should not be called again. + if (m_futureWatcher.isRunning()) return; + // Set an invalid result. + this->m_result = { QList(), -1 }; + // We never want to set this while the loader is running, hence the Mutex and setting it here // instead when Loader::setApiClient is called. - this->m_loader.setApiClient(this->m_apiClient); - try { - setRequestStartIndex

(this->m_parameters, offset); - setRequestLimit(this->m_parameters, limit); - R result; - try { - std::optional optResult = m_loader.load(this->m_parameters); - if (!optResult.has_value()) { - this->setStatus(ModelStatus::Error); - return {QList(), -1}; - } - result = optResult.value(); - } catch (Support::LoadException e) { - this->setStatus(ModelStatus::Error); - return {QList(), -1}; - } + this->m_loader->setApiClient(this->m_apiClient); + setRequestStartIndex

(this->m_parameters, offset); + setRequestLimit

(this->m_parameters, limit); - QList records = extractRecords(result); - int totalRecordCount = extractTotalRecordCount(result); - // If totalRecordCount < 0, it is not supported for this endpoint - if (totalRecordCount < 0) { - totalRecordCount = records.size(); - } - QList models; - models.reserve(records.size()); - - // Convert the DTOs into models - for (int i = 0; i < records.size(); i++) { - models[i] = T(records[i], m_loader.apiClient()); - } - this->setStatus(ModelStatus::Ready); - return { models, totalRecordCount}; - } catch (Support::LoadException e) { - //this->setErrorString(QString(e.what())); - this->setStatus(ModelStatus::Error); - return {QList(), -1}; - } + this->m_loader->setParameters(this->m_parameters); + this->m_loader->prepareLoad(); + QFuture> future = QtConcurrent::run(this->m_loader.data(), &Support::Loader::load); + this->m_futureWatcher.setFuture(future); } - Support::Loader m_loader; + + QScopedPointer> m_loader; QMutex m_mutex; P m_parameters; + QFutureWatcher> m_futureWatcher; + + void futureReady() override { + R result; + try { + std::optional optResult = m_futureWatcher.result(); + if (!optResult.has_value()) { + this->setStatus(ModelStatus::Error); + } + result = optResult.value(); + } catch (Support::LoadException e) { + qWarning() << "Exception while loading: " << e.what(); + this->setStatus(ModelStatus::Error); + } + + QList records = extractRecords(result); + int totalRecordCount = extractTotalRecordCount(result); + // If totalRecordCount < 0, it is not supported for this endpoint + if (totalRecordCount < 0) { + totalRecordCount = records.size(); + } + QList models; + models.reserve(records.size()); + + // Convert the DTOs into models + for (int i = 0; i < records.size(); i++) { + models[i] = T(records[i], m_loader->apiClient()); + } + this->setStatus(ModelStatus::Ready); + this->m_result = { models, totalRecordCount}; + this->emitItemsLoaded(); + } + }; class BaseApiModel : public QAbstractListModel { @@ -270,12 +321,22 @@ public: virtual BaseModelLoader *loader() const = 0; virtual void setLoader(BaseModelLoader *newLoader) { - Q_UNUSED(newLoader); connect(newLoader, &BaseModelLoader::reloadWanted, this, &BaseApiModel::reload); + connect(newLoader, &BaseModelLoader::modelShouldClear, this, &BaseApiModel::clear); + connect(newLoader, &BaseModelLoader::itemsLoaded, this, &BaseApiModel::loadingFinished); emit loaderChanged(); }; + void disconnectOldLoader(BaseModelLoader *oldLoader) { + if (oldLoader != nullptr) { + // Disconnect all signals + disconnect(oldLoader, nullptr, this, nullptr); + } + } public slots: - virtual void reload(); + virtual void reload() = 0; + virtual void clear() = 0; +protected slots: + virtual void loadingFinished() = 0; signals: void loaderChanged(); }; @@ -341,8 +402,6 @@ public: */ explicit ApiModel(QObject *parent = nullptr) : BaseApiModel(parent) { - m_futureWatcherConnection = connect(&m_futureWatcher, &QFutureWatcher>::finished, - [&](){ futureFinished(); }); } // Standard QAbstractItemModel overrides @@ -376,11 +435,20 @@ public: }; void removeAt(int index) { + Q_ASSERT(index < size()); this->beginRemoveRows(QModelIndex(), index, index); m_array.removeAt(index); this->endRemoveRows(); } + void removeUntilEnd(int from) { + this->beginRemoveRows(QModelIndex(), from , m_array.size()); + while (m_array.size() != from) { + m_array.removeLast(); + } + this->endRemoveRows(); + } + void removeOne(T &object) { int idx = m_array.indexOf(object); if (idx >= 0) { @@ -388,6 +456,12 @@ public: } } + void clear() override { + this->beginResetModel(); + m_array.clear(); + this->endResetModel(); + } + // From AbstractListModel, gets implemented in ApiModel //virtual QHash roleNames() const override = 0; /*virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override = 0;*/ @@ -399,8 +473,7 @@ public: virtual void fetchMore(const QModelIndex &parent) override { if (parent.isValid()) return; if (m_loader != nullptr) { - QFuture> result = QtConcurrent::run(m_loader, &ModelLoader::loadMore); - m_futureWatcher.setFuture(result); + m_loader->loadMore(); } } @@ -411,9 +484,10 @@ public: void setLoader(BaseModelLoader *newLoader) { ModelLoader *castedLoader = dynamic_cast *>(newLoader); if (castedLoader != nullptr) { - m_loader = castedLoader; // Hacky way to emit a signal BaseApiModel::setLoader(newLoader); + BaseApiModel::disconnectOldLoader(m_loader); + m_loader = castedLoader; } else { qWarning() << "Somehow set a BaseModelLoader on ApiModel instead of a ModelLoader"; } @@ -421,23 +495,28 @@ public: void reload() override { if (m_loader != nullptr) { - QFuture> result = QtConcurrent::run(m_loader, &ModelLoader::reload); - m_futureWatcher.setFuture(result); + m_loader->reload(); } } protected: // Model-specific properties. QList m_array; - ModelLoader *m_loader; - QFutureWatcher> m_futureWatcher; + ModelLoader *m_loader = nullptr; - void futureFinished() { - try { - QList result = m_futureWatcher.result(); - append(result); - } catch (QUnhandledException &e) { - qWarning() << "Unhandled exception while waiting for a future: " << e.what(); + void loadingFinished() override { + Q_ASSERT(m_loader != nullptr); + std::pair, int> result = m_loader->result(); + if (result.second == -1) { + clear(); + } else if (result.second == m_array.size()) { + append(result.first); + } else if (result.second < m_array.size()){ + removeUntilEnd(result.second); + append(result.first); + } else { + // result.second > m_array.size() + qWarning() << "Retrieved data from loader at position bigger than size()"; } } private: diff --git a/core/include/JellyfinQt/dto/accessschedule.h b/core/include/JellyfinQt/dto/accessschedule.h index 87ea0fd..d389f4f 100644 --- a/core/include/JellyfinQt/dto/accessschedule.h +++ b/core/include/JellyfinQt/dto/accessschedule.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/dynamicdayofweek.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static AccessSchedule fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -107,6 +111,18 @@ protected: double m_endHour; }; +} // NS DTO + +namespace Support { + +using AccessSchedule = Jellyfin::DTO::AccessSchedule; + +template <> +AccessSchedule fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AccessSchedule &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/activitylogentry.h b/core/include/JellyfinQt/dto/activitylogentry.h index 9ab7b12..ff3f4b6 100644 --- a/core/include/JellyfinQt/dto/activitylogentry.h +++ b/core/include/JellyfinQt/dto/activitylogentry.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/loglevel.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ActivityLogEntry fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -170,6 +174,18 @@ protected: LogLevel m_severity; }; +} // NS DTO + +namespace Support { + +using ActivityLogEntry = Jellyfin::DTO::ActivityLogEntry; + +template <> +ActivityLogEntry fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ActivityLogEntry &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/activitylogentryqueryresult.h b/core/include/JellyfinQt/dto/activitylogentryqueryresult.h index 5d4a0ba..140774c 100644 --- a/core/include/JellyfinQt/dto/activitylogentryqueryresult.h +++ b/core/include/JellyfinQt/dto/activitylogentryqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/activitylogentry.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ActivityLogEntryQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using ActivityLogEntryQueryResult = Jellyfin::DTO::ActivityLogEntryQueryResult; + +template <> +ActivityLogEntryQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ActivityLogEntryQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/addvirtualfolderdto.h b/core/include/JellyfinQt/dto/addvirtualfolderdto.h index 1cf93ce..cca3d18 100644 --- a/core/include/JellyfinQt/dto/addvirtualfolderdto.h +++ b/core/include/JellyfinQt/dto/addvirtualfolderdto.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/libraryoptions.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static AddVirtualFolderDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -67,6 +71,18 @@ protected: QSharedPointer m_libraryOptions = nullptr; }; +} // NS DTO + +namespace Support { + +using AddVirtualFolderDto = Jellyfin::DTO::AddVirtualFolderDto; + +template <> +AddVirtualFolderDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AddVirtualFolderDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/albuminfo.h b/core/include/JellyfinQt/dto/albuminfo.h index 6b77e11..126af4b 100644 --- a/core/include/JellyfinQt/dto/albuminfo.h +++ b/core/include/JellyfinQt/dto/albuminfo.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/songinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static AlbumInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -107,11 +111,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -166,11 +170,11 @@ public: /** * @brief Gets or sets the artist provider ids. */ - std::optional artistProviderIds() const; + QJsonObject artistProviderIds() const; /** * @brief Gets or sets the artist provider ids. */ - void setArtistProviderIds(std::optional newArtistProviderIds); + void setArtistProviderIds(QJsonObject newArtistProviderIds); bool artistProviderIdsNull() const; void setArtistProviderIdsNull(); @@ -187,17 +191,29 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; QDateTime m_premiereDate; bool m_isAutomated; QStringList m_albumArtists; - std::optional m_artistProviderIds = std::nullopt; + QJsonObject m_artistProviderIds; QList m_songInfos; }; +} // NS DTO + +namespace Support { + +using AlbumInfo = Jellyfin::DTO::AlbumInfo; + +template <> +AlbumInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AlbumInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/albuminforemotesearchquery.h b/core/include/JellyfinQt/dto/albuminforemotesearchquery.h index cb85b8f..d161ee5 100644 --- a/core/include/JellyfinQt/dto/albuminforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/albuminforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/albuminfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static AlbumInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using AlbumInfoRemoteSearchQuery = Jellyfin::DTO::AlbumInfoRemoteSearchQuery; + +template <> +AlbumInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AlbumInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/allthememediaresult.h b/core/include/JellyfinQt/dto/allthememediaresult.h index 4afe025..bec99ea 100644 --- a/core/include/JellyfinQt/dto/allthememediaresult.h +++ b/core/include/JellyfinQt/dto/allthememediaresult.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/thememediaresult.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static AllThemeMediaResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -79,6 +83,18 @@ protected: QSharedPointer m_soundtrackSongsResult = nullptr; }; +} // NS DTO + +namespace Support { + +using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult; + +template <> +AllThemeMediaResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AllThemeMediaResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/architecture.h b/core/include/JellyfinQt/dto/architecture.h index d80c868..bed8c1e 100644 --- a/core/include/JellyfinQt/dto/architecture.h +++ b/core/include/JellyfinQt/dto/architecture.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit ArchitectureClass(); }; -typedef ArchitectureClass::Value Architecture; +using Architecture = ArchitectureClass::Value; + +} // NS DTO + +namespace Support { + +using Architecture = Jellyfin::DTO::Architecture; + +template <> +Architecture fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const Architecture &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/artistinfo.h b/core/include/JellyfinQt/dto/artistinfo.h index cb83058..4d95682 100644 --- a/core/include/JellyfinQt/dto/artistinfo.h +++ b/core/include/JellyfinQt/dto/artistinfo.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/songinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static ArtistInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -107,11 +111,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -165,7 +169,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -174,6 +178,18 @@ protected: QList m_songInfos; }; +} // NS DTO + +namespace Support { + +using ArtistInfo = Jellyfin::DTO::ArtistInfo; + +template <> +ArtistInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ArtistInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/artistinforemotesearchquery.h b/core/include/JellyfinQt/dto/artistinforemotesearchquery.h index ce69743..5dffaa9 100644 --- a/core/include/JellyfinQt/dto/artistinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/artistinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/artistinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ArtistInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using ArtistInfoRemoteSearchQuery = Jellyfin::DTO::ArtistInfoRemoteSearchQuery; + +template <> +ArtistInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ArtistInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/authenticateuserbyname.h b/core/include/JellyfinQt/dto/authenticateuserbyname.h index 4d51c37..a64e595 100644 --- a/core/include/JellyfinQt/dto/authenticateuserbyname.h +++ b/core/include/JellyfinQt/dto/authenticateuserbyname.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static AuthenticateUserByName fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -96,6 +100,18 @@ protected: QString m_password; }; +} // NS DTO + +namespace Support { + +using AuthenticateUserByName = Jellyfin::DTO::AuthenticateUserByName; + +template <> +AuthenticateUserByName fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AuthenticateUserByName &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/authenticationinfo.h b/core/include/JellyfinQt/dto/authenticationinfo.h index a205783..1072ff4 100644 --- a/core/include/JellyfinQt/dto/authenticationinfo.h +++ b/core/include/JellyfinQt/dto/authenticationinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static AuthenticationInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -187,6 +191,18 @@ protected: QString m_userName; }; +} // NS DTO + +namespace Support { + +using AuthenticationInfo = Jellyfin::DTO::AuthenticationInfo; + +template <> +AuthenticationInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AuthenticationInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/authenticationinfoqueryresult.h b/core/include/JellyfinQt/dto/authenticationinfoqueryresult.h index 7dd2468..24fee3a 100644 --- a/core/include/JellyfinQt/dto/authenticationinfoqueryresult.h +++ b/core/include/JellyfinQt/dto/authenticationinfoqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/authenticationinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static AuthenticationInfoQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using AuthenticationInfoQueryResult = Jellyfin::DTO::AuthenticationInfoQueryResult; + +template <> +AuthenticationInfoQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AuthenticationInfoQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/authenticationresult.h b/core/include/JellyfinQt/dto/authenticationresult.h index 2680ef2..2de547e 100644 --- a/core/include/JellyfinQt/dto/authenticationresult.h +++ b/core/include/JellyfinQt/dto/authenticationresult.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/userdto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static AuthenticationResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -91,6 +95,18 @@ protected: QString m_serverId; }; +} // NS DTO + +namespace Support { + +using AuthenticationResult = Jellyfin::DTO::AuthenticationResult; + +template <> +AuthenticationResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const AuthenticationResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/baseitem.h b/core/include/JellyfinQt/dto/baseitem.h index aecfd53..86434d8 100644 --- a/core/include/JellyfinQt/dto/baseitem.h +++ b/core/include/JellyfinQt/dto/baseitem.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/mediaurl.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static BaseItem fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -144,6 +148,18 @@ protected: bool m_supportsExternalTransfer; }; +} // NS DTO + +namespace Support { + +using BaseItem = Jellyfin::DTO::BaseItem; + +template <> +BaseItem fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BaseItem &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/baseitemdto.h b/core/include/JellyfinQt/dto/baseitemdto.h index a229513..a054ccb 100644 --- a/core/include/JellyfinQt/dto/baseitemdto.h +++ b/core/include/JellyfinQt/dto/baseitemdto.h @@ -59,6 +59,10 @@ #include "JellyfinQt/dto/videotype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -75,7 +79,7 @@ public: static BaseItemDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -549,11 +553,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -969,11 +973,11 @@ public: /** * @brief Gets or sets the image tags. */ - std::optional imageTags() const; + QJsonObject imageTags() const; /** * @brief Gets or sets the image tags. */ - void setImageTags(std::optional newImageTags); + void setImageTags(QJsonObject newImageTags); bool imageTagsNull() const; void setImageTagsNull(); @@ -1047,12 +1051,12 @@ public: * @brief Gets or sets the blurhashes for the image tags. Maps image type to dictionary mapping image tag to blurhash value. */ - std::optional imageBlurHashes() const; + QJsonObject imageBlurHashes() const; /** * @brief Gets or sets the blurhashes for the image tags. Maps image type to dictionary mapping image tag to blurhash value. */ - void setImageBlurHashes(std::optional newImageBlurHashes); + void setImageBlurHashes(QJsonObject newImageBlurHashes); bool imageBlurHashesNull() const; void setImageBlurHashesNull(); @@ -1595,7 +1599,7 @@ protected: std::optional m_indexNumberEnd = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; QList m_remoteTrailers; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_isHD = std::nullopt; std::optional m_isFolder = std::nullopt; QString m_parentId; @@ -1635,14 +1639,14 @@ protected: VideoType m_videoType; std::optional m_partCount = std::nullopt; std::optional m_mediaSourceCount = std::nullopt; - std::optional m_imageTags = std::nullopt; + QJsonObject m_imageTags; QStringList m_backdropImageTags; QStringList m_screenshotImageTags; QString m_parentLogoImageTag; QString m_parentArtItemId; QString m_parentArtImageTag; QString m_seriesThumbImageTag; - std::optional m_imageBlurHashes = std::nullopt; + QJsonObject m_imageBlurHashes; QString m_seriesStudio; QString m_parentThumbItemId; QString m_parentThumbImageTag; @@ -1698,6 +1702,18 @@ protected: QSharedPointer m_currentProgram = nullptr; }; +} // NS DTO + +namespace Support { + +using BaseItemDto = Jellyfin::DTO::BaseItemDto; + +template <> +BaseItemDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BaseItemDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/baseitemdtoqueryresult.h b/core/include/JellyfinQt/dto/baseitemdtoqueryresult.h index bb8e1d4..8f443b3 100644 --- a/core/include/JellyfinQt/dto/baseitemdtoqueryresult.h +++ b/core/include/JellyfinQt/dto/baseitemdtoqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/baseitemdto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static BaseItemDtoQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using BaseItemDtoQueryResult = Jellyfin::DTO::BaseItemDtoQueryResult; + +template <> +BaseItemDtoQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BaseItemDtoQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/baseitemperson.h b/core/include/JellyfinQt/dto/baseitemperson.h index 67dfa0c..91dc434 100644 --- a/core/include/JellyfinQt/dto/baseitemperson.h +++ b/core/include/JellyfinQt/dto/baseitemperson.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static BaseItemPerson fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -114,11 +118,11 @@ public: /** * @brief Gets or sets the primary image blurhash. */ - std::optional imageBlurHashes() const; + QJsonObject imageBlurHashes() const; /** * @brief Gets or sets the primary image blurhash. */ - void setImageBlurHashes(std::optional newImageBlurHashes); + void setImageBlurHashes(QJsonObject newImageBlurHashes); bool imageBlurHashesNull() const; void setImageBlurHashesNull(); @@ -129,9 +133,21 @@ protected: QString m_role; QString m_type; QString m_primaryImageTag; - std::optional m_imageBlurHashes = std::nullopt; + QJsonObject m_imageBlurHashes; }; +} // NS DTO + +namespace Support { + +using BaseItemPerson = Jellyfin::DTO::BaseItemPerson; + +template <> +BaseItemPerson fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BaseItemPerson &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/basepluginconfiguration.h b/core/include/JellyfinQt/dto/basepluginconfiguration.h index 487cdcc..f204b7d 100644 --- a/core/include/JellyfinQt/dto/basepluginconfiguration.h +++ b/core/include/JellyfinQt/dto/basepluginconfiguration.h @@ -32,6 +32,10 @@ #include +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { diff --git a/core/include/JellyfinQt/dto/bookinfo.h b/core/include/JellyfinQt/dto/bookinfo.h index 809626a..e5bdb8e 100644 --- a/core/include/JellyfinQt/dto/bookinfo.h +++ b/core/include/JellyfinQt/dto/bookinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static BookInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -162,7 +166,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -171,6 +175,18 @@ protected: QString m_seriesName; }; +} // NS DTO + +namespace Support { + +using BookInfo = Jellyfin::DTO::BookInfo; + +template <> +BookInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BookInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/bookinforemotesearchquery.h b/core/include/JellyfinQt/dto/bookinforemotesearchquery.h index 0441e89..5cfa3fa 100644 --- a/core/include/JellyfinQt/dto/bookinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/bookinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/bookinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static BookInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using BookInfoRemoteSearchQuery = Jellyfin::DTO::BookInfoRemoteSearchQuery; + +template <> +BookInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BookInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/boxsetinfo.h b/core/include/JellyfinQt/dto/boxsetinfo.h index 86788a5..84a3734 100644 --- a/core/include/JellyfinQt/dto/boxsetinfo.h +++ b/core/include/JellyfinQt/dto/boxsetinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static BoxSetInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -155,7 +159,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -163,6 +167,18 @@ protected: bool m_isAutomated; }; +} // NS DTO + +namespace Support { + +using BoxSetInfo = Jellyfin::DTO::BoxSetInfo; + +template <> +BoxSetInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BoxSetInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/boxsetinforemotesearchquery.h b/core/include/JellyfinQt/dto/boxsetinforemotesearchquery.h index 9c27d8e..9c20d90 100644 --- a/core/include/JellyfinQt/dto/boxsetinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/boxsetinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/boxsetinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static BoxSetInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using BoxSetInfoRemoteSearchQuery = Jellyfin::DTO::BoxSetInfoRemoteSearchQuery; + +template <> +BoxSetInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BoxSetInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/brandingoptions.h b/core/include/JellyfinQt/dto/brandingoptions.h index 4fb79c4..1059eda 100644 --- a/core/include/JellyfinQt/dto/brandingoptions.h +++ b/core/include/JellyfinQt/dto/brandingoptions.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static BrandingOptions fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_customCss; }; +} // NS DTO + +namespace Support { + +using BrandingOptions = Jellyfin::DTO::BrandingOptions; + +template <> +BrandingOptions fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BrandingOptions &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/bufferrequestdto.h b/core/include/JellyfinQt/dto/bufferrequestdto.h index f7bd882..1b72b20 100644 --- a/core/include/JellyfinQt/dto/bufferrequestdto.h +++ b/core/include/JellyfinQt/dto/bufferrequestdto.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static BufferRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -101,6 +105,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using BufferRequestDto = Jellyfin::DTO::BufferRequestDto; + +template <> +BufferRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const BufferRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channelfeatures.h b/core/include/JellyfinQt/dto/channelfeatures.h index 454a6dd..4dd68bb 100644 --- a/core/include/JellyfinQt/dto/channelfeatures.h +++ b/core/include/JellyfinQt/dto/channelfeatures.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/channelmediatype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static ChannelFeatures fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -199,6 +203,18 @@ protected: bool m_supportsContentDownloading; }; +} // NS DTO + +namespace Support { + +using ChannelFeatures = Jellyfin::DTO::ChannelFeatures; + +template <> +ChannelFeatures fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ChannelFeatures &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channelitemsortfield.h b/core/include/JellyfinQt/dto/channelitemsortfield.h index 489eabe..dcc630b 100644 --- a/core/include/JellyfinQt/dto/channelitemsortfield.h +++ b/core/include/JellyfinQt/dto/channelitemsortfield.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit ChannelItemSortFieldClass(); }; -typedef ChannelItemSortFieldClass::Value ChannelItemSortField; +using ChannelItemSortField = ChannelItemSortFieldClass::Value; + +} // NS DTO + +namespace Support { + +using ChannelItemSortField = Jellyfin::DTO::ChannelItemSortField; + +template <> +ChannelItemSortField fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ChannelItemSortField &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channelmappingoptionsdto.h b/core/include/JellyfinQt/dto/channelmappingoptionsdto.h index 34629b2..18a4c90 100644 --- a/core/include/JellyfinQt/dto/channelmappingoptionsdto.h +++ b/core/include/JellyfinQt/dto/channelmappingoptionsdto.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/tunerchannelmapping.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static ChannelMappingOptionsDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -113,6 +117,18 @@ protected: QString m_providerName; }; +} // NS DTO + +namespace Support { + +using ChannelMappingOptionsDto = Jellyfin::DTO::ChannelMappingOptionsDto; + +template <> +ChannelMappingOptionsDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ChannelMappingOptionsDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channelmediacontenttype.h b/core/include/JellyfinQt/dto/channelmediacontenttype.h index 778d953..57a81eb 100644 --- a/core/include/JellyfinQt/dto/channelmediacontenttype.h +++ b/core/include/JellyfinQt/dto/channelmediacontenttype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,19 @@ private: explicit ChannelMediaContentTypeClass(); }; -typedef ChannelMediaContentTypeClass::Value ChannelMediaContentType; +using ChannelMediaContentType = ChannelMediaContentTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ChannelMediaContentType = Jellyfin::DTO::ChannelMediaContentType; + +template <> +ChannelMediaContentType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ChannelMediaContentType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channelmediatype.h b/core/include/JellyfinQt/dto/channelmediatype.h index 5c06190..dd9e4b6 100644 --- a/core/include/JellyfinQt/dto/channelmediatype.h +++ b/core/include/JellyfinQt/dto/channelmediatype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit ChannelMediaTypeClass(); }; -typedef ChannelMediaTypeClass::Value ChannelMediaType; +using ChannelMediaType = ChannelMediaTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ChannelMediaType = Jellyfin::DTO::ChannelMediaType; + +template <> +ChannelMediaType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ChannelMediaType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/channeltype.h b/core/include/JellyfinQt/dto/channeltype.h index 680df3f..d71e5d2 100644 --- a/core/include/JellyfinQt/dto/channeltype.h +++ b/core/include/JellyfinQt/dto/channeltype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit ChannelTypeClass(); }; -typedef ChannelTypeClass::Value ChannelType; +using ChannelType = ChannelTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ChannelType = Jellyfin::DTO::ChannelType; + +template <> +ChannelType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ChannelType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/chapterinfo.h b/core/include/JellyfinQt/dto/chapterinfo.h index 1ac895b..8846f73 100644 --- a/core/include/JellyfinQt/dto/chapterinfo.h +++ b/core/include/JellyfinQt/dto/chapterinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static ChapterInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -109,6 +113,18 @@ protected: QString m_imageTag; }; +} // NS DTO + +namespace Support { + +using ChapterInfo = Jellyfin::DTO::ChapterInfo; + +template <> +ChapterInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ChapterInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/clientcapabilities.h b/core/include/JellyfinQt/dto/clientcapabilities.h index 2b99695..b4eb113 100644 --- a/core/include/JellyfinQt/dto/clientcapabilities.h +++ b/core/include/JellyfinQt/dto/clientcapabilities.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/generalcommandtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static ClientCapabilities fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -135,6 +139,18 @@ protected: QString m_iconUrl; }; +} // NS DTO + +namespace Support { + +using ClientCapabilities = Jellyfin::DTO::ClientCapabilities; + +template <> +ClientCapabilities fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ClientCapabilities &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/clientcapabilitiesdto.h b/core/include/JellyfinQt/dto/clientcapabilitiesdto.h index 8355593..b9e06df 100644 --- a/core/include/JellyfinQt/dto/clientcapabilitiesdto.h +++ b/core/include/JellyfinQt/dto/clientcapabilitiesdto.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/generalcommandtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static ClientCapabilitiesDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -171,6 +175,18 @@ protected: QString m_iconUrl; }; +} // NS DTO + +namespace Support { + +using ClientCapabilitiesDto = Jellyfin::DTO::ClientCapabilitiesDto; + +template <> +ClientCapabilitiesDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ClientCapabilitiesDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/codecprofile.h b/core/include/JellyfinQt/dto/codecprofile.h index 8dd2b3e..af2c7ff 100644 --- a/core/include/JellyfinQt/dto/codecprofile.h +++ b/core/include/JellyfinQt/dto/codecprofile.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/profilecondition.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static CodecProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -102,6 +106,18 @@ protected: QString m_container; }; +} // NS DTO + +namespace Support { + +using CodecProfile = Jellyfin::DTO::CodecProfile; + +template <> +CodecProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CodecProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/codectype.h b/core/include/JellyfinQt/dto/codectype.h index 6f88b2d..65d5d86 100644 --- a/core/include/JellyfinQt/dto/codectype.h +++ b/core/include/JellyfinQt/dto/codectype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit CodecTypeClass(); }; -typedef CodecTypeClass::Value CodecType; +using CodecType = CodecTypeClass::Value; + +} // NS DTO + +namespace Support { + +using CodecType = Jellyfin::DTO::CodecType; + +template <> +CodecType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const CodecType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/collectioncreationresult.h b/core/include/JellyfinQt/dto/collectioncreationresult.h index af06f7a..d6fd09d 100644 --- a/core/include/JellyfinQt/dto/collectioncreationresult.h +++ b/core/include/JellyfinQt/dto/collectioncreationresult.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static CollectionCreationResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -66,6 +70,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using CollectionCreationResult = Jellyfin::DTO::CollectionCreationResult; + +template <> +CollectionCreationResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CollectionCreationResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/configurationpageinfo.h b/core/include/JellyfinQt/dto/configurationpageinfo.h index b4f448b..46c7ef7 100644 --- a/core/include/JellyfinQt/dto/configurationpageinfo.h +++ b/core/include/JellyfinQt/dto/configurationpageinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/configurationpagetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static ConfigurationPageInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -137,6 +141,18 @@ protected: QString m_pluginId; }; +} // NS DTO + +namespace Support { + +using ConfigurationPageInfo = Jellyfin::DTO::ConfigurationPageInfo; + +template <> +ConfigurationPageInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ConfigurationPageInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/configurationpagetype.h b/core/include/JellyfinQt/dto/configurationpagetype.h index f38a273..45b5297 100644 --- a/core/include/JellyfinQt/dto/configurationpagetype.h +++ b/core/include/JellyfinQt/dto/configurationpagetype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit ConfigurationPageTypeClass(); }; -typedef ConfigurationPageTypeClass::Value ConfigurationPageType; +using ConfigurationPageType = ConfigurationPageTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType; + +template <> +ConfigurationPageType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ConfigurationPageType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/containerprofile.h b/core/include/JellyfinQt/dto/containerprofile.h index c4e3605..3b2b6bc 100644 --- a/core/include/JellyfinQt/dto/containerprofile.h +++ b/core/include/JellyfinQt/dto/containerprofile.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/profilecondition.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static ContainerProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -86,6 +90,18 @@ protected: QString m_container; }; +} // NS DTO + +namespace Support { + +using ContainerProfile = Jellyfin::DTO::ContainerProfile; + +template <> +ContainerProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ContainerProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/controlresponse.h b/core/include/JellyfinQt/dto/controlresponse.h index 61ffdb2..142fdfe 100644 --- a/core/include/JellyfinQt/dto/controlresponse.h +++ b/core/include/JellyfinQt/dto/controlresponse.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,13 +57,13 @@ public: static ControlResponse fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties - std::optional headers() const; + QJsonObject headers() const; - void setHeaders(std::optional newHeaders); + void setHeaders(QJsonObject newHeaders); bool headersNull() const; void setHeadersNull(); @@ -77,11 +81,23 @@ public: protected: - std::optional m_headers = std::nullopt; + QJsonObject m_headers; QString m_xml; bool m_isSuccessful; }; +} // NS DTO + +namespace Support { + +using ControlResponse = Jellyfin::DTO::ControlResponse; + +template <> +ControlResponse fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ControlResponse &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/countryinfo.h b/core/include/JellyfinQt/dto/countryinfo.h index af91b8f..eb2f675 100644 --- a/core/include/JellyfinQt/dto/countryinfo.h +++ b/core/include/JellyfinQt/dto/countryinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static CountryInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -108,6 +112,18 @@ protected: QString m_threeLetterISORegionName; }; +} // NS DTO + +namespace Support { + +using CountryInfo = Jellyfin::DTO::CountryInfo; + +template <> +CountryInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CountryInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/createplaylistdto.h b/core/include/JellyfinQt/dto/createplaylistdto.h index 7e2121b..6381cf8 100644 --- a/core/include/JellyfinQt/dto/createplaylistdto.h +++ b/core/include/JellyfinQt/dto/createplaylistdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static CreatePlaylistDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -110,6 +114,18 @@ protected: QString m_mediaType; }; +} // NS DTO + +namespace Support { + +using CreatePlaylistDto = Jellyfin::DTO::CreatePlaylistDto; + +template <> +CreatePlaylistDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CreatePlaylistDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/createuserbyname.h b/core/include/JellyfinQt/dto/createuserbyname.h index 0063183..d46db3d 100644 --- a/core/include/JellyfinQt/dto/createuserbyname.h +++ b/core/include/JellyfinQt/dto/createuserbyname.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static CreateUserByName fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_password; }; +} // NS DTO + +namespace Support { + +using CreateUserByName = Jellyfin::DTO::CreateUserByName; + +template <> +CreateUserByName fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CreateUserByName &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/culturedto.h b/core/include/JellyfinQt/dto/culturedto.h index 43944f9..3ef3df3 100644 --- a/core/include/JellyfinQt/dto/culturedto.h +++ b/core/include/JellyfinQt/dto/culturedto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static CultureDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -118,6 +122,18 @@ protected: QStringList m_threeLetterISOLanguageNames; }; +} // NS DTO + +namespace Support { + +using CultureDto = Jellyfin::DTO::CultureDto; + +template <> +CultureDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const CultureDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/dayofweek.h b/core/include/JellyfinQt/dto/dayofweek.h index 7e77253..0d7a36c 100644 --- a/core/include/JellyfinQt/dto/dayofweek.h +++ b/core/include/JellyfinQt/dto/dayofweek.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit DayOfWeekClass(); }; -typedef DayOfWeekClass::Value DayOfWeek; +using DayOfWeek = DayOfWeekClass::Value; + +} // NS DTO + +namespace Support { + +using DayOfWeek = Jellyfin::DTO::DayOfWeek; + +template <> +DayOfWeek fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const DayOfWeek &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/daypattern.h b/core/include/JellyfinQt/dto/daypattern.h index f4d18ba..d3a3884 100644 --- a/core/include/JellyfinQt/dto/daypattern.h +++ b/core/include/JellyfinQt/dto/daypattern.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit DayPatternClass(); }; -typedef DayPatternClass::Value DayPattern; +using DayPattern = DayPatternClass::Value; + +} // NS DTO + +namespace Support { + +using DayPattern = Jellyfin::DTO::DayPattern; + +template <> +DayPattern fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const DayPattern &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/defaultdirectorybrowserinfodto.h b/core/include/JellyfinQt/dto/defaultdirectorybrowserinfodto.h index 74ff6a8..000ada7 100644 --- a/core/include/JellyfinQt/dto/defaultdirectorybrowserinfodto.h +++ b/core/include/JellyfinQt/dto/defaultdirectorybrowserinfodto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static DefaultDirectoryBrowserInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -72,6 +76,18 @@ protected: QString m_path; }; +} // NS DTO + +namespace Support { + +using DefaultDirectoryBrowserInfoDto = Jellyfin::DTO::DefaultDirectoryBrowserInfoDto; + +template <> +DefaultDirectoryBrowserInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DefaultDirectoryBrowserInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceidentification.h b/core/include/JellyfinQt/dto/deviceidentification.h index c2574e9..d4d0216 100644 --- a/core/include/JellyfinQt/dto/deviceidentification.h +++ b/core/include/JellyfinQt/dto/deviceidentification.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/httpheaderinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static DeviceIdentification fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -171,6 +175,18 @@ protected: QList m_headers; }; +} // NS DTO + +namespace Support { + +using DeviceIdentification = Jellyfin::DTO::DeviceIdentification; + +template <> +DeviceIdentification fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceIdentification &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceinfo.h b/core/include/JellyfinQt/dto/deviceinfo.h index c7c8a9b..d574463 100644 --- a/core/include/JellyfinQt/dto/deviceinfo.h +++ b/core/include/JellyfinQt/dto/deviceinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/clientcapabilities.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static DeviceInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -153,6 +157,18 @@ protected: QString m_iconUrl; }; +} // NS DTO + +namespace Support { + +using DeviceInfo = Jellyfin::DTO::DeviceInfo; + +template <> +DeviceInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceinfoqueryresult.h b/core/include/JellyfinQt/dto/deviceinfoqueryresult.h index 8500430..8c972a9 100644 --- a/core/include/JellyfinQt/dto/deviceinfoqueryresult.h +++ b/core/include/JellyfinQt/dto/deviceinfoqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/deviceinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static DeviceInfoQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult; + +template <> +DeviceInfoQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceInfoQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceoptions.h b/core/include/JellyfinQt/dto/deviceoptions.h index 98acb12..ec4a302 100644 --- a/core/include/JellyfinQt/dto/deviceoptions.h +++ b/core/include/JellyfinQt/dto/deviceoptions.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static DeviceOptions fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -68,6 +72,18 @@ protected: QString m_customName; }; +} // NS DTO + +namespace Support { + +using DeviceOptions = Jellyfin::DTO::DeviceOptions; + +template <> +DeviceOptions fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceOptions &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceprofile.h b/core/include/JellyfinQt/dto/deviceprofile.h index 8105aaa..0ff9d82 100644 --- a/core/include/JellyfinQt/dto/deviceprofile.h +++ b/core/include/JellyfinQt/dto/deviceprofile.h @@ -48,6 +48,10 @@ #include "JellyfinQt/dto/xmlattribute.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -64,7 +68,7 @@ public: static DeviceProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -513,6 +517,18 @@ protected: QList m_subtitleProfiles; }; +} // NS DTO + +namespace Support { + +using DeviceProfile = Jellyfin::DTO::DeviceProfile; + +template <> +DeviceProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceprofileinfo.h b/core/include/JellyfinQt/dto/deviceprofileinfo.h index d9cb32c..f6a21be 100644 --- a/core/include/JellyfinQt/dto/deviceprofileinfo.h +++ b/core/include/JellyfinQt/dto/deviceprofileinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/deviceprofiletype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static DeviceProfileInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -91,6 +95,18 @@ protected: DeviceProfileType m_type; }; +} // NS DTO + +namespace Support { + +using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo; + +template <> +DeviceProfileInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DeviceProfileInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/deviceprofiletype.h b/core/include/JellyfinQt/dto/deviceprofiletype.h index 1a61277..e4351d6 100644 --- a/core/include/JellyfinQt/dto/deviceprofiletype.h +++ b/core/include/JellyfinQt/dto/deviceprofiletype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit DeviceProfileTypeClass(); }; -typedef DeviceProfileTypeClass::Value DeviceProfileType; +using DeviceProfileType = DeviceProfileTypeClass::Value; + +} // NS DTO + +namespace Support { + +using DeviceProfileType = Jellyfin::DTO::DeviceProfileType; + +template <> +DeviceProfileType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const DeviceProfileType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/directplayprofile.h b/core/include/JellyfinQt/dto/directplayprofile.h index 979b365..494b25f 100644 --- a/core/include/JellyfinQt/dto/directplayprofile.h +++ b/core/include/JellyfinQt/dto/directplayprofile.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/dlnaprofiletype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static DirectPlayProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -91,6 +95,18 @@ protected: DlnaProfileType m_type; }; +} // NS DTO + +namespace Support { + +using DirectPlayProfile = Jellyfin::DTO::DirectPlayProfile; + +template <> +DirectPlayProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DirectPlayProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/displaypreferencesdto.h b/core/include/JellyfinQt/dto/displaypreferencesdto.h index 5072ef3..8a814e9 100644 --- a/core/include/JellyfinQt/dto/displaypreferencesdto.h +++ b/core/include/JellyfinQt/dto/displaypreferencesdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/sortorder.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static DisplayPreferencesDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -132,11 +136,11 @@ public: /** * @brief Gets or sets the custom prefs. */ - std::optional customPrefs() const; + QJsonObject customPrefs() const; /** * @brief Gets or sets the custom prefs. */ - void setCustomPrefs(std::optional newCustomPrefs); + void setCustomPrefs(QJsonObject newCustomPrefs); bool customPrefsNull() const; void setCustomPrefsNull(); @@ -197,7 +201,7 @@ protected: bool m_rememberIndexing; qint32 m_primaryImageHeight; qint32 m_primaryImageWidth; - std::optional m_customPrefs = std::nullopt; + QJsonObject m_customPrefs; ScrollDirection m_scrollDirection; bool m_showBackdrop; bool m_rememberSorting; @@ -206,6 +210,18 @@ protected: QString m_client; }; +} // NS DTO + +namespace Support { + +using DisplayPreferencesDto = Jellyfin::DTO::DisplayPreferencesDto; + +template <> +DisplayPreferencesDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const DisplayPreferencesDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/dlnaprofiletype.h b/core/include/JellyfinQt/dto/dlnaprofiletype.h index cbef3e1..4003e43 100644 --- a/core/include/JellyfinQt/dto/dlnaprofiletype.h +++ b/core/include/JellyfinQt/dto/dlnaprofiletype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit DlnaProfileTypeClass(); }; -typedef DlnaProfileTypeClass::Value DlnaProfileType; +using DlnaProfileType = DlnaProfileTypeClass::Value; + +} // NS DTO + +namespace Support { + +using DlnaProfileType = Jellyfin::DTO::DlnaProfileType; + +template <> +DlnaProfileType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const DlnaProfileType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/dynamicdayofweek.h b/core/include/JellyfinQt/dto/dynamicdayofweek.h index b242c64..c9c8d02 100644 --- a/core/include/JellyfinQt/dto/dynamicdayofweek.h +++ b/core/include/JellyfinQt/dto/dynamicdayofweek.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -60,7 +64,19 @@ private: explicit DynamicDayOfWeekClass(); }; -typedef DynamicDayOfWeekClass::Value DynamicDayOfWeek; +using DynamicDayOfWeek = DynamicDayOfWeekClass::Value; + +} // NS DTO + +namespace Support { + +using DynamicDayOfWeek = Jellyfin::DTO::DynamicDayOfWeek; + +template <> +DynamicDayOfWeek fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const DynamicDayOfWeek &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/encodingcontext.h b/core/include/JellyfinQt/dto/encodingcontext.h index 1d86ad1..a7b82d2 100644 --- a/core/include/JellyfinQt/dto/encodingcontext.h +++ b/core/include/JellyfinQt/dto/encodingcontext.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit EncodingContextClass(); }; -typedef EncodingContextClass::Value EncodingContext; +using EncodingContext = EncodingContextClass::Value; + +} // NS DTO + +namespace Support { + +using EncodingContext = Jellyfin::DTO::EncodingContext; + +template <> +EncodingContext fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const EncodingContext &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/endpointinfo.h b/core/include/JellyfinQt/dto/endpointinfo.h index a98b94b..9db0eb3 100644 --- a/core/include/JellyfinQt/dto/endpointinfo.h +++ b/core/include/JellyfinQt/dto/endpointinfo.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static EndPointInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -71,6 +75,18 @@ protected: bool m_isInNetwork; }; +} // NS DTO + +namespace Support { + +using EndPointInfo = Jellyfin::DTO::EndPointInfo; + +template <> +EndPointInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const EndPointInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/externalidinfo.h b/core/include/JellyfinQt/dto/externalidinfo.h index 04089d9..5ad7f13 100644 --- a/core/include/JellyfinQt/dto/externalidinfo.h +++ b/core/include/JellyfinQt/dto/externalidinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/externalidmediatype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static ExternalIdInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -103,6 +107,18 @@ protected: QString m_urlFormatString; }; +} // NS DTO + +namespace Support { + +using ExternalIdInfo = Jellyfin::DTO::ExternalIdInfo; + +template <> +ExternalIdInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ExternalIdInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/externalidmediatype.h b/core/include/JellyfinQt/dto/externalidmediatype.h index 47cbb25..cdf05a5 100644 --- a/core/include/JellyfinQt/dto/externalidmediatype.h +++ b/core/include/JellyfinQt/dto/externalidmediatype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -62,7 +66,19 @@ private: explicit ExternalIdMediaTypeClass(); }; -typedef ExternalIdMediaTypeClass::Value ExternalIdMediaType; +using ExternalIdMediaType = ExternalIdMediaTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ExternalIdMediaType = Jellyfin::DTO::ExternalIdMediaType; + +template <> +ExternalIdMediaType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ExternalIdMediaType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/externalurl.h b/core/include/JellyfinQt/dto/externalurl.h index 8467580..d9dc5c2 100644 --- a/core/include/JellyfinQt/dto/externalurl.h +++ b/core/include/JellyfinQt/dto/externalurl.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ExternalUrl fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_url; }; +} // NS DTO + +namespace Support { + +using ExternalUrl = Jellyfin::DTO::ExternalUrl; + +template <> +ExternalUrl fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ExternalUrl &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/ffmpeglocation.h b/core/include/JellyfinQt/dto/ffmpeglocation.h index 7f83a2b..1aac3f0 100644 --- a/core/include/JellyfinQt/dto/ffmpeglocation.h +++ b/core/include/JellyfinQt/dto/ffmpeglocation.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit FFmpegLocationClass(); }; -typedef FFmpegLocationClass::Value FFmpegLocation; +using FFmpegLocation = FFmpegLocationClass::Value; + +} // NS DTO + +namespace Support { + +using FFmpegLocation = Jellyfin::DTO::FFmpegLocation; + +template <> +FFmpegLocation fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const FFmpegLocation &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/filesystementryinfo.h b/core/include/JellyfinQt/dto/filesystementryinfo.h index ad789e3..3b6de62 100644 --- a/core/include/JellyfinQt/dto/filesystementryinfo.h +++ b/core/include/JellyfinQt/dto/filesystementryinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/filesystementrytype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static FileSystemEntryInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -91,6 +95,18 @@ protected: FileSystemEntryType m_type; }; +} // NS DTO + +namespace Support { + +using FileSystemEntryInfo = Jellyfin::DTO::FileSystemEntryInfo; + +template <> +FileSystemEntryInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const FileSystemEntryInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/filesystementrytype.h b/core/include/JellyfinQt/dto/filesystementrytype.h index d2a5d56..0fa8acc 100644 --- a/core/include/JellyfinQt/dto/filesystementrytype.h +++ b/core/include/JellyfinQt/dto/filesystementrytype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit FileSystemEntryTypeClass(); }; -typedef FileSystemEntryTypeClass::Value FileSystemEntryType; +using FileSystemEntryType = FileSystemEntryTypeClass::Value; + +} // NS DTO + +namespace Support { + +using FileSystemEntryType = Jellyfin::DTO::FileSystemEntryType; + +template <> +FileSystemEntryType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const FileSystemEntryType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/fontfile.h b/core/include/JellyfinQt/dto/fontfile.h index 84fc669..d3085b3 100644 --- a/core/include/JellyfinQt/dto/fontfile.h +++ b/core/include/JellyfinQt/dto/fontfile.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static FontFile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -103,6 +107,18 @@ protected: QDateTime m_dateModified; }; +} // NS DTO + +namespace Support { + +using FontFile = Jellyfin::DTO::FontFile; + +template <> +FontFile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const FontFile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/forgotpasswordaction.h b/core/include/JellyfinQt/dto/forgotpasswordaction.h index 3c9e618..4c27a77 100644 --- a/core/include/JellyfinQt/dto/forgotpasswordaction.h +++ b/core/include/JellyfinQt/dto/forgotpasswordaction.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit ForgotPasswordActionClass(); }; -typedef ForgotPasswordActionClass::Value ForgotPasswordAction; +using ForgotPasswordAction = ForgotPasswordActionClass::Value; + +} // NS DTO + +namespace Support { + +using ForgotPasswordAction = Jellyfin::DTO::ForgotPasswordAction; + +template <> +ForgotPasswordAction fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ForgotPasswordAction &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/forgotpassworddto.h b/core/include/JellyfinQt/dto/forgotpassworddto.h index 86b4858..5754a7f 100644 --- a/core/include/JellyfinQt/dto/forgotpassworddto.h +++ b/core/include/JellyfinQt/dto/forgotpassworddto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ForgotPasswordDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_enteredUsername; }; +} // NS DTO + +namespace Support { + +using ForgotPasswordDto = Jellyfin::DTO::ForgotPasswordDto; + +template <> +ForgotPasswordDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ForgotPasswordDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/forgotpasswordresult.h b/core/include/JellyfinQt/dto/forgotpasswordresult.h index 745231d..4138ac0 100644 --- a/core/include/JellyfinQt/dto/forgotpasswordresult.h +++ b/core/include/JellyfinQt/dto/forgotpasswordresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/forgotpasswordaction.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ForgotPasswordResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -92,6 +96,18 @@ protected: QDateTime m_pinExpirationDate; }; +} // NS DTO + +namespace Support { + +using ForgotPasswordResult = Jellyfin::DTO::ForgotPasswordResult; + +template <> +ForgotPasswordResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ForgotPasswordResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/generalcommand.h b/core/include/JellyfinQt/dto/generalcommand.h index c7482e1..8d042ff 100644 --- a/core/include/JellyfinQt/dto/generalcommand.h +++ b/core/include/JellyfinQt/dto/generalcommand.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/generalcommandtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static GeneralCommand fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -68,9 +72,9 @@ public: void setControllingUserId(QString newControllingUserId); - std::optional arguments() const; + QJsonObject arguments() const; - void setArguments(std::optional newArguments); + void setArguments(QJsonObject newArguments); bool argumentsNull() const; void setArgumentsNull(); @@ -78,9 +82,21 @@ public: protected: GeneralCommandType m_name; QString m_controllingUserId; - std::optional m_arguments = std::nullopt; + QJsonObject m_arguments; }; +} // NS DTO + +namespace Support { + +using GeneralCommand = Jellyfin::DTO::GeneralCommand; + +template <> +GeneralCommand fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const GeneralCommand &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/generalcommandtype.h b/core/include/JellyfinQt/dto/generalcommandtype.h index 6e5388a..05cb573 100644 --- a/core/include/JellyfinQt/dto/generalcommandtype.h +++ b/core/include/JellyfinQt/dto/generalcommandtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -91,7 +95,19 @@ private: explicit GeneralCommandTypeClass(); }; -typedef GeneralCommandTypeClass::Value GeneralCommandType; +using GeneralCommandType = GeneralCommandTypeClass::Value; + +} // NS DTO + +namespace Support { + +using GeneralCommandType = Jellyfin::DTO::GeneralCommandType; + +template <> +GeneralCommandType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GeneralCommandType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/getprogramsdto.h b/core/include/JellyfinQt/dto/getprogramsdto.h index d8e9334..660c856 100644 --- a/core/include/JellyfinQt/dto/getprogramsdto.h +++ b/core/include/JellyfinQt/dto/getprogramsdto.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/itemfields.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static GetProgramsDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -425,6 +429,18 @@ protected: QList m_fields; }; +} // NS DTO + +namespace Support { + +using GetProgramsDto = Jellyfin::DTO::GetProgramsDto; + +template <> +GetProgramsDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const GetProgramsDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/groupinfodto.h b/core/include/JellyfinQt/dto/groupinfodto.h index b37d670..e6707ff 100644 --- a/core/include/JellyfinQt/dto/groupinfodto.h +++ b/core/include/JellyfinQt/dto/groupinfodto.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/groupstatetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static GroupInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -114,6 +118,18 @@ protected: QDateTime m_lastUpdatedAt; }; +} // NS DTO + +namespace Support { + +using GroupInfoDto = Jellyfin::DTO::GroupInfoDto; + +template <> +GroupInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const GroupInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/groupqueuemode.h b/core/include/JellyfinQt/dto/groupqueuemode.h index 8f33d80..fe940aa 100644 --- a/core/include/JellyfinQt/dto/groupqueuemode.h +++ b/core/include/JellyfinQt/dto/groupqueuemode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit GroupQueueModeClass(); }; -typedef GroupQueueModeClass::Value GroupQueueMode; +using GroupQueueMode = GroupQueueModeClass::Value; + +} // NS DTO + +namespace Support { + +using GroupQueueMode = Jellyfin::DTO::GroupQueueMode; + +template <> +GroupQueueMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GroupQueueMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/grouprepeatmode.h b/core/include/JellyfinQt/dto/grouprepeatmode.h index 935279d..f92a453 100644 --- a/core/include/JellyfinQt/dto/grouprepeatmode.h +++ b/core/include/JellyfinQt/dto/grouprepeatmode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit GroupRepeatModeClass(); }; -typedef GroupRepeatModeClass::Value GroupRepeatMode; +using GroupRepeatMode = GroupRepeatModeClass::Value; + +} // NS DTO + +namespace Support { + +using GroupRepeatMode = Jellyfin::DTO::GroupRepeatMode; + +template <> +GroupRepeatMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GroupRepeatMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/groupshufflemode.h b/core/include/JellyfinQt/dto/groupshufflemode.h index 5d6553a..3de874e 100644 --- a/core/include/JellyfinQt/dto/groupshufflemode.h +++ b/core/include/JellyfinQt/dto/groupshufflemode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit GroupShuffleModeClass(); }; -typedef GroupShuffleModeClass::Value GroupShuffleMode; +using GroupShuffleMode = GroupShuffleModeClass::Value; + +} // NS DTO + +namespace Support { + +using GroupShuffleMode = Jellyfin::DTO::GroupShuffleMode; + +template <> +GroupShuffleMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GroupShuffleMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/groupstatetype.h b/core/include/JellyfinQt/dto/groupstatetype.h index bc95d38..28cc5a5 100644 --- a/core/include/JellyfinQt/dto/groupstatetype.h +++ b/core/include/JellyfinQt/dto/groupstatetype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit GroupStateTypeClass(); }; -typedef GroupStateTypeClass::Value GroupStateType; +using GroupStateType = GroupStateTypeClass::Value; + +} // NS DTO + +namespace Support { + +using GroupStateType = Jellyfin::DTO::GroupStateType; + +template <> +GroupStateType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GroupStateType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/groupupdatetype.h b/core/include/JellyfinQt/dto/groupupdatetype.h index 2936b2f..c13487b 100644 --- a/core/include/JellyfinQt/dto/groupupdatetype.h +++ b/core/include/JellyfinQt/dto/groupupdatetype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -61,7 +65,19 @@ private: explicit GroupUpdateTypeClass(); }; -typedef GroupUpdateTypeClass::Value GroupUpdateType; +using GroupUpdateType = GroupUpdateTypeClass::Value; + +} // NS DTO + +namespace Support { + +using GroupUpdateType = Jellyfin::DTO::GroupUpdateType; + +template <> +GroupUpdateType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const GroupUpdateType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/guideinfo.h b/core/include/JellyfinQt/dto/guideinfo.h index 708892e..1a1b65b 100644 --- a/core/include/JellyfinQt/dto/guideinfo.h +++ b/core/include/JellyfinQt/dto/guideinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static GuideInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -80,6 +84,18 @@ protected: QDateTime m_endDate; }; +} // NS DTO + +namespace Support { + +using GuideInfo = Jellyfin::DTO::GuideInfo; + +template <> +GuideInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const GuideInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/headermatchtype.h b/core/include/JellyfinQt/dto/headermatchtype.h index d77945b..8b37c1a 100644 --- a/core/include/JellyfinQt/dto/headermatchtype.h +++ b/core/include/JellyfinQt/dto/headermatchtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit HeaderMatchTypeClass(); }; -typedef HeaderMatchTypeClass::Value HeaderMatchType; +using HeaderMatchType = HeaderMatchTypeClass::Value; + +} // NS DTO + +namespace Support { + +using HeaderMatchType = Jellyfin::DTO::HeaderMatchType; + +template <> +HeaderMatchType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const HeaderMatchType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/httpheaderinfo.h b/core/include/JellyfinQt/dto/httpheaderinfo.h index 41396c0..253d1dc 100644 --- a/core/include/JellyfinQt/dto/httpheaderinfo.h +++ b/core/include/JellyfinQt/dto/httpheaderinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/headermatchtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static HttpHeaderInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -83,6 +87,18 @@ protected: HeaderMatchType m_match; }; +} // NS DTO + +namespace Support { + +using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo; + +template <> +HttpHeaderInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const HttpHeaderInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/ignorewaitrequestdto.h b/core/include/JellyfinQt/dto/ignorewaitrequestdto.h index bc522de..df3a9e6 100644 --- a/core/include/JellyfinQt/dto/ignorewaitrequestdto.h +++ b/core/include/JellyfinQt/dto/ignorewaitrequestdto.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static IgnoreWaitRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -69,6 +73,18 @@ protected: bool m_ignoreWait; }; +} // NS DTO + +namespace Support { + +using IgnoreWaitRequestDto = Jellyfin::DTO::IgnoreWaitRequestDto; + +template <> +IgnoreWaitRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const IgnoreWaitRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imagebynameinfo.h b/core/include/JellyfinQt/dto/imagebynameinfo.h index eb89a1c..0866c2f 100644 --- a/core/include/JellyfinQt/dto/imagebynameinfo.h +++ b/core/include/JellyfinQt/dto/imagebynameinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ImageByNameInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -118,6 +122,18 @@ protected: QString m_format; }; +} // NS DTO + +namespace Support { + +using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo; + +template <> +ImageByNameInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ImageByNameInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imageformat.h b/core/include/JellyfinQt/dto/imageformat.h index 718741a..78a1f3d 100644 --- a/core/include/JellyfinQt/dto/imageformat.h +++ b/core/include/JellyfinQt/dto/imageformat.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit ImageFormatClass(); }; -typedef ImageFormatClass::Value ImageFormat; +using ImageFormat = ImageFormatClass::Value; + +} // NS DTO + +namespace Support { + +using ImageFormat = Jellyfin::DTO::ImageFormat; + +template <> +ImageFormat fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ImageFormat &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imageinfo.h b/core/include/JellyfinQt/dto/imageinfo.h index 00abb49..bf43811 100644 --- a/core/include/JellyfinQt/dto/imageinfo.h +++ b/core/include/JellyfinQt/dto/imageinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/imagetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static ImageInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -149,6 +153,18 @@ protected: qint64 m_size; }; +} // NS DTO + +namespace Support { + +using ImageInfo = Jellyfin::DTO::ImageInfo; + +template <> +ImageInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ImageInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imageoption.h b/core/include/JellyfinQt/dto/imageoption.h index 9471391..4dcf4f2 100644 --- a/core/include/JellyfinQt/dto/imageoption.h +++ b/core/include/JellyfinQt/dto/imageoption.h @@ -37,6 +37,10 @@ #include "JellyfinQt/dto/imagetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ImageOption fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -86,6 +90,18 @@ protected: qint32 m_minWidth; }; +} // NS DTO + +namespace Support { + +using ImageOption = Jellyfin::DTO::ImageOption; + +template <> +ImageOption fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ImageOption &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imageorientation.h b/core/include/JellyfinQt/dto/imageorientation.h index c9c9b53..b270a70 100644 --- a/core/include/JellyfinQt/dto/imageorientation.h +++ b/core/include/JellyfinQt/dto/imageorientation.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,19 @@ private: explicit ImageOrientationClass(); }; -typedef ImageOrientationClass::Value ImageOrientation; +using ImageOrientation = ImageOrientationClass::Value; + +} // NS DTO + +namespace Support { + +using ImageOrientation = Jellyfin::DTO::ImageOrientation; + +template <> +ImageOrientation fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ImageOrientation &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imageproviderinfo.h b/core/include/JellyfinQt/dto/imageproviderinfo.h index 731ce28..0a30232 100644 --- a/core/include/JellyfinQt/dto/imageproviderinfo.h +++ b/core/include/JellyfinQt/dto/imageproviderinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/imagetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static ImageProviderInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -87,6 +91,18 @@ protected: QList m_supportedImages; }; +} // NS DTO + +namespace Support { + +using ImageProviderInfo = Jellyfin::DTO::ImageProviderInfo; + +template <> +ImageProviderInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ImageProviderInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imagesavingconvention.h b/core/include/JellyfinQt/dto/imagesavingconvention.h index 8aa9121..3737e92 100644 --- a/core/include/JellyfinQt/dto/imagesavingconvention.h +++ b/core/include/JellyfinQt/dto/imagesavingconvention.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit ImageSavingConventionClass(); }; -typedef ImageSavingConventionClass::Value ImageSavingConvention; +using ImageSavingConvention = ImageSavingConventionClass::Value; + +} // NS DTO + +namespace Support { + +using ImageSavingConvention = Jellyfin::DTO::ImageSavingConvention; + +template <> +ImageSavingConvention fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ImageSavingConvention &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/imagetype.h b/core/include/JellyfinQt/dto/imagetype.h index 714d64c..78255c1 100644 --- a/core/include/JellyfinQt/dto/imagetype.h +++ b/core/include/JellyfinQt/dto/imagetype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -63,7 +67,19 @@ private: explicit ImageTypeClass(); }; -typedef ImageTypeClass::Value ImageType; +using ImageType = ImageTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ImageType = Jellyfin::DTO::ImageType; + +template <> +ImageType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ImageType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/installationinfo.h b/core/include/JellyfinQt/dto/installationinfo.h index 7d220f8..10b8415 100644 --- a/core/include/JellyfinQt/dto/installationinfo.h +++ b/core/include/JellyfinQt/dto/installationinfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static InstallationInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -126,6 +130,18 @@ protected: QString m_checksum; }; +} // NS DTO + +namespace Support { + +using InstallationInfo = Jellyfin::DTO::InstallationInfo; + +template <> +InstallationInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const InstallationInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/iplugin.h b/core/include/JellyfinQt/dto/iplugin.h index 14a71a4..4055873 100644 --- a/core/include/JellyfinQt/dto/iplugin.h +++ b/core/include/JellyfinQt/dto/iplugin.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static IPlugin fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -136,6 +140,18 @@ protected: QString m_dataFolderPath; }; +} // NS DTO + +namespace Support { + +using IPlugin = Jellyfin::DTO::IPlugin; + +template <> +IPlugin fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const IPlugin &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/isotype.h b/core/include/JellyfinQt/dto/isotype.h index 3dd83d9..c6aa77f 100644 --- a/core/include/JellyfinQt/dto/isotype.h +++ b/core/include/JellyfinQt/dto/isotype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit IsoTypeClass(); }; -typedef IsoTypeClass::Value IsoType; +using IsoType = IsoTypeClass::Value; + +} // NS DTO + +namespace Support { + +using IsoType = Jellyfin::DTO::IsoType; + +template <> +IsoType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const IsoType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/itemcounts.h b/core/include/JellyfinQt/dto/itemcounts.h index c2928c7..c9f7b7e 100644 --- a/core/include/JellyfinQt/dto/itemcounts.h +++ b/core/include/JellyfinQt/dto/itemcounts.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static ItemCounts fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -179,6 +183,18 @@ protected: qint32 m_itemCount; }; +} // NS DTO + +namespace Support { + +using ItemCounts = Jellyfin::DTO::ItemCounts; + +template <> +ItemCounts fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ItemCounts &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/itemfields.h b/core/include/JellyfinQt/dto/itemfields.h index ce07a34..6cbe2d7 100644 --- a/core/include/JellyfinQt/dto/itemfields.h +++ b/core/include/JellyfinQt/dto/itemfields.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -111,7 +115,19 @@ private: explicit ItemFieldsClass(); }; -typedef ItemFieldsClass::Value ItemFields; +using ItemFields = ItemFieldsClass::Value; + +} // NS DTO + +namespace Support { + +using ItemFields = Jellyfin::DTO::ItemFields; + +template <> +ItemFields fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ItemFields &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/itemfilter.h b/core/include/JellyfinQt/dto/itemfilter.h index d863ec8..f15c4ef 100644 --- a/core/include/JellyfinQt/dto/itemfilter.h +++ b/core/include/JellyfinQt/dto/itemfilter.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,19 @@ private: explicit ItemFilterClass(); }; -typedef ItemFilterClass::Value ItemFilter; +using ItemFilter = ItemFilterClass::Value; + +} // NS DTO + +namespace Support { + +using ItemFilter = Jellyfin::DTO::ItemFilter; + +template <> +ItemFilter fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ItemFilter &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/joingrouprequestdto.h b/core/include/JellyfinQt/dto/joingrouprequestdto.h index faa1beb..6e69e5e 100644 --- a/core/include/JellyfinQt/dto/joingrouprequestdto.h +++ b/core/include/JellyfinQt/dto/joingrouprequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static JoinGroupRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_groupId; }; +} // NS DTO + +namespace Support { + +using JoinGroupRequestDto = Jellyfin::DTO::JoinGroupRequestDto; + +template <> +JoinGroupRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const JoinGroupRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/keepuntil.h b/core/include/JellyfinQt/dto/keepuntil.h index 74f9094..8fe34ec 100644 --- a/core/include/JellyfinQt/dto/keepuntil.h +++ b/core/include/JellyfinQt/dto/keepuntil.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit KeepUntilClass(); }; -typedef KeepUntilClass::Value KeepUntil; +using KeepUntil = KeepUntilClass::Value; + +} // NS DTO + +namespace Support { + +using KeepUntil = Jellyfin::DTO::KeepUntil; + +template <> +KeepUntil fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const KeepUntil &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/libraryoptioninfodto.h b/core/include/JellyfinQt/dto/libraryoptioninfodto.h index b8449e9..b7c7494 100644 --- a/core/include/JellyfinQt/dto/libraryoptioninfodto.h +++ b/core/include/JellyfinQt/dto/libraryoptioninfodto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static LibraryOptionInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -82,6 +86,18 @@ protected: bool m_defaultEnabled; }; +} // NS DTO + +namespace Support { + +using LibraryOptionInfoDto = Jellyfin::DTO::LibraryOptionInfoDto; + +template <> +LibraryOptionInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LibraryOptionInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/libraryoptions.h b/core/include/JellyfinQt/dto/libraryoptions.h index d5c9d24..a472bc9 100644 --- a/core/include/JellyfinQt/dto/libraryoptions.h +++ b/core/include/JellyfinQt/dto/libraryoptions.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/typeoptions.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static LibraryOptions fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -244,6 +248,18 @@ protected: QList m_typeOptions; }; +} // NS DTO + +namespace Support { + +using LibraryOptions = Jellyfin::DTO::LibraryOptions; + +template <> +LibraryOptions fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LibraryOptions &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/libraryoptionsresultdto.h b/core/include/JellyfinQt/dto/libraryoptionsresultdto.h index 13b5cc7..18e4830 100644 --- a/core/include/JellyfinQt/dto/libraryoptionsresultdto.h +++ b/core/include/JellyfinQt/dto/libraryoptionsresultdto.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/librarytypeoptionsdto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static LibraryOptionsResultDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -111,6 +115,18 @@ protected: QList m_typeOptions; }; +} // NS DTO + +namespace Support { + +using LibraryOptionsResultDto = Jellyfin::DTO::LibraryOptionsResultDto; + +template <> +LibraryOptionsResultDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LibraryOptionsResultDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/librarytypeoptionsdto.h b/core/include/JellyfinQt/dto/librarytypeoptionsdto.h index 569d686..fb0cb9f 100644 --- a/core/include/JellyfinQt/dto/librarytypeoptionsdto.h +++ b/core/include/JellyfinQt/dto/librarytypeoptionsdto.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/libraryoptioninfodto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static LibraryTypeOptionsDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -125,6 +129,18 @@ protected: QList m_defaultImageOptions; }; +} // NS DTO + +namespace Support { + +using LibraryTypeOptionsDto = Jellyfin::DTO::LibraryTypeOptionsDto; + +template <> +LibraryTypeOptionsDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LibraryTypeOptionsDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/libraryupdateinfo.h b/core/include/JellyfinQt/dto/libraryupdateinfo.h index 3391fee..b1071a8 100644 --- a/core/include/JellyfinQt/dto/libraryupdateinfo.h +++ b/core/include/JellyfinQt/dto/libraryupdateinfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static LibraryUpdateInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -136,6 +140,18 @@ protected: bool m_isEmpty; }; +} // NS DTO + +namespace Support { + +using LibraryUpdateInfo = Jellyfin::DTO::LibraryUpdateInfo; + +template <> +LibraryUpdateInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LibraryUpdateInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/listingsproviderinfo.h b/core/include/JellyfinQt/dto/listingsproviderinfo.h index 529a3a1..f743a63 100644 --- a/core/include/JellyfinQt/dto/listingsproviderinfo.h +++ b/core/include/JellyfinQt/dto/listingsproviderinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/namevaluepair.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static ListingsProviderInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -205,6 +209,18 @@ protected: QString m_userAgent; }; +} // NS DTO + +namespace Support { + +using ListingsProviderInfo = Jellyfin::DTO::ListingsProviderInfo; + +template <> +ListingsProviderInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ListingsProviderInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/livestreamresponse.h b/core/include/JellyfinQt/dto/livestreamresponse.h index a8ee409..a680333 100644 --- a/core/include/JellyfinQt/dto/livestreamresponse.h +++ b/core/include/JellyfinQt/dto/livestreamresponse.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/mediasourceinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static LiveStreamResponse fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -67,6 +71,18 @@ protected: QSharedPointer m_mediaSource = nullptr; }; +} // NS DTO + +namespace Support { + +using LiveStreamResponse = Jellyfin::DTO::LiveStreamResponse; + +template <> +LiveStreamResponse fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LiveStreamResponse &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/livetvinfo.h b/core/include/JellyfinQt/dto/livetvinfo.h index f82da65..0d00fd2 100644 --- a/core/include/JellyfinQt/dto/livetvinfo.h +++ b/core/include/JellyfinQt/dto/livetvinfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/livetvserviceinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static LiveTvInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -96,6 +100,18 @@ protected: QStringList m_enabledUsers; }; +} // NS DTO + +namespace Support { + +using LiveTvInfo = Jellyfin::DTO::LiveTvInfo; + +template <> +LiveTvInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LiveTvInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/livetvserviceinfo.h b/core/include/JellyfinQt/dto/livetvserviceinfo.h index 28310b1..7409d18 100644 --- a/core/include/JellyfinQt/dto/livetvserviceinfo.h +++ b/core/include/JellyfinQt/dto/livetvserviceinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/livetvservicestatus.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static LiveTvServiceInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -145,6 +149,18 @@ protected: QStringList m_tuners; }; +} // NS DTO + +namespace Support { + +using LiveTvServiceInfo = Jellyfin::DTO::LiveTvServiceInfo; + +template <> +LiveTvServiceInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LiveTvServiceInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/livetvservicestatus.h b/core/include/JellyfinQt/dto/livetvservicestatus.h index 87e1bf7..ac6477b 100644 --- a/core/include/JellyfinQt/dto/livetvservicestatus.h +++ b/core/include/JellyfinQt/dto/livetvservicestatus.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit LiveTvServiceStatusClass(); }; -typedef LiveTvServiceStatusClass::Value LiveTvServiceStatus; +using LiveTvServiceStatus = LiveTvServiceStatusClass::Value; + +} // NS DTO + +namespace Support { + +using LiveTvServiceStatus = Jellyfin::DTO::LiveTvServiceStatus; + +template <> +LiveTvServiceStatus fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const LiveTvServiceStatus &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/localizationoption.h b/core/include/JellyfinQt/dto/localizationoption.h index 92052e5..8501016 100644 --- a/core/include/JellyfinQt/dto/localizationoption.h +++ b/core/include/JellyfinQt/dto/localizationoption.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static LocalizationOption fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -76,6 +80,18 @@ protected: QString m_value; }; +} // NS DTO + +namespace Support { + +using LocalizationOption = Jellyfin::DTO::LocalizationOption; + +template <> +LocalizationOption fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LocalizationOption &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/locationtype.h b/core/include/JellyfinQt/dto/locationtype.h index 02e1fd3..96092bc 100644 --- a/core/include/JellyfinQt/dto/locationtype.h +++ b/core/include/JellyfinQt/dto/locationtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit LocationTypeClass(); }; -typedef LocationTypeClass::Value LocationType; +using LocationType = LocationTypeClass::Value; + +} // NS DTO + +namespace Support { + +using LocationType = Jellyfin::DTO::LocationType; + +template <> +LocationType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const LocationType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/logfile.h b/core/include/JellyfinQt/dto/logfile.h index cf70066..2d993c2 100644 --- a/core/include/JellyfinQt/dto/logfile.h +++ b/core/include/JellyfinQt/dto/logfile.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static LogFile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -103,6 +107,18 @@ protected: QString m_name; }; +} // NS DTO + +namespace Support { + +using LogFile = Jellyfin::DTO::LogFile; + +template <> +LogFile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const LogFile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/loglevel.h b/core/include/JellyfinQt/dto/loglevel.h index 9fbb7a8..8f40a21 100644 --- a/core/include/JellyfinQt/dto/loglevel.h +++ b/core/include/JellyfinQt/dto/loglevel.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit LogLevelClass(); }; -typedef LogLevelClass::Value LogLevel; +using LogLevel = LogLevelClass::Value; + +} // NS DTO + +namespace Support { + +using LogLevel = Jellyfin::DTO::LogLevel; + +template <> +LogLevel fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const LogLevel &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediaattachment.h b/core/include/JellyfinQt/dto/mediaattachment.h index 3074e48..b9c7a80 100644 --- a/core/include/JellyfinQt/dto/mediaattachment.h +++ b/core/include/JellyfinQt/dto/mediaattachment.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MediaAttachment fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -142,6 +146,18 @@ protected: QString m_deliveryUrl; }; +} // NS DTO + +namespace Support { + +using MediaAttachment = Jellyfin::DTO::MediaAttachment; + +template <> +MediaAttachment fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaAttachment &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediaencoderpathdto.h b/core/include/JellyfinQt/dto/mediaencoderpathdto.h index c93b98a..329d1f5 100644 --- a/core/include/JellyfinQt/dto/mediaencoderpathdto.h +++ b/core/include/JellyfinQt/dto/mediaencoderpathdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MediaEncoderPathDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_pathType; }; +} // NS DTO + +namespace Support { + +using MediaEncoderPathDto = Jellyfin::DTO::MediaEncoderPathDto; + +template <> +MediaEncoderPathDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaEncoderPathDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediapathdto.h b/core/include/JellyfinQt/dto/mediapathdto.h index 85b1aca..6060a64 100644 --- a/core/include/JellyfinQt/dto/mediapathdto.h +++ b/core/include/JellyfinQt/dto/mediapathdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/mediapathinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static MediaPathDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -90,6 +94,18 @@ protected: QSharedPointer m_pathInfo = nullptr; }; +} // NS DTO + +namespace Support { + +using MediaPathDto = Jellyfin::DTO::MediaPathDto; + +template <> +MediaPathDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaPathDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediapathinfo.h b/core/include/JellyfinQt/dto/mediapathinfo.h index 99a6d60..31fc3a4 100644 --- a/core/include/JellyfinQt/dto/mediapathinfo.h +++ b/core/include/JellyfinQt/dto/mediapathinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MediaPathInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -76,6 +80,18 @@ protected: QString m_networkPath; }; +} // NS DTO + +namespace Support { + +using MediaPathInfo = Jellyfin::DTO::MediaPathInfo; + +template <> +MediaPathInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaPathInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediaprotocol.h b/core/include/JellyfinQt/dto/mediaprotocol.h index b46bbff..db80893 100644 --- a/core/include/JellyfinQt/dto/mediaprotocol.h +++ b/core/include/JellyfinQt/dto/mediaprotocol.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit MediaProtocolClass(); }; -typedef MediaProtocolClass::Value MediaProtocol; +using MediaProtocol = MediaProtocolClass::Value; + +} // NS DTO + +namespace Support { + +using MediaProtocol = Jellyfin::DTO::MediaProtocol; + +template <> +MediaProtocol fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const MediaProtocol &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediasourceinfo.h b/core/include/JellyfinQt/dto/mediasourceinfo.h index 136bb8c..d352c99 100644 --- a/core/include/JellyfinQt/dto/mediasourceinfo.h +++ b/core/include/JellyfinQt/dto/mediasourceinfo.h @@ -47,6 +47,10 @@ #include "JellyfinQt/dto/videotype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -63,7 +67,7 @@ public: static MediaSourceInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -276,9 +280,9 @@ public: void setTimestamp(TransportStreamTimestamp newTimestamp); - std::optional requiredHttpHeaders() const; + QJsonObject requiredHttpHeaders() const; - void setRequiredHttpHeaders(std::optional newRequiredHttpHeaders); + void setRequiredHttpHeaders(QJsonObject newRequiredHttpHeaders); bool requiredHttpHeadersNull() const; void setRequiredHttpHeadersNull(); @@ -361,7 +365,7 @@ protected: QStringList m_formats; std::optional m_bitrate = std::nullopt; TransportStreamTimestamp m_timestamp; - std::optional m_requiredHttpHeaders = std::nullopt; + QJsonObject m_requiredHttpHeaders; QString m_transcodingUrl; QString m_transcodingSubProtocol; QString m_transcodingContainer; @@ -370,6 +374,18 @@ protected: std::optional m_defaultSubtitleStreamIndex = std::nullopt; }; +} // NS DTO + +namespace Support { + +using MediaSourceInfo = Jellyfin::DTO::MediaSourceInfo; + +template <> +MediaSourceInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaSourceInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediasourcetype.h b/core/include/JellyfinQt/dto/mediasourcetype.h index 43a4753..7e4f6d4 100644 --- a/core/include/JellyfinQt/dto/mediasourcetype.h +++ b/core/include/JellyfinQt/dto/mediasourcetype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit MediaSourceTypeClass(); }; -typedef MediaSourceTypeClass::Value MediaSourceType; +using MediaSourceType = MediaSourceTypeClass::Value; + +} // NS DTO + +namespace Support { + +using MediaSourceType = Jellyfin::DTO::MediaSourceType; + +template <> +MediaSourceType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const MediaSourceType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediastream.h b/core/include/JellyfinQt/dto/mediastream.h index 7416f55..27bdfde 100644 --- a/core/include/JellyfinQt/dto/mediastream.h +++ b/core/include/JellyfinQt/dto/mediastream.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/subtitledeliverymethod.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static MediaStream fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -572,6 +576,18 @@ protected: std::optional m_isAnamorphic = std::nullopt; }; +} // NS DTO + +namespace Support { + +using MediaStream = Jellyfin::DTO::MediaStream; + +template <> +MediaStream fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaStream &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediastreamtype.h b/core/include/JellyfinQt/dto/mediastreamtype.h index 1b07326..876c7b7 100644 --- a/core/include/JellyfinQt/dto/mediastreamtype.h +++ b/core/include/JellyfinQt/dto/mediastreamtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit MediaStreamTypeClass(); }; -typedef MediaStreamTypeClass::Value MediaStreamType; +using MediaStreamType = MediaStreamTypeClass::Value; + +} // NS DTO + +namespace Support { + +using MediaStreamType = Jellyfin::DTO::MediaStreamType; + +template <> +MediaStreamType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const MediaStreamType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediaupdateinfodto.h b/core/include/JellyfinQt/dto/mediaupdateinfodto.h index 93172f0..1bfd7a2 100644 --- a/core/include/JellyfinQt/dto/mediaupdateinfodto.h +++ b/core/include/JellyfinQt/dto/mediaupdateinfodto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MediaUpdateInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -86,6 +90,18 @@ protected: QString m_updateType; }; +} // NS DTO + +namespace Support { + +using MediaUpdateInfoDto = Jellyfin::DTO::MediaUpdateInfoDto; + +template <> +MediaUpdateInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaUpdateInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/mediaurl.h b/core/include/JellyfinQt/dto/mediaurl.h index dac2b3b..4bbb2e5 100644 --- a/core/include/JellyfinQt/dto/mediaurl.h +++ b/core/include/JellyfinQt/dto/mediaurl.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MediaUrl fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -76,6 +80,18 @@ protected: QString m_name; }; +} // NS DTO + +namespace Support { + +using MediaUrl = Jellyfin::DTO::MediaUrl; + +template <> +MediaUrl fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MediaUrl &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/metadataeditorinfo.h b/core/include/JellyfinQt/dto/metadataeditorinfo.h index 3d82c77..e4a8008 100644 --- a/core/include/JellyfinQt/dto/metadataeditorinfo.h +++ b/core/include/JellyfinQt/dto/metadataeditorinfo.h @@ -44,6 +44,10 @@ #include "JellyfinQt/dto/parentalrating.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -60,7 +64,7 @@ public: static MetadataEditorInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -115,6 +119,18 @@ protected: QList m_contentTypeOptions; }; +} // NS DTO + +namespace Support { + +using MetadataEditorInfo = Jellyfin::DTO::MetadataEditorInfo; + +template <> +MetadataEditorInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MetadataEditorInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/metadatafield.h b/core/include/JellyfinQt/dto/metadatafield.h index 28c508a..5d16e97 100644 --- a/core/include/JellyfinQt/dto/metadatafield.h +++ b/core/include/JellyfinQt/dto/metadatafield.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,19 @@ private: explicit MetadataFieldClass(); }; -typedef MetadataFieldClass::Value MetadataField; +using MetadataField = MetadataFieldClass::Value; + +} // NS DTO + +namespace Support { + +using MetadataField = Jellyfin::DTO::MetadataField; + +template <> +MetadataField fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const MetadataField &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/metadataoptions.h b/core/include/JellyfinQt/dto/metadataoptions.h index b56887e..0ab64fe 100644 --- a/core/include/JellyfinQt/dto/metadataoptions.h +++ b/core/include/JellyfinQt/dto/metadataoptions.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static MetadataOptions fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -118,6 +122,18 @@ protected: QStringList m_imageFetcherOrder; }; +} // NS DTO + +namespace Support { + +using MetadataOptions = Jellyfin::DTO::MetadataOptions; + +template <> +MetadataOptions fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MetadataOptions &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/metadatarefreshmode.h b/core/include/JellyfinQt/dto/metadatarefreshmode.h index 750233e..3a82bba 100644 --- a/core/include/JellyfinQt/dto/metadatarefreshmode.h +++ b/core/include/JellyfinQt/dto/metadatarefreshmode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit MetadataRefreshModeClass(); }; -typedef MetadataRefreshModeClass::Value MetadataRefreshMode; +using MetadataRefreshMode = MetadataRefreshModeClass::Value; + +} // NS DTO + +namespace Support { + +using MetadataRefreshMode = Jellyfin::DTO::MetadataRefreshMode; + +template <> +MetadataRefreshMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const MetadataRefreshMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/moveplaylistitemrequestdto.h b/core/include/JellyfinQt/dto/moveplaylistitemrequestdto.h index 9f82c74..ee55a78 100644 --- a/core/include/JellyfinQt/dto/moveplaylistitemrequestdto.h +++ b/core/include/JellyfinQt/dto/moveplaylistitemrequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static MovePlaylistItemRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -80,6 +84,18 @@ protected: qint32 m_newIndex; }; +} // NS DTO + +namespace Support { + +using MovePlaylistItemRequestDto = Jellyfin::DTO::MovePlaylistItemRequestDto; + +template <> +MovePlaylistItemRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MovePlaylistItemRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/movieinfo.h b/core/include/JellyfinQt/dto/movieinfo.h index 03fcc61..3ecf9d3 100644 --- a/core/include/JellyfinQt/dto/movieinfo.h +++ b/core/include/JellyfinQt/dto/movieinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static MovieInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -155,7 +159,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -163,6 +167,18 @@ protected: bool m_isAutomated; }; +} // NS DTO + +namespace Support { + +using MovieInfo = Jellyfin::DTO::MovieInfo; + +template <> +MovieInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MovieInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/movieinforemotesearchquery.h b/core/include/JellyfinQt/dto/movieinforemotesearchquery.h index aacf963..c997d04 100644 --- a/core/include/JellyfinQt/dto/movieinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/movieinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/movieinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static MovieInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using MovieInfoRemoteSearchQuery = Jellyfin::DTO::MovieInfoRemoteSearchQuery; + +template <> +MovieInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MovieInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/musicvideoinfo.h b/core/include/JellyfinQt/dto/musicvideoinfo.h index 76f6a8f..0e85b51 100644 --- a/core/include/JellyfinQt/dto/musicvideoinfo.h +++ b/core/include/JellyfinQt/dto/musicvideoinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static MusicVideoInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -106,11 +110,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -164,7 +168,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -173,6 +177,18 @@ protected: QStringList m_artists; }; +} // NS DTO + +namespace Support { + +using MusicVideoInfo = Jellyfin::DTO::MusicVideoInfo; + +template <> +MusicVideoInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MusicVideoInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/musicvideoinforemotesearchquery.h b/core/include/JellyfinQt/dto/musicvideoinforemotesearchquery.h index 67b9691..611cfe0 100644 --- a/core/include/JellyfinQt/dto/musicvideoinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/musicvideoinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/musicvideoinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static MusicVideoInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using MusicVideoInfoRemoteSearchQuery = Jellyfin::DTO::MusicVideoInfoRemoteSearchQuery; + +template <> +MusicVideoInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const MusicVideoInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/nameguidpair.h b/core/include/JellyfinQt/dto/nameguidpair.h index f9d0da8..c3a9516 100644 --- a/core/include/JellyfinQt/dto/nameguidpair.h +++ b/core/include/JellyfinQt/dto/nameguidpair.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NameGuidPair fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -74,6 +78,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using NameGuidPair = Jellyfin::DTO::NameGuidPair; + +template <> +NameGuidPair fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NameGuidPair &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/nameidpair.h b/core/include/JellyfinQt/dto/nameidpair.h index 1ad6f1b..ff42ab4 100644 --- a/core/include/JellyfinQt/dto/nameidpair.h +++ b/core/include/JellyfinQt/dto/nameidpair.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NameIdPair fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using NameIdPair = Jellyfin::DTO::NameIdPair; + +template <> +NameIdPair fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NameIdPair &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/namevaluepair.h b/core/include/JellyfinQt/dto/namevaluepair.h index 0c53610..d0fc2b0 100644 --- a/core/include/JellyfinQt/dto/namevaluepair.h +++ b/core/include/JellyfinQt/dto/namevaluepair.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NameValuePair fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_value; }; +} // NS DTO + +namespace Support { + +using NameValuePair = Jellyfin::DTO::NameValuePair; + +template <> +NameValuePair fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NameValuePair &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/newgrouprequestdto.h b/core/include/JellyfinQt/dto/newgrouprequestdto.h index 5cff6e1..84dc8cf 100644 --- a/core/include/JellyfinQt/dto/newgrouprequestdto.h +++ b/core/include/JellyfinQt/dto/newgrouprequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NewGroupRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -72,6 +76,18 @@ protected: QString m_groupName; }; +} // NS DTO + +namespace Support { + +using NewGroupRequestDto = Jellyfin::DTO::NewGroupRequestDto; + +template <> +NewGroupRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NewGroupRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/nextitemrequestdto.h b/core/include/JellyfinQt/dto/nextitemrequestdto.h index a141e8d..e367cec 100644 --- a/core/include/JellyfinQt/dto/nextitemrequestdto.h +++ b/core/include/JellyfinQt/dto/nextitemrequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NextItemRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using NextItemRequestDto = Jellyfin::DTO::NextItemRequestDto; + +template <> +NextItemRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NextItemRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/notificationdto.h b/core/include/JellyfinQt/dto/notificationdto.h index 529e242..5716b2a 100644 --- a/core/include/JellyfinQt/dto/notificationdto.h +++ b/core/include/JellyfinQt/dto/notificationdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/notificationlevel.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static NotificationDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -148,6 +152,18 @@ protected: NotificationLevel m_level; }; +} // NS DTO + +namespace Support { + +using NotificationDto = Jellyfin::DTO::NotificationDto; + +template <> +NotificationDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NotificationDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/notificationlevel.h b/core/include/JellyfinQt/dto/notificationlevel.h index 7a35ba7..1166ca7 100644 --- a/core/include/JellyfinQt/dto/notificationlevel.h +++ b/core/include/JellyfinQt/dto/notificationlevel.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit NotificationLevelClass(); }; -typedef NotificationLevelClass::Value NotificationLevel; +using NotificationLevel = NotificationLevelClass::Value; + +} // NS DTO + +namespace Support { + +using NotificationLevel = Jellyfin::DTO::NotificationLevel; + +template <> +NotificationLevel fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const NotificationLevel &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/notificationresultdto.h b/core/include/JellyfinQt/dto/notificationresultdto.h index 40c1104..d935b99 100644 --- a/core/include/JellyfinQt/dto/notificationresultdto.h +++ b/core/include/JellyfinQt/dto/notificationresultdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/notificationdto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static NotificationResultDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: qint32 m_totalRecordCount; }; +} // NS DTO + +namespace Support { + +using NotificationResultDto = Jellyfin::DTO::NotificationResultDto; + +template <> +NotificationResultDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NotificationResultDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/notificationssummarydto.h b/core/include/JellyfinQt/dto/notificationssummarydto.h index 94f892a..04c986d 100644 --- a/core/include/JellyfinQt/dto/notificationssummarydto.h +++ b/core/include/JellyfinQt/dto/notificationssummarydto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/dto/notificationlevel.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NotificationsSummaryDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -76,6 +80,18 @@ protected: NotificationLevel m_maxUnreadNotificationLevel; }; +} // NS DTO + +namespace Support { + +using NotificationsSummaryDto = Jellyfin::DTO::NotificationsSummaryDto; + +template <> +NotificationsSummaryDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NotificationsSummaryDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/notificationtypeinfo.h b/core/include/JellyfinQt/dto/notificationtypeinfo.h index 1cd0a2a..fa33b10 100644 --- a/core/include/JellyfinQt/dto/notificationtypeinfo.h +++ b/core/include/JellyfinQt/dto/notificationtypeinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static NotificationTypeInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_isBasedOnUserEvent; }; +} // NS DTO + +namespace Support { + +using NotificationTypeInfo = Jellyfin::DTO::NotificationTypeInfo; + +template <> +NotificationTypeInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const NotificationTypeInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/objectgroupupdate.h b/core/include/JellyfinQt/dto/objectgroupupdate.h index 1efd085..4c60987 100644 --- a/core/include/JellyfinQt/dto/objectgroupupdate.h +++ b/core/include/JellyfinQt/dto/objectgroupupdate.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/groupupdatetype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ObjectGroupUpdate fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -88,6 +92,18 @@ protected: QVariant m_data; }; +} // NS DTO + +namespace Support { + +using ObjectGroupUpdate = Jellyfin::DTO::ObjectGroupUpdate; + +template <> +ObjectGroupUpdate fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ObjectGroupUpdate &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/openlivestreamdto.h b/core/include/JellyfinQt/dto/openlivestreamdto.h index 109c5e6..5441f4b 100644 --- a/core/include/JellyfinQt/dto/openlivestreamdto.h +++ b/core/include/JellyfinQt/dto/openlivestreamdto.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/mediaprotocol.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static OpenLiveStreamDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -215,6 +219,18 @@ protected: QList m_directPlayProtocols; }; +} // NS DTO + +namespace Support { + +using OpenLiveStreamDto = Jellyfin::DTO::OpenLiveStreamDto; + +template <> +OpenLiveStreamDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const OpenLiveStreamDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/packageinfo.h b/core/include/JellyfinQt/dto/packageinfo.h index 38e62db..0c1771b 100644 --- a/core/include/JellyfinQt/dto/packageinfo.h +++ b/core/include/JellyfinQt/dto/packageinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/versioninfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static PackageInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -161,6 +165,18 @@ protected: QString m_imageUrl; }; +} // NS DTO + +namespace Support { + +using PackageInfo = Jellyfin::DTO::PackageInfo; + +template <> +PackageInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PackageInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/parentalrating.h b/core/include/JellyfinQt/dto/parentalrating.h index 2ee4c4c..5cacee2 100644 --- a/core/include/JellyfinQt/dto/parentalrating.h +++ b/core/include/JellyfinQt/dto/parentalrating.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ParentalRating fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -82,6 +86,18 @@ protected: qint32 m_value; }; +} // NS DTO + +namespace Support { + +using ParentalRating = Jellyfin::DTO::ParentalRating; + +template <> +ParentalRating fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ParentalRating &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/pathsubstitution.h b/core/include/JellyfinQt/dto/pathsubstitution.h index 181b29e..3402f67 100644 --- a/core/include/JellyfinQt/dto/pathsubstitution.h +++ b/core/include/JellyfinQt/dto/pathsubstitution.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static PathSubstitution fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_to; }; +} // NS DTO + +namespace Support { + +using PathSubstitution = Jellyfin::DTO::PathSubstitution; + +template <> +PathSubstitution fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PathSubstitution &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/personlookupinfo.h b/core/include/JellyfinQt/dto/personlookupinfo.h index 217dd02..2e51c3c 100644 --- a/core/include/JellyfinQt/dto/personlookupinfo.h +++ b/core/include/JellyfinQt/dto/personlookupinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static PersonLookupInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -155,7 +159,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -163,6 +167,18 @@ protected: bool m_isAutomated; }; +} // NS DTO + +namespace Support { + +using PersonLookupInfo = Jellyfin::DTO::PersonLookupInfo; + +template <> +PersonLookupInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PersonLookupInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/personlookupinforemotesearchquery.h b/core/include/JellyfinQt/dto/personlookupinforemotesearchquery.h index ae72848..0bbf993 100644 --- a/core/include/JellyfinQt/dto/personlookupinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/personlookupinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/personlookupinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static PersonLookupInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using PersonLookupInfoRemoteSearchQuery = Jellyfin::DTO::PersonLookupInfoRemoteSearchQuery; + +template <> +PersonLookupInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PersonLookupInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/pingrequestdto.h b/core/include/JellyfinQt/dto/pingrequestdto.h index 11a8f73..64f0a3b 100644 --- a/core/include/JellyfinQt/dto/pingrequestdto.h +++ b/core/include/JellyfinQt/dto/pingrequestdto.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static PingRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -69,6 +73,18 @@ protected: qint64 m_ping; }; +} // NS DTO + +namespace Support { + +using PingRequestDto = Jellyfin::DTO::PingRequestDto; + +template <> +PingRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PingRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/pinredeemresult.h b/core/include/JellyfinQt/dto/pinredeemresult.h index 7bff00b..64e41bd 100644 --- a/core/include/JellyfinQt/dto/pinredeemresult.h +++ b/core/include/JellyfinQt/dto/pinredeemresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static PinRedeemResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QStringList m_usersReset; }; +} // NS DTO + +namespace Support { + +using PinRedeemResult = Jellyfin::DTO::PinRedeemResult; + +template <> +PinRedeemResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PinRedeemResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playaccess.h b/core/include/JellyfinQt/dto/playaccess.h index 324dcf3..4073b63 100644 --- a/core/include/JellyfinQt/dto/playaccess.h +++ b/core/include/JellyfinQt/dto/playaccess.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit PlayAccessClass(); }; -typedef PlayAccessClass::Value PlayAccess; +using PlayAccess = PlayAccessClass::Value; + +} // NS DTO + +namespace Support { + +using PlayAccess = Jellyfin::DTO::PlayAccess; + +template <> +PlayAccess fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PlayAccess &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackerrorcode.h b/core/include/JellyfinQt/dto/playbackerrorcode.h index f42f7f0..1a51098 100644 --- a/core/include/JellyfinQt/dto/playbackerrorcode.h +++ b/core/include/JellyfinQt/dto/playbackerrorcode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit PlaybackErrorCodeClass(); }; -typedef PlaybackErrorCodeClass::Value PlaybackErrorCode; +using PlaybackErrorCode = PlaybackErrorCodeClass::Value; + +} // NS DTO + +namespace Support { + +using PlaybackErrorCode = Jellyfin::DTO::PlaybackErrorCode; + +template <> +PlaybackErrorCode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PlaybackErrorCode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackinfodto.h b/core/include/JellyfinQt/dto/playbackinfodto.h index a80930b..0c3ace0 100644 --- a/core/include/JellyfinQt/dto/playbackinfodto.h +++ b/core/include/JellyfinQt/dto/playbackinfodto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/deviceprofile.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static PlaybackInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -236,6 +240,18 @@ protected: std::optional m_autoOpenLiveStream = std::nullopt; }; +} // NS DTO + +namespace Support { + +using PlaybackInfoDto = Jellyfin::DTO::PlaybackInfoDto; + +template <> +PlaybackInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaybackInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackinforesponse.h b/core/include/JellyfinQt/dto/playbackinforesponse.h index 85fb76d..3c67b6d 100644 --- a/core/include/JellyfinQt/dto/playbackinforesponse.h +++ b/core/include/JellyfinQt/dto/playbackinforesponse.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/playbackerrorcode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static PlaybackInfoResponse fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: PlaybackErrorCode m_errorCode; }; +} // NS DTO + +namespace Support { + +using PlaybackInfoResponse = Jellyfin::DTO::PlaybackInfoResponse; + +template <> +PlaybackInfoResponse fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaybackInfoResponse &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackprogressinfo.h b/core/include/JellyfinQt/dto/playbackprogressinfo.h index 6ae7642..28725f5 100644 --- a/core/include/JellyfinQt/dto/playbackprogressinfo.h +++ b/core/include/JellyfinQt/dto/playbackprogressinfo.h @@ -44,6 +44,10 @@ #include "JellyfinQt/dto/repeatmode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -60,7 +64,7 @@ public: static PlaybackProgressInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -261,6 +265,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using PlaybackProgressInfo = Jellyfin::DTO::PlaybackProgressInfo; + +template <> +PlaybackProgressInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaybackProgressInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackstartinfo.h b/core/include/JellyfinQt/dto/playbackstartinfo.h index 6cee828..a4c9287 100644 --- a/core/include/JellyfinQt/dto/playbackstartinfo.h +++ b/core/include/JellyfinQt/dto/playbackstartinfo.h @@ -44,6 +44,10 @@ #include "JellyfinQt/dto/repeatmode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -60,7 +64,7 @@ public: static PlaybackStartInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -261,6 +265,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using PlaybackStartInfo = Jellyfin::DTO::PlaybackStartInfo; + +template <> +PlaybackStartInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaybackStartInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playbackstopinfo.h b/core/include/JellyfinQt/dto/playbackstopinfo.h index ec59368..b277af4 100644 --- a/core/include/JellyfinQt/dto/playbackstopinfo.h +++ b/core/include/JellyfinQt/dto/playbackstopinfo.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/queueitem.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static PlaybackStopInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -175,6 +179,18 @@ protected: QList m_nowPlayingQueue; }; +} // NS DTO + +namespace Support { + +using PlaybackStopInfo = Jellyfin::DTO::PlaybackStopInfo; + +template <> +PlaybackStopInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaybackStopInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playcommand.h b/core/include/JellyfinQt/dto/playcommand.h index 4e85a0b..2f4b06f 100644 --- a/core/include/JellyfinQt/dto/playcommand.h +++ b/core/include/JellyfinQt/dto/playcommand.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit PlayCommandClass(); }; -typedef PlayCommandClass::Value PlayCommand; +using PlayCommand = PlayCommandClass::Value; + +} // NS DTO + +namespace Support { + +using PlayCommand = Jellyfin::DTO::PlayCommand; + +template <> +PlayCommand fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PlayCommand &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playerstateinfo.h b/core/include/JellyfinQt/dto/playerstateinfo.h index 2b84d03..182647a 100644 --- a/core/include/JellyfinQt/dto/playerstateinfo.h +++ b/core/include/JellyfinQt/dto/playerstateinfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/repeatmode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static PlayerStateInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -164,6 +168,18 @@ protected: RepeatMode m_repeatMode; }; +} // NS DTO + +namespace Support { + +using PlayerStateInfo = Jellyfin::DTO::PlayerStateInfo; + +template <> +PlayerStateInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlayerStateInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playlistcreationresult.h b/core/include/JellyfinQt/dto/playlistcreationresult.h index 1158c2a..d2f14c2 100644 --- a/core/include/JellyfinQt/dto/playlistcreationresult.h +++ b/core/include/JellyfinQt/dto/playlistcreationresult.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static PlaylistCreationResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -68,6 +72,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using PlaylistCreationResult = Jellyfin::DTO::PlaylistCreationResult; + +template <> +PlaylistCreationResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaylistCreationResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playmethod.h b/core/include/JellyfinQt/dto/playmethod.h index 9daaed2..2d45b97 100644 --- a/core/include/JellyfinQt/dto/playmethod.h +++ b/core/include/JellyfinQt/dto/playmethod.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit PlayMethodClass(); }; -typedef PlayMethodClass::Value PlayMethod; +using PlayMethod = PlayMethodClass::Value; + +} // NS DTO + +namespace Support { + +using PlayMethod = Jellyfin::DTO::PlayMethod; + +template <> +PlayMethod fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PlayMethod &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playrequest.h b/core/include/JellyfinQt/dto/playrequest.h index 3094019..db61894 100644 --- a/core/include/JellyfinQt/dto/playrequest.h +++ b/core/include/JellyfinQt/dto/playrequest.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/playcommand.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static PlayRequest fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -135,6 +139,18 @@ protected: std::optional m_startIndex = std::nullopt; }; +} // NS DTO + +namespace Support { + +using PlayRequest = Jellyfin::DTO::PlayRequest; + +template <> +PlayRequest fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlayRequest &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playrequestdto.h b/core/include/JellyfinQt/dto/playrequestdto.h index f2fe990..6a77dae 100644 --- a/core/include/JellyfinQt/dto/playrequestdto.h +++ b/core/include/JellyfinQt/dto/playrequestdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static PlayRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint64 m_startPositionTicks; }; +} // NS DTO + +namespace Support { + +using PlayRequestDto = Jellyfin::DTO::PlayRequestDto; + +template <> +PlayRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlayRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playstatecommand.h b/core/include/JellyfinQt/dto/playstatecommand.h index d9b1983..3c5a9a1 100644 --- a/core/include/JellyfinQt/dto/playstatecommand.h +++ b/core/include/JellyfinQt/dto/playstatecommand.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,19 @@ private: explicit PlaystateCommandClass(); }; -typedef PlaystateCommandClass::Value PlaystateCommand; +using PlaystateCommand = PlaystateCommandClass::Value; + +} // NS DTO + +namespace Support { + +using PlaystateCommand = Jellyfin::DTO::PlaystateCommand; + +template <> +PlaystateCommand fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PlaystateCommand &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/playstaterequest.h b/core/include/JellyfinQt/dto/playstaterequest.h index abb14ad..ef03861 100644 --- a/core/include/JellyfinQt/dto/playstaterequest.h +++ b/core/include/JellyfinQt/dto/playstaterequest.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/playstatecommand.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static PlaystateRequest fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -87,6 +91,18 @@ protected: QString m_controllingUserId; }; +} // NS DTO + +namespace Support { + +using PlaystateRequest = Jellyfin::DTO::PlaystateRequest; + +template <> +PlaystateRequest fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PlaystateRequest &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/plugininfo.h b/core/include/JellyfinQt/dto/plugininfo.h index 847ea4a..ccf575f 100644 --- a/core/include/JellyfinQt/dto/plugininfo.h +++ b/core/include/JellyfinQt/dto/plugininfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static PluginInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -141,6 +145,18 @@ protected: PluginStatus m_status; }; +} // NS DTO + +namespace Support { + +using PluginInfo = Jellyfin::DTO::PluginInfo; + +template <> +PluginInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PluginInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/pluginsecurityinfo.h b/core/include/JellyfinQt/dto/pluginsecurityinfo.h index 9aae579..ae6488a 100644 --- a/core/include/JellyfinQt/dto/pluginsecurityinfo.h +++ b/core/include/JellyfinQt/dto/pluginsecurityinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static PluginSecurityInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -82,6 +86,18 @@ protected: bool m_isMbSupporter; }; +} // NS DTO + +namespace Support { + +using PluginSecurityInfo = Jellyfin::DTO::PluginSecurityInfo; + +template <> +PluginSecurityInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PluginSecurityInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/pluginstatus.h b/core/include/JellyfinQt/dto/pluginstatus.h index 77a72bc..c39fa3e 100644 --- a/core/include/JellyfinQt/dto/pluginstatus.h +++ b/core/include/JellyfinQt/dto/pluginstatus.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit PluginStatusClass(); }; -typedef PluginStatusClass::Value PluginStatus; +using PluginStatus = PluginStatusClass::Value; + +} // NS DTO + +namespace Support { + +using PluginStatus = Jellyfin::DTO::PluginStatus; + +template <> +PluginStatus fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const PluginStatus &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/previousitemrequestdto.h b/core/include/JellyfinQt/dto/previousitemrequestdto.h index 9bc9a11..b6f5850 100644 --- a/core/include/JellyfinQt/dto/previousitemrequestdto.h +++ b/core/include/JellyfinQt/dto/previousitemrequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static PreviousItemRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using PreviousItemRequestDto = Jellyfin::DTO::PreviousItemRequestDto; + +template <> +PreviousItemRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PreviousItemRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/problemdetails.h b/core/include/JellyfinQt/dto/problemdetails.h index 6df4fc2..e223866 100644 --- a/core/include/JellyfinQt/dto/problemdetails.h +++ b/core/include/JellyfinQt/dto/problemdetails.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ProblemDetails fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -100,6 +104,18 @@ protected: QString m_instance; }; +} // NS DTO + +namespace Support { + +using ProblemDetails = Jellyfin::DTO::ProblemDetails; + +template <> +ProblemDetails fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ProblemDetails &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/profilecondition.h b/core/include/JellyfinQt/dto/profilecondition.h index d26402d..3d4c27e 100644 --- a/core/include/JellyfinQt/dto/profilecondition.h +++ b/core/include/JellyfinQt/dto/profilecondition.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/profileconditionvalue.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static ProfileCondition fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -88,6 +92,18 @@ protected: bool m_isRequired; }; +} // NS DTO + +namespace Support { + +using ProfileCondition = Jellyfin::DTO::ProfileCondition; + +template <> +ProfileCondition fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ProfileCondition &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/profileconditiontype.h b/core/include/JellyfinQt/dto/profileconditiontype.h index 8dd2c8e..01867fd 100644 --- a/core/include/JellyfinQt/dto/profileconditiontype.h +++ b/core/include/JellyfinQt/dto/profileconditiontype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit ProfileConditionTypeClass(); }; -typedef ProfileConditionTypeClass::Value ProfileConditionType; +using ProfileConditionType = ProfileConditionTypeClass::Value; + +} // NS DTO + +namespace Support { + +using ProfileConditionType = Jellyfin::DTO::ProfileConditionType; + +template <> +ProfileConditionType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ProfileConditionType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/profileconditionvalue.h b/core/include/JellyfinQt/dto/profileconditionvalue.h index 608eb03..fd8212a 100644 --- a/core/include/JellyfinQt/dto/profileconditionvalue.h +++ b/core/include/JellyfinQt/dto/profileconditionvalue.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -73,7 +77,19 @@ private: explicit ProfileConditionValueClass(); }; -typedef ProfileConditionValueClass::Value ProfileConditionValue; +using ProfileConditionValue = ProfileConditionValueClass::Value; + +} // NS DTO + +namespace Support { + +using ProfileConditionValue = Jellyfin::DTO::ProfileConditionValue; + +template <> +ProfileConditionValue fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ProfileConditionValue &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/programaudio.h b/core/include/JellyfinQt/dto/programaudio.h index c46334c..8cd074b 100644 --- a/core/include/JellyfinQt/dto/programaudio.h +++ b/core/include/JellyfinQt/dto/programaudio.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,19 @@ private: explicit ProgramAudioClass(); }; -typedef ProgramAudioClass::Value ProgramAudio; +using ProgramAudio = ProgramAudioClass::Value; + +} // NS DTO + +namespace Support { + +using ProgramAudio = Jellyfin::DTO::ProgramAudio; + +template <> +ProgramAudio fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ProgramAudio &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/publicsysteminfo.h b/core/include/JellyfinQt/dto/publicsysteminfo.h index 9b33db6..94ee38c 100644 --- a/core/include/JellyfinQt/dto/publicsysteminfo.h +++ b/core/include/JellyfinQt/dto/publicsysteminfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static PublicSystemInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -144,6 +148,18 @@ protected: std::optional m_startupWizardCompleted = std::nullopt; }; +} // NS DTO + +namespace Support { + +using PublicSystemInfo = Jellyfin::DTO::PublicSystemInfo; + +template <> +PublicSystemInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const PublicSystemInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/queryfilters.h b/core/include/JellyfinQt/dto/queryfilters.h index e90761c..641481c 100644 --- a/core/include/JellyfinQt/dto/queryfilters.h +++ b/core/include/JellyfinQt/dto/queryfilters.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/nameguidpair.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static QueryFilters fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -78,6 +82,18 @@ protected: QStringList m_tags; }; +} // NS DTO + +namespace Support { + +using QueryFilters = Jellyfin::DTO::QueryFilters; + +template <> +QueryFilters fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QueryFilters &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/queryfilterslegacy.h b/core/include/JellyfinQt/dto/queryfilterslegacy.h index 365fe3e..6d6df1c 100644 --- a/core/include/JellyfinQt/dto/queryfilterslegacy.h +++ b/core/include/JellyfinQt/dto/queryfilterslegacy.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static QueryFiltersLegacy fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -94,6 +98,18 @@ protected: QList m_years; }; +} // NS DTO + +namespace Support { + +using QueryFiltersLegacy = Jellyfin::DTO::QueryFiltersLegacy; + +template <> +QueryFiltersLegacy fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QueryFiltersLegacy &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/queueitem.h b/core/include/JellyfinQt/dto/queueitem.h index 42a12f2..4ec988e 100644 --- a/core/include/JellyfinQt/dto/queueitem.h +++ b/core/include/JellyfinQt/dto/queueitem.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static QueueItem fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -74,6 +78,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using QueueItem = Jellyfin::DTO::QueueItem; + +template <> +QueueItem fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QueueItem &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/queuerequestdto.h b/core/include/JellyfinQt/dto/queuerequestdto.h index a8db754..05903b6 100644 --- a/core/include/JellyfinQt/dto/queuerequestdto.h +++ b/core/include/JellyfinQt/dto/queuerequestdto.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/groupqueuemode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static QueueRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -81,6 +85,18 @@ protected: GroupQueueMode m_mode; }; +} // NS DTO + +namespace Support { + +using QueueRequestDto = Jellyfin::DTO::QueueRequestDto; + +template <> +QueueRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QueueRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/quickconnectdto.h b/core/include/JellyfinQt/dto/quickconnectdto.h index 9c6cd7f..e7d68fe 100644 --- a/core/include/JellyfinQt/dto/quickconnectdto.h +++ b/core/include/JellyfinQt/dto/quickconnectdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static QuickConnectDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_token; }; +} // NS DTO + +namespace Support { + +using QuickConnectDto = Jellyfin::DTO::QuickConnectDto; + +template <> +QuickConnectDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QuickConnectDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/quickconnectresult.h b/core/include/JellyfinQt/dto/quickconnectresult.h index e1aad30..5ba841c 100644 --- a/core/include/JellyfinQt/dto/quickconnectresult.h +++ b/core/include/JellyfinQt/dto/quickconnectresult.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static QuickConnectResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -131,6 +135,18 @@ protected: QDateTime m_dateAdded; }; +} // NS DTO + +namespace Support { + +using QuickConnectResult = Jellyfin::DTO::QuickConnectResult; + +template <> +QuickConnectResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const QuickConnectResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/quickconnectstate.h b/core/include/JellyfinQt/dto/quickconnectstate.h index a69ade5..5ff17f8 100644 --- a/core/include/JellyfinQt/dto/quickconnectstate.h +++ b/core/include/JellyfinQt/dto/quickconnectstate.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit QuickConnectStateClass(); }; -typedef QuickConnectStateClass::Value QuickConnectState; +using QuickConnectState = QuickConnectStateClass::Value; + +} // NS DTO + +namespace Support { + +using QuickConnectState = Jellyfin::DTO::QuickConnectState; + +template <> +QuickConnectState fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const QuickConnectState &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/ratingtype.h b/core/include/JellyfinQt/dto/ratingtype.h index 3e27d60..2ec9db9 100644 --- a/core/include/JellyfinQt/dto/ratingtype.h +++ b/core/include/JellyfinQt/dto/ratingtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit RatingTypeClass(); }; -typedef RatingTypeClass::Value RatingType; +using RatingType = RatingTypeClass::Value; + +} // NS DTO + +namespace Support { + +using RatingType = Jellyfin::DTO::RatingType; + +template <> +RatingType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const RatingType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/readyrequestdto.h b/core/include/JellyfinQt/dto/readyrequestdto.h index 36defaf..8480847 100644 --- a/core/include/JellyfinQt/dto/readyrequestdto.h +++ b/core/include/JellyfinQt/dto/readyrequestdto.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static ReadyRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -101,6 +105,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using ReadyRequestDto = Jellyfin::DTO::ReadyRequestDto; + +template <> +ReadyRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ReadyRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/recommendationdto.h b/core/include/JellyfinQt/dto/recommendationdto.h index 1d909ad..6892394 100644 --- a/core/include/JellyfinQt/dto/recommendationdto.h +++ b/core/include/JellyfinQt/dto/recommendationdto.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/recommendationtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static RecommendationDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -92,6 +96,18 @@ protected: QString m_categoryId; }; +} // NS DTO + +namespace Support { + +using RecommendationDto = Jellyfin::DTO::RecommendationDto; + +template <> +RecommendationDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RecommendationDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/recommendationtype.h b/core/include/JellyfinQt/dto/recommendationtype.h index 0a1ac24..c884f79 100644 --- a/core/include/JellyfinQt/dto/recommendationtype.h +++ b/core/include/JellyfinQt/dto/recommendationtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,19 @@ private: explicit RecommendationTypeClass(); }; -typedef RecommendationTypeClass::Value RecommendationType; +using RecommendationType = RecommendationTypeClass::Value; + +} // NS DTO + +namespace Support { + +using RecommendationType = Jellyfin::DTO::RecommendationType; + +template <> +RecommendationType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const RecommendationType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/recordingstatus.h b/core/include/JellyfinQt/dto/recordingstatus.h index 04e82ff..ed4720a 100644 --- a/core/include/JellyfinQt/dto/recordingstatus.h +++ b/core/include/JellyfinQt/dto/recordingstatus.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,19 @@ private: explicit RecordingStatusClass(); }; -typedef RecordingStatusClass::Value RecordingStatus; +using RecordingStatus = RecordingStatusClass::Value; + +} // NS DTO + +namespace Support { + +using RecordingStatus = Jellyfin::DTO::RecordingStatus; + +template <> +RecordingStatus fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const RecordingStatus &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/remoteimageinfo.h b/core/include/JellyfinQt/dto/remoteimageinfo.h index 063f2d6..1acdf78 100644 --- a/core/include/JellyfinQt/dto/remoteimageinfo.h +++ b/core/include/JellyfinQt/dto/remoteimageinfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/ratingtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static RemoteImageInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -170,6 +174,18 @@ protected: RatingType m_ratingType; }; +} // NS DTO + +namespace Support { + +using RemoteImageInfo = Jellyfin::DTO::RemoteImageInfo; + +template <> +RemoteImageInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RemoteImageInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/remoteimageresult.h b/core/include/JellyfinQt/dto/remoteimageresult.h index c808ccf..751c91c 100644 --- a/core/include/JellyfinQt/dto/remoteimageresult.h +++ b/core/include/JellyfinQt/dto/remoteimageresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/remoteimageinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static RemoteImageResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -96,6 +100,18 @@ protected: QStringList m_providers; }; +} // NS DTO + +namespace Support { + +using RemoteImageResult = Jellyfin::DTO::RemoteImageResult; + +template <> +RemoteImageResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RemoteImageResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/remotesearchresult.h b/core/include/JellyfinQt/dto/remotesearchresult.h index bbda689..f405425 100644 --- a/core/include/JellyfinQt/dto/remotesearchresult.h +++ b/core/include/JellyfinQt/dto/remotesearchresult.h @@ -41,6 +41,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static RemoteSearchResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -74,11 +78,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -157,7 +161,7 @@ public: protected: QString m_name; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_productionYear = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_indexNumberEnd = std::nullopt; @@ -170,6 +174,18 @@ protected: QList m_artists; }; +} // NS DTO + +namespace Support { + +using RemoteSearchResult = Jellyfin::DTO::RemoteSearchResult; + +template <> +RemoteSearchResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RemoteSearchResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/remotesubtitleinfo.h b/core/include/JellyfinQt/dto/remotesubtitleinfo.h index 1144cb6..a97182a 100644 --- a/core/include/JellyfinQt/dto/remotesubtitleinfo.h +++ b/core/include/JellyfinQt/dto/remotesubtitleinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static RemoteSubtitleInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -149,6 +153,18 @@ protected: std::optional m_isHashMatch = std::nullopt; }; +} // NS DTO + +namespace Support { + +using RemoteSubtitleInfo = Jellyfin::DTO::RemoteSubtitleInfo; + +template <> +RemoteSubtitleInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RemoteSubtitleInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/removefromplaylistrequestdto.h b/core/include/JellyfinQt/dto/removefromplaylistrequestdto.h index c2e90cc..af1d8ee 100644 --- a/core/include/JellyfinQt/dto/removefromplaylistrequestdto.h +++ b/core/include/JellyfinQt/dto/removefromplaylistrequestdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static RemoveFromPlaylistRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -74,6 +78,18 @@ protected: QStringList m_playlistItemIds; }; +} // NS DTO + +namespace Support { + +using RemoveFromPlaylistRequestDto = Jellyfin::DTO::RemoveFromPlaylistRequestDto; + +template <> +RemoveFromPlaylistRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RemoveFromPlaylistRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/repeatmode.h b/core/include/JellyfinQt/dto/repeatmode.h index 9555954..28c04bb 100644 --- a/core/include/JellyfinQt/dto/repeatmode.h +++ b/core/include/JellyfinQt/dto/repeatmode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit RepeatModeClass(); }; -typedef RepeatModeClass::Value RepeatMode; +using RepeatMode = RepeatModeClass::Value; + +} // NS DTO + +namespace Support { + +using RepeatMode = Jellyfin::DTO::RepeatMode; + +template <> +RepeatMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const RepeatMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/repositoryinfo.h b/core/include/JellyfinQt/dto/repositoryinfo.h index 4bef364..6b8654c 100644 --- a/core/include/JellyfinQt/dto/repositoryinfo.h +++ b/core/include/JellyfinQt/dto/repositoryinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static RepositoryInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: bool m_enabled; }; +} // NS DTO + +namespace Support { + +using RepositoryInfo = Jellyfin::DTO::RepositoryInfo; + +template <> +RepositoryInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const RepositoryInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/responseprofile.h b/core/include/JellyfinQt/dto/responseprofile.h index 177e1a1..6f28034 100644 --- a/core/include/JellyfinQt/dto/responseprofile.h +++ b/core/include/JellyfinQt/dto/responseprofile.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/profilecondition.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static ResponseProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -118,6 +122,18 @@ protected: QList m_conditions; }; +} // NS DTO + +namespace Support { + +using ResponseProfile = Jellyfin::DTO::ResponseProfile; + +template <> +ResponseProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ResponseProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/scrolldirection.h b/core/include/JellyfinQt/dto/scrolldirection.h index dbcfa83..2b70c45 100644 --- a/core/include/JellyfinQt/dto/scrolldirection.h +++ b/core/include/JellyfinQt/dto/scrolldirection.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit ScrollDirectionClass(); }; -typedef ScrollDirectionClass::Value ScrollDirection; +using ScrollDirection = ScrollDirectionClass::Value; + +} // NS DTO + +namespace Support { + +using ScrollDirection = Jellyfin::DTO::ScrollDirection; + +template <> +ScrollDirection fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const ScrollDirection &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/searchhint.h b/core/include/JellyfinQt/dto/searchhint.h index 45e77cc..7616a4c 100644 --- a/core/include/JellyfinQt/dto/searchhint.h +++ b/core/include/JellyfinQt/dto/searchhint.h @@ -40,6 +40,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static SearchHint fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -379,6 +383,18 @@ protected: std::optional m_primaryImageAspectRatio = std::nullopt; }; +} // NS DTO + +namespace Support { + +using SearchHint = Jellyfin::DTO::SearchHint; + +template <> +SearchHint fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SearchHint &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/searchhintresult.h b/core/include/JellyfinQt/dto/searchhintresult.h index 6160721..ab16df3 100644 --- a/core/include/JellyfinQt/dto/searchhintresult.h +++ b/core/include/JellyfinQt/dto/searchhintresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/searchhint.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static SearchHintResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: qint32 m_totalRecordCount; }; +} // NS DTO + +namespace Support { + +using SearchHintResult = Jellyfin::DTO::SearchHintResult; + +template <> +SearchHintResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SearchHintResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seekrequestdto.h b/core/include/JellyfinQt/dto/seekrequestdto.h index 4d77efb..cfbbc4f 100644 --- a/core/include/JellyfinQt/dto/seekrequestdto.h +++ b/core/include/JellyfinQt/dto/seekrequestdto.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static SeekRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -69,6 +73,18 @@ protected: qint64 m_positionTicks; }; +} // NS DTO + +namespace Support { + +using SeekRequestDto = Jellyfin::DTO::SeekRequestDto; + +template <> +SeekRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SeekRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/sendcommand.h b/core/include/JellyfinQt/dto/sendcommand.h index fe279ad..936384d 100644 --- a/core/include/JellyfinQt/dto/sendcommand.h +++ b/core/include/JellyfinQt/dto/sendcommand.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/sendcommandtype.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static SendCommand fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -120,6 +124,18 @@ protected: QDateTime m_emittedAt; }; +} // NS DTO + +namespace Support { + +using SendCommand = Jellyfin::DTO::SendCommand; + +template <> +SendCommand fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SendCommand &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/sendcommandtype.h b/core/include/JellyfinQt/dto/sendcommandtype.h index 7d8f1d0..5640e5e 100644 --- a/core/include/JellyfinQt/dto/sendcommandtype.h +++ b/core/include/JellyfinQt/dto/sendcommandtype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit SendCommandTypeClass(); }; -typedef SendCommandTypeClass::Value SendCommandType; +using SendCommandType = SendCommandTypeClass::Value; + +} // NS DTO + +namespace Support { + +using SendCommandType = Jellyfin::DTO::SendCommandType; + +template <> +SendCommandType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SendCommandType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seriesinfo.h b/core/include/JellyfinQt/dto/seriesinfo.h index c047c47..694e575 100644 --- a/core/include/JellyfinQt/dto/seriesinfo.h +++ b/core/include/JellyfinQt/dto/seriesinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static SeriesInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -155,7 +159,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -163,6 +167,18 @@ protected: bool m_isAutomated; }; +} // NS DTO + +namespace Support { + +using SeriesInfo = Jellyfin::DTO::SeriesInfo; + +template <> +SeriesInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SeriesInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seriesinforemotesearchquery.h b/core/include/JellyfinQt/dto/seriesinforemotesearchquery.h index 03e3eff..541864f 100644 --- a/core/include/JellyfinQt/dto/seriesinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/seriesinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/seriesinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static SeriesInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using SeriesInfoRemoteSearchQuery = Jellyfin::DTO::SeriesInfoRemoteSearchQuery; + +template <> +SeriesInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SeriesInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seriesstatus.h b/core/include/JellyfinQt/dto/seriesstatus.h index ee3bb9d..3a8ee8e 100644 --- a/core/include/JellyfinQt/dto/seriesstatus.h +++ b/core/include/JellyfinQt/dto/seriesstatus.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit SeriesStatusClass(); }; -typedef SeriesStatusClass::Value SeriesStatus; +using SeriesStatus = SeriesStatusClass::Value; + +} // NS DTO + +namespace Support { + +using SeriesStatus = Jellyfin::DTO::SeriesStatus; + +template <> +SeriesStatus fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SeriesStatus &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seriestimerinfodto.h b/core/include/JellyfinQt/dto/seriestimerinfodto.h index 0ed4f6e..538683e 100644 --- a/core/include/JellyfinQt/dto/seriestimerinfodto.h +++ b/core/include/JellyfinQt/dto/seriestimerinfodto.h @@ -43,6 +43,10 @@ #include "JellyfinQt/dto/keepuntil.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,7 @@ public: static SeriesTimerInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -341,11 +345,11 @@ public: /** * @brief Gets or sets the image tags. */ - std::optional imageTags() const; + QJsonObject imageTags() const; /** * @brief Gets or sets the image tags. */ - void setImageTags(std::optional newImageTags); + void setImageTags(QJsonObject newImageTags); bool imageTagsNull() const; void setImageTagsNull(); @@ -425,13 +429,25 @@ protected: bool m_recordNewOnly; QList m_days; DayPattern m_dayPattern; - std::optional m_imageTags = std::nullopt; + QJsonObject m_imageTags; QString m_parentThumbItemId; QString m_parentThumbImageTag; QString m_parentPrimaryImageItemId; QString m_parentPrimaryImageTag; }; +} // NS DTO + +namespace Support { + +using SeriesTimerInfoDto = Jellyfin::DTO::SeriesTimerInfoDto; + +template <> +SeriesTimerInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SeriesTimerInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/seriestimerinfodtoqueryresult.h b/core/include/JellyfinQt/dto/seriestimerinfodtoqueryresult.h index 03146a9..afedd00 100644 --- a/core/include/JellyfinQt/dto/seriestimerinfodtoqueryresult.h +++ b/core/include/JellyfinQt/dto/seriestimerinfodtoqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/seriestimerinfodto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static SeriesTimerInfoDtoQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using SeriesTimerInfoDtoQueryResult = Jellyfin::DTO::SeriesTimerInfoDtoQueryResult; + +template <> +SeriesTimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SeriesTimerInfoDtoQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/serverconfiguration.h b/core/include/JellyfinQt/dto/serverconfiguration.h index 055c705..094e620 100644 --- a/core/include/JellyfinQt/dto/serverconfiguration.h +++ b/core/include/JellyfinQt/dto/serverconfiguration.h @@ -46,6 +46,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -62,7 +66,7 @@ public: static ServerConfiguration fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -899,6 +903,18 @@ protected: bool m_disablePluginImages; }; +} // NS DTO + +namespace Support { + +using ServerConfiguration = Jellyfin::DTO::ServerConfiguration; + +template <> +ServerConfiguration fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ServerConfiguration &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/sessioninfo.h b/core/include/JellyfinQt/dto/sessioninfo.h index 0b795b4..024b35e 100644 --- a/core/include/JellyfinQt/dto/sessioninfo.h +++ b/core/include/JellyfinQt/dto/sessioninfo.h @@ -49,6 +49,10 @@ #include "JellyfinQt/dto/transcodinginfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -65,7 +69,7 @@ public: static SessionInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -326,6 +330,18 @@ protected: QList m_supportedCommands; }; +} // NS DTO + +namespace Support { + +using SessionInfo = Jellyfin::DTO::SessionInfo; + +template <> +SessionInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SessionInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/sessionuserinfo.h b/core/include/JellyfinQt/dto/sessionuserinfo.h index c744be1..9084cc9 100644 --- a/core/include/JellyfinQt/dto/sessionuserinfo.h +++ b/core/include/JellyfinQt/dto/sessionuserinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SessionUserInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -82,6 +86,18 @@ protected: QString m_userName; }; +} // NS DTO + +namespace Support { + +using SessionUserInfo = Jellyfin::DTO::SessionUserInfo; + +template <> +SessionUserInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SessionUserInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/setchannelmappingdto.h b/core/include/JellyfinQt/dto/setchannelmappingdto.h index 529ee48..433bfd0 100644 --- a/core/include/JellyfinQt/dto/setchannelmappingdto.h +++ b/core/include/JellyfinQt/dto/setchannelmappingdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SetChannelMappingDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -90,6 +94,18 @@ protected: QString m_providerChannelId; }; +} // NS DTO + +namespace Support { + +using SetChannelMappingDto = Jellyfin::DTO::SetChannelMappingDto; + +template <> +SetChannelMappingDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SetChannelMappingDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/setplaylistitemrequestdto.h b/core/include/JellyfinQt/dto/setplaylistitemrequestdto.h index e889696..2dca543 100644 --- a/core/include/JellyfinQt/dto/setplaylistitemrequestdto.h +++ b/core/include/JellyfinQt/dto/setplaylistitemrequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SetPlaylistItemRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -70,6 +74,18 @@ protected: QString m_playlistItemId; }; +} // NS DTO + +namespace Support { + +using SetPlaylistItemRequestDto = Jellyfin::DTO::SetPlaylistItemRequestDto; + +template <> +SetPlaylistItemRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SetPlaylistItemRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/setrepeatmoderequestdto.h b/core/include/JellyfinQt/dto/setrepeatmoderequestdto.h index 61e87b5..583d6ce 100644 --- a/core/include/JellyfinQt/dto/setrepeatmoderequestdto.h +++ b/core/include/JellyfinQt/dto/setrepeatmoderequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/dto/grouprepeatmode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SetRepeatModeRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -66,6 +70,18 @@ protected: GroupRepeatMode m_mode; }; +} // NS DTO + +namespace Support { + +using SetRepeatModeRequestDto = Jellyfin::DTO::SetRepeatModeRequestDto; + +template <> +SetRepeatModeRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SetRepeatModeRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/setshufflemoderequestdto.h b/core/include/JellyfinQt/dto/setshufflemoderequestdto.h index a956614..7890409 100644 --- a/core/include/JellyfinQt/dto/setshufflemoderequestdto.h +++ b/core/include/JellyfinQt/dto/setshufflemoderequestdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/dto/groupshufflemode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SetShuffleModeRequestDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -66,6 +70,18 @@ protected: GroupShuffleMode m_mode; }; +} // NS DTO + +namespace Support { + +using SetShuffleModeRequestDto = Jellyfin::DTO::SetShuffleModeRequestDto; + +template <> +SetShuffleModeRequestDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SetShuffleModeRequestDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/songinfo.h b/core/include/JellyfinQt/dto/songinfo.h index bea21dc..b45251b 100644 --- a/core/include/JellyfinQt/dto/songinfo.h +++ b/core/include/JellyfinQt/dto/songinfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static SongInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -106,11 +110,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -178,7 +182,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -189,6 +193,18 @@ protected: QStringList m_artists; }; +} // NS DTO + +namespace Support { + +using SongInfo = Jellyfin::DTO::SongInfo; + +template <> +SongInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SongInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/sortorder.h b/core/include/JellyfinQt/dto/sortorder.h index f9b078d..f6f1a60 100644 --- a/core/include/JellyfinQt/dto/sortorder.h +++ b/core/include/JellyfinQt/dto/sortorder.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit SortOrderClass(); }; -typedef SortOrderClass::Value SortOrder; +using SortOrder = SortOrderClass::Value; + +} // NS DTO + +namespace Support { + +using SortOrder = Jellyfin::DTO::SortOrder; + +template <> +SortOrder fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SortOrder &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/specialviewoptiondto.h b/core/include/JellyfinQt/dto/specialviewoptiondto.h index 5cdd454..bfede41 100644 --- a/core/include/JellyfinQt/dto/specialviewoptiondto.h +++ b/core/include/JellyfinQt/dto/specialviewoptiondto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static SpecialViewOptionDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using SpecialViewOptionDto = Jellyfin::DTO::SpecialViewOptionDto; + +template <> +SpecialViewOptionDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SpecialViewOptionDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/startupconfigurationdto.h b/core/include/JellyfinQt/dto/startupconfigurationdto.h index 61a41d2..b8d6de2 100644 --- a/core/include/JellyfinQt/dto/startupconfigurationdto.h +++ b/core/include/JellyfinQt/dto/startupconfigurationdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static StartupConfigurationDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -96,6 +100,18 @@ protected: QString m_preferredMetadataLanguage; }; +} // NS DTO + +namespace Support { + +using StartupConfigurationDto = Jellyfin::DTO::StartupConfigurationDto; + +template <> +StartupConfigurationDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const StartupConfigurationDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/startupremoteaccessdto.h b/core/include/JellyfinQt/dto/startupremoteaccessdto.h index fcb8b3b..01420c8 100644 --- a/core/include/JellyfinQt/dto/startupremoteaccessdto.h +++ b/core/include/JellyfinQt/dto/startupremoteaccessdto.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static StartupRemoteAccessDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -79,6 +83,18 @@ protected: bool m_enableAutomaticPortMapping; }; +} // NS DTO + +namespace Support { + +using StartupRemoteAccessDto = Jellyfin::DTO::StartupRemoteAccessDto; + +template <> +StartupRemoteAccessDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const StartupRemoteAccessDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/startupuserdto.h b/core/include/JellyfinQt/dto/startupuserdto.h index bda878f..317ee43 100644 --- a/core/include/JellyfinQt/dto/startupuserdto.h +++ b/core/include/JellyfinQt/dto/startupuserdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static StartupUserDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_password; }; +} // NS DTO + +namespace Support { + +using StartupUserDto = Jellyfin::DTO::StartupUserDto; + +template <> +StartupUserDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const StartupUserDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/subtitledeliverymethod.h b/core/include/JellyfinQt/dto/subtitledeliverymethod.h index 1ce69ca..21118fc 100644 --- a/core/include/JellyfinQt/dto/subtitledeliverymethod.h +++ b/core/include/JellyfinQt/dto/subtitledeliverymethod.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit SubtitleDeliveryMethodClass(); }; -typedef SubtitleDeliveryMethodClass::Value SubtitleDeliveryMethod; +using SubtitleDeliveryMethod = SubtitleDeliveryMethodClass::Value; + +} // NS DTO + +namespace Support { + +using SubtitleDeliveryMethod = Jellyfin::DTO::SubtitleDeliveryMethod; + +template <> +SubtitleDeliveryMethod fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SubtitleDeliveryMethod &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/subtitleplaybackmode.h b/core/include/JellyfinQt/dto/subtitleplaybackmode.h index 3fcc864..5bafaf5 100644 --- a/core/include/JellyfinQt/dto/subtitleplaybackmode.h +++ b/core/include/JellyfinQt/dto/subtitleplaybackmode.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit SubtitlePlaybackModeClass(); }; -typedef SubtitlePlaybackModeClass::Value SubtitlePlaybackMode; +using SubtitlePlaybackMode = SubtitlePlaybackModeClass::Value; + +} // NS DTO + +namespace Support { + +using SubtitlePlaybackMode = Jellyfin::DTO::SubtitlePlaybackMode; + +template <> +SubtitlePlaybackMode fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SubtitlePlaybackMode &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/subtitleprofile.h b/core/include/JellyfinQt/dto/subtitleprofile.h index fd0b4b0..43587b8 100644 --- a/core/include/JellyfinQt/dto/subtitleprofile.h +++ b/core/include/JellyfinQt/dto/subtitleprofile.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/subtitledeliverymethod.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static SubtitleProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -99,6 +103,18 @@ protected: QString m_container; }; +} // NS DTO + +namespace Support { + +using SubtitleProfile = Jellyfin::DTO::SubtitleProfile; + +template <> +SubtitleProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SubtitleProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/syncplayuseraccesstype.h b/core/include/JellyfinQt/dto/syncplayuseraccesstype.h index 4fe1b6a..626232e 100644 --- a/core/include/JellyfinQt/dto/syncplayuseraccesstype.h +++ b/core/include/JellyfinQt/dto/syncplayuseraccesstype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit SyncPlayUserAccessTypeClass(); }; -typedef SyncPlayUserAccessTypeClass::Value SyncPlayUserAccessType; +using SyncPlayUserAccessType = SyncPlayUserAccessTypeClass::Value; + +} // NS DTO + +namespace Support { + +using SyncPlayUserAccessType = Jellyfin::DTO::SyncPlayUserAccessType; + +template <> +SyncPlayUserAccessType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const SyncPlayUserAccessType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/systeminfo.h b/core/include/JellyfinQt/dto/systeminfo.h index 733d18a..711a9a1 100644 --- a/core/include/JellyfinQt/dto/systeminfo.h +++ b/core/include/JellyfinQt/dto/systeminfo.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/installationinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static SystemInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -343,6 +347,18 @@ protected: Architecture m_systemArchitecture; }; +} // NS DTO + +namespace Support { + +using SystemInfo = Jellyfin::DTO::SystemInfo; + +template <> +SystemInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const SystemInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/taskcompletionstatus.h b/core/include/JellyfinQt/dto/taskcompletionstatus.h index 327a2d7..9165844 100644 --- a/core/include/JellyfinQt/dto/taskcompletionstatus.h +++ b/core/include/JellyfinQt/dto/taskcompletionstatus.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit TaskCompletionStatusClass(); }; -typedef TaskCompletionStatusClass::Value TaskCompletionStatus; +using TaskCompletionStatus = TaskCompletionStatusClass::Value; + +} // NS DTO + +namespace Support { + +using TaskCompletionStatus = Jellyfin::DTO::TaskCompletionStatus; + +template <> +TaskCompletionStatus fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const TaskCompletionStatus &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/taskinfo.h b/core/include/JellyfinQt/dto/taskinfo.h index db1f495..065632f 100644 --- a/core/include/JellyfinQt/dto/taskinfo.h +++ b/core/include/JellyfinQt/dto/taskinfo.h @@ -43,6 +43,10 @@ #include "JellyfinQt/dto/tasktriggerinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,7 @@ public: static TaskInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -172,6 +176,18 @@ protected: QString m_key; }; +} // NS DTO + +namespace Support { + +using TaskInfo = Jellyfin::DTO::TaskInfo; + +template <> +TaskInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TaskInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/taskresult.h b/core/include/JellyfinQt/dto/taskresult.h index e3100c8..72d8968 100644 --- a/core/include/JellyfinQt/dto/taskresult.h +++ b/core/include/JellyfinQt/dto/taskresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/taskcompletionstatus.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static TaskResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -148,6 +152,18 @@ protected: QString m_longErrorMessage; }; +} // NS DTO + +namespace Support { + +using TaskResult = Jellyfin::DTO::TaskResult; + +template <> +TaskResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TaskResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/taskstate.h b/core/include/JellyfinQt/dto/taskstate.h index b6c6920..5897daa 100644 --- a/core/include/JellyfinQt/dto/taskstate.h +++ b/core/include/JellyfinQt/dto/taskstate.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit TaskStateClass(); }; -typedef TaskStateClass::Value TaskState; +using TaskState = TaskStateClass::Value; + +} // NS DTO + +namespace Support { + +using TaskState = Jellyfin::DTO::TaskState; + +template <> +TaskState fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const TaskState &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/tasktriggerinfo.h b/core/include/JellyfinQt/dto/tasktriggerinfo.h index 037841f..ca255c8 100644 --- a/core/include/JellyfinQt/dto/tasktriggerinfo.h +++ b/core/include/JellyfinQt/dto/tasktriggerinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/dto/dayofweek.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static TaskTriggerInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -115,6 +119,18 @@ protected: std::optional m_maxRuntimeTicks = std::nullopt; }; +} // NS DTO + +namespace Support { + +using TaskTriggerInfo = Jellyfin::DTO::TaskTriggerInfo; + +template <> +TaskTriggerInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TaskTriggerInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/thememediaresult.h b/core/include/JellyfinQt/dto/thememediaresult.h index 4a699c8..8c53115 100644 --- a/core/include/JellyfinQt/dto/thememediaresult.h +++ b/core/include/JellyfinQt/dto/thememediaresult.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/baseitemdto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static ThemeMediaResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -105,6 +109,18 @@ protected: QString m_ownerId; }; +} // NS DTO + +namespace Support { + +using ThemeMediaResult = Jellyfin::DTO::ThemeMediaResult; + +template <> +ThemeMediaResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ThemeMediaResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/timereventinfo.h b/core/include/JellyfinQt/dto/timereventinfo.h index 57fec82..f7a06f2 100644 --- a/core/include/JellyfinQt/dto/timereventinfo.h +++ b/core/include/JellyfinQt/dto/timereventinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static TimerEventInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -76,6 +80,18 @@ protected: QString m_programId; }; +} // NS DTO + +namespace Support { + +using TimerEventInfo = Jellyfin::DTO::TimerEventInfo; + +template <> +TimerEventInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TimerEventInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/timerinfodto.h b/core/include/JellyfinQt/dto/timerinfodto.h index 6506757..d521c7e 100644 --- a/core/include/JellyfinQt/dto/timerinfodto.h +++ b/core/include/JellyfinQt/dto/timerinfodto.h @@ -44,6 +44,10 @@ #include "JellyfinQt/dto/recordingstatus.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -60,7 +64,7 @@ public: static TimerInfoDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -361,6 +365,18 @@ protected: QSharedPointer m_programInfo = nullptr; }; +} // NS DTO + +namespace Support { + +using TimerInfoDto = Jellyfin::DTO::TimerInfoDto; + +template <> +TimerInfoDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TimerInfoDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/timerinfodtoqueryresult.h b/core/include/JellyfinQt/dto/timerinfodtoqueryresult.h index e70e036..fe7f2de 100644 --- a/core/include/JellyfinQt/dto/timerinfodtoqueryresult.h +++ b/core/include/JellyfinQt/dto/timerinfodtoqueryresult.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/timerinfodto.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static TimerInfoDtoQueryResult fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: qint32 m_startIndex; }; +} // NS DTO + +namespace Support { + +using TimerInfoDtoQueryResult = Jellyfin::DTO::TimerInfoDtoQueryResult; + +template <> +TimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TimerInfoDtoQueryResult &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/trailerinfo.h b/core/include/JellyfinQt/dto/trailerinfo.h index 9023b9c..8241b95 100644 --- a/core/include/JellyfinQt/dto/trailerinfo.h +++ b/core/include/JellyfinQt/dto/trailerinfo.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static TrailerInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -104,11 +108,11 @@ public: /** * @brief Gets or sets the provider ids. */ - std::optional providerIds() const; + QJsonObject providerIds() const; /** * @brief Gets or sets the provider ids. */ - void setProviderIds(std::optional newProviderIds); + void setProviderIds(QJsonObject newProviderIds); bool providerIdsNull() const; void setProviderIdsNull(); @@ -155,7 +159,7 @@ protected: QString m_path; QString m_metadataLanguage; QString m_metadataCountryCode; - std::optional m_providerIds = std::nullopt; + QJsonObject m_providerIds; std::optional m_year = std::nullopt; std::optional m_indexNumber = std::nullopt; std::optional m_parentIndexNumber = std::nullopt; @@ -163,6 +167,18 @@ protected: bool m_isAutomated; }; +} // NS DTO + +namespace Support { + +using TrailerInfo = Jellyfin::DTO::TrailerInfo; + +template <> +TrailerInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TrailerInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/trailerinforemotesearchquery.h b/core/include/JellyfinQt/dto/trailerinforemotesearchquery.h index 71b8d7d..04124b0 100644 --- a/core/include/JellyfinQt/dto/trailerinforemotesearchquery.h +++ b/core/include/JellyfinQt/dto/trailerinforemotesearchquery.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/trailerinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static TrailerInfoRemoteSearchQuery fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -96,6 +100,18 @@ protected: bool m_includeDisabledProviders; }; +} // NS DTO + +namespace Support { + +using TrailerInfoRemoteSearchQuery = Jellyfin::DTO::TrailerInfoRemoteSearchQuery; + +template <> +TrailerInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TrailerInfoRemoteSearchQuery &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/transcodereason.h b/core/include/JellyfinQt/dto/transcodereason.h index fa92010..ea5ae58 100644 --- a/core/include/JellyfinQt/dto/transcodereason.h +++ b/core/include/JellyfinQt/dto/transcodereason.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -73,7 +77,19 @@ private: explicit TranscodeReasonClass(); }; -typedef TranscodeReasonClass::Value TranscodeReason; +using TranscodeReason = TranscodeReasonClass::Value; + +} // NS DTO + +namespace Support { + +using TranscodeReason = Jellyfin::DTO::TranscodeReason; + +template <> +TranscodeReason fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const TranscodeReason &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/transcodeseekinfo.h b/core/include/JellyfinQt/dto/transcodeseekinfo.h index d08a4ae..b820004 100644 --- a/core/include/JellyfinQt/dto/transcodeseekinfo.h +++ b/core/include/JellyfinQt/dto/transcodeseekinfo.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,19 @@ private: explicit TranscodeSeekInfoClass(); }; -typedef TranscodeSeekInfoClass::Value TranscodeSeekInfo; +using TranscodeSeekInfo = TranscodeSeekInfoClass::Value; + +} // NS DTO + +namespace Support { + +using TranscodeSeekInfo = Jellyfin::DTO::TranscodeSeekInfo; + +template <> +TranscodeSeekInfo fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const TranscodeSeekInfo &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/transcodinginfo.h b/core/include/JellyfinQt/dto/transcodinginfo.h index d45a483..ae09178 100644 --- a/core/include/JellyfinQt/dto/transcodinginfo.h +++ b/core/include/JellyfinQt/dto/transcodinginfo.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/transcodereason.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static TranscodingInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -155,6 +159,18 @@ protected: QList m_transcodeReasons; }; +} // NS DTO + +namespace Support { + +using TranscodingInfo = Jellyfin::DTO::TranscodingInfo; + +template <> +TranscodingInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TranscodingInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/transcodingprofile.h b/core/include/JellyfinQt/dto/transcodingprofile.h index f412888..329fd26 100644 --- a/core/include/JellyfinQt/dto/transcodingprofile.h +++ b/core/include/JellyfinQt/dto/transcodingprofile.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/transcodeseekinfo.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static TranscodingProfile fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -163,6 +167,18 @@ protected: bool m_breakOnNonKeyFrames; }; +} // NS DTO + +namespace Support { + +using TranscodingProfile = Jellyfin::DTO::TranscodingProfile; + +template <> +TranscodingProfile fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TranscodingProfile &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/transportstreamtimestamp.h b/core/include/JellyfinQt/dto/transportstreamtimestamp.h index 984bc2a..01cb001 100644 --- a/core/include/JellyfinQt/dto/transportstreamtimestamp.h +++ b/core/include/JellyfinQt/dto/transportstreamtimestamp.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,19 @@ private: explicit TransportStreamTimestampClass(); }; -typedef TransportStreamTimestampClass::Value TransportStreamTimestamp; +using TransportStreamTimestamp = TransportStreamTimestampClass::Value; + +} // NS DTO + +namespace Support { + +using TransportStreamTimestamp = Jellyfin::DTO::TransportStreamTimestamp; + +template <> +TransportStreamTimestamp fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const TransportStreamTimestamp &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/tunerchannelmapping.h b/core/include/JellyfinQt/dto/tunerchannelmapping.h index 34bbbc9..3c58b34 100644 --- a/core/include/JellyfinQt/dto/tunerchannelmapping.h +++ b/core/include/JellyfinQt/dto/tunerchannelmapping.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static TunerChannelMapping fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -92,6 +96,18 @@ protected: QString m_jellyfinId; }; +} // NS DTO + +namespace Support { + +using TunerChannelMapping = Jellyfin::DTO::TunerChannelMapping; + +template <> +TunerChannelMapping fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TunerChannelMapping &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/tunerhostinfo.h b/core/include/JellyfinQt/dto/tunerhostinfo.h index 47ce9db..fa601e5 100644 --- a/core/include/JellyfinQt/dto/tunerhostinfo.h +++ b/core/include/JellyfinQt/dto/tunerhostinfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static TunerHostInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -140,6 +144,18 @@ protected: QString m_userAgent; }; +} // NS DTO + +namespace Support { + +using TunerHostInfo = Jellyfin::DTO::TunerHostInfo; + +template <> +TunerHostInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TunerHostInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/typeoptions.h b/core/include/JellyfinQt/dto/typeoptions.h index 6f2855f..7862516 100644 --- a/core/include/JellyfinQt/dto/typeoptions.h +++ b/core/include/JellyfinQt/dto/typeoptions.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/imageoption.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static TypeOptions fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -111,6 +115,18 @@ protected: QList m_imageOptions; }; +} // NS DTO + +namespace Support { + +using TypeOptions = Jellyfin::DTO::TypeOptions; + +template <> +TypeOptions fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const TypeOptions &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/unrateditem.h b/core/include/JellyfinQt/dto/unrateditem.h index b24b33c..87b490b 100644 --- a/core/include/JellyfinQt/dto/unrateditem.h +++ b/core/include/JellyfinQt/dto/unrateditem.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -59,7 +63,19 @@ private: explicit UnratedItemClass(); }; -typedef UnratedItemClass::Value UnratedItem; +using UnratedItem = UnratedItemClass::Value; + +} // NS DTO + +namespace Support { + +using UnratedItem = Jellyfin::DTO::UnratedItem; + +template <> +UnratedItem fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const UnratedItem &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/updatelibraryoptionsdto.h b/core/include/JellyfinQt/dto/updatelibraryoptionsdto.h index 720b268..bc2ccdc 100644 --- a/core/include/JellyfinQt/dto/updatelibraryoptionsdto.h +++ b/core/include/JellyfinQt/dto/updatelibraryoptionsdto.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/libraryoptions.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static UpdateLibraryOptionsDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -78,6 +82,18 @@ protected: QSharedPointer m_libraryOptions = nullptr; }; +} // NS DTO + +namespace Support { + +using UpdateLibraryOptionsDto = Jellyfin::DTO::UpdateLibraryOptionsDto; + +template <> +UpdateLibraryOptionsDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UpdateLibraryOptionsDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/updateusereasypassword.h b/core/include/JellyfinQt/dto/updateusereasypassword.h index 691a751..fc5ba30 100644 --- a/core/include/JellyfinQt/dto/updateusereasypassword.h +++ b/core/include/JellyfinQt/dto/updateusereasypassword.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static UpdateUserEasyPassword fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: bool m_resetPassword; }; +} // NS DTO + +namespace Support { + +using UpdateUserEasyPassword = Jellyfin::DTO::UpdateUserEasyPassword; + +template <> +UpdateUserEasyPassword fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UpdateUserEasyPassword &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/updateuserpassword.h b/core/include/JellyfinQt/dto/updateuserpassword.h index e02c6d9..80650b7 100644 --- a/core/include/JellyfinQt/dto/updateuserpassword.h +++ b/core/include/JellyfinQt/dto/updateuserpassword.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static UpdateUserPassword fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -106,6 +110,18 @@ protected: bool m_resetPassword; }; +} // NS DTO + +namespace Support { + +using UpdateUserPassword = Jellyfin::DTO::UpdateUserPassword; + +template <> +UpdateUserPassword fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UpdateUserPassword &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/uploadsubtitledto.h b/core/include/JellyfinQt/dto/uploadsubtitledto.h index 959ab56..021b173 100644 --- a/core/include/JellyfinQt/dto/uploadsubtitledto.h +++ b/core/include/JellyfinQt/dto/uploadsubtitledto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static UploadSubtitleDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -100,6 +104,18 @@ protected: QString m_data; }; +} // NS DTO + +namespace Support { + +using UploadSubtitleDto = Jellyfin::DTO::UploadSubtitleDto; + +template <> +UploadSubtitleDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UploadSubtitleDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/userconfiguration.h b/core/include/JellyfinQt/dto/userconfiguration.h index b1f9f81..91f087e 100644 --- a/core/include/JellyfinQt/dto/userconfiguration.h +++ b/core/include/JellyfinQt/dto/userconfiguration.h @@ -40,6 +40,10 @@ #include "JellyfinQt/dto/subtitleplaybackmode.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -56,7 +60,7 @@ public: static UserConfiguration fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -177,6 +181,18 @@ protected: bool m_enableNextEpisodeAutoPlay; }; +} // NS DTO + +namespace Support { + +using UserConfiguration = Jellyfin::DTO::UserConfiguration; + +template <> +UserConfiguration fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UserConfiguration &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/userdto.h b/core/include/JellyfinQt/dto/userdto.h index 4a1043e..31addf5 100644 --- a/core/include/JellyfinQt/dto/userdto.h +++ b/core/include/JellyfinQt/dto/userdto.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/userpolicy.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static UserDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -214,6 +218,18 @@ protected: std::optional m_primaryImageAspectRatio = std::nullopt; }; +} // NS DTO + +namespace Support { + +using UserDto = Jellyfin::DTO::UserDto; + +template <> +UserDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UserDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/useritemdatadto.h b/core/include/JellyfinQt/dto/useritemdatadto.h index 7a2715a..5c135aa 100644 --- a/core/include/JellyfinQt/dto/useritemdatadto.h +++ b/core/include/JellyfinQt/dto/useritemdatadto.h @@ -38,6 +38,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,7 @@ public: static UserItemDataDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -185,6 +189,18 @@ protected: QString m_itemId; }; +} // NS DTO + +namespace Support { + +using UserItemDataDto = Jellyfin::DTO::UserItemDataDto; + +template <> +UserItemDataDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UserItemDataDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/userpolicy.h b/core/include/JellyfinQt/dto/userpolicy.h index d9aeb74..6f2ad9e 100644 --- a/core/include/JellyfinQt/dto/userpolicy.h +++ b/core/include/JellyfinQt/dto/userpolicy.h @@ -42,6 +42,10 @@ #include "JellyfinQt/dto/unrateditem.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -58,7 +62,7 @@ public: static UserPolicy fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -343,6 +347,18 @@ protected: SyncPlayUserAccessType m_syncPlayAccess; }; +} // NS DTO + +namespace Support { + +using UserPolicy = Jellyfin::DTO::UserPolicy; + +template <> +UserPolicy fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UserPolicy &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/utctimeresponse.h b/core/include/JellyfinQt/dto/utctimeresponse.h index 60f8d2f..7bbe5e2 100644 --- a/core/include/JellyfinQt/dto/utctimeresponse.h +++ b/core/include/JellyfinQt/dto/utctimeresponse.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static UtcTimeResponse fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -80,6 +84,18 @@ protected: QDateTime m_responseTransmissionTime; }; +} // NS DTO + +namespace Support { + +using UtcTimeResponse = Jellyfin::DTO::UtcTimeResponse; + +template <> +UtcTimeResponse fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const UtcTimeResponse &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/validatepathdto.h b/core/include/JellyfinQt/dto/validatepathdto.h index 62f7fd9..9345d6e 100644 --- a/core/include/JellyfinQt/dto/validatepathdto.h +++ b/core/include/JellyfinQt/dto/validatepathdto.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static ValidatePathDto fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -94,6 +98,18 @@ protected: std::optional m_isFile = std::nullopt; }; +} // NS DTO + +namespace Support { + +using ValidatePathDto = Jellyfin::DTO::ValidatePathDto; + +template <> +ValidatePathDto fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const ValidatePathDto &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/version.h b/core/include/JellyfinQt/dto/version.h index eaf71f7..a0d6917 100644 --- a/core/include/JellyfinQt/dto/version.h +++ b/core/include/JellyfinQt/dto/version.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -52,7 +56,7 @@ public: static Version fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties @@ -95,6 +99,18 @@ protected: qint32 m_minorRevision; }; +} // NS DTO + +namespace Support { + +using Version = Jellyfin::DTO::Version; + +template <> +Version fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const Version &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/versioninfo.h b/core/include/JellyfinQt/dto/versioninfo.h index 3403446..ec9ce2b 100644 --- a/core/include/JellyfinQt/dto/versioninfo.h +++ b/core/include/JellyfinQt/dto/versioninfo.h @@ -39,6 +39,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,7 @@ public: static VersionInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -164,6 +168,18 @@ protected: QString m_repositoryUrl; }; +} // NS DTO + +namespace Support { + +using VersionInfo = Jellyfin::DTO::VersionInfo; + +template <> +VersionInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const VersionInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/video3dformat.h b/core/include/JellyfinQt/dto/video3dformat.h index 6069a64..9afa567 100644 --- a/core/include/JellyfinQt/dto/video3dformat.h +++ b/core/include/JellyfinQt/dto/video3dformat.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -55,7 +59,19 @@ private: explicit Video3DFormatClass(); }; -typedef Video3DFormatClass::Value Video3DFormat; +using Video3DFormat = Video3DFormatClass::Value; + +} // NS DTO + +namespace Support { + +using Video3DFormat = Jellyfin::DTO::Video3DFormat; + +template <> +Video3DFormat fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const Video3DFormat &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/videotype.h b/core/include/JellyfinQt/dto/videotype.h index f3e1920..63f3689 100644 --- a/core/include/JellyfinQt/dto/videotype.h +++ b/core/include/JellyfinQt/dto/videotype.h @@ -36,6 +36,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -54,7 +58,19 @@ private: explicit VideoTypeClass(); }; -typedef VideoTypeClass::Value VideoType; +using VideoType = VideoTypeClass::Value; + +} // NS DTO + +namespace Support { + +using VideoType = Jellyfin::DTO::VideoType; + +template <> +VideoType fromJsonValue(const QJsonValue &source, convertType); + +template <> +QJsonValue toJsonValue(const VideoType &source, convertType); } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/virtualfolderinfo.h b/core/include/JellyfinQt/dto/virtualfolderinfo.h index 6932199..a652cdc 100644 --- a/core/include/JellyfinQt/dto/virtualfolderinfo.h +++ b/core/include/JellyfinQt/dto/virtualfolderinfo.h @@ -41,6 +41,10 @@ #include "JellyfinQt/dto/libraryoptions.h" #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -57,7 +61,7 @@ public: static VirtualFolderInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -146,6 +150,18 @@ protected: QString m_refreshStatus; }; +} // NS DTO + +namespace Support { + +using VirtualFolderInfo = Jellyfin::DTO::VirtualFolderInfo; + +template <> +VirtualFolderInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const VirtualFolderInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/wakeonlaninfo.h b/core/include/JellyfinQt/dto/wakeonlaninfo.h index 1372990..b0c9bdf 100644 --- a/core/include/JellyfinQt/dto/wakeonlaninfo.h +++ b/core/include/JellyfinQt/dto/wakeonlaninfo.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static WakeOnLanInfo fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -82,6 +86,18 @@ protected: qint32 m_port; }; +} // NS DTO + +namespace Support { + +using WakeOnLanInfo = Jellyfin::DTO::WakeOnLanInfo; + +template <> +WakeOnLanInfo fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const WakeOnLanInfo &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/dto/xmlattribute.h b/core/include/JellyfinQt/dto/xmlattribute.h index a4a303f..fb0ad66 100644 --- a/core/include/JellyfinQt/dto/xmlattribute.h +++ b/core/include/JellyfinQt/dto/xmlattribute.h @@ -37,6 +37,10 @@ #include "JellyfinQt/support/jsonconv.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace DTO { @@ -53,7 +57,7 @@ public: static XmlAttribute fromJson(QJsonObject source); void setFromJson(QJsonObject source); - QJsonObject toJson(); + QJsonObject toJson() const; // Properties /** @@ -84,6 +88,18 @@ protected: QString m_value; }; +} // NS DTO + +namespace Support { + +using XmlAttribute = Jellyfin::DTO::XmlAttribute; + +template <> +XmlAttribute fromJsonValue(const QJsonValue &source, convertType); + +template<> +QJsonValue toJsonValue(const XmlAttribute &source, convertType); + } // NS DTO } // NS Jellyfin diff --git a/core/include/JellyfinQt/loader/http/activate.h b/core/include/JellyfinQt/loader/http/activate.h index 3c31ebd..00de23c 100644 --- a/core/include/JellyfinQt/loader/http/activate.h +++ b/core/include/JellyfinQt/loader/http/activate.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/addlistingprovider.h b/core/include/JellyfinQt/loader/http/addlistingprovider.h index 7457f51..fa574d2 100644 --- a/core/include/JellyfinQt/loader/http/addlistingprovider.h +++ b/core/include/JellyfinQt/loader/http/addlistingprovider.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/listingsproviderinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Adds a listings provider. */ -class AddListingProviderLoader : public Jellyfin::Support::HttpLoader { + +class AddListingProviderLoader : public Jellyfin::Support::HttpLoader { public: explicit AddListingProviderLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/addmediapath.h b/core/include/JellyfinQt/loader/http/addmediapath.h index ab71d6d..1363b80 100644 --- a/core/include/JellyfinQt/loader/http/addmediapath.h +++ b/core/include/JellyfinQt/loader/http/addmediapath.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/addtocollection.h b/core/include/JellyfinQt/loader/http/addtocollection.h index 6d1a672..113ec62 100644 --- a/core/include/JellyfinQt/loader/http/addtocollection.h +++ b/core/include/JellyfinQt/loader/http/addtocollection.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/addtoplaylist.h b/core/include/JellyfinQt/loader/http/addtoplaylist.h index 48da885..4efc942 100644 --- a/core/include/JellyfinQt/loader/http/addtoplaylist.h +++ b/core/include/JellyfinQt/loader/http/addtoplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/addtunerhost.h b/core/include/JellyfinQt/loader/http/addtunerhost.h index 1a52daf..3052573 100644 --- a/core/include/JellyfinQt/loader/http/addtunerhost.h +++ b/core/include/JellyfinQt/loader/http/addtunerhost.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/tunerhostinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Adds a tuner host. */ -class AddTunerHostLoader : public Jellyfin::Support::HttpLoader { + +class AddTunerHostLoader : public Jellyfin::Support::HttpLoader { public: explicit AddTunerHostLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/addusertosession.h b/core/include/JellyfinQt/loader/http/addusertosession.h index 8c4d3fb..a899c63 100644 --- a/core/include/JellyfinQt/loader/http/addusertosession.h +++ b/core/include/JellyfinQt/loader/http/addusertosession.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/addvirtualfolder.h b/core/include/JellyfinQt/loader/http/addvirtualfolder.h index b2c8633..6c2809b 100644 --- a/core/include/JellyfinQt/loader/http/addvirtualfolder.h +++ b/core/include/JellyfinQt/loader/http/addvirtualfolder.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/applysearchcriteria.h b/core/include/JellyfinQt/loader/http/applysearchcriteria.h index 2e21aef..da4e948 100644 --- a/core/include/JellyfinQt/loader/http/applysearchcriteria.h +++ b/core/include/JellyfinQt/loader/http/applysearchcriteria.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/authenticateuser.h b/core/include/JellyfinQt/loader/http/authenticateuser.h index a91e68d..1677561 100644 --- a/core/include/JellyfinQt/loader/http/authenticateuser.h +++ b/core/include/JellyfinQt/loader/http/authenticateuser.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/authenticationresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Authenticates a user. */ -class AuthenticateUserLoader : public Jellyfin::Support::HttpLoader { + +class AuthenticateUserLoader : public Jellyfin::Support::HttpLoader { public: explicit AuthenticateUserLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/authenticateuserbyname.h b/core/include/JellyfinQt/loader/http/authenticateuserbyname.h index 8bd9993..7316b6e 100644 --- a/core/include/JellyfinQt/loader/http/authenticateuserbyname.h +++ b/core/include/JellyfinQt/loader/http/authenticateuserbyname.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/authenticationresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Authenticates a user by name. */ -class AuthenticateUserByNameLoader : public Jellyfin::Support::HttpLoader { + +class AuthenticateUserByNameLoader : public Jellyfin::Support::HttpLoader { public: explicit AuthenticateUserByNameLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/authenticatewithquickconnect.h b/core/include/JellyfinQt/loader/http/authenticatewithquickconnect.h index c04b60a..c30e300 100644 --- a/core/include/JellyfinQt/loader/http/authenticatewithquickconnect.h +++ b/core/include/JellyfinQt/loader/http/authenticatewithquickconnect.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/authenticationresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Authenticates a user with quick connect. */ -class AuthenticateWithQuickConnectLoader : public Jellyfin::Support::HttpLoader { + +class AuthenticateWithQuickConnectLoader : public Jellyfin::Support::HttpLoader { public: explicit AuthenticateWithQuickConnectLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/authorize.h b/core/include/JellyfinQt/loader/http/authorize.h index 473eaf5..be17de6 100644 --- a/core/include/JellyfinQt/loader/http/authorize.h +++ b/core/include/JellyfinQt/loader/http/authorize.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Authorizes a pending quick connect request. + */ + +class AuthorizeLoader : public Jellyfin::Support::HttpLoader { +public: + explicit AuthorizeLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const AuthorizeParams& parameters) const override; + QUrlQuery query(const AuthorizeParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/available.h b/core/include/JellyfinQt/loader/http/available.h index cfa3129..b6c7b33 100644 --- a/core/include/JellyfinQt/loader/http/available.h +++ b/core/include/JellyfinQt/loader/http/available.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/cancelpackageinstallation.h b/core/include/JellyfinQt/loader/http/cancelpackageinstallation.h index 37cd407..0c0797b 100644 --- a/core/include/JellyfinQt/loader/http/cancelpackageinstallation.h +++ b/core/include/JellyfinQt/loader/http/cancelpackageinstallation.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/cancelseriestimer.h b/core/include/JellyfinQt/loader/http/cancelseriestimer.h index 5725350..c61f89d 100644 --- a/core/include/JellyfinQt/loader/http/cancelseriestimer.h +++ b/core/include/JellyfinQt/loader/http/cancelseriestimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/canceltimer.h b/core/include/JellyfinQt/loader/http/canceltimer.h index 5841d13..1f69a24 100644 --- a/core/include/JellyfinQt/loader/http/canceltimer.h +++ b/core/include/JellyfinQt/loader/http/canceltimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/closelivestream.h b/core/include/JellyfinQt/loader/http/closelivestream.h index d543d5f..b3c511a 100644 --- a/core/include/JellyfinQt/loader/http/closelivestream.h +++ b/core/include/JellyfinQt/loader/http/closelivestream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/completewizard.h b/core/include/JellyfinQt/loader/http/completewizard.h index d61e198..2b8aff3 100644 --- a/core/include/JellyfinQt/loader/http/completewizard.h +++ b/core/include/JellyfinQt/loader/http/completewizard.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/connect.h b/core/include/JellyfinQt/loader/http/connect.h index 65ca3b3..fb33bb0 100644 --- a/core/include/JellyfinQt/loader/http/connect.h +++ b/core/include/JellyfinQt/loader/http/connect.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/quickconnectresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Attempts to retrieve authentication information. */ -class ConnectLoader : public Jellyfin::Support::HttpLoader { + +class ConnectLoader : public Jellyfin::Support::HttpLoader { public: explicit ConnectLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/createadminnotification.h b/core/include/JellyfinQt/loader/http/createadminnotification.h index 2a0b477..2ed1ecd 100644 --- a/core/include/JellyfinQt/loader/http/createadminnotification.h +++ b/core/include/JellyfinQt/loader/http/createadminnotification.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/createcollection.h b/core/include/JellyfinQt/loader/http/createcollection.h index 0272250..e6d66fa 100644 --- a/core/include/JellyfinQt/loader/http/createcollection.h +++ b/core/include/JellyfinQt/loader/http/createcollection.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/collectioncreationresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates a new collection. */ -class CreateCollectionLoader : public Jellyfin::Support::HttpLoader { + +class CreateCollectionLoader : public Jellyfin::Support::HttpLoader { public: explicit CreateCollectionLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/createkey.h b/core/include/JellyfinQt/loader/http/createkey.h index e8a7b97..fb98537 100644 --- a/core/include/JellyfinQt/loader/http/createkey.h +++ b/core/include/JellyfinQt/loader/http/createkey.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/createplaylist.h b/core/include/JellyfinQt/loader/http/createplaylist.h index a1f736f..e95e460 100644 --- a/core/include/JellyfinQt/loader/http/createplaylist.h +++ b/core/include/JellyfinQt/loader/http/createplaylist.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/playlistcreationresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates a new playlist. */ -class CreatePlaylistLoader : public Jellyfin::Support::HttpLoader { + +class CreatePlaylistLoader : public Jellyfin::Support::HttpLoader { public: explicit CreatePlaylistLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/createprofile.h b/core/include/JellyfinQt/loader/http/createprofile.h index c3e21dc..a76afe8 100644 --- a/core/include/JellyfinQt/loader/http/createprofile.h +++ b/core/include/JellyfinQt/loader/http/createprofile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/createseriestimer.h b/core/include/JellyfinQt/loader/http/createseriestimer.h index d18fb18..b67525e 100644 --- a/core/include/JellyfinQt/loader/http/createseriestimer.h +++ b/core/include/JellyfinQt/loader/http/createseriestimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/createtimer.h b/core/include/JellyfinQt/loader/http/createtimer.h index b47da7b..4a98eb9 100644 --- a/core/include/JellyfinQt/loader/http/createtimer.h +++ b/core/include/JellyfinQt/loader/http/createtimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/createuserbyname.h b/core/include/JellyfinQt/loader/http/createuserbyname.h index 823f8db..20e021f 100644 --- a/core/include/JellyfinQt/loader/http/createuserbyname.h +++ b/core/include/JellyfinQt/loader/http/createuserbyname.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/userdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates a user. */ -class CreateUserByNameLoader : public Jellyfin::Support::HttpLoader { + +class CreateUserByNameLoader : public Jellyfin::Support::HttpLoader { public: explicit CreateUserByNameLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/deauthorize.h b/core/include/JellyfinQt/loader/http/deauthorize.h index 0387ad2..cdfdc3f 100644 --- a/core/include/JellyfinQt/loader/http/deauthorize.h +++ b/core/include/JellyfinQt/loader/http/deauthorize.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Deauthorize all quick connect devices for the current user. + */ + +class DeauthorizeLoader : public Jellyfin::Support::HttpLoader { +public: + explicit DeauthorizeLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DeauthorizeParams& parameters) const override; + QUrlQuery query(const DeauthorizeParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/deletealternatesources.h b/core/include/JellyfinQt/loader/http/deletealternatesources.h index 30b7e5a..bede8cd 100644 --- a/core/include/JellyfinQt/loader/http/deletealternatesources.h +++ b/core/include/JellyfinQt/loader/http/deletealternatesources.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deletedevice.h b/core/include/JellyfinQt/loader/http/deletedevice.h index 44ba9b2..f2beada 100644 --- a/core/include/JellyfinQt/loader/http/deletedevice.h +++ b/core/include/JellyfinQt/loader/http/deletedevice.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteitem.h b/core/include/JellyfinQt/loader/http/deleteitem.h index 8cc4aa6..1aed7c7 100644 --- a/core/include/JellyfinQt/loader/http/deleteitem.h +++ b/core/include/JellyfinQt/loader/http/deleteitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteitemimage.h b/core/include/JellyfinQt/loader/http/deleteitemimage.h index dfd24b3..f28d79d 100644 --- a/core/include/JellyfinQt/loader/http/deleteitemimage.h +++ b/core/include/JellyfinQt/loader/http/deleteitemimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteitemimagebyindex.h b/core/include/JellyfinQt/loader/http/deleteitemimagebyindex.h index 8c153f9..6093a5a 100644 --- a/core/include/JellyfinQt/loader/http/deleteitemimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/deleteitemimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteitems.h b/core/include/JellyfinQt/loader/http/deleteitems.h index 1e2e831..a6fc16a 100644 --- a/core/include/JellyfinQt/loader/http/deleteitems.h +++ b/core/include/JellyfinQt/loader/http/deleteitems.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deletelistingprovider.h b/core/include/JellyfinQt/loader/http/deletelistingprovider.h index 3d8b612..908de0c 100644 --- a/core/include/JellyfinQt/loader/http/deletelistingprovider.h +++ b/core/include/JellyfinQt/loader/http/deletelistingprovider.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteprofile.h b/core/include/JellyfinQt/loader/http/deleteprofile.h index 4c2e7a1..c9e2471 100644 --- a/core/include/JellyfinQt/loader/http/deleteprofile.h +++ b/core/include/JellyfinQt/loader/http/deleteprofile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleterecording.h b/core/include/JellyfinQt/loader/http/deleterecording.h index 5d97fbc..fe867fb 100644 --- a/core/include/JellyfinQt/loader/http/deleterecording.h +++ b/core/include/JellyfinQt/loader/http/deleterecording.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deletesubtitle.h b/core/include/JellyfinQt/loader/http/deletesubtitle.h index 0b3548c..38e7fce 100644 --- a/core/include/JellyfinQt/loader/http/deletesubtitle.h +++ b/core/include/JellyfinQt/loader/http/deletesubtitle.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deletetunerhost.h b/core/include/JellyfinQt/loader/http/deletetunerhost.h index 8a02391..05ea43b 100644 --- a/core/include/JellyfinQt/loader/http/deletetunerhost.h +++ b/core/include/JellyfinQt/loader/http/deletetunerhost.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteuser.h b/core/include/JellyfinQt/loader/http/deleteuser.h index 150e7a5..86abe7a 100644 --- a/core/include/JellyfinQt/loader/http/deleteuser.h +++ b/core/include/JellyfinQt/loader/http/deleteuser.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteuserimage.h b/core/include/JellyfinQt/loader/http/deleteuserimage.h index 691131a..aa53f39 100644 --- a/core/include/JellyfinQt/loader/http/deleteuserimage.h +++ b/core/include/JellyfinQt/loader/http/deleteuserimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteuserimagebyindex.h b/core/include/JellyfinQt/loader/http/deleteuserimagebyindex.h index b8c2cfe..00a3d5e 100644 --- a/core/include/JellyfinQt/loader/http/deleteuserimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/deleteuserimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/deleteuseritemrating.h b/core/include/JellyfinQt/loader/http/deleteuseritemrating.h index d50d9e9..2551a2e 100644 --- a/core/include/JellyfinQt/loader/http/deleteuseritemrating.h +++ b/core/include/JellyfinQt/loader/http/deleteuseritemrating.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Deletes a user's saved personal rating for an item. */ -class DeleteUserItemRatingLoader : public Jellyfin::Support::HttpLoader { + +class DeleteUserItemRatingLoader : public Jellyfin::Support::HttpLoader { public: explicit DeleteUserItemRatingLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/disableplugin.h b/core/include/JellyfinQt/loader/http/disableplugin.h index 7494f7f..99f0d50 100644 --- a/core/include/JellyfinQt/loader/http/disableplugin.h +++ b/core/include/JellyfinQt/loader/http/disableplugin.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/discovertuners.h b/core/include/JellyfinQt/loader/http/discovertuners.h index ccc0461..219ca03 100644 --- a/core/include/JellyfinQt/loader/http/discovertuners.h +++ b/core/include/JellyfinQt/loader/http/discovertuners.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/tunerhostinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Discover tuners. + */ + +class DiscoverTunersLoader : public Jellyfin::Support::HttpLoader, DiscoverTunersParams> { +public: + explicit DiscoverTunersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DiscoverTunersParams& parameters) const override; + QUrlQuery query(const DiscoverTunersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/discvovertuners.h b/core/include/JellyfinQt/loader/http/discvovertuners.h index e52c85d..4eb7d97 100644 --- a/core/include/JellyfinQt/loader/http/discvovertuners.h +++ b/core/include/JellyfinQt/loader/http/discvovertuners.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/tunerhostinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Discover tuners. + */ + +class DiscvoverTunersLoader : public Jellyfin::Support::HttpLoader, DiscvoverTunersParams> { +public: + explicit DiscvoverTunersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const DiscvoverTunersParams& parameters) const override; + QUrlQuery query(const DiscvoverTunersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/displaycontent.h b/core/include/JellyfinQt/loader/http/displaycontent.h index 18e5a96..1be80f2 100644 --- a/core/include/JellyfinQt/loader/http/displaycontent.h +++ b/core/include/JellyfinQt/loader/http/displaycontent.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/downloadremoteimage.h b/core/include/JellyfinQt/loader/http/downloadremoteimage.h index 700a0a5..96529a6 100644 --- a/core/include/JellyfinQt/loader/http/downloadremoteimage.h +++ b/core/include/JellyfinQt/loader/http/downloadremoteimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/downloadremotesubtitles.h b/core/include/JellyfinQt/loader/http/downloadremotesubtitles.h index ea37139..e33d5da 100644 --- a/core/include/JellyfinQt/loader/http/downloadremotesubtitles.h +++ b/core/include/JellyfinQt/loader/http/downloadremotesubtitles.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/enableplugin.h b/core/include/JellyfinQt/loader/http/enableplugin.h index 90b7993..7c01521 100644 --- a/core/include/JellyfinQt/loader/http/enableplugin.h +++ b/core/include/JellyfinQt/loader/http/enableplugin.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/forgotpassword.h b/core/include/JellyfinQt/loader/http/forgotpassword.h index 18db732..5bb8923 100644 --- a/core/include/JellyfinQt/loader/http/forgotpassword.h +++ b/core/include/JellyfinQt/loader/http/forgotpassword.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/forgotpasswordresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Initiates the forgot password process for a local user. */ -class ForgotPasswordLoader : public Jellyfin::Support::HttpLoader { + +class ForgotPasswordLoader : public Jellyfin::Support::HttpLoader { public: explicit ForgotPasswordLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/forgotpasswordpin.h b/core/include/JellyfinQt/loader/http/forgotpasswordpin.h index da1cafd..abc8ff6 100644 --- a/core/include/JellyfinQt/loader/http/forgotpasswordpin.h +++ b/core/include/JellyfinQt/loader/http/forgotpasswordpin.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/pinredeemresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Redeems a forgot password pin. */ -class ForgotPasswordPinLoader : public Jellyfin::Support::HttpLoader { + +class ForgotPasswordPinLoader : public Jellyfin::Support::HttpLoader { public: explicit ForgotPasswordPinLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/get.h b/core/include/JellyfinQt/loader/http/get.h index 1049fc9..8ea5fc9 100644 --- a/core/include/JellyfinQt/loader/http/get.h +++ b/core/include/JellyfinQt/loader/http/get.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/searchhintresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the search hint result. */ -class GetLoader : public Jellyfin::Support::HttpLoader { + +class GetLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getadditionalpart.h b/core/include/JellyfinQt/loader/http/getadditionalpart.h index 8bd9836..683ef47 100644 --- a/core/include/JellyfinQt/loader/http/getadditionalpart.h +++ b/core/include/JellyfinQt/loader/http/getadditionalpart.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets additional parts for a video. */ -class GetAdditionalPartLoader : public Jellyfin::Support::HttpLoader { + +class GetAdditionalPartLoader : public Jellyfin::Support::HttpLoader { public: explicit GetAdditionalPartLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getalbumartists.h b/core/include/JellyfinQt/loader/http/getalbumartists.h index 4a5d1fb..3b2596a 100644 --- a/core/include/JellyfinQt/loader/http/getalbumartists.h +++ b/core/include/JellyfinQt/loader/http/getalbumartists.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all album artists from a given item, folder, or the entire library. */ -class GetAlbumArtistsLoader : public Jellyfin::Support::HttpLoader { + +class GetAlbumArtistsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetAlbumArtistsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getallchannelfeatures.h b/core/include/JellyfinQt/loader/http/getallchannelfeatures.h index 5ff5e7c..b54d9d9 100644 --- a/core/include/JellyfinQt/loader/http/getallchannelfeatures.h +++ b/core/include/JellyfinQt/loader/http/getallchannelfeatures.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/channelfeatures.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all channel features. + */ + +class GetAllChannelFeaturesLoader : public Jellyfin::Support::HttpLoader, GetAllChannelFeaturesParams> { +public: + explicit GetAllChannelFeaturesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetAllChannelFeaturesParams& parameters) const override; + QUrlQuery query(const GetAllChannelFeaturesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getancestors.h b/core/include/JellyfinQt/loader/http/getancestors.h index 198ddc2..916f3f1 100644 --- a/core/include/JellyfinQt/loader/http/getancestors.h +++ b/core/include/JellyfinQt/loader/http/getancestors.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets all parents of an item. + */ + +class GetAncestorsLoader : public Jellyfin::Support::HttpLoader, GetAncestorsParams> { +public: + explicit GetAncestorsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetAncestorsParams& parameters) const override; + QUrlQuery query(const GetAncestorsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getartistbyname.h b/core/include/JellyfinQt/loader/http/getartistbyname.h index 65472a8..154932e 100644 --- a/core/include/JellyfinQt/loader/http/getartistbyname.h +++ b/core/include/JellyfinQt/loader/http/getartistbyname.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets an artist by name. */ -class GetArtistByNameLoader : public Jellyfin::Support::HttpLoader { + +class GetArtistByNameLoader : public Jellyfin::Support::HttpLoader { public: explicit GetArtistByNameLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getartistimage.h b/core/include/JellyfinQt/loader/http/getartistimage.h index 43249c8..5963a46 100644 --- a/core/include/JellyfinQt/loader/http/getartistimage.h +++ b/core/include/JellyfinQt/loader/http/getartistimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getartists.h b/core/include/JellyfinQt/loader/http/getartists.h index 8a4ee62..34042d0 100644 --- a/core/include/JellyfinQt/loader/http/getartists.h +++ b/core/include/JellyfinQt/loader/http/getartists.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all artists from a given item, folder, or the entire library. */ -class GetArtistsLoader : public Jellyfin::Support::HttpLoader { + +class GetArtistsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetArtistsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getattachment.h b/core/include/JellyfinQt/loader/http/getattachment.h index dd336e9..92c5510 100644 --- a/core/include/JellyfinQt/loader/http/getattachment.h +++ b/core/include/JellyfinQt/loader/http/getattachment.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getaudiostream.h b/core/include/JellyfinQt/loader/http/getaudiostream.h index 0ba2452..e05c556 100644 --- a/core/include/JellyfinQt/loader/http/getaudiostream.h +++ b/core/include/JellyfinQt/loader/http/getaudiostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getaudiostreambycontainer.h b/core/include/JellyfinQt/loader/http/getaudiostreambycontainer.h index 55cb133..53cddf1 100644 --- a/core/include/JellyfinQt/loader/http/getaudiostreambycontainer.h +++ b/core/include/JellyfinQt/loader/http/getaudiostreambycontainer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getauthproviders.h b/core/include/JellyfinQt/loader/http/getauthproviders.h index 8540c11..5855d71 100644 --- a/core/include/JellyfinQt/loader/http/getauthproviders.h +++ b/core/include/JellyfinQt/loader/http/getauthproviders.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/nameidpair.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all auth providers. + */ + +class GetAuthProvidersLoader : public Jellyfin::Support::HttpLoader, GetAuthProvidersParams> { +public: + explicit GetAuthProvidersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetAuthProvidersParams& parameters) const override; + QUrlQuery query(const GetAuthProvidersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getbitratetestbytes.h b/core/include/JellyfinQt/loader/http/getbitratetestbytes.h index 7b3b4d3..1d9c7c6 100644 --- a/core/include/JellyfinQt/loader/http/getbitratetestbytes.h +++ b/core/include/JellyfinQt/loader/http/getbitratetestbytes.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getbookremotesearchresults.h b/core/include/JellyfinQt/loader/http/getbookremotesearchresults.h index 0f362d1..3d8be1b 100644 --- a/core/include/JellyfinQt/loader/http/getbookremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getbookremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get book remote search. + */ + +class GetBookRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetBookRemoteSearchResultsParams> { +public: + explicit GetBookRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetBookRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetBookRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getboxsetremotesearchresults.h b/core/include/JellyfinQt/loader/http/getboxsetremotesearchresults.h index 0e14894..3165106 100644 --- a/core/include/JellyfinQt/loader/http/getboxsetremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getboxsetremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get box set remote search. + */ + +class GetBoxSetRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetBoxSetRemoteSearchResultsParams> { +public: + explicit GetBoxSetRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetBoxSetRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetBoxSetRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getbrandingcss.h b/core/include/JellyfinQt/loader/http/getbrandingcss.h index a045d42..ed3509a 100644 --- a/core/include/JellyfinQt/loader/http/getbrandingcss.h +++ b/core/include/JellyfinQt/loader/http/getbrandingcss.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets branding css. + */ + +class GetBrandingCssLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetBrandingCssLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetBrandingCssParams& parameters) const override; + QUrlQuery query(const GetBrandingCssParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getbrandingcss_2.h b/core/include/JellyfinQt/loader/http/getbrandingcss_2.h index f820a01..5bb7055 100644 --- a/core/include/JellyfinQt/loader/http/getbrandingcss_2.h +++ b/core/include/JellyfinQt/loader/http/getbrandingcss_2.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets branding css. + */ + +class GetBrandingCss_2Loader : public Jellyfin::Support::HttpLoader { +public: + explicit GetBrandingCss_2Loader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetBrandingCss_2Params& parameters) const override; + QUrlQuery query(const GetBrandingCss_2Params& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getbrandingoptions.h b/core/include/JellyfinQt/loader/http/getbrandingoptions.h index 077d7bb..e5bedbe 100644 --- a/core/include/JellyfinQt/loader/http/getbrandingoptions.h +++ b/core/include/JellyfinQt/loader/http/getbrandingoptions.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/brandingoptions.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets branding configuration. */ -class GetBrandingOptionsLoader : public Jellyfin::Support::HttpLoader { + +class GetBrandingOptionsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetBrandingOptionsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getchannel.h b/core/include/JellyfinQt/loader/http/getchannel.h index 3069142..b064eb0 100644 --- a/core/include/JellyfinQt/loader/http/getchannel.h +++ b/core/include/JellyfinQt/loader/http/getchannel.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a live tv channel. */ -class GetChannelLoader : public Jellyfin::Support::HttpLoader { + +class GetChannelLoader : public Jellyfin::Support::HttpLoader { public: explicit GetChannelLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getchannelfeatures.h b/core/include/JellyfinQt/loader/http/getchannelfeatures.h index 3931787..f44653b 100644 --- a/core/include/JellyfinQt/loader/http/getchannelfeatures.h +++ b/core/include/JellyfinQt/loader/http/getchannelfeatures.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/channelfeatures.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get channel features. */ -class GetChannelFeaturesLoader : public Jellyfin::Support::HttpLoader { + +class GetChannelFeaturesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetChannelFeaturesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getchannelitems.h b/core/include/JellyfinQt/loader/http/getchannelitems.h index 2333a8c..630853f 100644 --- a/core/include/JellyfinQt/loader/http/getchannelitems.h +++ b/core/include/JellyfinQt/loader/http/getchannelitems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get channel items. */ -class GetChannelItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetChannelItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetChannelItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getchannelmappingoptions.h b/core/include/JellyfinQt/loader/http/getchannelmappingoptions.h index 2852faa..55982cf 100644 --- a/core/include/JellyfinQt/loader/http/getchannelmappingoptions.h +++ b/core/include/JellyfinQt/loader/http/getchannelmappingoptions.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/channelmappingoptionsdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get channel mapping options. */ -class GetChannelMappingOptionsLoader : public Jellyfin::Support::HttpLoader { + +class GetChannelMappingOptionsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetChannelMappingOptionsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getchannels.h b/core/include/JellyfinQt/loader/http/getchannels.h index c8b4d5e..b7342b1 100644 --- a/core/include/JellyfinQt/loader/http/getchannels.h +++ b/core/include/JellyfinQt/loader/http/getchannels.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available channels. */ -class GetChannelsLoader : public Jellyfin::Support::HttpLoader { + +class GetChannelsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetChannelsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getconfiguration.h b/core/include/JellyfinQt/loader/http/getconfiguration.h index 3143899..1f219ba 100644 --- a/core/include/JellyfinQt/loader/http/getconfiguration.h +++ b/core/include/JellyfinQt/loader/http/getconfiguration.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/serverconfiguration.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets application configuration. */ -class GetConfigurationLoader : public Jellyfin::Support::HttpLoader { + +class GetConfigurationLoader : public Jellyfin::Support::HttpLoader { public: explicit GetConfigurationLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getconfigurationpages.h b/core/include/JellyfinQt/loader/http/getconfigurationpages.h index 82c09c6..59e655f 100644 --- a/core/include/JellyfinQt/loader/http/getconfigurationpages.h +++ b/core/include/JellyfinQt/loader/http/getconfigurationpages.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/configurationpageinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets the configuration pages. + */ + +class GetConfigurationPagesLoader : public Jellyfin::Support::HttpLoader, GetConfigurationPagesParams> { +public: + explicit GetConfigurationPagesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetConfigurationPagesParams& parameters) const override; + QUrlQuery query(const GetConfigurationPagesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getconnectionmanager.h b/core/include/JellyfinQt/loader/http/getconnectionmanager.h index bedc2fb..2132542 100644 --- a/core/include/JellyfinQt/loader/http/getconnectionmanager.h +++ b/core/include/JellyfinQt/loader/http/getconnectionmanager.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getconnectionmanager_2.h b/core/include/JellyfinQt/loader/http/getconnectionmanager_2.h index 10be1ad..dc3b6db 100644 --- a/core/include/JellyfinQt/loader/http/getconnectionmanager_2.h +++ b/core/include/JellyfinQt/loader/http/getconnectionmanager_2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getconnectionmanager_3.h b/core/include/JellyfinQt/loader/http/getconnectionmanager_3.h index 07519ad..a5a456e 100644 --- a/core/include/JellyfinQt/loader/http/getconnectionmanager_3.h +++ b/core/include/JellyfinQt/loader/http/getconnectionmanager_3.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getcontentdirectory.h b/core/include/JellyfinQt/loader/http/getcontentdirectory.h index c6586e1..bcf1d6a 100644 --- a/core/include/JellyfinQt/loader/http/getcontentdirectory.h +++ b/core/include/JellyfinQt/loader/http/getcontentdirectory.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getcontentdirectory_2.h b/core/include/JellyfinQt/loader/http/getcontentdirectory_2.h index 989e8f4..682b631 100644 --- a/core/include/JellyfinQt/loader/http/getcontentdirectory_2.h +++ b/core/include/JellyfinQt/loader/http/getcontentdirectory_2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getcontentdirectory_3.h b/core/include/JellyfinQt/loader/http/getcontentdirectory_3.h index a0f0f6e..d3749a8 100644 --- a/core/include/JellyfinQt/loader/http/getcontentdirectory_3.h +++ b/core/include/JellyfinQt/loader/http/getcontentdirectory_3.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getcountries.h b/core/include/JellyfinQt/loader/http/getcountries.h index 803a84a..4e75f0b 100644 --- a/core/include/JellyfinQt/loader/http/getcountries.h +++ b/core/include/JellyfinQt/loader/http/getcountries.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/countryinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets known countries. + */ + +class GetCountriesLoader : public Jellyfin::Support::HttpLoader, GetCountriesParams> { +public: + explicit GetCountriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetCountriesParams& parameters) const override; + QUrlQuery query(const GetCountriesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getcriticreviews.h b/core/include/JellyfinQt/loader/http/getcriticreviews.h index 0b11ce4..4d1cac9 100644 --- a/core/include/JellyfinQt/loader/http/getcriticreviews.h +++ b/core/include/JellyfinQt/loader/http/getcriticreviews.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets critic review for an item. */ -class GetCriticReviewsLoader : public Jellyfin::Support::HttpLoader { + +class GetCriticReviewsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetCriticReviewsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getcultures.h b/core/include/JellyfinQt/loader/http/getcultures.h index 7a205e7..0be9f29 100644 --- a/core/include/JellyfinQt/loader/http/getcultures.h +++ b/core/include/JellyfinQt/loader/http/getcultures.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/culturedto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets known cultures. + */ + +class GetCulturesLoader : public Jellyfin::Support::HttpLoader, GetCulturesParams> { +public: + explicit GetCulturesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetCulturesParams& parameters) const override; + QUrlQuery query(const GetCulturesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getcurrentuser.h b/core/include/JellyfinQt/loader/http/getcurrentuser.h index d600f94..0d5a79e 100644 --- a/core/include/JellyfinQt/loader/http/getcurrentuser.h +++ b/core/include/JellyfinQt/loader/http/getcurrentuser.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/userdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the user based on auth token. */ -class GetCurrentUserLoader : public Jellyfin::Support::HttpLoader { + +class GetCurrentUserLoader : public Jellyfin::Support::HttpLoader { public: explicit GetCurrentUserLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdashboardconfigurationpage.h b/core/include/JellyfinQt/loader/http/getdashboardconfigurationpage.h index 5ab61a8..84ba0db 100644 --- a/core/include/JellyfinQt/loader/http/getdashboardconfigurationpage.h +++ b/core/include/JellyfinQt/loader/http/getdashboardconfigurationpage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getdefaultdirectorybrowser.h b/core/include/JellyfinQt/loader/http/getdefaultdirectorybrowser.h index 7739785..ed73db2 100644 --- a/core/include/JellyfinQt/loader/http/getdefaultdirectorybrowser.h +++ b/core/include/JellyfinQt/loader/http/getdefaultdirectorybrowser.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/defaultdirectorybrowserinfodto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get Default directory browser. */ -class GetDefaultDirectoryBrowserLoader : public Jellyfin::Support::HttpLoader { + +class GetDefaultDirectoryBrowserLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDefaultDirectoryBrowserLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdefaultlistingprovider.h b/core/include/JellyfinQt/loader/http/getdefaultlistingprovider.h index 87718d0..befb958 100644 --- a/core/include/JellyfinQt/loader/http/getdefaultlistingprovider.h +++ b/core/include/JellyfinQt/loader/http/getdefaultlistingprovider.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/listingsproviderinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets default listings provider info. */ -class GetDefaultListingProviderLoader : public Jellyfin::Support::HttpLoader { + +class GetDefaultListingProviderLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDefaultListingProviderLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdefaultmetadataoptions.h b/core/include/JellyfinQt/loader/http/getdefaultmetadataoptions.h index 79ec301..0d3356c 100644 --- a/core/include/JellyfinQt/loader/http/getdefaultmetadataoptions.h +++ b/core/include/JellyfinQt/loader/http/getdefaultmetadataoptions.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/metadataoptions.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a default MetadataOptions object. */ -class GetDefaultMetadataOptionsLoader : public Jellyfin::Support::HttpLoader { + +class GetDefaultMetadataOptionsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDefaultMetadataOptionsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdefaultprofile.h b/core/include/JellyfinQt/loader/http/getdefaultprofile.h index 619e977..17c21e3 100644 --- a/core/include/JellyfinQt/loader/http/getdefaultprofile.h +++ b/core/include/JellyfinQt/loader/http/getdefaultprofile.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/deviceprofile.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the default profile. */ -class GetDefaultProfileLoader : public Jellyfin::Support::HttpLoader { + +class GetDefaultProfileLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDefaultProfileLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdefaulttimer.h b/core/include/JellyfinQt/loader/http/getdefaulttimer.h index 0f72c8d..5a9afee 100644 --- a/core/include/JellyfinQt/loader/http/getdefaulttimer.h +++ b/core/include/JellyfinQt/loader/http/getdefaulttimer.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/seriestimerinfodto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the default values for a new timer. */ -class GetDefaultTimerLoader : public Jellyfin::Support::HttpLoader { + +class GetDefaultTimerLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDefaultTimerLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdescriptionxml.h b/core/include/JellyfinQt/loader/http/getdescriptionxml.h index ac979b9..9393f25 100644 --- a/core/include/JellyfinQt/loader/http/getdescriptionxml.h +++ b/core/include/JellyfinQt/loader/http/getdescriptionxml.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getdescriptionxml_2.h b/core/include/JellyfinQt/loader/http/getdescriptionxml_2.h index f0002ae..5f0bb19 100644 --- a/core/include/JellyfinQt/loader/http/getdescriptionxml_2.h +++ b/core/include/JellyfinQt/loader/http/getdescriptionxml_2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getdeviceinfo.h b/core/include/JellyfinQt/loader/http/getdeviceinfo.h index 69ed524..037bbe4 100644 --- a/core/include/JellyfinQt/loader/http/getdeviceinfo.h +++ b/core/include/JellyfinQt/loader/http/getdeviceinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/deviceinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get info for a device. */ -class GetDeviceInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetDeviceInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDeviceInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdeviceoptions.h b/core/include/JellyfinQt/loader/http/getdeviceoptions.h index b2e750a..6a347c0 100644 --- a/core/include/JellyfinQt/loader/http/getdeviceoptions.h +++ b/core/include/JellyfinQt/loader/http/getdeviceoptions.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/deviceoptions.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get options for a device. */ -class GetDeviceOptionsLoader : public Jellyfin::Support::HttpLoader { + +class GetDeviceOptionsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDeviceOptionsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdevices.h b/core/include/JellyfinQt/loader/http/getdevices.h index dca01a9..a8d46a3 100644 --- a/core/include/JellyfinQt/loader/http/getdevices.h +++ b/core/include/JellyfinQt/loader/http/getdevices.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/deviceinfoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get Devices. */ -class GetDevicesLoader : public Jellyfin::Support::HttpLoader { + +class GetDevicesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDevicesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdirectorycontents.h b/core/include/JellyfinQt/loader/http/getdirectorycontents.h index 32f7a73..a7669de 100644 --- a/core/include/JellyfinQt/loader/http/getdirectorycontents.h +++ b/core/include/JellyfinQt/loader/http/getdirectorycontents.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/filesystementryinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets the contents of a given directory in the file system. + */ + +class GetDirectoryContentsLoader : public Jellyfin::Support::HttpLoader, GetDirectoryContentsParams> { +public: + explicit GetDirectoryContentsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetDirectoryContentsParams& parameters) const override; + QUrlQuery query(const GetDirectoryContentsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getdisplaypreferences.h b/core/include/JellyfinQt/loader/http/getdisplaypreferences.h index bcebb88..d26fbaf 100644 --- a/core/include/JellyfinQt/loader/http/getdisplaypreferences.h +++ b/core/include/JellyfinQt/loader/http/getdisplaypreferences.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/displaypreferencesdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get Display Preferences. */ -class GetDisplayPreferencesLoader : public Jellyfin::Support::HttpLoader { + +class GetDisplayPreferencesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetDisplayPreferencesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getdownload.h b/core/include/JellyfinQt/loader/http/getdownload.h index 5a7aa33..b438fbd 100644 --- a/core/include/JellyfinQt/loader/http/getdownload.h +++ b/core/include/JellyfinQt/loader/http/getdownload.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getdrives.h b/core/include/JellyfinQt/loader/http/getdrives.h index 4c6d721..3a99a84 100644 --- a/core/include/JellyfinQt/loader/http/getdrives.h +++ b/core/include/JellyfinQt/loader/http/getdrives.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/filesystementryinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets available drives from the server's file system. + */ + +class GetDrivesLoader : public Jellyfin::Support::HttpLoader, GetDrivesParams> { +public: + explicit GetDrivesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetDrivesParams& parameters) const override; + QUrlQuery query(const GetDrivesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getendpointinfo.h b/core/include/JellyfinQt/loader/http/getendpointinfo.h index e25114a..7041d36 100644 --- a/core/include/JellyfinQt/loader/http/getendpointinfo.h +++ b/core/include/JellyfinQt/loader/http/getendpointinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/endpointinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets information about the request endpoint. */ -class GetEndpointInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetEndpointInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetEndpointInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getepisodes.h b/core/include/JellyfinQt/loader/http/getepisodes.h index e9b565d..cee2f40 100644 --- a/core/include/JellyfinQt/loader/http/getepisodes.h +++ b/core/include/JellyfinQt/loader/http/getepisodes.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets episodes for a tv season. */ -class GetEpisodesLoader : public Jellyfin::Support::HttpLoader { + +class GetEpisodesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetEpisodesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getexternalidinfos.h b/core/include/JellyfinQt/loader/http/getexternalidinfos.h index 9f54dc6..f02fe71 100644 --- a/core/include/JellyfinQt/loader/http/getexternalidinfos.h +++ b/core/include/JellyfinQt/loader/http/getexternalidinfos.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/externalidinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get the item's external id info. + */ + +class GetExternalIdInfosLoader : public Jellyfin::Support::HttpLoader, GetExternalIdInfosParams> { +public: + explicit GetExternalIdInfosLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetExternalIdInfosParams& parameters) const override; + QUrlQuery query(const GetExternalIdInfosParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getfallbackfont.h b/core/include/JellyfinQt/loader/http/getfallbackfont.h index 2f0ee4c..e2b3314 100644 --- a/core/include/JellyfinQt/loader/http/getfallbackfont.h +++ b/core/include/JellyfinQt/loader/http/getfallbackfont.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getfallbackfontlist.h b/core/include/JellyfinQt/loader/http/getfallbackfontlist.h index 5694c32..b694630 100644 --- a/core/include/JellyfinQt/loader/http/getfallbackfontlist.h +++ b/core/include/JellyfinQt/loader/http/getfallbackfontlist.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/fontfile.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of available fallback font files. + */ + +class GetFallbackFontListLoader : public Jellyfin::Support::HttpLoader, GetFallbackFontListParams> { +public: + explicit GetFallbackFontListLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetFallbackFontListParams& parameters) const override; + QUrlQuery query(const GetFallbackFontListParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getfile.h b/core/include/JellyfinQt/loader/http/getfile.h index ab8d18e..7a44384 100644 --- a/core/include/JellyfinQt/loader/http/getfile.h +++ b/core/include/JellyfinQt/loader/http/getfile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getfirstuser.h b/core/include/JellyfinQt/loader/http/getfirstuser.h index f14f1e6..ede23a1 100644 --- a/core/include/JellyfinQt/loader/http/getfirstuser.h +++ b/core/include/JellyfinQt/loader/http/getfirstuser.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/startupuserdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the first user. */ -class GetFirstUserLoader : public Jellyfin::Support::HttpLoader { + +class GetFirstUserLoader : public Jellyfin::Support::HttpLoader { public: explicit GetFirstUserLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getfirstuser_2.h b/core/include/JellyfinQt/loader/http/getfirstuser_2.h index db51ab3..9cafac1 100644 --- a/core/include/JellyfinQt/loader/http/getfirstuser_2.h +++ b/core/include/JellyfinQt/loader/http/getfirstuser_2.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/startupuserdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the first user. */ -class GetFirstUser_2Loader : public Jellyfin::Support::HttpLoader { + +class GetFirstUser_2Loader : public Jellyfin::Support::HttpLoader { public: explicit GetFirstUser_2Loader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getgeneralimage.h b/core/include/JellyfinQt/loader/http/getgeneralimage.h index 3eb1c05..59671fb 100644 --- a/core/include/JellyfinQt/loader/http/getgeneralimage.h +++ b/core/include/JellyfinQt/loader/http/getgeneralimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getgeneralimages.h b/core/include/JellyfinQt/loader/http/getgeneralimages.h index 5738e8f..14ae087 100644 --- a/core/include/JellyfinQt/loader/http/getgeneralimages.h +++ b/core/include/JellyfinQt/loader/http/getgeneralimages.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/imagebynameinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all general images. + */ + +class GetGeneralImagesLoader : public Jellyfin::Support::HttpLoader, GetGeneralImagesParams> { +public: + explicit GetGeneralImagesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetGeneralImagesParams& parameters) const override; + QUrlQuery query(const GetGeneralImagesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getgenre.h b/core/include/JellyfinQt/loader/http/getgenre.h index 630a592..3ba14d5 100644 --- a/core/include/JellyfinQt/loader/http/getgenre.h +++ b/core/include/JellyfinQt/loader/http/getgenre.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a genre, by name. */ -class GetGenreLoader : public Jellyfin::Support::HttpLoader { + +class GetGenreLoader : public Jellyfin::Support::HttpLoader { public: explicit GetGenreLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getgenreimage.h b/core/include/JellyfinQt/loader/http/getgenreimage.h index 06017b1..4d0e2ab 100644 --- a/core/include/JellyfinQt/loader/http/getgenreimage.h +++ b/core/include/JellyfinQt/loader/http/getgenreimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getgenreimagebyindex.h b/core/include/JellyfinQt/loader/http/getgenreimagebyindex.h index 9cbdfda..f1a0e41 100644 --- a/core/include/JellyfinQt/loader/http/getgenreimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getgenreimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getgenres.h b/core/include/JellyfinQt/loader/http/getgenres.h index ffa3e42..e8b990a 100644 --- a/core/include/JellyfinQt/loader/http/getgenres.h +++ b/core/include/JellyfinQt/loader/http/getgenres.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all genres from a given item, folder, or the entire library. */ -class GetGenresLoader : public Jellyfin::Support::HttpLoader { + +class GetGenresLoader : public Jellyfin::Support::HttpLoader { public: explicit GetGenresLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getgroupingoptions.h b/core/include/JellyfinQt/loader/http/getgroupingoptions.h index 1e41da1..3bce731 100644 --- a/core/include/JellyfinQt/loader/http/getgroupingoptions.h +++ b/core/include/JellyfinQt/loader/http/getgroupingoptions.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/specialviewoptiondto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get user view grouping options. + */ + +class GetGroupingOptionsLoader : public Jellyfin::Support::HttpLoader, GetGroupingOptionsParams> { +public: + explicit GetGroupingOptionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetGroupingOptionsParams& parameters) const override; + QUrlQuery query(const GetGroupingOptionsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getguideinfo.h b/core/include/JellyfinQt/loader/http/getguideinfo.h index 0a3ea51..a9778ab 100644 --- a/core/include/JellyfinQt/loader/http/getguideinfo.h +++ b/core/include/JellyfinQt/loader/http/getguideinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/guideinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get guid info. */ -class GetGuideInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetGuideInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetGuideInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gethlsaudiosegment.h b/core/include/JellyfinQt/loader/http/gethlsaudiosegment.h index 4c9f446..58b5247 100644 --- a/core/include/JellyfinQt/loader/http/gethlsaudiosegment.h +++ b/core/include/JellyfinQt/loader/http/gethlsaudiosegment.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacyaac.h b/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacyaac.h index fba3c76..fa76ac5 100644 --- a/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacyaac.h +++ b/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacyaac.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacymp3.h b/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacymp3.h index 03f60fd..b500ab5 100644 --- a/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacymp3.h +++ b/core/include/JellyfinQt/loader/http/gethlsaudiosegmentlegacymp3.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/gethlsplaylistlegacy.h b/core/include/JellyfinQt/loader/http/gethlsplaylistlegacy.h index f0d2df6..e2790c2 100644 --- a/core/include/JellyfinQt/loader/http/gethlsplaylistlegacy.h +++ b/core/include/JellyfinQt/loader/http/gethlsplaylistlegacy.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/gethlsvideosegment.h b/core/include/JellyfinQt/loader/http/gethlsvideosegment.h index 615038b..d6b2b81 100644 --- a/core/include/JellyfinQt/loader/http/gethlsvideosegment.h +++ b/core/include/JellyfinQt/loader/http/gethlsvideosegment.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/gethlsvideosegmentlegacy.h b/core/include/JellyfinQt/loader/http/gethlsvideosegmentlegacy.h index ff24361..672a39b 100644 --- a/core/include/JellyfinQt/loader/http/gethlsvideosegmentlegacy.h +++ b/core/include/JellyfinQt/loader/http/gethlsvideosegmentlegacy.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/geticon.h b/core/include/JellyfinQt/loader/http/geticon.h index d3c3d78..1c1ee0a 100644 --- a/core/include/JellyfinQt/loader/http/geticon.h +++ b/core/include/JellyfinQt/loader/http/geticon.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/geticonid.h b/core/include/JellyfinQt/loader/http/geticonid.h index ece2a5c..ba7cdb2 100644 --- a/core/include/JellyfinQt/loader/http/geticonid.h +++ b/core/include/JellyfinQt/loader/http/geticonid.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfromalbum.h b/core/include/JellyfinQt/loader/http/getinstantmixfromalbum.h index 4a960b0..790b23e 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfromalbum.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfromalbum.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromAlbumLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromAlbumLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromAlbumLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfromartists.h b/core/include/JellyfinQt/loader/http/getinstantmixfromartists.h index 1aa4566..b54754e 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfromartists.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfromartists.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromArtistsLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromArtistsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromArtistsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfromitem.h b/core/include/JellyfinQt/loader/http/getinstantmixfromitem.h index 3ecd52f..85edc0d 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfromitem.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfromitem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromItemLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromItemLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenre.h b/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenre.h index 09d546d..98f71f3 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenre.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenre.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromMusicGenreLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromMusicGenreLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromMusicGenreLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenres.h b/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenres.h index 18274f1..ec97d41 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenres.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfrommusicgenres.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromMusicGenresLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromMusicGenresLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromMusicGenresLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfromplaylist.h b/core/include/JellyfinQt/loader/http/getinstantmixfromplaylist.h index 1f9b1cd..0c0ae87 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfromplaylist.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfromplaylist.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromPlaylistLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromPlaylistLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromPlaylistLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getinstantmixfromsong.h b/core/include/JellyfinQt/loader/http/getinstantmixfromsong.h index 005324c..3134149 100644 --- a/core/include/JellyfinQt/loader/http/getinstantmixfromsong.h +++ b/core/include/JellyfinQt/loader/http/getinstantmixfromsong.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Creates an instant playlist based on a given song. */ -class GetInstantMixFromSongLoader : public Jellyfin::Support::HttpLoader { + +class GetInstantMixFromSongLoader : public Jellyfin::Support::HttpLoader { public: explicit GetInstantMixFromSongLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getintros.h b/core/include/JellyfinQt/loader/http/getintros.h index e2059b2..9fb6de7 100644 --- a/core/include/JellyfinQt/loader/http/getintros.h +++ b/core/include/JellyfinQt/loader/http/getintros.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets intros to play before the main media item plays. */ -class GetIntrosLoader : public Jellyfin::Support::HttpLoader { + +class GetIntrosLoader : public Jellyfin::Support::HttpLoader { public: explicit GetIntrosLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getitem.h b/core/include/JellyfinQt/loader/http/getitem.h index a0f2851..6696bef 100644 --- a/core/include/JellyfinQt/loader/http/getitem.h +++ b/core/include/JellyfinQt/loader/http/getitem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets an item from a user's library. */ -class GetItemLoader : public Jellyfin::Support::HttpLoader { + +class GetItemLoader : public Jellyfin::Support::HttpLoader { public: explicit GetItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getitemcounts.h b/core/include/JellyfinQt/loader/http/getitemcounts.h index bd45850..f49788c 100644 --- a/core/include/JellyfinQt/loader/http/getitemcounts.h +++ b/core/include/JellyfinQt/loader/http/getitemcounts.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/itemcounts.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get item counts. */ -class GetItemCountsLoader : public Jellyfin::Support::HttpLoader { + +class GetItemCountsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetItemCountsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getitemimage.h b/core/include/JellyfinQt/loader/http/getitemimage.h index 1029011..53f1e52 100644 --- a/core/include/JellyfinQt/loader/http/getitemimage.h +++ b/core/include/JellyfinQt/loader/http/getitemimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getitemimage2.h b/core/include/JellyfinQt/loader/http/getitemimage2.h index e7e8ef9..f9cc4b6 100644 --- a/core/include/JellyfinQt/loader/http/getitemimage2.h +++ b/core/include/JellyfinQt/loader/http/getitemimage2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getitemimagebyindex.h b/core/include/JellyfinQt/loader/http/getitemimagebyindex.h index 23d145b..5dcda15 100644 --- a/core/include/JellyfinQt/loader/http/getitemimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getitemimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getitemimageinfos.h b/core/include/JellyfinQt/loader/http/getitemimageinfos.h index c3df7d9..764eff8 100644 --- a/core/include/JellyfinQt/loader/http/getitemimageinfos.h +++ b/core/include/JellyfinQt/loader/http/getitemimageinfos.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/imageinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get item image infos. + */ + +class GetItemImageInfosLoader : public Jellyfin::Support::HttpLoader, GetItemImageInfosParams> { +public: + explicit GetItemImageInfosLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetItemImageInfosParams& parameters) const override; + QUrlQuery query(const GetItemImageInfosParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getitems.h b/core/include/JellyfinQt/loader/http/getitems.h index 1ffa0f5..0d6fe1c 100644 --- a/core/include/JellyfinQt/loader/http/getitems.h +++ b/core/include/JellyfinQt/loader/http/getitems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets items based on a query. */ -class GetItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getitemsbyuserid.h b/core/include/JellyfinQt/loader/http/getitemsbyuserid.h index 3477f39..848188a 100644 --- a/core/include/JellyfinQt/loader/http/getitemsbyuserid.h +++ b/core/include/JellyfinQt/loader/http/getitemsbyuserid.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets items based on a query. */ -class GetItemsByUserIdLoader : public Jellyfin::Support::HttpLoader { + +class GetItemsByUserIdLoader : public Jellyfin::Support::HttpLoader { public: explicit GetItemsByUserIdLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getkeys.h b/core/include/JellyfinQt/loader/http/getkeys.h index c289ac5..9780477 100644 --- a/core/include/JellyfinQt/loader/http/getkeys.h +++ b/core/include/JellyfinQt/loader/http/getkeys.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/authenticationinfoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get all keys. */ -class GetKeysLoader : public Jellyfin::Support::HttpLoader { + +class GetKeysLoader : public Jellyfin::Support::HttpLoader { public: explicit GetKeysLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlatestchannelitems.h b/core/include/JellyfinQt/loader/http/getlatestchannelitems.h index 9a6a830..24da3e7 100644 --- a/core/include/JellyfinQt/loader/http/getlatestchannelitems.h +++ b/core/include/JellyfinQt/loader/http/getlatestchannelitems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets latest channel items. */ -class GetLatestChannelItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetLatestChannelItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLatestChannelItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlatestmedia.h b/core/include/JellyfinQt/loader/http/getlatestmedia.h index 7afde7b..596916b 100644 --- a/core/include/JellyfinQt/loader/http/getlatestmedia.h +++ b/core/include/JellyfinQt/loader/http/getlatestmedia.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets latest media. + */ + +class GetLatestMediaLoader : public Jellyfin::Support::HttpLoader, GetLatestMediaParams> { +public: + explicit GetLatestMediaLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetLatestMediaParams& parameters) const override; + QUrlQuery query(const GetLatestMediaParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getlibraryoptionsinfo.h b/core/include/JellyfinQt/loader/http/getlibraryoptionsinfo.h index bf7213d..59c918c 100644 --- a/core/include/JellyfinQt/loader/http/getlibraryoptionsinfo.h +++ b/core/include/JellyfinQt/loader/http/getlibraryoptionsinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/libraryoptionsresultdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the library options info. */ -class GetLibraryOptionsInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetLibraryOptionsInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLibraryOptionsInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlineups.h b/core/include/JellyfinQt/loader/http/getlineups.h index 11a25fd..7092b69 100644 --- a/core/include/JellyfinQt/loader/http/getlineups.h +++ b/core/include/JellyfinQt/loader/http/getlineups.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/nameidpair.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets available lineups. + */ + +class GetLineupsLoader : public Jellyfin::Support::HttpLoader, GetLineupsParams> { +public: + explicit GetLineupsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetLineupsParams& parameters) const override; + QUrlQuery query(const GetLineupsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getlivehlsstream.h b/core/include/JellyfinQt/loader/http/getlivehlsstream.h index 5eae777..ba0e25f 100644 --- a/core/include/JellyfinQt/loader/http/getlivehlsstream.h +++ b/core/include/JellyfinQt/loader/http/getlivehlsstream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getliverecordingfile.h b/core/include/JellyfinQt/loader/http/getliverecordingfile.h index ca23387..4bf267e 100644 --- a/core/include/JellyfinQt/loader/http/getliverecordingfile.h +++ b/core/include/JellyfinQt/loader/http/getliverecordingfile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getlivestreamfile.h b/core/include/JellyfinQt/loader/http/getlivestreamfile.h index 1a0879f..aea6a77 100644 --- a/core/include/JellyfinQt/loader/http/getlivestreamfile.h +++ b/core/include/JellyfinQt/loader/http/getlivestreamfile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getlivetvchannels.h b/core/include/JellyfinQt/loader/http/getlivetvchannels.h index 92028dc..0938dac 100644 --- a/core/include/JellyfinQt/loader/http/getlivetvchannels.h +++ b/core/include/JellyfinQt/loader/http/getlivetvchannels.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available live tv channels. */ -class GetLiveTvChannelsLoader : public Jellyfin::Support::HttpLoader { + +class GetLiveTvChannelsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLiveTvChannelsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlivetvinfo.h b/core/include/JellyfinQt/loader/http/getlivetvinfo.h index 7b556d7..b09978c 100644 --- a/core/include/JellyfinQt/loader/http/getlivetvinfo.h +++ b/core/include/JellyfinQt/loader/http/getlivetvinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/livetvinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available live tv services. */ -class GetLiveTvInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetLiveTvInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLiveTvInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlivetvprograms.h b/core/include/JellyfinQt/loader/http/getlivetvprograms.h index 3fd0610..ed2a243 100644 --- a/core/include/JellyfinQt/loader/http/getlivetvprograms.h +++ b/core/include/JellyfinQt/loader/http/getlivetvprograms.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available live tv epgs. */ -class GetLiveTvProgramsLoader : public Jellyfin::Support::HttpLoader { + +class GetLiveTvProgramsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLiveTvProgramsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlocalizationoptions.h b/core/include/JellyfinQt/loader/http/getlocalizationoptions.h index 6b17fa6..28a08b1 100644 --- a/core/include/JellyfinQt/loader/http/getlocalizationoptions.h +++ b/core/include/JellyfinQt/loader/http/getlocalizationoptions.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/localizationoption.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets localization options. + */ + +class GetLocalizationOptionsLoader : public Jellyfin::Support::HttpLoader, GetLocalizationOptionsParams> { +public: + explicit GetLocalizationOptionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetLocalizationOptionsParams& parameters) const override; + QUrlQuery query(const GetLocalizationOptionsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getlocaltrailers.h b/core/include/JellyfinQt/loader/http/getlocaltrailers.h index 598c23f..a1e7160 100644 --- a/core/include/JellyfinQt/loader/http/getlocaltrailers.h +++ b/core/include/JellyfinQt/loader/http/getlocaltrailers.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets local trailers for an item. + */ + +class GetLocalTrailersLoader : public Jellyfin::Support::HttpLoader, GetLocalTrailersParams> { +public: + explicit GetLocalTrailersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetLocalTrailersParams& parameters) const override; + QUrlQuery query(const GetLocalTrailersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getlogentries.h b/core/include/JellyfinQt/loader/http/getlogentries.h index 978f9cf..b9140e4 100644 --- a/core/include/JellyfinQt/loader/http/getlogentries.h +++ b/core/include/JellyfinQt/loader/http/getlogentries.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/activitylogentryqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets activity log entries. */ -class GetLogEntriesLoader : public Jellyfin::Support::HttpLoader { + +class GetLogEntriesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetLogEntriesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getlogfile.h b/core/include/JellyfinQt/loader/http/getlogfile.h index b7689fa..f2299be 100644 --- a/core/include/JellyfinQt/loader/http/getlogfile.h +++ b/core/include/JellyfinQt/loader/http/getlogfile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmasterhlsaudioplaylist.h b/core/include/JellyfinQt/loader/http/getmasterhlsaudioplaylist.h index 76a9e8f..700c541 100644 --- a/core/include/JellyfinQt/loader/http/getmasterhlsaudioplaylist.h +++ b/core/include/JellyfinQt/loader/http/getmasterhlsaudioplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmasterhlsvideoplaylist.h b/core/include/JellyfinQt/loader/http/getmasterhlsvideoplaylist.h index ccccdd5..9e9d948 100644 --- a/core/include/JellyfinQt/loader/http/getmasterhlsvideoplaylist.h +++ b/core/include/JellyfinQt/loader/http/getmasterhlsvideoplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmediafolders.h b/core/include/JellyfinQt/loader/http/getmediafolders.h index a4daccc..4b15e6c 100644 --- a/core/include/JellyfinQt/loader/http/getmediafolders.h +++ b/core/include/JellyfinQt/loader/http/getmediafolders.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all user media folders. */ -class GetMediaFoldersLoader : public Jellyfin::Support::HttpLoader { + +class GetMediaFoldersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetMediaFoldersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getmediainfoimage.h b/core/include/JellyfinQt/loader/http/getmediainfoimage.h index 88635db..862a0b9 100644 --- a/core/include/JellyfinQt/loader/http/getmediainfoimage.h +++ b/core/include/JellyfinQt/loader/http/getmediainfoimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmediainfoimages.h b/core/include/JellyfinQt/loader/http/getmediainfoimages.h index 9510c30..5c99d38 100644 --- a/core/include/JellyfinQt/loader/http/getmediainfoimages.h +++ b/core/include/JellyfinQt/loader/http/getmediainfoimages.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/imagebynameinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all media info images. + */ + +class GetMediaInfoImagesLoader : public Jellyfin::Support::HttpLoader, GetMediaInfoImagesParams> { +public: + explicit GetMediaInfoImagesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMediaInfoImagesParams& parameters) const override; + QUrlQuery query(const GetMediaInfoImagesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar.h b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar.h index 97fde11..10bb888 100644 --- a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar.h +++ b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_2.h b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_2.h index 388ae4e..286fa4b 100644 --- a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_2.h +++ b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_3.h b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_3.h index d4684f0..55e7e82 100644 --- a/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_3.h +++ b/core/include/JellyfinQt/loader/http/getmediareceiverregistrar_3.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmetadataeditorinfo.h b/core/include/JellyfinQt/loader/http/getmetadataeditorinfo.h index b88ce7d..60f3885 100644 --- a/core/include/JellyfinQt/loader/http/getmetadataeditorinfo.h +++ b/core/include/JellyfinQt/loader/http/getmetadataeditorinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/metadataeditorinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets metadata editor info for an item. */ -class GetMetadataEditorInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetMetadataEditorInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetMetadataEditorInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getmovierecommendations.h b/core/include/JellyfinQt/loader/http/getmovierecommendations.h index 03c982a..fa01adc 100644 --- a/core/include/JellyfinQt/loader/http/getmovierecommendations.h +++ b/core/include/JellyfinQt/loader/http/getmovierecommendations.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/recommendationdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets movie recommendations. + */ + +class GetMovieRecommendationsLoader : public Jellyfin::Support::HttpLoader, GetMovieRecommendationsParams> { +public: + explicit GetMovieRecommendationsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMovieRecommendationsParams& parameters) const override; + QUrlQuery query(const GetMovieRecommendationsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getmovieremotesearchresults.h b/core/include/JellyfinQt/loader/http/getmovieremotesearchresults.h index e1ab5f6..eaa6436 100644 --- a/core/include/JellyfinQt/loader/http/getmovieremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getmovieremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get movie remote search. + */ + +class GetMovieRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetMovieRemoteSearchResultsParams> { +public: + explicit GetMovieRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMovieRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetMovieRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getmusicalbumremotesearchresults.h b/core/include/JellyfinQt/loader/http/getmusicalbumremotesearchresults.h index 985d19f..2ae7998 100644 --- a/core/include/JellyfinQt/loader/http/getmusicalbumremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getmusicalbumremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get music album remote search. + */ + +class GetMusicAlbumRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetMusicAlbumRemoteSearchResultsParams> { +public: + explicit GetMusicAlbumRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMusicAlbumRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetMusicAlbumRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getmusicartistremotesearchresults.h b/core/include/JellyfinQt/loader/http/getmusicartistremotesearchresults.h index 5339b5a..1455c79 100644 --- a/core/include/JellyfinQt/loader/http/getmusicartistremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getmusicartistremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get music artist remote search. + */ + +class GetMusicArtistRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetMusicArtistRemoteSearchResultsParams> { +public: + explicit GetMusicArtistRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMusicArtistRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetMusicArtistRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getmusicgenre.h b/core/include/JellyfinQt/loader/http/getmusicgenre.h index 308bba0..440ba02 100644 --- a/core/include/JellyfinQt/loader/http/getmusicgenre.h +++ b/core/include/JellyfinQt/loader/http/getmusicgenre.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a music genre, by name. */ -class GetMusicGenreLoader : public Jellyfin::Support::HttpLoader { + +class GetMusicGenreLoader : public Jellyfin::Support::HttpLoader { public: explicit GetMusicGenreLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getmusicgenreimage.h b/core/include/JellyfinQt/loader/http/getmusicgenreimage.h index 1800b68..95b2388 100644 --- a/core/include/JellyfinQt/loader/http/getmusicgenreimage.h +++ b/core/include/JellyfinQt/loader/http/getmusicgenreimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmusicgenreimagebyindex.h b/core/include/JellyfinQt/loader/http/getmusicgenreimagebyindex.h index 38cf764..519edee 100644 --- a/core/include/JellyfinQt/loader/http/getmusicgenreimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getmusicgenreimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getmusicgenres.h b/core/include/JellyfinQt/loader/http/getmusicgenres.h index 72c376f..65d0e16 100644 --- a/core/include/JellyfinQt/loader/http/getmusicgenres.h +++ b/core/include/JellyfinQt/loader/http/getmusicgenres.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all music genres from a given item, folder, or the entire library. */ -class GetMusicGenresLoader : public Jellyfin::Support::HttpLoader { + +class GetMusicGenresLoader : public Jellyfin::Support::HttpLoader { public: explicit GetMusicGenresLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getmusicvideoremotesearchresults.h b/core/include/JellyfinQt/loader/http/getmusicvideoremotesearchresults.h index 9301f66..8f2d87a 100644 --- a/core/include/JellyfinQt/loader/http/getmusicvideoremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getmusicvideoremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get music video remote search. + */ + +class GetMusicVideoRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetMusicVideoRemoteSearchResultsParams> { +public: + explicit GetMusicVideoRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetMusicVideoRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetMusicVideoRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getnamedconfiguration.h b/core/include/JellyfinQt/loader/http/getnamedconfiguration.h index 937e516..9c0c395 100644 --- a/core/include/JellyfinQt/loader/http/getnamedconfiguration.h +++ b/core/include/JellyfinQt/loader/http/getnamedconfiguration.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a named configuration. + */ + +class GetNamedConfigurationLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetNamedConfigurationLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetNamedConfigurationParams& parameters) const override; + QUrlQuery query(const GetNamedConfigurationParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getnetworkshares.h b/core/include/JellyfinQt/loader/http/getnetworkshares.h index 262d845..190e486 100644 --- a/core/include/JellyfinQt/loader/http/getnetworkshares.h +++ b/core/include/JellyfinQt/loader/http/getnetworkshares.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/filesystementryinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets network paths. + */ + +class GetNetworkSharesLoader : public Jellyfin::Support::HttpLoader, GetNetworkSharesParams> { +public: + explicit GetNetworkSharesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetNetworkSharesParams& parameters) const override; + QUrlQuery query(const GetNetworkSharesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getnextup.h b/core/include/JellyfinQt/loader/http/getnextup.h index 6fda54e..cb792e9 100644 --- a/core/include/JellyfinQt/loader/http/getnextup.h +++ b/core/include/JellyfinQt/loader/http/getnextup.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a list of next up episodes. */ -class GetNextUpLoader : public Jellyfin::Support::HttpLoader { + +class GetNextUpLoader : public Jellyfin::Support::HttpLoader { public: explicit GetNextUpLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getnotifications.h b/core/include/JellyfinQt/loader/http/getnotifications.h index dc7a7d5..16229d8 100644 --- a/core/include/JellyfinQt/loader/http/getnotifications.h +++ b/core/include/JellyfinQt/loader/http/getnotifications.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/notificationresultdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a user's notifications. */ -class GetNotificationsLoader : public Jellyfin::Support::HttpLoader { + +class GetNotificationsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetNotificationsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getnotificationservices.h b/core/include/JellyfinQt/loader/http/getnotificationservices.h index 72947bb..1670012 100644 --- a/core/include/JellyfinQt/loader/http/getnotificationservices.h +++ b/core/include/JellyfinQt/loader/http/getnotificationservices.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/nameidpair.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets notification services. + */ + +class GetNotificationServicesLoader : public Jellyfin::Support::HttpLoader, GetNotificationServicesParams> { +public: + explicit GetNotificationServicesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetNotificationServicesParams& parameters) const override; + QUrlQuery query(const GetNotificationServicesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getnotificationssummary.h b/core/include/JellyfinQt/loader/http/getnotificationssummary.h index 6c0710c..12b3944 100644 --- a/core/include/JellyfinQt/loader/http/getnotificationssummary.h +++ b/core/include/JellyfinQt/loader/http/getnotificationssummary.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/notificationssummarydto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a user's notification summary. */ -class GetNotificationsSummaryLoader : public Jellyfin::Support::HttpLoader { + +class GetNotificationsSummaryLoader : public Jellyfin::Support::HttpLoader { public: explicit GetNotificationsSummaryLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getnotificationtypes.h b/core/include/JellyfinQt/loader/http/getnotificationtypes.h index eb33113..e94d870 100644 --- a/core/include/JellyfinQt/loader/http/getnotificationtypes.h +++ b/core/include/JellyfinQt/loader/http/getnotificationtypes.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/notificationtypeinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets notification types. + */ + +class GetNotificationTypesLoader : public Jellyfin::Support::HttpLoader, GetNotificationTypesParams> { +public: + explicit GetNotificationTypesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetNotificationTypesParams& parameters) const override; + QUrlQuery query(const GetNotificationTypesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getpackageinfo.h b/core/include/JellyfinQt/loader/http/getpackageinfo.h index 517eb73..b96c988 100644 --- a/core/include/JellyfinQt/loader/http/getpackageinfo.h +++ b/core/include/JellyfinQt/loader/http/getpackageinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/packageinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a package by name or assembly GUID. */ -class GetPackageInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetPackageInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPackageInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpackages.h b/core/include/JellyfinQt/loader/http/getpackages.h index 7d8339b..3bf0b5c 100644 --- a/core/include/JellyfinQt/loader/http/getpackages.h +++ b/core/include/JellyfinQt/loader/http/getpackages.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/packageinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets available packages. + */ + +class GetPackagesLoader : public Jellyfin::Support::HttpLoader, GetPackagesParams> { +public: + explicit GetPackagesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPackagesParams& parameters) const override; + QUrlQuery query(const GetPackagesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getparentalratings.h b/core/include/JellyfinQt/loader/http/getparentalratings.h index 3302741..270d27c 100644 --- a/core/include/JellyfinQt/loader/http/getparentalratings.h +++ b/core/include/JellyfinQt/loader/http/getparentalratings.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/parentalrating.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets known parental ratings. + */ + +class GetParentalRatingsLoader : public Jellyfin::Support::HttpLoader, GetParentalRatingsParams> { +public: + explicit GetParentalRatingsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetParentalRatingsParams& parameters) const override; + QUrlQuery query(const GetParentalRatingsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getparentpath.h b/core/include/JellyfinQt/loader/http/getparentpath.h index 68acc6b..d387073 100644 --- a/core/include/JellyfinQt/loader/http/getparentpath.h +++ b/core/include/JellyfinQt/loader/http/getparentpath.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets the parent path of a given path. + */ + +class GetParentPathLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetParentPathLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetParentPathParams& parameters) const override; + QUrlQuery query(const GetParentPathParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getpasswordresetproviders.h b/core/include/JellyfinQt/loader/http/getpasswordresetproviders.h index 055dcdb..d34e96b 100644 --- a/core/include/JellyfinQt/loader/http/getpasswordresetproviders.h +++ b/core/include/JellyfinQt/loader/http/getpasswordresetproviders.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/nameidpair.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all password reset providers. + */ + +class GetPasswordResetProvidersLoader : public Jellyfin::Support::HttpLoader, GetPasswordResetProvidersParams> { +public: + explicit GetPasswordResetProvidersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPasswordResetProvidersParams& parameters) const override; + QUrlQuery query(const GetPasswordResetProvidersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getperson.h b/core/include/JellyfinQt/loader/http/getperson.h index ba227b5..a5897f4 100644 --- a/core/include/JellyfinQt/loader/http/getperson.h +++ b/core/include/JellyfinQt/loader/http/getperson.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get person by name. */ -class GetPersonLoader : public Jellyfin::Support::HttpLoader { + +class GetPersonLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPersonLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpersonimage.h b/core/include/JellyfinQt/loader/http/getpersonimage.h index f03cc02..8c4ec21 100644 --- a/core/include/JellyfinQt/loader/http/getpersonimage.h +++ b/core/include/JellyfinQt/loader/http/getpersonimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getpersonimagebyindex.h b/core/include/JellyfinQt/loader/http/getpersonimagebyindex.h index abd68a8..bce19c5 100644 --- a/core/include/JellyfinQt/loader/http/getpersonimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getpersonimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getpersonremotesearchresults.h b/core/include/JellyfinQt/loader/http/getpersonremotesearchresults.h index 3c49f7a..e6b7431 100644 --- a/core/include/JellyfinQt/loader/http/getpersonremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getpersonremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get person remote search. + */ + +class GetPersonRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetPersonRemoteSearchResultsParams> { +public: + explicit GetPersonRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPersonRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetPersonRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getpersons.h b/core/include/JellyfinQt/loader/http/getpersons.h index 15b17f0..c051017 100644 --- a/core/include/JellyfinQt/loader/http/getpersons.h +++ b/core/include/JellyfinQt/loader/http/getpersons.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all persons. */ -class GetPersonsLoader : public Jellyfin::Support::HttpLoader { + +class GetPersonsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPersonsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getphysicalpaths.h b/core/include/JellyfinQt/loader/http/getphysicalpaths.h index 2ab1884..f459429 100644 --- a/core/include/JellyfinQt/loader/http/getphysicalpaths.h +++ b/core/include/JellyfinQt/loader/http/getphysicalpaths.h @@ -31,17 +31,34 @@ #define JELLYFIN_LOADER_HTTP_GETPHYSICALPATHS_H #include +#include #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of physical paths from virtual folders. + */ + +class GetPhysicalPathsLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetPhysicalPathsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPhysicalPathsParams& parameters) const override; + QUrlQuery query(const GetPhysicalPathsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getpingsystem.h b/core/include/JellyfinQt/loader/http/getpingsystem.h index 5043c2e..806a897 100644 --- a/core/include/JellyfinQt/loader/http/getpingsystem.h +++ b/core/include/JellyfinQt/loader/http/getpingsystem.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Pings the system. + */ + +class GetPingSystemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetPingSystemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPingSystemParams& parameters) const override; + QUrlQuery query(const GetPingSystemParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getplaybackinfo.h b/core/include/JellyfinQt/loader/http/getplaybackinfo.h index 7b7eaaa..9a6a7bd 100644 --- a/core/include/JellyfinQt/loader/http/getplaybackinfo.h +++ b/core/include/JellyfinQt/loader/http/getplaybackinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/playbackinforesponse.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live playback media info for an item. */ -class GetPlaybackInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetPlaybackInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPlaybackInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getplaylistitems.h b/core/include/JellyfinQt/loader/http/getplaylistitems.h index 0912b7a..2f8bffb 100644 --- a/core/include/JellyfinQt/loader/http/getplaylistitems.h +++ b/core/include/JellyfinQt/loader/http/getplaylistitems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the original items of a playlist. */ -class GetPlaylistItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetPlaylistItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPlaylistItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpluginconfiguration.h b/core/include/JellyfinQt/loader/http/getpluginconfiguration.h index f00aaa2..c501ff4 100644 --- a/core/include/JellyfinQt/loader/http/getpluginconfiguration.h +++ b/core/include/JellyfinQt/loader/http/getpluginconfiguration.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/basepluginconfiguration.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets plugin configuration. */ -class GetPluginConfigurationLoader : public Jellyfin::Support::HttpLoader { + +class GetPluginConfigurationLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPluginConfigurationLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpluginimage.h b/core/include/JellyfinQt/loader/http/getpluginimage.h index c032d24..c443b47 100644 --- a/core/include/JellyfinQt/loader/http/getpluginimage.h +++ b/core/include/JellyfinQt/loader/http/getpluginimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getpluginmanifest.h b/core/include/JellyfinQt/loader/http/getpluginmanifest.h index e7902e1..24d783c 100644 --- a/core/include/JellyfinQt/loader/http/getpluginmanifest.h +++ b/core/include/JellyfinQt/loader/http/getpluginmanifest.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getplugins.h b/core/include/JellyfinQt/loader/http/getplugins.h index 23d3bb1..1087ac8 100644 --- a/core/include/JellyfinQt/loader/http/getplugins.h +++ b/core/include/JellyfinQt/loader/http/getplugins.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/plugininfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of currently installed plugins. + */ + +class GetPluginsLoader : public Jellyfin::Support::HttpLoader, GetPluginsParams> { +public: + explicit GetPluginsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPluginsParams& parameters) const override; + QUrlQuery query(const GetPluginsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getpostedplaybackinfo.h b/core/include/JellyfinQt/loader/http/getpostedplaybackinfo.h index f6ee9ac..de36c7f 100644 --- a/core/include/JellyfinQt/loader/http/getpostedplaybackinfo.h +++ b/core/include/JellyfinQt/loader/http/getpostedplaybackinfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/playbackinforesponse.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live playback media info for an item. */ -class GetPostedPlaybackInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetPostedPlaybackInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPostedPlaybackInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getprofile.h b/core/include/JellyfinQt/loader/http/getprofile.h index 9d2355e..c98a59e 100644 --- a/core/include/JellyfinQt/loader/http/getprofile.h +++ b/core/include/JellyfinQt/loader/http/getprofile.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/deviceprofile.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a single profile. */ -class GetProfileLoader : public Jellyfin::Support::HttpLoader { + +class GetProfileLoader : public Jellyfin::Support::HttpLoader { public: explicit GetProfileLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getprofileinfos.h b/core/include/JellyfinQt/loader/http/getprofileinfos.h index b209a3d..7d5dd0e 100644 --- a/core/include/JellyfinQt/loader/http/getprofileinfos.h +++ b/core/include/JellyfinQt/loader/http/getprofileinfos.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/deviceprofileinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get profile infos. + */ + +class GetProfileInfosLoader : public Jellyfin::Support::HttpLoader, GetProfileInfosParams> { +public: + explicit GetProfileInfosLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetProfileInfosParams& parameters) const override; + QUrlQuery query(const GetProfileInfosParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getprogram.h b/core/include/JellyfinQt/loader/http/getprogram.h index 54f26c7..5ec1a9e 100644 --- a/core/include/JellyfinQt/loader/http/getprogram.h +++ b/core/include/JellyfinQt/loader/http/getprogram.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a live tv program. */ -class GetProgramLoader : public Jellyfin::Support::HttpLoader { + +class GetProgramLoader : public Jellyfin::Support::HttpLoader { public: explicit GetProgramLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getprograms.h b/core/include/JellyfinQt/loader/http/getprograms.h index d7138d1..0dea7f8 100644 --- a/core/include/JellyfinQt/loader/http/getprograms.h +++ b/core/include/JellyfinQt/loader/http/getprograms.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available live tv epgs. */ -class GetProgramsLoader : public Jellyfin::Support::HttpLoader { + +class GetProgramsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetProgramsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpublicsysteminfo.h b/core/include/JellyfinQt/loader/http/getpublicsysteminfo.h index 3a28a0d..57fc58a 100644 --- a/core/include/JellyfinQt/loader/http/getpublicsysteminfo.h +++ b/core/include/JellyfinQt/loader/http/getpublicsysteminfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/publicsysteminfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets public information about the server. */ -class GetPublicSystemInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetPublicSystemInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetPublicSystemInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getpublicusers.h b/core/include/JellyfinQt/loader/http/getpublicusers.h index f49a768..1379beb 100644 --- a/core/include/JellyfinQt/loader/http/getpublicusers.h +++ b/core/include/JellyfinQt/loader/http/getpublicusers.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/userdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of publicly visible users for display on a login screen. + */ + +class GetPublicUsersLoader : public Jellyfin::Support::HttpLoader, GetPublicUsersParams> { +public: + explicit GetPublicUsersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetPublicUsersParams& parameters) const override; + QUrlQuery query(const GetPublicUsersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getqueryfilters.h b/core/include/JellyfinQt/loader/http/getqueryfilters.h index 00c56b8..e524499 100644 --- a/core/include/JellyfinQt/loader/http/getqueryfilters.h +++ b/core/include/JellyfinQt/loader/http/getqueryfilters.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/queryfilters.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets query filters. */ -class GetQueryFiltersLoader : public Jellyfin::Support::HttpLoader { + +class GetQueryFiltersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetQueryFiltersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getqueryfilterslegacy.h b/core/include/JellyfinQt/loader/http/getqueryfilterslegacy.h index 4f51557..159f03a 100644 --- a/core/include/JellyfinQt/loader/http/getqueryfilterslegacy.h +++ b/core/include/JellyfinQt/loader/http/getqueryfilterslegacy.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/queryfilterslegacy.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets legacy query filters. */ -class GetQueryFiltersLegacyLoader : public Jellyfin::Support::HttpLoader { + +class GetQueryFiltersLegacyLoader : public Jellyfin::Support::HttpLoader { public: explicit GetQueryFiltersLegacyLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getratingimage.h b/core/include/JellyfinQt/loader/http/getratingimage.h index 6b4a0ab..c9f12c3 100644 --- a/core/include/JellyfinQt/loader/http/getratingimage.h +++ b/core/include/JellyfinQt/loader/http/getratingimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getratingimages.h b/core/include/JellyfinQt/loader/http/getratingimages.h index 6b29ece..03a91d4 100644 --- a/core/include/JellyfinQt/loader/http/getratingimages.h +++ b/core/include/JellyfinQt/loader/http/getratingimages.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/imagebynameinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get all general images. + */ + +class GetRatingImagesLoader : public Jellyfin::Support::HttpLoader, GetRatingImagesParams> { +public: + explicit GetRatingImagesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetRatingImagesParams& parameters) const override; + QUrlQuery query(const GetRatingImagesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getrecommendedprograms.h b/core/include/JellyfinQt/loader/http/getrecommendedprograms.h index 9de768e..f86af91 100644 --- a/core/include/JellyfinQt/loader/http/getrecommendedprograms.h +++ b/core/include/JellyfinQt/loader/http/getrecommendedprograms.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets recommended live tv epgs. */ -class GetRecommendedProgramsLoader : public Jellyfin::Support::HttpLoader { + +class GetRecommendedProgramsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecommendedProgramsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrecording.h b/core/include/JellyfinQt/loader/http/getrecording.h index 7cde68c..457cc39 100644 --- a/core/include/JellyfinQt/loader/http/getrecording.h +++ b/core/include/JellyfinQt/loader/http/getrecording.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a live tv recording. */ -class GetRecordingLoader : public Jellyfin::Support::HttpLoader { + +class GetRecordingLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecordingLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrecordingfolders.h b/core/include/JellyfinQt/loader/http/getrecordingfolders.h index 53b13ae..c52ef31 100644 --- a/core/include/JellyfinQt/loader/http/getrecordingfolders.h +++ b/core/include/JellyfinQt/loader/http/getrecordingfolders.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets recording folders. */ -class GetRecordingFoldersLoader : public Jellyfin::Support::HttpLoader { + +class GetRecordingFoldersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecordingFoldersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrecordinggroup.h b/core/include/JellyfinQt/loader/http/getrecordinggroup.h index 249553f..37b75d1 100644 --- a/core/include/JellyfinQt/loader/http/getrecordinggroup.h +++ b/core/include/JellyfinQt/loader/http/getrecordinggroup.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getrecordinggroups.h b/core/include/JellyfinQt/loader/http/getrecordinggroups.h index 73064dc..ea062b8 100644 --- a/core/include/JellyfinQt/loader/http/getrecordinggroups.h +++ b/core/include/JellyfinQt/loader/http/getrecordinggroups.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live tv recording groups. */ -class GetRecordingGroupsLoader : public Jellyfin::Support::HttpLoader { + +class GetRecordingGroupsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecordingGroupsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrecordings.h b/core/include/JellyfinQt/loader/http/getrecordings.h index 3b68324..8506394 100644 --- a/core/include/JellyfinQt/loader/http/getrecordings.h +++ b/core/include/JellyfinQt/loader/http/getrecordings.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live tv recordings. */ -class GetRecordingsLoader : public Jellyfin::Support::HttpLoader { + +class GetRecordingsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecordingsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrecordingsseries.h b/core/include/JellyfinQt/loader/http/getrecordingsseries.h index 6722d59..131ce64 100644 --- a/core/include/JellyfinQt/loader/http/getrecordingsseries.h +++ b/core/include/JellyfinQt/loader/http/getrecordingsseries.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live tv recording series. */ -class GetRecordingsSeriesLoader : public Jellyfin::Support::HttpLoader { + +class GetRecordingsSeriesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRecordingsSeriesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getremoteimage.h b/core/include/JellyfinQt/loader/http/getremoteimage.h index e25e3b3..d2f6c67 100644 --- a/core/include/JellyfinQt/loader/http/getremoteimage.h +++ b/core/include/JellyfinQt/loader/http/getremoteimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getremoteimageproviders.h b/core/include/JellyfinQt/loader/http/getremoteimageproviders.h index ba5738e..8b80563 100644 --- a/core/include/JellyfinQt/loader/http/getremoteimageproviders.h +++ b/core/include/JellyfinQt/loader/http/getremoteimageproviders.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/imageproviderinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets available remote image providers for an item. + */ + +class GetRemoteImageProvidersLoader : public Jellyfin::Support::HttpLoader, GetRemoteImageProvidersParams> { +public: + explicit GetRemoteImageProvidersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetRemoteImageProvidersParams& parameters) const override; + QUrlQuery query(const GetRemoteImageProvidersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getremoteimages.h b/core/include/JellyfinQt/loader/http/getremoteimages.h index 6be9b2e..cd040bd 100644 --- a/core/include/JellyfinQt/loader/http/getremoteimages.h +++ b/core/include/JellyfinQt/loader/http/getremoteimages.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/remoteimageresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets available remote images for an item. */ -class GetRemoteImagesLoader : public Jellyfin::Support::HttpLoader { + +class GetRemoteImagesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRemoteImagesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getremotesearchimage.h b/core/include/JellyfinQt/loader/http/getremotesearchimage.h index c9c9937..2a4efbf 100644 --- a/core/include/JellyfinQt/loader/http/getremotesearchimage.h +++ b/core/include/JellyfinQt/loader/http/getremotesearchimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getremotesubtitles.h b/core/include/JellyfinQt/loader/http/getremotesubtitles.h index 16ef553..1a3108d 100644 --- a/core/include/JellyfinQt/loader/http/getremotesubtitles.h +++ b/core/include/JellyfinQt/loader/http/getremotesubtitles.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getrepositories.h b/core/include/JellyfinQt/loader/http/getrepositories.h index c1a6b9c..2f980a9 100644 --- a/core/include/JellyfinQt/loader/http/getrepositories.h +++ b/core/include/JellyfinQt/loader/http/getrepositories.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/repositoryinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets all package repositories. + */ + +class GetRepositoriesLoader : public Jellyfin::Support::HttpLoader, GetRepositoriesParams> { +public: + explicit GetRepositoriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetRepositoriesParams& parameters) const override; + QUrlQuery query(const GetRepositoriesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getresumeitems.h b/core/include/JellyfinQt/loader/http/getresumeitems.h index 30ee752..1069bc8 100644 --- a/core/include/JellyfinQt/loader/http/getresumeitems.h +++ b/core/include/JellyfinQt/loader/http/getresumeitems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets items based on a query. */ -class GetResumeItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetResumeItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetResumeItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getrootfolder.h b/core/include/JellyfinQt/loader/http/getrootfolder.h index 5345032..983df48 100644 --- a/core/include/JellyfinQt/loader/http/getrootfolder.h +++ b/core/include/JellyfinQt/loader/http/getrootfolder.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the root folder from a user's library. */ -class GetRootFolderLoader : public Jellyfin::Support::HttpLoader { + +class GetRootFolderLoader : public Jellyfin::Support::HttpLoader { public: explicit GetRootFolderLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getschedulesdirectcountries.h b/core/include/JellyfinQt/loader/http/getschedulesdirectcountries.h index 5a75cc6..80cbe36 100644 --- a/core/include/JellyfinQt/loader/http/getschedulesdirectcountries.h +++ b/core/include/JellyfinQt/loader/http/getschedulesdirectcountries.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets available countries. + */ + +class GetSchedulesDirectCountriesLoader : public Jellyfin::Support::HttpLoader { +public: + explicit GetSchedulesDirectCountriesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetSchedulesDirectCountriesParams& parameters) const override; + QUrlQuery query(const GetSchedulesDirectCountriesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getseasons.h b/core/include/JellyfinQt/loader/http/getseasons.h index d288dc2..e118feb 100644 --- a/core/include/JellyfinQt/loader/http/getseasons.h +++ b/core/include/JellyfinQt/loader/http/getseasons.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets seasons for a tv series. */ -class GetSeasonsLoader : public Jellyfin::Support::HttpLoader { + +class GetSeasonsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSeasonsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getseriesremotesearchresults.h b/core/include/JellyfinQt/loader/http/getseriesremotesearchresults.h index a6cf778..b0103bf 100644 --- a/core/include/JellyfinQt/loader/http/getseriesremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/getseriesremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get series remote search. + */ + +class GetSeriesRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetSeriesRemoteSearchResultsParams> { +public: + explicit GetSeriesRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetSeriesRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetSeriesRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getseriestimer.h b/core/include/JellyfinQt/loader/http/getseriestimer.h index a57e1d3..4a9f8b2 100644 --- a/core/include/JellyfinQt/loader/http/getseriestimer.h +++ b/core/include/JellyfinQt/loader/http/getseriestimer.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/seriestimerinfodto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a live tv series timer. */ -class GetSeriesTimerLoader : public Jellyfin::Support::HttpLoader { + +class GetSeriesTimerLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSeriesTimerLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getseriestimers.h b/core/include/JellyfinQt/loader/http/getseriestimers.h index 934867a..92168b2 100644 --- a/core/include/JellyfinQt/loader/http/getseriestimers.h +++ b/core/include/JellyfinQt/loader/http/getseriestimers.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/seriestimerinfodtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets live tv series timers. */ -class GetSeriesTimersLoader : public Jellyfin::Support::HttpLoader { + +class GetSeriesTimersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSeriesTimersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getserverlogs.h b/core/include/JellyfinQt/loader/http/getserverlogs.h index 05a5726..a559d2d 100644 --- a/core/include/JellyfinQt/loader/http/getserverlogs.h +++ b/core/include/JellyfinQt/loader/http/getserverlogs.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/logfile.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of available server log files. + */ + +class GetServerLogsLoader : public Jellyfin::Support::HttpLoader, GetServerLogsParams> { +public: + explicit GetServerLogsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetServerLogsParams& parameters) const override; + QUrlQuery query(const GetServerLogsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getsessions.h b/core/include/JellyfinQt/loader/http/getsessions.h index aae5bae..3746799 100644 --- a/core/include/JellyfinQt/loader/http/getsessions.h +++ b/core/include/JellyfinQt/loader/http/getsessions.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/sessioninfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of sessions. + */ + +class GetSessionsLoader : public Jellyfin::Support::HttpLoader, GetSessionsParams> { +public: + explicit GetSessionsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetSessionsParams& parameters) const override; + QUrlQuery query(const GetSessionsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getsimilaralbums.h b/core/include/JellyfinQt/loader/http/getsimilaralbums.h index c6f18f8..498a178 100644 --- a/core/include/JellyfinQt/loader/http/getsimilaralbums.h +++ b/core/include/JellyfinQt/loader/http/getsimilaralbums.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarAlbumsLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarAlbumsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarAlbumsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsimilarartists.h b/core/include/JellyfinQt/loader/http/getsimilarartists.h index c78d46e..e37c234 100644 --- a/core/include/JellyfinQt/loader/http/getsimilarartists.h +++ b/core/include/JellyfinQt/loader/http/getsimilarartists.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarArtistsLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarArtistsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarArtistsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsimilaritems.h b/core/include/JellyfinQt/loader/http/getsimilaritems.h index 44e6e41..61cf067 100644 --- a/core/include/JellyfinQt/loader/http/getsimilaritems.h +++ b/core/include/JellyfinQt/loader/http/getsimilaritems.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarItemsLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarItemsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarItemsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsimilarmovies.h b/core/include/JellyfinQt/loader/http/getsimilarmovies.h index dcb165b..15a002e 100644 --- a/core/include/JellyfinQt/loader/http/getsimilarmovies.h +++ b/core/include/JellyfinQt/loader/http/getsimilarmovies.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarMoviesLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarMoviesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarMoviesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsimilarshows.h b/core/include/JellyfinQt/loader/http/getsimilarshows.h index c81bb1a..774d5c5 100644 --- a/core/include/JellyfinQt/loader/http/getsimilarshows.h +++ b/core/include/JellyfinQt/loader/http/getsimilarshows.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarShowsLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarShowsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarShowsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsimilartrailers.h b/core/include/JellyfinQt/loader/http/getsimilartrailers.h index a0b6c01..1030e72 100644 --- a/core/include/JellyfinQt/loader/http/getsimilartrailers.h +++ b/core/include/JellyfinQt/loader/http/getsimilartrailers.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets similar items. */ -class GetSimilarTrailersLoader : public Jellyfin::Support::HttpLoader { + +class GetSimilarTrailersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSimilarTrailersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getspecialfeatures.h b/core/include/JellyfinQt/loader/http/getspecialfeatures.h index 2b98c43..567d094 100644 --- a/core/include/JellyfinQt/loader/http/getspecialfeatures.h +++ b/core/include/JellyfinQt/loader/http/getspecialfeatures.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets special features for an item. + */ + +class GetSpecialFeaturesLoader : public Jellyfin::Support::HttpLoader, GetSpecialFeaturesParams> { +public: + explicit GetSpecialFeaturesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetSpecialFeaturesParams& parameters) const override; + QUrlQuery query(const GetSpecialFeaturesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getstartupconfiguration.h b/core/include/JellyfinQt/loader/http/getstartupconfiguration.h index fb65c44..7dddd83 100644 --- a/core/include/JellyfinQt/loader/http/getstartupconfiguration.h +++ b/core/include/JellyfinQt/loader/http/getstartupconfiguration.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/startupconfigurationdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the initial startup wizard configuration. */ -class GetStartupConfigurationLoader : public Jellyfin::Support::HttpLoader { + +class GetStartupConfigurationLoader : public Jellyfin::Support::HttpLoader { public: explicit GetStartupConfigurationLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getstatus.h b/core/include/JellyfinQt/loader/http/getstatus.h index d8590b3..18540fc 100644 --- a/core/include/JellyfinQt/loader/http/getstatus.h +++ b/core/include/JellyfinQt/loader/http/getstatus.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/quickconnectstate.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the current quick connect state. */ -class GetStatusLoader : public Jellyfin::Support::HttpLoader { + +class GetStatusLoader : public Jellyfin::Support::HttpLoader { public: explicit GetStatusLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getstudio.h b/core/include/JellyfinQt/loader/http/getstudio.h index 1ca51a2..ad73c3d 100644 --- a/core/include/JellyfinQt/loader/http/getstudio.h +++ b/core/include/JellyfinQt/loader/http/getstudio.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a studio by name. */ -class GetStudioLoader : public Jellyfin::Support::HttpLoader { + +class GetStudioLoader : public Jellyfin::Support::HttpLoader { public: explicit GetStudioLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getstudioimage.h b/core/include/JellyfinQt/loader/http/getstudioimage.h index aea2fa8..733e4e6 100644 --- a/core/include/JellyfinQt/loader/http/getstudioimage.h +++ b/core/include/JellyfinQt/loader/http/getstudioimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getstudioimagebyindex.h b/core/include/JellyfinQt/loader/http/getstudioimagebyindex.h index 8448b46..392032f 100644 --- a/core/include/JellyfinQt/loader/http/getstudioimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getstudioimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getstudios.h b/core/include/JellyfinQt/loader/http/getstudios.h index 2f76ee0..6cb92fb 100644 --- a/core/include/JellyfinQt/loader/http/getstudios.h +++ b/core/include/JellyfinQt/loader/http/getstudios.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets all studios from a given item, folder, or the entire library. */ -class GetStudiosLoader : public Jellyfin::Support::HttpLoader { + +class GetStudiosLoader : public Jellyfin::Support::HttpLoader { public: explicit GetStudiosLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsubtitle.h b/core/include/JellyfinQt/loader/http/getsubtitle.h index 2d30b37..9016bf3 100644 --- a/core/include/JellyfinQt/loader/http/getsubtitle.h +++ b/core/include/JellyfinQt/loader/http/getsubtitle.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getsubtitleplaylist.h b/core/include/JellyfinQt/loader/http/getsubtitleplaylist.h index 78d8432..407a366 100644 --- a/core/include/JellyfinQt/loader/http/getsubtitleplaylist.h +++ b/core/include/JellyfinQt/loader/http/getsubtitleplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getsubtitlewithticks.h b/core/include/JellyfinQt/loader/http/getsubtitlewithticks.h index 14c97a8..c17c23b 100644 --- a/core/include/JellyfinQt/loader/http/getsubtitlewithticks.h +++ b/core/include/JellyfinQt/loader/http/getsubtitlewithticks.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getsuggestions.h b/core/include/JellyfinQt/loader/http/getsuggestions.h index c4a270a..e2e4fbd 100644 --- a/core/include/JellyfinQt/loader/http/getsuggestions.h +++ b/core/include/JellyfinQt/loader/http/getsuggestions.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets suggestions. */ -class GetSuggestionsLoader : public Jellyfin::Support::HttpLoader { + +class GetSuggestionsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSuggestionsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getsysteminfo.h b/core/include/JellyfinQt/loader/http/getsysteminfo.h index 0faa57b..211b92b 100644 --- a/core/include/JellyfinQt/loader/http/getsysteminfo.h +++ b/core/include/JellyfinQt/loader/http/getsysteminfo.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/systeminfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets information about the server. */ -class GetSystemInfoLoader : public Jellyfin::Support::HttpLoader { + +class GetSystemInfoLoader : public Jellyfin::Support::HttpLoader { public: explicit GetSystemInfoLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettask.h b/core/include/JellyfinQt/loader/http/gettask.h index 6f0f617..2b13844 100644 --- a/core/include/JellyfinQt/loader/http/gettask.h +++ b/core/include/JellyfinQt/loader/http/gettask.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/taskinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get task by id. */ -class GetTaskLoader : public Jellyfin::Support::HttpLoader { + +class GetTaskLoader : public Jellyfin::Support::HttpLoader { public: explicit GetTaskLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettasks.h b/core/include/JellyfinQt/loader/http/gettasks.h index a6a88d4..cecb189 100644 --- a/core/include/JellyfinQt/loader/http/gettasks.h +++ b/core/include/JellyfinQt/loader/http/gettasks.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/taskinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get tasks. + */ + +class GetTasksLoader : public Jellyfin::Support::HttpLoader, GetTasksParams> { +public: + explicit GetTasksLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetTasksParams& parameters) const override; + QUrlQuery query(const GetTasksParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getthememedia.h b/core/include/JellyfinQt/loader/http/getthememedia.h index 213b90d..ffff6d0 100644 --- a/core/include/JellyfinQt/loader/http/getthememedia.h +++ b/core/include/JellyfinQt/loader/http/getthememedia.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/allthememediaresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get theme songs and videos for an item. */ -class GetThemeMediaLoader : public Jellyfin::Support::HttpLoader { + +class GetThemeMediaLoader : public Jellyfin::Support::HttpLoader { public: explicit GetThemeMediaLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getthemesongs.h b/core/include/JellyfinQt/loader/http/getthemesongs.h index cd3ddbd..ab95d09 100644 --- a/core/include/JellyfinQt/loader/http/getthemesongs.h +++ b/core/include/JellyfinQt/loader/http/getthemesongs.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/thememediaresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get theme songs for an item. */ -class GetThemeSongsLoader : public Jellyfin::Support::HttpLoader { + +class GetThemeSongsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetThemeSongsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getthemevideos.h b/core/include/JellyfinQt/loader/http/getthemevideos.h index afd7d5c..8f0a47b 100644 --- a/core/include/JellyfinQt/loader/http/getthemevideos.h +++ b/core/include/JellyfinQt/loader/http/getthemevideos.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/thememediaresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get theme videos for an item. */ -class GetThemeVideosLoader : public Jellyfin::Support::HttpLoader { + +class GetThemeVideosLoader : public Jellyfin::Support::HttpLoader { public: explicit GetThemeVideosLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettimer.h b/core/include/JellyfinQt/loader/http/gettimer.h index 578ca78..92af48f 100644 --- a/core/include/JellyfinQt/loader/http/gettimer.h +++ b/core/include/JellyfinQt/loader/http/gettimer.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/timerinfodto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a timer. */ -class GetTimerLoader : public Jellyfin::Support::HttpLoader { + +class GetTimerLoader : public Jellyfin::Support::HttpLoader { public: explicit GetTimerLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettimers.h b/core/include/JellyfinQt/loader/http/gettimers.h index d430b05..3d41836 100644 --- a/core/include/JellyfinQt/loader/http/gettimers.h +++ b/core/include/JellyfinQt/loader/http/gettimers.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/timerinfodtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the live tv timers. */ -class GetTimersLoader : public Jellyfin::Support::HttpLoader { + +class GetTimersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetTimersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettrailerremotesearchresults.h b/core/include/JellyfinQt/loader/http/gettrailerremotesearchresults.h index 897b299..66a7bad 100644 --- a/core/include/JellyfinQt/loader/http/gettrailerremotesearchresults.h +++ b/core/include/JellyfinQt/loader/http/gettrailerremotesearchresults.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesearchresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get trailer remote search. + */ + +class GetTrailerRemoteSearchResultsLoader : public Jellyfin::Support::HttpLoader, GetTrailerRemoteSearchResultsParams> { +public: + explicit GetTrailerRemoteSearchResultsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetTrailerRemoteSearchResultsParams& parameters) const override; + QUrlQuery query(const GetTrailerRemoteSearchResultsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/gettrailers.h b/core/include/JellyfinQt/loader/http/gettrailers.h index 2712658..1e851e2 100644 --- a/core/include/JellyfinQt/loader/http/gettrailers.h +++ b/core/include/JellyfinQt/loader/http/gettrailers.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Finds movies and trailers similar to a given trailer. */ -class GetTrailersLoader : public Jellyfin::Support::HttpLoader { + +class GetTrailersLoader : public Jellyfin::Support::HttpLoader { public: explicit GetTrailersLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/gettunerhosttypes.h b/core/include/JellyfinQt/loader/http/gettunerhosttypes.h index adbc0e6..f28ca86 100644 --- a/core/include/JellyfinQt/loader/http/gettunerhosttypes.h +++ b/core/include/JellyfinQt/loader/http/gettunerhosttypes.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/nameidpair.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Get tuner host types. + */ + +class GetTunerHostTypesLoader : public Jellyfin::Support::HttpLoader, GetTunerHostTypesParams> { +public: + explicit GetTunerHostTypesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetTunerHostTypesParams& parameters) const override; + QUrlQuery query(const GetTunerHostTypesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getuniversalaudiostream.h b/core/include/JellyfinQt/loader/http/getuniversalaudiostream.h index 4d4fd38..f9625fa 100644 --- a/core/include/JellyfinQt/loader/http/getuniversalaudiostream.h +++ b/core/include/JellyfinQt/loader/http/getuniversalaudiostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getupcomingepisodes.h b/core/include/JellyfinQt/loader/http/getupcomingepisodes.h index 5aca5c4..1d48093 100644 --- a/core/include/JellyfinQt/loader/http/getupcomingepisodes.h +++ b/core/include/JellyfinQt/loader/http/getupcomingepisodes.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a list of upcoming episodes. */ -class GetUpcomingEpisodesLoader : public Jellyfin::Support::HttpLoader { + +class GetUpcomingEpisodesLoader : public Jellyfin::Support::HttpLoader { public: explicit GetUpcomingEpisodesLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getuserbyid.h b/core/include/JellyfinQt/loader/http/getuserbyid.h index b0c3287..9ed6d69 100644 --- a/core/include/JellyfinQt/loader/http/getuserbyid.h +++ b/core/include/JellyfinQt/loader/http/getuserbyid.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/userdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a user by Id. */ -class GetUserByIdLoader : public Jellyfin::Support::HttpLoader { + +class GetUserByIdLoader : public Jellyfin::Support::HttpLoader { public: explicit GetUserByIdLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getuserimage.h b/core/include/JellyfinQt/loader/http/getuserimage.h index 906ad04..abb1254 100644 --- a/core/include/JellyfinQt/loader/http/getuserimage.h +++ b/core/include/JellyfinQt/loader/http/getuserimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getuserimagebyindex.h b/core/include/JellyfinQt/loader/http/getuserimagebyindex.h index 5f98967..4a9ddd1 100644 --- a/core/include/JellyfinQt/loader/http/getuserimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/getuserimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getusers.h b/core/include/JellyfinQt/loader/http/getusers.h index 83994e6..6eeeff9 100644 --- a/core/include/JellyfinQt/loader/http/getusers.h +++ b/core/include/JellyfinQt/loader/http/getusers.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/userdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets a list of users. + */ + +class GetUsersLoader : public Jellyfin::Support::HttpLoader, GetUsersParams> { +public: + explicit GetUsersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetUsersParams& parameters) const override; + QUrlQuery query(const GetUsersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getuserviews.h b/core/include/JellyfinQt/loader/http/getuserviews.h index a3dec25..50b41f4 100644 --- a/core/include/JellyfinQt/loader/http/getuserviews.h +++ b/core/include/JellyfinQt/loader/http/getuserviews.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get user views. */ -class GetUserViewsLoader : public Jellyfin::Support::HttpLoader { + +class GetUserViewsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetUserViewsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getutctime.h b/core/include/JellyfinQt/loader/http/getutctime.h index 8eab80e..f97091e 100644 --- a/core/include/JellyfinQt/loader/http/getutctime.h +++ b/core/include/JellyfinQt/loader/http/getutctime.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/utctimeresponse.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets the current UTC time. */ -class GetUtcTimeLoader : public Jellyfin::Support::HttpLoader { + +class GetUtcTimeLoader : public Jellyfin::Support::HttpLoader { public: explicit GetUtcTimeLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getvarianthlsaudioplaylist.h b/core/include/JellyfinQt/loader/http/getvarianthlsaudioplaylist.h index 06fb639..cd9dfcb 100644 --- a/core/include/JellyfinQt/loader/http/getvarianthlsaudioplaylist.h +++ b/core/include/JellyfinQt/loader/http/getvarianthlsaudioplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getvarianthlsvideoplaylist.h b/core/include/JellyfinQt/loader/http/getvarianthlsvideoplaylist.h index 5bb43b7..dcc8820 100644 --- a/core/include/JellyfinQt/loader/http/getvarianthlsvideoplaylist.h +++ b/core/include/JellyfinQt/loader/http/getvarianthlsvideoplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getvideostream.h b/core/include/JellyfinQt/loader/http/getvideostream.h index eb3e8dc..5d9c5f5 100644 --- a/core/include/JellyfinQt/loader/http/getvideostream.h +++ b/core/include/JellyfinQt/loader/http/getvideostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getvideostreambycontainer.h b/core/include/JellyfinQt/loader/http/getvideostreambycontainer.h index 0912822..1019c58 100644 --- a/core/include/JellyfinQt/loader/http/getvideostreambycontainer.h +++ b/core/include/JellyfinQt/loader/http/getvideostreambycontainer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/getvirtualfolders.h b/core/include/JellyfinQt/loader/http/getvirtualfolders.h index 57744ce..b5fb6f9 100644 --- a/core/include/JellyfinQt/loader/http/getvirtualfolders.h +++ b/core/include/JellyfinQt/loader/http/getvirtualfolders.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/virtualfolderinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets all virtual folders. + */ + +class GetVirtualFoldersLoader : public Jellyfin::Support::HttpLoader, GetVirtualFoldersParams> { +public: + explicit GetVirtualFoldersLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetVirtualFoldersParams& parameters) const override; + QUrlQuery query(const GetVirtualFoldersParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getwakeonlaninfo.h b/core/include/JellyfinQt/loader/http/getwakeonlaninfo.h index 35a1fa9..29682c5 100644 --- a/core/include/JellyfinQt/loader/http/getwakeonlaninfo.h +++ b/core/include/JellyfinQt/loader/http/getwakeonlaninfo.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/wakeonlaninfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets wake on lan information. + */ + +class GetWakeOnLanInfoLoader : public Jellyfin::Support::HttpLoader, GetWakeOnLanInfoParams> { +public: + explicit GetWakeOnLanInfoLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const GetWakeOnLanInfoParams& parameters) const override; + QUrlQuery query(const GetWakeOnLanInfoParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/getyear.h b/core/include/JellyfinQt/loader/http/getyear.h index 2f59899..105ea77 100644 --- a/core/include/JellyfinQt/loader/http/getyear.h +++ b/core/include/JellyfinQt/loader/http/getyear.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Gets a year. */ -class GetYearLoader : public Jellyfin::Support::HttpLoader { + +class GetYearLoader : public Jellyfin::Support::HttpLoader { public: explicit GetYearLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/getyears.h b/core/include/JellyfinQt/loader/http/getyears.h index a66d7a5..6e62ec4 100644 --- a/core/include/JellyfinQt/loader/http/getyears.h +++ b/core/include/JellyfinQt/loader/http/getyears.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/baseitemdtoqueryresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Get years. */ -class GetYearsLoader : public Jellyfin::Support::HttpLoader { + +class GetYearsLoader : public Jellyfin::Support::HttpLoader { public: explicit GetYearsLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/headartistimage.h b/core/include/JellyfinQt/loader/http/headartistimage.h index e03d759..1ec4ff6 100644 --- a/core/include/JellyfinQt/loader/http/headartistimage.h +++ b/core/include/JellyfinQt/loader/http/headartistimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headaudiostream.h b/core/include/JellyfinQt/loader/http/headaudiostream.h index fda21b4..c372680 100644 --- a/core/include/JellyfinQt/loader/http/headaudiostream.h +++ b/core/include/JellyfinQt/loader/http/headaudiostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headaudiostreambycontainer.h b/core/include/JellyfinQt/loader/http/headaudiostreambycontainer.h index 27780fb..a96a4f0 100644 --- a/core/include/JellyfinQt/loader/http/headaudiostreambycontainer.h +++ b/core/include/JellyfinQt/loader/http/headaudiostreambycontainer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headgenreimage.h b/core/include/JellyfinQt/loader/http/headgenreimage.h index fe7e0ea..5001391 100644 --- a/core/include/JellyfinQt/loader/http/headgenreimage.h +++ b/core/include/JellyfinQt/loader/http/headgenreimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headgenreimagebyindex.h b/core/include/JellyfinQt/loader/http/headgenreimagebyindex.h index ad83cee..5209252 100644 --- a/core/include/JellyfinQt/loader/http/headgenreimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headgenreimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headitemimage.h b/core/include/JellyfinQt/loader/http/headitemimage.h index 3dc6965..23353cb 100644 --- a/core/include/JellyfinQt/loader/http/headitemimage.h +++ b/core/include/JellyfinQt/loader/http/headitemimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headitemimage2.h b/core/include/JellyfinQt/loader/http/headitemimage2.h index ae4ff14..6ca8b3e 100644 --- a/core/include/JellyfinQt/loader/http/headitemimage2.h +++ b/core/include/JellyfinQt/loader/http/headitemimage2.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headitemimagebyindex.h b/core/include/JellyfinQt/loader/http/headitemimagebyindex.h index 7a5e3bc..3134840 100644 --- a/core/include/JellyfinQt/loader/http/headitemimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headitemimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headmasterhlsaudioplaylist.h b/core/include/JellyfinQt/loader/http/headmasterhlsaudioplaylist.h index 5ec0a55..4c93781 100644 --- a/core/include/JellyfinQt/loader/http/headmasterhlsaudioplaylist.h +++ b/core/include/JellyfinQt/loader/http/headmasterhlsaudioplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headmasterhlsvideoplaylist.h b/core/include/JellyfinQt/loader/http/headmasterhlsvideoplaylist.h index 1a65f20..1087ba1 100644 --- a/core/include/JellyfinQt/loader/http/headmasterhlsvideoplaylist.h +++ b/core/include/JellyfinQt/loader/http/headmasterhlsvideoplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headmusicgenreimage.h b/core/include/JellyfinQt/loader/http/headmusicgenreimage.h index d8bc48e..d44906b 100644 --- a/core/include/JellyfinQt/loader/http/headmusicgenreimage.h +++ b/core/include/JellyfinQt/loader/http/headmusicgenreimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headmusicgenreimagebyindex.h b/core/include/JellyfinQt/loader/http/headmusicgenreimagebyindex.h index 5c2ce2d..2d39711 100644 --- a/core/include/JellyfinQt/loader/http/headmusicgenreimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headmusicgenreimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headpersonimage.h b/core/include/JellyfinQt/loader/http/headpersonimage.h index 778e6ec..1f68e29 100644 --- a/core/include/JellyfinQt/loader/http/headpersonimage.h +++ b/core/include/JellyfinQt/loader/http/headpersonimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headpersonimagebyindex.h b/core/include/JellyfinQt/loader/http/headpersonimagebyindex.h index faa04eb..70b5437 100644 --- a/core/include/JellyfinQt/loader/http/headpersonimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headpersonimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headstudioimage.h b/core/include/JellyfinQt/loader/http/headstudioimage.h index 7678a8b..a299b95 100644 --- a/core/include/JellyfinQt/loader/http/headstudioimage.h +++ b/core/include/JellyfinQt/loader/http/headstudioimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headstudioimagebyindex.h b/core/include/JellyfinQt/loader/http/headstudioimagebyindex.h index 3d073b8..f57f0ac 100644 --- a/core/include/JellyfinQt/loader/http/headstudioimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headstudioimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headuniversalaudiostream.h b/core/include/JellyfinQt/loader/http/headuniversalaudiostream.h index 70e976b..7751745 100644 --- a/core/include/JellyfinQt/loader/http/headuniversalaudiostream.h +++ b/core/include/JellyfinQt/loader/http/headuniversalaudiostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headuserimage.h b/core/include/JellyfinQt/loader/http/headuserimage.h index bc2f44c..63215aa 100644 --- a/core/include/JellyfinQt/loader/http/headuserimage.h +++ b/core/include/JellyfinQt/loader/http/headuserimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headuserimagebyindex.h b/core/include/JellyfinQt/loader/http/headuserimagebyindex.h index da4fa26..b95dc22 100644 --- a/core/include/JellyfinQt/loader/http/headuserimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/headuserimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headvideostream.h b/core/include/JellyfinQt/loader/http/headvideostream.h index 2ae85ff..0de3aed 100644 --- a/core/include/JellyfinQt/loader/http/headvideostream.h +++ b/core/include/JellyfinQt/loader/http/headvideostream.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/headvideostreambycontainer.h b/core/include/JellyfinQt/loader/http/headvideostreambycontainer.h index 1cef4aa..bcfe718 100644 --- a/core/include/JellyfinQt/loader/http/headvideostreambycontainer.h +++ b/core/include/JellyfinQt/loader/http/headvideostreambycontainer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/initiate.h b/core/include/JellyfinQt/loader/http/initiate.h index 276b5e0..eb2d389 100644 --- a/core/include/JellyfinQt/loader/http/initiate.h +++ b/core/include/JellyfinQt/loader/http/initiate.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/quickconnectresult.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Initiate a new quick connect request. */ -class InitiateLoader : public Jellyfin::Support::HttpLoader { + +class InitiateLoader : public Jellyfin::Support::HttpLoader { public: explicit InitiateLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/installpackage.h b/core/include/JellyfinQt/loader/http/installpackage.h index effbd34..34d30be 100644 --- a/core/include/JellyfinQt/loader/http/installpackage.h +++ b/core/include/JellyfinQt/loader/http/installpackage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/markfavoriteitem.h b/core/include/JellyfinQt/loader/http/markfavoriteitem.h index c49ebbd..24b38ba 100644 --- a/core/include/JellyfinQt/loader/http/markfavoriteitem.h +++ b/core/include/JellyfinQt/loader/http/markfavoriteitem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Marks an item as a favorite. */ -class MarkFavoriteItemLoader : public Jellyfin::Support::HttpLoader { + +class MarkFavoriteItemLoader : public Jellyfin::Support::HttpLoader { public: explicit MarkFavoriteItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/markplayeditem.h b/core/include/JellyfinQt/loader/http/markplayeditem.h index 94dedef..2a8dd78 100644 --- a/core/include/JellyfinQt/loader/http/markplayeditem.h +++ b/core/include/JellyfinQt/loader/http/markplayeditem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Marks an item as played for user. */ -class MarkPlayedItemLoader : public Jellyfin::Support::HttpLoader { + +class MarkPlayedItemLoader : public Jellyfin::Support::HttpLoader { public: explicit MarkPlayedItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/markunplayeditem.h b/core/include/JellyfinQt/loader/http/markunplayeditem.h index 3f89bcc..cd858f1 100644 --- a/core/include/JellyfinQt/loader/http/markunplayeditem.h +++ b/core/include/JellyfinQt/loader/http/markunplayeditem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Marks an item as unplayed for user. */ -class MarkUnplayedItemLoader : public Jellyfin::Support::HttpLoader { + +class MarkUnplayedItemLoader : public Jellyfin::Support::HttpLoader { public: explicit MarkUnplayedItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/mergeversions.h b/core/include/JellyfinQt/loader/http/mergeversions.h index 21c0160..22d328f 100644 --- a/core/include/JellyfinQt/loader/http/mergeversions.h +++ b/core/include/JellyfinQt/loader/http/mergeversions.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/moveitem.h b/core/include/JellyfinQt/loader/http/moveitem.h index 5825361..eea925d 100644 --- a/core/include/JellyfinQt/loader/http/moveitem.h +++ b/core/include/JellyfinQt/loader/http/moveitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/onplaybackprogress.h b/core/include/JellyfinQt/loader/http/onplaybackprogress.h index ac91e9f..e483dd5 100644 --- a/core/include/JellyfinQt/loader/http/onplaybackprogress.h +++ b/core/include/JellyfinQt/loader/http/onplaybackprogress.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/onplaybackstart.h b/core/include/JellyfinQt/loader/http/onplaybackstart.h index 3878e91..2f41e4a 100644 --- a/core/include/JellyfinQt/loader/http/onplaybackstart.h +++ b/core/include/JellyfinQt/loader/http/onplaybackstart.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/onplaybackstopped.h b/core/include/JellyfinQt/loader/http/onplaybackstopped.h index bf35221..1023179 100644 --- a/core/include/JellyfinQt/loader/http/onplaybackstopped.h +++ b/core/include/JellyfinQt/loader/http/onplaybackstopped.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/openlivestream.h b/core/include/JellyfinQt/loader/http/openlivestream.h index ab65af1..0abd0b7 100644 --- a/core/include/JellyfinQt/loader/http/openlivestream.h +++ b/core/include/JellyfinQt/loader/http/openlivestream.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/livestreamresponse.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Opens a media source. */ -class OpenLiveStreamLoader : public Jellyfin::Support::HttpLoader { + +class OpenLiveStreamLoader : public Jellyfin::Support::HttpLoader { public: explicit OpenLiveStreamLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/pingplaybacksession.h b/core/include/JellyfinQt/loader/http/pingplaybacksession.h index 3b1ef16..9322be4 100644 --- a/core/include/JellyfinQt/loader/http/pingplaybacksession.h +++ b/core/include/JellyfinQt/loader/http/pingplaybacksession.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/play.h b/core/include/JellyfinQt/loader/http/play.h index 38fb7e8..e07c3c7 100644 --- a/core/include/JellyfinQt/loader/http/play.h +++ b/core/include/JellyfinQt/loader/http/play.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/post.h b/core/include/JellyfinQt/loader/http/post.h index 73ce801..bf26af3 100644 --- a/core/include/JellyfinQt/loader/http/post.h +++ b/core/include/JellyfinQt/loader/http/post.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postaddedmovies.h b/core/include/JellyfinQt/loader/http/postaddedmovies.h index 60d3939..e157189 100644 --- a/core/include/JellyfinQt/loader/http/postaddedmovies.h +++ b/core/include/JellyfinQt/loader/http/postaddedmovies.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postaddedseries.h b/core/include/JellyfinQt/loader/http/postaddedseries.h index 4da6749..aa8ebce 100644 --- a/core/include/JellyfinQt/loader/http/postaddedseries.h +++ b/core/include/JellyfinQt/loader/http/postaddedseries.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postcapabilities.h b/core/include/JellyfinQt/loader/http/postcapabilities.h index ab27f8c..ce44c45 100644 --- a/core/include/JellyfinQt/loader/http/postcapabilities.h +++ b/core/include/JellyfinQt/loader/http/postcapabilities.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postfullcapabilities.h b/core/include/JellyfinQt/loader/http/postfullcapabilities.h index 5c816c3..05d36e6 100644 --- a/core/include/JellyfinQt/loader/http/postfullcapabilities.h +++ b/core/include/JellyfinQt/loader/http/postfullcapabilities.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postpingsystem.h b/core/include/JellyfinQt/loader/http/postpingsystem.h index 99de177..c3d2bf7 100644 --- a/core/include/JellyfinQt/loader/http/postpingsystem.h +++ b/core/include/JellyfinQt/loader/http/postpingsystem.h @@ -35,13 +35,29 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Pings the system. + */ + +class PostPingSystemLoader : public Jellyfin::Support::HttpLoader { +public: + explicit PostPingSystemLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const PostPingSystemParams& parameters) const override; + QUrlQuery query(const PostPingSystemParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/postupdatedmedia.h b/core/include/JellyfinQt/loader/http/postupdatedmedia.h index 25978cb..1d3c843 100644 --- a/core/include/JellyfinQt/loader/http/postupdatedmedia.h +++ b/core/include/JellyfinQt/loader/http/postupdatedmedia.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postupdatedmovies.h b/core/include/JellyfinQt/loader/http/postupdatedmovies.h index 36299c2..f5c3bf2 100644 --- a/core/include/JellyfinQt/loader/http/postupdatedmovies.h +++ b/core/include/JellyfinQt/loader/http/postupdatedmovies.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postupdatedseries.h b/core/include/JellyfinQt/loader/http/postupdatedseries.h index 55f44e7..24a27b8 100644 --- a/core/include/JellyfinQt/loader/http/postupdatedseries.h +++ b/core/include/JellyfinQt/loader/http/postupdatedseries.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postuserimage.h b/core/include/JellyfinQt/loader/http/postuserimage.h index 9ead83b..dc81c7f 100644 --- a/core/include/JellyfinQt/loader/http/postuserimage.h +++ b/core/include/JellyfinQt/loader/http/postuserimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/postuserimagebyindex.h b/core/include/JellyfinQt/loader/http/postuserimagebyindex.h index 7264d71..0001fea 100644 --- a/core/include/JellyfinQt/loader/http/postuserimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/postuserimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/processconnectionmanagercontrolrequest.h b/core/include/JellyfinQt/loader/http/processconnectionmanagercontrolrequest.h index 198787a..70a6d73 100644 --- a/core/include/JellyfinQt/loader/http/processconnectionmanagercontrolrequest.h +++ b/core/include/JellyfinQt/loader/http/processconnectionmanagercontrolrequest.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/processcontentdirectorycontrolrequest.h b/core/include/JellyfinQt/loader/http/processcontentdirectorycontrolrequest.h index 377ea6e..3b7064d 100644 --- a/core/include/JellyfinQt/loader/http/processcontentdirectorycontrolrequest.h +++ b/core/include/JellyfinQt/loader/http/processcontentdirectorycontrolrequest.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/processmediareceiverregistrarcontrolrequest.h b/core/include/JellyfinQt/loader/http/processmediareceiverregistrarcontrolrequest.h index cba7bc8..cd5783b 100644 --- a/core/include/JellyfinQt/loader/http/processmediareceiverregistrarcontrolrequest.h +++ b/core/include/JellyfinQt/loader/http/processmediareceiverregistrarcontrolrequest.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/refreshlibrary.h b/core/include/JellyfinQt/loader/http/refreshlibrary.h index de2d496..71757d1 100644 --- a/core/include/JellyfinQt/loader/http/refreshlibrary.h +++ b/core/include/JellyfinQt/loader/http/refreshlibrary.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/removefromcollection.h b/core/include/JellyfinQt/loader/http/removefromcollection.h index f2e847d..5fe9ec6 100644 --- a/core/include/JellyfinQt/loader/http/removefromcollection.h +++ b/core/include/JellyfinQt/loader/http/removefromcollection.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/removefromplaylist.h b/core/include/JellyfinQt/loader/http/removefromplaylist.h index 50a8096..bfba7cd 100644 --- a/core/include/JellyfinQt/loader/http/removefromplaylist.h +++ b/core/include/JellyfinQt/loader/http/removefromplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/removemediapath.h b/core/include/JellyfinQt/loader/http/removemediapath.h index 1d971b5..271475b 100644 --- a/core/include/JellyfinQt/loader/http/removemediapath.h +++ b/core/include/JellyfinQt/loader/http/removemediapath.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/removeuserfromsession.h b/core/include/JellyfinQt/loader/http/removeuserfromsession.h index faf1f3e..2182a35 100644 --- a/core/include/JellyfinQt/loader/http/removeuserfromsession.h +++ b/core/include/JellyfinQt/loader/http/removeuserfromsession.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/removevirtualfolder.h b/core/include/JellyfinQt/loader/http/removevirtualfolder.h index feb096c..94bcb15 100644 --- a/core/include/JellyfinQt/loader/http/removevirtualfolder.h +++ b/core/include/JellyfinQt/loader/http/removevirtualfolder.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/renamevirtualfolder.h b/core/include/JellyfinQt/loader/http/renamevirtualfolder.h index 618177b..0b3c407 100644 --- a/core/include/JellyfinQt/loader/http/renamevirtualfolder.h +++ b/core/include/JellyfinQt/loader/http/renamevirtualfolder.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/reportplaybackprogress.h b/core/include/JellyfinQt/loader/http/reportplaybackprogress.h index 5d42968..7422b30 100644 --- a/core/include/JellyfinQt/loader/http/reportplaybackprogress.h +++ b/core/include/JellyfinQt/loader/http/reportplaybackprogress.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/reportplaybackstart.h b/core/include/JellyfinQt/loader/http/reportplaybackstart.h index f61ffd8..451c30b 100644 --- a/core/include/JellyfinQt/loader/http/reportplaybackstart.h +++ b/core/include/JellyfinQt/loader/http/reportplaybackstart.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/reportplaybackstopped.h b/core/include/JellyfinQt/loader/http/reportplaybackstopped.h index ba7b454..90c09d8 100644 --- a/core/include/JellyfinQt/loader/http/reportplaybackstopped.h +++ b/core/include/JellyfinQt/loader/http/reportplaybackstopped.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/reportsessionended.h b/core/include/JellyfinQt/loader/http/reportsessionended.h index fa8400f..643f9fc 100644 --- a/core/include/JellyfinQt/loader/http/reportsessionended.h +++ b/core/include/JellyfinQt/loader/http/reportsessionended.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/reportviewing.h b/core/include/JellyfinQt/loader/http/reportviewing.h index b945447..3dd80c1 100644 --- a/core/include/JellyfinQt/loader/http/reportviewing.h +++ b/core/include/JellyfinQt/loader/http/reportviewing.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/resettuner.h b/core/include/JellyfinQt/loader/http/resettuner.h index 3926b97..f402a5a 100644 --- a/core/include/JellyfinQt/loader/http/resettuner.h +++ b/core/include/JellyfinQt/loader/http/resettuner.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/restartapplication.h b/core/include/JellyfinQt/loader/http/restartapplication.h index fe23490..e62fab7 100644 --- a/core/include/JellyfinQt/loader/http/restartapplication.h +++ b/core/include/JellyfinQt/loader/http/restartapplication.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/revokekey.h b/core/include/JellyfinQt/loader/http/revokekey.h index 9eb0412..a8af4cf 100644 --- a/core/include/JellyfinQt/loader/http/revokekey.h +++ b/core/include/JellyfinQt/loader/http/revokekey.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/searchremotesubtitles.h b/core/include/JellyfinQt/loader/http/searchremotesubtitles.h index 5c4e1bc..1be3062 100644 --- a/core/include/JellyfinQt/loader/http/searchremotesubtitles.h +++ b/core/include/JellyfinQt/loader/http/searchremotesubtitles.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/remotesubtitleinfo.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Search remote subtitles. + */ + +class SearchRemoteSubtitlesLoader : public Jellyfin::Support::HttpLoader, SearchRemoteSubtitlesParams> { +public: + explicit SearchRemoteSubtitlesLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SearchRemoteSubtitlesParams& parameters) const override; + QUrlQuery query(const SearchRemoteSubtitlesParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/sendfullgeneralcommand.h b/core/include/JellyfinQt/loader/http/sendfullgeneralcommand.h index 7a4280b..0282772 100644 --- a/core/include/JellyfinQt/loader/http/sendfullgeneralcommand.h +++ b/core/include/JellyfinQt/loader/http/sendfullgeneralcommand.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/sendgeneralcommand.h b/core/include/JellyfinQt/loader/http/sendgeneralcommand.h index 825af46..d22d495 100644 --- a/core/include/JellyfinQt/loader/http/sendgeneralcommand.h +++ b/core/include/JellyfinQt/loader/http/sendgeneralcommand.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/sendmessagecommand.h b/core/include/JellyfinQt/loader/http/sendmessagecommand.h index b70cf30..4b2a718 100644 --- a/core/include/JellyfinQt/loader/http/sendmessagecommand.h +++ b/core/include/JellyfinQt/loader/http/sendmessagecommand.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/sendplaystatecommand.h b/core/include/JellyfinQt/loader/http/sendplaystatecommand.h index 2bad853..c96745b 100644 --- a/core/include/JellyfinQt/loader/http/sendplaystatecommand.h +++ b/core/include/JellyfinQt/loader/http/sendplaystatecommand.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/sendsystemcommand.h b/core/include/JellyfinQt/loader/http/sendsystemcommand.h index a5d0959..e38786a 100644 --- a/core/include/JellyfinQt/loader/http/sendsystemcommand.h +++ b/core/include/JellyfinQt/loader/http/sendsystemcommand.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setchannelmapping.h b/core/include/JellyfinQt/loader/http/setchannelmapping.h index fd2da23..dbbfe99 100644 --- a/core/include/JellyfinQt/loader/http/setchannelmapping.h +++ b/core/include/JellyfinQt/loader/http/setchannelmapping.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/tunerchannelmapping.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Set channel mappings. */ -class SetChannelMappingLoader : public Jellyfin::Support::HttpLoader { + +class SetChannelMappingLoader : public Jellyfin::Support::HttpLoader { public: explicit SetChannelMappingLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/setitemimage.h b/core/include/JellyfinQt/loader/http/setitemimage.h index 906f91d..7a8c682 100644 --- a/core/include/JellyfinQt/loader/http/setitemimage.h +++ b/core/include/JellyfinQt/loader/http/setitemimage.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setitemimagebyindex.h b/core/include/JellyfinQt/loader/http/setitemimagebyindex.h index 154e2d3..2ba431b 100644 --- a/core/include/JellyfinQt/loader/http/setitemimagebyindex.h +++ b/core/include/JellyfinQt/loader/http/setitemimagebyindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setread.h b/core/include/JellyfinQt/loader/http/setread.h index 3a53af1..58ed621 100644 --- a/core/include/JellyfinQt/loader/http/setread.h +++ b/core/include/JellyfinQt/loader/http/setread.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setremoteaccess.h b/core/include/JellyfinQt/loader/http/setremoteaccess.h index efd5087..61a8033 100644 --- a/core/include/JellyfinQt/loader/http/setremoteaccess.h +++ b/core/include/JellyfinQt/loader/http/setremoteaccess.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setrepositories.h b/core/include/JellyfinQt/loader/http/setrepositories.h index fa58628..a5fb588 100644 --- a/core/include/JellyfinQt/loader/http/setrepositories.h +++ b/core/include/JellyfinQt/loader/http/setrepositories.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/setunread.h b/core/include/JellyfinQt/loader/http/setunread.h index 30e77ab..be2fa6b 100644 --- a/core/include/JellyfinQt/loader/http/setunread.h +++ b/core/include/JellyfinQt/loader/http/setunread.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/shutdownapplication.h b/core/include/JellyfinQt/loader/http/shutdownapplication.h index aba670e..c7fbfb0 100644 --- a/core/include/JellyfinQt/loader/http/shutdownapplication.h +++ b/core/include/JellyfinQt/loader/http/shutdownapplication.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/starttask.h b/core/include/JellyfinQt/loader/http/starttask.h index 7f7246f..8d7e49a 100644 --- a/core/include/JellyfinQt/loader/http/starttask.h +++ b/core/include/JellyfinQt/loader/http/starttask.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/stopencodingprocess.h b/core/include/JellyfinQt/loader/http/stopencodingprocess.h index 34c9309..bc9dfcd 100644 --- a/core/include/JellyfinQt/loader/http/stopencodingprocess.h +++ b/core/include/JellyfinQt/loader/http/stopencodingprocess.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/stoptask.h b/core/include/JellyfinQt/loader/http/stoptask.h index ce00e08..890ad9c 100644 --- a/core/include/JellyfinQt/loader/http/stoptask.h +++ b/core/include/JellyfinQt/loader/http/stoptask.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaybuffering.h b/core/include/JellyfinQt/loader/http/syncplaybuffering.h index 1e33f13..81f703b 100644 --- a/core/include/JellyfinQt/loader/http/syncplaybuffering.h +++ b/core/include/JellyfinQt/loader/http/syncplaybuffering.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaycreategroup.h b/core/include/JellyfinQt/loader/http/syncplaycreategroup.h index 5f9d117..509c827 100644 --- a/core/include/JellyfinQt/loader/http/syncplaycreategroup.h +++ b/core/include/JellyfinQt/loader/http/syncplaycreategroup.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaygetgroups.h b/core/include/JellyfinQt/loader/http/syncplaygetgroups.h index 5e21335..667d117 100644 --- a/core/include/JellyfinQt/loader/http/syncplaygetgroups.h +++ b/core/include/JellyfinQt/loader/http/syncplaygetgroups.h @@ -35,13 +35,30 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +#include "JellyfinQt/dto/groupinfodto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +/** + * @brief Gets all SyncPlay groups. + */ + +class SyncPlayGetGroupsLoader : public Jellyfin::Support::HttpLoader, SyncPlayGetGroupsParams> { +public: + explicit SyncPlayGetGroupsLoader(ApiClient *apiClient = nullptr); + +protected: + QString path(const SyncPlayGetGroupsParams& parameters) const override; + QUrlQuery query(const SyncPlayGetGroupsParams& parameters) const override; +}; } // NS HTTP } // NS Loader diff --git a/core/include/JellyfinQt/loader/http/syncplayjoingroup.h b/core/include/JellyfinQt/loader/http/syncplayjoingroup.h index 9646c60..4f8dbb9 100644 --- a/core/include/JellyfinQt/loader/http/syncplayjoingroup.h +++ b/core/include/JellyfinQt/loader/http/syncplayjoingroup.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayleavegroup.h b/core/include/JellyfinQt/loader/http/syncplayleavegroup.h index a9c4738..42722df 100644 --- a/core/include/JellyfinQt/loader/http/syncplayleavegroup.h +++ b/core/include/JellyfinQt/loader/http/syncplayleavegroup.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaymoveplaylistitem.h b/core/include/JellyfinQt/loader/http/syncplaymoveplaylistitem.h index 43a5359..4c61fe5 100644 --- a/core/include/JellyfinQt/loader/http/syncplaymoveplaylistitem.h +++ b/core/include/JellyfinQt/loader/http/syncplaymoveplaylistitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaynextitem.h b/core/include/JellyfinQt/loader/http/syncplaynextitem.h index 11db89d..09d7c95 100644 --- a/core/include/JellyfinQt/loader/http/syncplaynextitem.h +++ b/core/include/JellyfinQt/loader/http/syncplaynextitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaypause.h b/core/include/JellyfinQt/loader/http/syncplaypause.h index 4c43931..9993716 100644 --- a/core/include/JellyfinQt/loader/http/syncplaypause.h +++ b/core/include/JellyfinQt/loader/http/syncplaypause.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayping.h b/core/include/JellyfinQt/loader/http/syncplayping.h index 2d6f606..6c0bf1f 100644 --- a/core/include/JellyfinQt/loader/http/syncplayping.h +++ b/core/include/JellyfinQt/loader/http/syncplayping.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaypreviousitem.h b/core/include/JellyfinQt/loader/http/syncplaypreviousitem.h index 5eb61d9..e824aa9 100644 --- a/core/include/JellyfinQt/loader/http/syncplaypreviousitem.h +++ b/core/include/JellyfinQt/loader/http/syncplaypreviousitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayqueue.h b/core/include/JellyfinQt/loader/http/syncplayqueue.h index 58ffed1..5ff4a21 100644 --- a/core/include/JellyfinQt/loader/http/syncplayqueue.h +++ b/core/include/JellyfinQt/loader/http/syncplayqueue.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayready.h b/core/include/JellyfinQt/loader/http/syncplayready.h index 32ada80..8eca0fb 100644 --- a/core/include/JellyfinQt/loader/http/syncplayready.h +++ b/core/include/JellyfinQt/loader/http/syncplayready.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayremovefromplaylist.h b/core/include/JellyfinQt/loader/http/syncplayremovefromplaylist.h index 801cb1f..fb397b4 100644 --- a/core/include/JellyfinQt/loader/http/syncplayremovefromplaylist.h +++ b/core/include/JellyfinQt/loader/http/syncplayremovefromplaylist.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayseek.h b/core/include/JellyfinQt/loader/http/syncplayseek.h index f551fd6..61b082c 100644 --- a/core/include/JellyfinQt/loader/http/syncplayseek.h +++ b/core/include/JellyfinQt/loader/http/syncplayseek.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaysetignorewait.h b/core/include/JellyfinQt/loader/http/syncplaysetignorewait.h index dd16eab..e3ad786 100644 --- a/core/include/JellyfinQt/loader/http/syncplaysetignorewait.h +++ b/core/include/JellyfinQt/loader/http/syncplaysetignorewait.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaysetnewqueue.h b/core/include/JellyfinQt/loader/http/syncplaysetnewqueue.h index d7e0fc7..6b09b4e 100644 --- a/core/include/JellyfinQt/loader/http/syncplaysetnewqueue.h +++ b/core/include/JellyfinQt/loader/http/syncplaysetnewqueue.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaysetplaylistitem.h b/core/include/JellyfinQt/loader/http/syncplaysetplaylistitem.h index b4a68bd..ad446e2 100644 --- a/core/include/JellyfinQt/loader/http/syncplaysetplaylistitem.h +++ b/core/include/JellyfinQt/loader/http/syncplaysetplaylistitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaysetrepeatmode.h b/core/include/JellyfinQt/loader/http/syncplaysetrepeatmode.h index de88f77..eaafc33 100644 --- a/core/include/JellyfinQt/loader/http/syncplaysetrepeatmode.h +++ b/core/include/JellyfinQt/loader/http/syncplaysetrepeatmode.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaysetshufflemode.h b/core/include/JellyfinQt/loader/http/syncplaysetshufflemode.h index 8b76c84..cd0d972 100644 --- a/core/include/JellyfinQt/loader/http/syncplaysetshufflemode.h +++ b/core/include/JellyfinQt/loader/http/syncplaysetshufflemode.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplaystop.h b/core/include/JellyfinQt/loader/http/syncplaystop.h index fc344c4..6eed52f 100644 --- a/core/include/JellyfinQt/loader/http/syncplaystop.h +++ b/core/include/JellyfinQt/loader/http/syncplaystop.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/syncplayunpause.h b/core/include/JellyfinQt/loader/http/syncplayunpause.h index 2024dc5..6e900d1 100644 --- a/core/include/JellyfinQt/loader/http/syncplayunpause.h +++ b/core/include/JellyfinQt/loader/http/syncplayunpause.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/uninstallplugin.h b/core/include/JellyfinQt/loader/http/uninstallplugin.h index 5749a0c..46c74f3 100644 --- a/core/include/JellyfinQt/loader/http/uninstallplugin.h +++ b/core/include/JellyfinQt/loader/http/uninstallplugin.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/uninstallpluginbyversion.h b/core/include/JellyfinQt/loader/http/uninstallpluginbyversion.h index 00b396f..edfb40e 100644 --- a/core/include/JellyfinQt/loader/http/uninstallpluginbyversion.h +++ b/core/include/JellyfinQt/loader/http/uninstallpluginbyversion.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/unmarkfavoriteitem.h b/core/include/JellyfinQt/loader/http/unmarkfavoriteitem.h index db61c99..3711c6c 100644 --- a/core/include/JellyfinQt/loader/http/unmarkfavoriteitem.h +++ b/core/include/JellyfinQt/loader/http/unmarkfavoriteitem.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Unmarks item as a favorite. */ -class UnmarkFavoriteItemLoader : public Jellyfin::Support::HttpLoader { + +class UnmarkFavoriteItemLoader : public Jellyfin::Support::HttpLoader { public: explicit UnmarkFavoriteItemLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/updateconfiguration.h b/core/include/JellyfinQt/loader/http/updateconfiguration.h index f524c37..0d30e0b 100644 --- a/core/include/JellyfinQt/loader/http/updateconfiguration.h +++ b/core/include/JellyfinQt/loader/http/updateconfiguration.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatedeviceoptions.h b/core/include/JellyfinQt/loader/http/updatedeviceoptions.h index b950453..875b7f1 100644 --- a/core/include/JellyfinQt/loader/http/updatedeviceoptions.h +++ b/core/include/JellyfinQt/loader/http/updatedeviceoptions.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatedisplaypreferences.h b/core/include/JellyfinQt/loader/http/updatedisplaypreferences.h index 7c45fb4..1c14c40 100644 --- a/core/include/JellyfinQt/loader/http/updatedisplaypreferences.h +++ b/core/include/JellyfinQt/loader/http/updatedisplaypreferences.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateinitialconfiguration.h b/core/include/JellyfinQt/loader/http/updateinitialconfiguration.h index fb3943e..33c4147 100644 --- a/core/include/JellyfinQt/loader/http/updateinitialconfiguration.h +++ b/core/include/JellyfinQt/loader/http/updateinitialconfiguration.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateitem.h b/core/include/JellyfinQt/loader/http/updateitem.h index 27819e8..94a09c2 100644 --- a/core/include/JellyfinQt/loader/http/updateitem.h +++ b/core/include/JellyfinQt/loader/http/updateitem.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateitemcontenttype.h b/core/include/JellyfinQt/loader/http/updateitemcontenttype.h index 4384d29..46e58f3 100644 --- a/core/include/JellyfinQt/loader/http/updateitemcontenttype.h +++ b/core/include/JellyfinQt/loader/http/updateitemcontenttype.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateitemimageindex.h b/core/include/JellyfinQt/loader/http/updateitemimageindex.h index dcccde8..9734a0a 100644 --- a/core/include/JellyfinQt/loader/http/updateitemimageindex.h +++ b/core/include/JellyfinQt/loader/http/updateitemimageindex.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatelibraryoptions.h b/core/include/JellyfinQt/loader/http/updatelibraryoptions.h index d74bdaf..b835117 100644 --- a/core/include/JellyfinQt/loader/http/updatelibraryoptions.h +++ b/core/include/JellyfinQt/loader/http/updatelibraryoptions.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatemediaencoderpath.h b/core/include/JellyfinQt/loader/http/updatemediaencoderpath.h index f0046c8..4877d24 100644 --- a/core/include/JellyfinQt/loader/http/updatemediaencoderpath.h +++ b/core/include/JellyfinQt/loader/http/updatemediaencoderpath.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatemediapath.h b/core/include/JellyfinQt/loader/http/updatemediapath.h index 393e347..608c91f 100644 --- a/core/include/JellyfinQt/loader/http/updatemediapath.h +++ b/core/include/JellyfinQt/loader/http/updatemediapath.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatenamedconfiguration.h b/core/include/JellyfinQt/loader/http/updatenamedconfiguration.h index b0b9a2b..a386a92 100644 --- a/core/include/JellyfinQt/loader/http/updatenamedconfiguration.h +++ b/core/include/JellyfinQt/loader/http/updatenamedconfiguration.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatepluginconfiguration.h b/core/include/JellyfinQt/loader/http/updatepluginconfiguration.h index f2387e2..348282b 100644 --- a/core/include/JellyfinQt/loader/http/updatepluginconfiguration.h +++ b/core/include/JellyfinQt/loader/http/updatepluginconfiguration.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatepluginsecurityinfo.h b/core/include/JellyfinQt/loader/http/updatepluginsecurityinfo.h index adb8280..8988ccd 100644 --- a/core/include/JellyfinQt/loader/http/updatepluginsecurityinfo.h +++ b/core/include/JellyfinQt/loader/http/updatepluginsecurityinfo.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateprofile.h b/core/include/JellyfinQt/loader/http/updateprofile.h index 9b9b211..aa3dd29 100644 --- a/core/include/JellyfinQt/loader/http/updateprofile.h +++ b/core/include/JellyfinQt/loader/http/updateprofile.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateseriestimer.h b/core/include/JellyfinQt/loader/http/updateseriestimer.h index 61d7249..2120ada 100644 --- a/core/include/JellyfinQt/loader/http/updateseriestimer.h +++ b/core/include/JellyfinQt/loader/http/updateseriestimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatestartupuser.h b/core/include/JellyfinQt/loader/http/updatestartupuser.h index 48cd032..12b01ce 100644 --- a/core/include/JellyfinQt/loader/http/updatestartupuser.h +++ b/core/include/JellyfinQt/loader/http/updatestartupuser.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatetask.h b/core/include/JellyfinQt/loader/http/updatetask.h index 232777f..b28d8d5 100644 --- a/core/include/JellyfinQt/loader/http/updatetask.h +++ b/core/include/JellyfinQt/loader/http/updatetask.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updatetimer.h b/core/include/JellyfinQt/loader/http/updatetimer.h index 63e1e36..29de7f1 100644 --- a/core/include/JellyfinQt/loader/http/updatetimer.h +++ b/core/include/JellyfinQt/loader/http/updatetimer.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateuser.h b/core/include/JellyfinQt/loader/http/updateuser.h index 30193b8..9f019aa 100644 --- a/core/include/JellyfinQt/loader/http/updateuser.h +++ b/core/include/JellyfinQt/loader/http/updateuser.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateuserconfiguration.h b/core/include/JellyfinQt/loader/http/updateuserconfiguration.h index 7ed59f2..961685c 100644 --- a/core/include/JellyfinQt/loader/http/updateuserconfiguration.h +++ b/core/include/JellyfinQt/loader/http/updateuserconfiguration.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateusereasypassword.h b/core/include/JellyfinQt/loader/http/updateusereasypassword.h index 0066470..e3bfe8d 100644 --- a/core/include/JellyfinQt/loader/http/updateusereasypassword.h +++ b/core/include/JellyfinQt/loader/http/updateusereasypassword.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateuseritemrating.h b/core/include/JellyfinQt/loader/http/updateuseritemrating.h index a0874f7..3bad6d5 100644 --- a/core/include/JellyfinQt/loader/http/updateuseritemrating.h +++ b/core/include/JellyfinQt/loader/http/updateuseritemrating.h @@ -35,17 +35,23 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" #include "JellyfinQt/dto/useritemdatadto.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { + +using namespace Jellyfin::DTO; /** * @brief Updates a user's rating for an item. */ -class UpdateUserItemRatingLoader : public Jellyfin::Support::HttpLoader { + +class UpdateUserItemRatingLoader : public Jellyfin::Support::HttpLoader { public: explicit UpdateUserItemRatingLoader(ApiClient *apiClient = nullptr); diff --git a/core/include/JellyfinQt/loader/http/updateuserpassword.h b/core/include/JellyfinQt/loader/http/updateuserpassword.h index 0efcadc..5f14328 100644 --- a/core/include/JellyfinQt/loader/http/updateuserpassword.h +++ b/core/include/JellyfinQt/loader/http/updateuserpassword.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/updateuserpolicy.h b/core/include/JellyfinQt/loader/http/updateuserpolicy.h index e0ce1f9..0fcb4dc 100644 --- a/core/include/JellyfinQt/loader/http/updateuserpolicy.h +++ b/core/include/JellyfinQt/loader/http/updateuserpolicy.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/uploadsubtitle.h b/core/include/JellyfinQt/loader/http/uploadsubtitle.h index da7988a..922f302 100644 --- a/core/include/JellyfinQt/loader/http/uploadsubtitle.h +++ b/core/include/JellyfinQt/loader/http/uploadsubtitle.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/http/validatepath.h b/core/include/JellyfinQt/loader/http/validatepath.h index a68f327..4db31b3 100644 --- a/core/include/JellyfinQt/loader/http/validatepath.h +++ b/core/include/JellyfinQt/loader/http/validatepath.h @@ -35,8 +35,11 @@ #include "JellyfinQt/support/jsonconv.h" #include "JellyfinQt/support/loader.h" #include "JellyfinQt/loader/requesttypes.h" -#include "JellyfinQt/apiclient.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { namespace HTTP { diff --git a/core/include/JellyfinQt/loader/requesttypes.h b/core/include/JellyfinQt/loader/requesttypes.h index 6099466..443acb2 100644 --- a/core/include/JellyfinQt/loader/requesttypes.h +++ b/core/include/JellyfinQt/loader/requesttypes.h @@ -59,6 +59,10 @@ #include "JellyfinQt/dto/version.h" #include "JellyfinQt/dto/videotype.h" +namespace Jellyfin { +// Forward declaration +class ApiClient; +} namespace Jellyfin { namespace Loader { @@ -3019,7 +3023,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -3517,7 +3521,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -5807,7 +5811,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -6405,7 +6409,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -10193,7 +10197,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -11377,7 +11381,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -11875,7 +11879,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -19027,7 +19031,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -19517,7 +19521,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -20017,7 +20021,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -20523,7 +20527,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -21415,7 +21419,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -21913,7 +21917,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -23293,7 +23297,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -23791,7 +23795,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -25897,7 +25901,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; @@ -26403,7 +26407,7 @@ private: std::optional m_segmentLength = std::nullopt; std::optional m_startTimeTicks = std::nullopt; std::optional m_staticStreaming = std::nullopt; - std::optional m_streamOptions = std::nullopt; + QJsonObject m_streamOptions; QString m_subtitleCodec; SubtitleDeliveryMethod m_subtitleMethod; std::optional m_subtitleStreamIndex = std::nullopt; diff --git a/core/include/JellyfinQt/deviceprofile.h b/core/include/JellyfinQt/model/deviceprofile.h similarity index 90% rename from core/include/JellyfinQt/deviceprofile.h rename to core/include/JellyfinQt/model/deviceprofile.h index cc3e1a0..dc69146 100644 --- a/core/include/JellyfinQt/deviceprofile.h +++ b/core/include/JellyfinQt/model/deviceprofile.h @@ -17,8 +17,8 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef JELLYFIN_DEVICE_PROFILE_H -#define JELLYFIN_DEVICE_PROFILE_H +#ifndef JELLYFIN_MODEL_DEVICEPROFILE_H +#define JELLYFIN_MODEL_DEVICEPROFILE_H #include #include @@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include namespace Jellyfin { +namespace Model { namespace DeviceProfile { QJsonObject generateProfile(); // Transport @@ -48,5 +49,6 @@ namespace DeviceProfile { bool supportsMp3VideoAudio(); } } +} -#endif // JELLYFIN_DEVICE_PROFILE_H +#endif // JELLYFIN_MODEL_DEVICEPROFILE_H diff --git a/core/include/JellyfinQt/support/jsonconv.h b/core/include/JellyfinQt/support/jsonconv.h index 4f47a99..1d78231 100644 --- a/core/include/JellyfinQt/support/jsonconv.h +++ b/core/include/JellyfinQt/support/jsonconv.h @@ -19,12 +19,12 @@ #ifndef JELLYFIN_SUPPORT_JSONCONV_H #define JELLYFIN_SUPPORT_JSONCONV_H -#include -#include +#include #include #include #include +#include #include #include #include @@ -39,47 +39,116 @@ QUuid stringToUuid(const QString &source); /** * @brief Thrown when JSON cannot be parsed. */ -class ParseException : public std::runtime_error { +class ParseException : public QException { public: - explicit ParseException(const char *message) - : std::runtime_error(message) {} + explicit ParseException(const QString &message) + : m_message(message.toStdString()) {} + + /*explicit ParseException(const ParseException &other) + : m_message(other.m_message) {}*/ + + virtual const char *what() const noexcept override; + + virtual QException *clone() const override; + virtual void raise() const override; +private: + std::string m_message; }; +// https://www.fluentcpp.com/2017/08/15/function-templates-partial-specialization-cpp/ +template +struct convertType{}; + /** * Template for converting types from JSON into their respective type. */ template -T fromJsonValue(const QJsonValue &source) { +T fromJsonValue(const QJsonValue &source, convertType) { Q_UNUSED(source) Q_ASSERT_X(false, "fromJsonValue", "fromJsonValue called with unimplemented type"); } + template -QJsonValue toJsonValue(const T &source) { +QJsonValue toJsonValue(const T &source, convertType) { Q_UNUSED(source) - Q_ASSERT_X(false, "toJsonValue", "toJsonValue called with unimplemented type"); + std::string msg = "toJsonValue called with unimplemented type "; + msg += typeid (T).name(); + Q_ASSERT_X(false, "toJsonValue", msg.c_str()); + return QJsonValue(); +} + +template +T fromJsonValue(const QJsonValue &source) { + return fromJsonValue(source, convertType{}); +} + + +template +QJsonValue toJsonValue(const T &source) { + return toJsonValue(source, convertType{}); } // QList template -QList fromJsonValue(const QJsonArray &source) { +QList fromJsonValue(const QJsonValue &source, convertType>) { QList result; - result.reserve(source.size()); - for (auto it = source.cbegin(); it != source.cend(); it++) { + QJsonArray arr = source.toArray(); + result.reserve(arr.size()); + for (auto it = arr.cbegin(); it != arr.cend(); it++) { result.append(fromJsonValue(*it)); } return result; } template -QJsonValue toJsonValue(const QList &source) { +QJsonValue toJsonValue(const QList &source, convertType>) { QJsonArray result; for (auto it = source.cbegin(); it != source.cend(); it++) { - result.push_back(*it); + result.push_back(toJsonValue(*it)); } return result; } +// Optional + +template +std::optional fromJsonValue(const QJsonValue &source, convertType>) { + if (source.isNull()) { + return std::nullopt; + } else { + return fromJsonValue(source, convertType{}); + } +} + +template +QJsonValue toJsonValue(const std::optional &source, convertType>) { + if (source.has_value()) { + return toJsonValue(source.value(), convertType{}); + } else { + // Null + return QJsonValue(); + } +} + +// QSharedPointer +template +QSharedPointer fromJsonValue(const QJsonValue &source, convertType>) { + if (source.isNull()) { + return QSharedPointer(); + } + return QSharedPointer::create(fromJsonValue(source)); +} + +template +QJsonValue toJsonValue(const QSharedPointer &source, convertType>) { + if (source.isNull()) { + return QJsonValue(); + } + return toJsonValue(*source); +} + + /** * Templates for string conversion. */ diff --git a/core/include/JellyfinQt/support/loader.h b/core/include/JellyfinQt/support/loader.h index a0fd5e7..44686ae 100644 --- a/core/include/JellyfinQt/support/loader.h +++ b/core/include/JellyfinQt/support/loader.h @@ -40,6 +40,10 @@ class LoadException : public QException { public: explicit LoadException(const QString &message) : m_message(message.toStdString()) {} + + /*explicit LoadException(const LoadException &other) + : m_message(other.m_message) {}*/ + virtual const char *what() const noexcept override; virtual QException *clone() const override; @@ -54,6 +58,10 @@ static const int HTTP_TIMEOUT = 30000; // 30 seconds; * 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. @@ -67,13 +75,18 @@ class Loader { public: explicit Loader(ApiClient *apiClient) : m_apiClient(apiClient) {} + /** - * @brief load Loads the given resource. - * @param parameters Parameters to determine which resource should be loaded. + * @brief Called just before load() is called. In constrast to load, + * this runs on the same thread as the ApiClient object. + */ + virtual void prepareLoad() {}; + + /** + * @brief load Loads the given resource. This usually run on a different thread. * @return The resource if successfull. */ - virtual std::optional load(const P ¶meters) const { - Q_UNUSED(parameters) + virtual std::optional load() { throw LoadException(QStringLiteral("Loader not set")); } /** @@ -86,38 +99,10 @@ public: virtual bool isAvailable() const { return false; }; void setApiClient(ApiClient *newApiClient) { m_apiClient = newApiClient; } ApiClient *apiClient() const { return m_apiClient; } + void setParameters(const P ¶meters) { m_parameters = parameters; } protected: Jellyfin::ApiClient *m_apiClient; -}; - -/** - * Implementation of a Loader that tries multiple loaders. - */ -template -class MultipleChoiceLoader : public Loader { - using L = Loader; -public: - explicit MultipleChoiceLoader(ApiClient *apiClient, - std::initializer_list loaders) - : L(apiClient), m_loaders(loaders) {} - - virtual std::optional load(const P ¶meters) const override { - for(auto it = m_loaders.begin(); it != m_loaders.end(); it++) { - if (it->isAvailable()) { - try { - std::optional res = it->load(parameters); - if (res.has_value()) return res; - } catch (LoadException &e) { - qDebug() << "Error while loading: " << e.what(); - } - } - } - qDebug() << "No loaders were able to fulfill the request"; - return std::nullopt; - } - -private: - QList m_loaders; + P m_parameters; }; /** @@ -129,29 +114,40 @@ public: explicit HttpLoader(Jellyfin::ApiClient *apiClient) : Loader (apiClient) {} - virtual std::optional load(const P ¶meters) const override { - QNetworkReply *reply = this->m_apiClient->get(path(parameters), query(parameters)); - QByteArray array; - while (!reply->atEnd()) { - if (!reply->waitForReadyRead(HTTP_TIMEOUT)) { - if (reply->error() == QNetworkReply::NoError) { - reply->deleteLater(); - //: Loading from a resource failed due to the server taking too long to respond - throw LoadException(QObject::tr("Network timeout")); - } - reply->deleteLater(); - //: An HTTP has occurred. First argument is replaced by QNetworkReply->errorString() - throw LoadException(QObject::tr("HTTP error: %1").arg(reply->errorString())); - } - array.append(reply->readAll()); + virtual void prepareLoad() override { + m_reply = this->m_apiClient->get(path(this->m_parameters), query(this->m_parameters)); + m_requestFinishedConnection = QObject::connect(m_reply, &QNetworkReply::finished, [&]() { this->requestFinished(); }); + } + + virtual std::optional load() override { + Q_ASSERT_X(m_reply != nullptr, "HttpLoader::load", "prepareLoad() must be called before load()"); + QMutexLocker locker(&m_mutex); + while (!m_reply->isFinished()) { + m_waitCondition.wait(&m_mutex); } - reply->deleteLater(); + QByteArray array = m_reply->readAll(); + if (m_reply->error() != QNetworkReply::NoError) { + m_reply->deleteLater(); + //: An HTTP has occurred. First argument is replaced by QNetworkReply->errorString() + throw LoadException(QObject::tr("HTTP error: %1").arg(m_reply->errorString())); + } + m_reply->deleteLater(); + m_reply = nullptr; QJsonParseError error; QJsonDocument document = QJsonDocument::fromJson(array, &error); if (error.error != QJsonParseError::NoError) { + qWarning() << array; throw LoadException(error.errorString().toLocal8Bit().constData()); } - return fromJsonValue(QJsonValue(document.object())); + if (document.isNull() || document.isEmpty()) { + return std::nullopt; + } else if (document.isArray()) { + return std::optional(fromJsonValue(document.array())); + } else if (document.isObject()){ + return std::optional(fromJsonValue(document.object())); + } else { + return std::nullopt; + } } bool isAvailable() const override { @@ -169,6 +165,16 @@ protected: */ virtual QString path(const P ¶meters) const = 0; virtual QUrlQuery query(const P ¶meters) const = 0; +private: + QNetworkReply *m_reply = nullptr; + QWaitCondition m_waitCondition; + QMutex m_mutex; + QMetaObject::Connection m_requestFinishedConnection; + + void requestFinished() { + QObject::disconnect(m_requestFinishedConnection); + m_waitCondition.wakeAll(); + } }; } // NS Support diff --git a/core/include/JellyfinQt/viewmodel/itemmodel.h b/core/include/JellyfinQt/viewmodel/itemmodel.h index ddc0ff1..42e9793 100644 --- a/core/include/JellyfinQt/viewmodel/itemmodel.h +++ b/core/include/JellyfinQt/viewmodel/itemmodel.h @@ -21,6 +21,7 @@ #include #include +#include #include "propertyhelper.h" #include "../dto/baseitemdto.h" @@ -70,6 +71,8 @@ public: FWDPROP(QStringList, artists, Artists) FWDPROP(bool, recursive, Recursive) //FWDPROP(bool, collapseBoxSetItems) +protected: + virtual bool canReload() const override; private slots: void apiClientChanged(ApiClient *newApiClient); void userIdChanged(const QString &newUserId); diff --git a/core/include/JellyfinQt/viewmodel/loader.h b/core/include/JellyfinQt/viewmodel/loader.h index faee294..f065afa 100644 --- a/core/include/JellyfinQt/viewmodel/loader.h +++ b/core/include/JellyfinQt/viewmodel/loader.h @@ -159,8 +159,11 @@ public: QObject *data() const { return m_dataViewModel; } void reload() override { + if (m_futureWatcher->isRunning()) return; setStatus(Loading); - QFuture> future = QtConcurrent::run(this, &Loader::invokeLoader, m_parameters); + m_loader.setParameters(m_parameters); + m_loader.prepareLoad(); + QFuture> future = QtConcurrent::run(this, &Loader::invokeLoader); m_futureWatcher->setFuture(future); } protected: @@ -179,11 +182,11 @@ private: * @param parameters Parameters to forward to the loader * @return empty optional if an error occured, otherwise the result. */ - std::optional invokeLoader(P parameters) { + std::optional invokeLoader() { QMutexLocker(&this->m_mutex); this->m_loader.setApiClient(m_apiClient); try { - return this->m_loader.load(parameters); + return this->m_loader.load(); } catch (Support::LoadException &e) { qWarning() << "Exception while loading an item: " << e.what(); this->setErrorString(QString(e.what())); diff --git a/core/openapigenerator.d b/core/openapigenerator.d index 2144bb7..94f8c00 100755 --- a/core/openapigenerator.d +++ b/core/openapigenerator.d @@ -201,7 +201,8 @@ void realMain(string[] args) { File headerFile = File(headerFileName, "w+"); File implementationFile = File(implementationFileName, "w+"); - generateFileForEndpoint(path, operation, endpoint, root["components"]["schemas"], headerFile, implementationFile, endpoints); + generateFileForEndpoint(path, operation, endpoint, root["components"]["schemas"], headerFile, + implementationFile, endpoints); } } string typesHeaderPath = buildPath(outputDirectory, "include", INCLUDE_PREFIX, LOADER_FOLDER, "requesttypes.h"); @@ -372,8 +373,7 @@ void generateFileForEndpoint(ref const string path, ref const string operation, string[] userImports = [ buildPath(SUPPORT_FOLDER, "jsonconv.h"), buildPath(SUPPORT_FOLDER, "loader.h"), - buildPath(LOADER_FOLDER, "requesttypes.h"), - "apiclient.h" + buildPath(LOADER_FOLDER, "requesttypes.h") ]; // Find the most likely result response. @@ -382,19 +382,34 @@ void generateFileForEndpoint(ref const string path, ref const string operation, if ([200, 201].canFind(codeNo)) { foreach(string contentType, const Node content; response["content"]) { if (contentType == "application/json") { + endpoint.hasSuccessResponse = true; if ("$ref" in content["schema"]) { - endpoint.hasSuccessResponse = true; string reference = content["schema"]["$ref"].as!string.chompPrefix("#/components/schemas/"); endpoint.resultIsReference = true; endpoint.resultType = reference; - string importFile = reference.applyCasePolicy(CasePolicy.PASCAL, CasePolicy.LOWER) ~ ".h"; - userImports ~= [buildPath(MODEL_FOLDER, importFile)]; - } else { + userImports ~= [buildPath(MODEL_FOLDER, reference.applyCasePolicy(CasePolicy.PASCAL, CasePolicy.LOWER) ~ ".h")]; + } else if ("schema" in content){ endpoint.resultIsReference = false; + string typeName = endpoint.name ~ "Response"; + MetaTypeInfo responseType = getType(typeName, content["schema"], allSchemas); + endpoint.resultType = responseType.typeName; + if (responseType.needsLocalImport && !responseType.isContainer) { + userImports ~= [buildPath(MODEL_FOLDER, endpoint.resultType)]; + } + + MetaTypeInfo t = responseType; + while(t.isContainer) { + t = t.containerType; + if (t.needsLocalImport) { + userImports ~= [buildPath(MODEL_FOLDER, t.fileName)]; + } else if (t.needsSystemImport && !t.isContainer){ + systemImports ~= [t.typeName]; + } + } } } } - } + } } // Build the parameter structure. @@ -444,7 +459,9 @@ void generateFileForEndpoint(ref const string path, ref const string operation, string pathStringInterpolation() { string result = "QStringLiteral(\"" ~ endpoint.path ~ "\")"; foreach(p; endpoint.parameters.filter!(p => p.location == ParameterLocation.PATH)) { - result = result.replace("{" ~ p.name ~ "}", "\") + Support::toString(params." ~ p.type.name ~ "()) + QStringLiteral(\""); + result = result.replace("{" ~ p.name ~ "}", "\") + Support::toString< " + ~ p.type.typeNameWithQualifiers ~">(params." ~ p.type.name + ~ "()) + QStringLiteral(\""); } result = result.replace(`+ QStringLiteral("")`, ""); return result; @@ -473,12 +490,13 @@ void generateFileForSchema(ref const string name, ref const Node scheme, Node al if ("enum" in scheme) { string[3] imports = ["QJsonValue", "QObject", "QString"]; string[1] userImports = [buildPath(SUPPORT_FOLDER, "jsonconv.h")]; - writeHeaderPreamble(headerFile, CPP_NAMESPACE_DTO, name, imports, userImports); Appender!(string[]) values; foreach (string value; scheme["enum"]) { values ~= value; } + + writeHeaderPreamble(headerFile, CPP_NAMESPACE_DTO, name, imports, userImports); writeEnumHeader(headerFile, name, values[]); writeHeaderPostamble(headerFile, CPP_NAMESPACE_DTO, name); @@ -663,6 +681,9 @@ MetaTypeInfo getType(ref const string name, const ref Node node, const ref Node goto default; case "object": info.typeName = "QJsonObject"; // This'll do for now + info.isTypeNullable = true; + info.typeNullableCheck = ".isEmpty()"; + info.typeNullableSetter = "= QJsonObject()"; return info; case "array": string containedTypeName = "arrayItem"; @@ -772,6 +793,12 @@ void writeHeaderPreamble(File output, immutable string[] fileNamespace, string c } if (userImports.length > 0) output.writeln(); + // FIXME: Should be configurable + output.writefln("namespace Jellyfin {"); + output.writefln("// Forward declaration"); + output.writefln("class ApiClient;"); + output.writefln("}"); + foreach (namespace; fileNamespace) { output.writefln("namespace %s {", namespace); } @@ -853,7 +880,6 @@ string applyCasePolicy(string source, CasePolicy input, CasePolicy output) { throw new Exception("Not implemented"); case CasePolicy.SCREAMING_SNAKE: if (input == CasePolicy.CAMEL || input == CasePolicy.PASCAL) { - char[] mutableSource = source.dup; Appender!(char[]) result; foreach(window; source.slide!(Yes.withPartial)(2)) { dchar c = window.front; @@ -862,8 +888,6 @@ string applyCasePolicy(string source, CasePolicy input, CasePolicy output) { if (isLower(c) && !isLower(n)) { result ~= toUpper(c); result ~= '_'; - } else if (!isLower(c) && !isLower(n)) { - result ~= toUpper(c); } else { result ~= toUpper(c); } @@ -949,11 +973,7 @@ public: if (needsOptional) { return " = std::nullopt"; } - if (typeNullableSetter.startsWith("=")) { - return typeNullableSetter; - } else { - return typeNullableSetter; - } + return typeNullableSetter; } string defaultInitializer() { @@ -961,6 +981,10 @@ public: if (needsOptional) return "std::nullopt"; return ""; } + + string fileName (){ + return typeName.applyCasePolicy(CasePolicy.PASCAL, CasePolicy.LOWER) ~ ".h"; + } } /** diff --git a/core/src/DTO/accessschedule.cpp b/core/src/DTO/accessschedule.cpp deleted file mode 100644 index ab82166..0000000 --- a/core/src/DTO/accessschedule.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AccessSchedule::AccessSchedule() {} -AccessSchedule::AccessSchedule(const AccessSchedule &other) : - m_jellyfinId(other.m_jellyfinId), - m_userId(other.m_userId), - m_dayOfWeek(other.m_dayOfWeek), - m_startHour(other.m_startHour), - m_endHour(other.m_endHour){} - -AccessSchedule AccessSchedule::fromJson(QJsonObject source) { - AccessSchedule instance; - instance.setFromJson(source); - return instance; -} - - -void AccessSchedule::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_dayOfWeek = Jellyfin::Support::fromJsonValue(source["DayOfWeek"]); - m_startHour = Jellyfin::Support::fromJsonValue(source["StartHour"]); - m_endHour = Jellyfin::Support::fromJsonValue(source["EndHour"]); - -} - -QJsonObject AccessSchedule::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["DayOfWeek"] = Jellyfin::Support::toJsonValue(m_dayOfWeek); - result["StartHour"] = Jellyfin::Support::toJsonValue(m_startHour); - result["EndHour"] = Jellyfin::Support::toJsonValue(m_endHour); - - return result; -} - -qint32 AccessSchedule::jellyfinId() const { return m_jellyfinId; } - -void AccessSchedule::setJellyfinId(qint32 newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QUuid AccessSchedule::userId() const { return m_userId; } - -void AccessSchedule::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -DynamicDayOfWeek AccessSchedule::dayOfWeek() const { return m_dayOfWeek; } - -void AccessSchedule::setDayOfWeek(DynamicDayOfWeek newDayOfWeek) { - m_dayOfWeek = newDayOfWeek; -} -double AccessSchedule::startHour() const { return m_startHour; } - -void AccessSchedule::setStartHour(double newStartHour) { - m_startHour = newStartHour; -} -double AccessSchedule::endHour() const { return m_endHour; } - -void AccessSchedule::setEndHour(double newEndHour) { - m_endHour = newEndHour; -} - -} // NS DTO - -namespace Support { - -using AccessSchedule = Jellyfin::DTO::AccessSchedule; - -template <> -AccessSchedule fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AccessSchedule::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/activitylogentry.cpp b/core/src/DTO/activitylogentry.cpp deleted file mode 100644 index c692761..0000000 --- a/core/src/DTO/activitylogentry.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ActivityLogEntry::ActivityLogEntry() {} -ActivityLogEntry::ActivityLogEntry(const ActivityLogEntry &other) : - m_jellyfinId(other.m_jellyfinId), - m_name(other.m_name), - m_overview(other.m_overview), - m_shortOverview(other.m_shortOverview), - m_type(other.m_type), - m_itemId(other.m_itemId), - m_date(other.m_date), - m_userId(other.m_userId), - m_userPrimaryImageTag(other.m_userPrimaryImageTag), - m_severity(other.m_severity){} - -ActivityLogEntry ActivityLogEntry::fromJson(QJsonObject source) { - ActivityLogEntry instance; - instance.setFromJson(source); - return instance; -} - - -void ActivityLogEntry::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_overview = Jellyfin::Support::fromJsonValue(source["Overview"]); - m_shortOverview = Jellyfin::Support::fromJsonValue(source["ShortOverview"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_date = Jellyfin::Support::fromJsonValue(source["Date"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_userPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["UserPrimaryImageTag"]); - m_severity = Jellyfin::Support::fromJsonValue(source["Severity"]); - -} - -QJsonObject ActivityLogEntry::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["ShortOverview"] = Jellyfin::Support::toJsonValue(m_shortOverview); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["Date"] = Jellyfin::Support::toJsonValue(m_date); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_userPrimaryImageTag); - result["Severity"] = Jellyfin::Support::toJsonValue(m_severity); - - return result; -} - -qint64 ActivityLogEntry::jellyfinId() const { return m_jellyfinId; } - -void ActivityLogEntry::setJellyfinId(qint64 newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString ActivityLogEntry::name() const { return m_name; } - -void ActivityLogEntry::setName(QString newName) { - m_name = newName; -} -QString ActivityLogEntry::overview() const { return m_overview; } - -void ActivityLogEntry::setOverview(QString newOverview) { - m_overview = newOverview; -} -QString ActivityLogEntry::shortOverview() const { return m_shortOverview; } - -void ActivityLogEntry::setShortOverview(QString newShortOverview) { - m_shortOverview = newShortOverview; -} -QString ActivityLogEntry::type() const { return m_type; } - -void ActivityLogEntry::setType(QString newType) { - m_type = newType; -} -QString ActivityLogEntry::itemId() const { return m_itemId; } - -void ActivityLogEntry::setItemId(QString newItemId) { - m_itemId = newItemId; -} -QDateTime ActivityLogEntry::date() const { return m_date; } - -void ActivityLogEntry::setDate(QDateTime newDate) { - m_date = newDate; -} -QUuid ActivityLogEntry::userId() const { return m_userId; } - -void ActivityLogEntry::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QString ActivityLogEntry::userPrimaryImageTag() const { return m_userPrimaryImageTag; } - -void ActivityLogEntry::setUserPrimaryImageTag(QString newUserPrimaryImageTag) { - m_userPrimaryImageTag = newUserPrimaryImageTag; -} -LogLevel ActivityLogEntry::severity() const { return m_severity; } - -void ActivityLogEntry::setSeverity(LogLevel newSeverity) { - m_severity = newSeverity; -} - -} // NS DTO - -namespace Support { - -using ActivityLogEntry = Jellyfin::DTO::ActivityLogEntry; - -template <> -ActivityLogEntry fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ActivityLogEntry::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/activitylogentryqueryresult.cpp b/core/src/DTO/activitylogentryqueryresult.cpp deleted file mode 100644 index af60ea5..0000000 --- a/core/src/DTO/activitylogentryqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ActivityLogEntryQueryResult::ActivityLogEntryQueryResult() {} -ActivityLogEntryQueryResult::ActivityLogEntryQueryResult(const ActivityLogEntryQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -ActivityLogEntryQueryResult ActivityLogEntryQueryResult::fromJson(QJsonObject source) { - ActivityLogEntryQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void ActivityLogEntryQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject ActivityLogEntryQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> ActivityLogEntryQueryResult::items() const { return m_items; } - -void ActivityLogEntryQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 ActivityLogEntryQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void ActivityLogEntryQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 ActivityLogEntryQueryResult::startIndex() const { return m_startIndex; } - -void ActivityLogEntryQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using ActivityLogEntryQueryResult = Jellyfin::DTO::ActivityLogEntryQueryResult; - -template <> -ActivityLogEntryQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ActivityLogEntryQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/addvirtualfolderdto.cpp b/core/src/DTO/addvirtualfolderdto.cpp deleted file mode 100644 index fa1bb63..0000000 --- a/core/src/DTO/addvirtualfolderdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AddVirtualFolderDto::AddVirtualFolderDto() {} -AddVirtualFolderDto::AddVirtualFolderDto(const AddVirtualFolderDto &other) : - m_libraryOptions(other.m_libraryOptions){} - -AddVirtualFolderDto AddVirtualFolderDto::fromJson(QJsonObject source) { - AddVirtualFolderDto instance; - instance.setFromJson(source); - return instance; -} - - -void AddVirtualFolderDto::setFromJson(QJsonObject source) { - m_libraryOptions = Jellyfin::Support::fromJsonValue>(source["LibraryOptions"]); - -} - -QJsonObject AddVirtualFolderDto::toJson() { - QJsonObject result; - result["LibraryOptions"] = Jellyfin::Support::toJsonValue>(m_libraryOptions); - - return result; -} - -QSharedPointer AddVirtualFolderDto::libraryOptions() const { return m_libraryOptions; } - -void AddVirtualFolderDto::setLibraryOptions(QSharedPointer newLibraryOptions) { - m_libraryOptions = newLibraryOptions; -} - -} // NS DTO - -namespace Support { - -using AddVirtualFolderDto = Jellyfin::DTO::AddVirtualFolderDto; - -template <> -AddVirtualFolderDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AddVirtualFolderDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/albuminfo.cpp b/core/src/DTO/albuminfo.cpp deleted file mode 100644 index e635baf..0000000 --- a/core/src/DTO/albuminfo.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AlbumInfo::AlbumInfo() {} -AlbumInfo::AlbumInfo(const AlbumInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated), - m_albumArtists(other.m_albumArtists), - m_artistProviderIds(other.m_artistProviderIds), - m_songInfos(other.m_songInfos){} - -AlbumInfo AlbumInfo::fromJson(QJsonObject source) { - AlbumInfo instance; - instance.setFromJson(source); - return instance; -} - - -void AlbumInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - m_albumArtists = Jellyfin::Support::fromJsonValue(source["AlbumArtists"]); - m_artistProviderIds = Jellyfin::Support::fromJsonValue(source["ArtistProviderIds"]); - m_songInfos = Jellyfin::Support::fromJsonValue>>(source["SongInfos"]); - -} - -QJsonObject AlbumInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - result["AlbumArtists"] = Jellyfin::Support::toJsonValue(m_albumArtists); - result["ArtistProviderIds"] = Jellyfin::Support::toJsonValue(m_artistProviderIds); - result["SongInfos"] = Jellyfin::Support::toJsonValue>>(m_songInfos); - - return result; -} - -QString AlbumInfo::name() const { return m_name; } - -void AlbumInfo::setName(QString newName) { - m_name = newName; -} -QString AlbumInfo::path() const { return m_path; } - -void AlbumInfo::setPath(QString newPath) { - m_path = newPath; -} -QString AlbumInfo::metadataLanguage() const { return m_metadataLanguage; } - -void AlbumInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString AlbumInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void AlbumInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject AlbumInfo::providerIds() const { return m_providerIds; } - -void AlbumInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 AlbumInfo::year() const { return m_year; } - -void AlbumInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 AlbumInfo::indexNumber() const { return m_indexNumber; } - -void AlbumInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 AlbumInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void AlbumInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime AlbumInfo::premiereDate() const { return m_premiereDate; } - -void AlbumInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool AlbumInfo::isAutomated() const { return m_isAutomated; } - -void AlbumInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} -QStringList AlbumInfo::albumArtists() const { return m_albumArtists; } - -void AlbumInfo::setAlbumArtists(QStringList newAlbumArtists) { - m_albumArtists = newAlbumArtists; -} -QJsonObject AlbumInfo::artistProviderIds() const { return m_artistProviderIds; } - -void AlbumInfo::setArtistProviderIds(QJsonObject newArtistProviderIds) { - m_artistProviderIds = newArtistProviderIds; -} -QList> AlbumInfo::songInfos() const { return m_songInfos; } - -void AlbumInfo::setSongInfos(QList> newSongInfos) { - m_songInfos = newSongInfos; -} - -} // NS DTO - -namespace Support { - -using AlbumInfo = Jellyfin::DTO::AlbumInfo; - -template <> -AlbumInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AlbumInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/albuminforemotesearchquery.cpp b/core/src/DTO/albuminforemotesearchquery.cpp deleted file mode 100644 index 9246cfc..0000000 --- a/core/src/DTO/albuminforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AlbumInfoRemoteSearchQuery::AlbumInfoRemoteSearchQuery() {} -AlbumInfoRemoteSearchQuery::AlbumInfoRemoteSearchQuery(const AlbumInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -AlbumInfoRemoteSearchQuery AlbumInfoRemoteSearchQuery::fromJson(QJsonObject source) { - AlbumInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void AlbumInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject AlbumInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer AlbumInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void AlbumInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid AlbumInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void AlbumInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString AlbumInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void AlbumInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool AlbumInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void AlbumInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using AlbumInfoRemoteSearchQuery = Jellyfin::DTO::AlbumInfoRemoteSearchQuery; - -template <> -AlbumInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AlbumInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/allthememediaresult.cpp b/core/src/DTO/allthememediaresult.cpp deleted file mode 100644 index 7362315..0000000 --- a/core/src/DTO/allthememediaresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AllThemeMediaResult::AllThemeMediaResult() {} -AllThemeMediaResult::AllThemeMediaResult(const AllThemeMediaResult &other) : - m_themeVideosResult(other.m_themeVideosResult), - m_themeSongsResult(other.m_themeSongsResult), - m_soundtrackSongsResult(other.m_soundtrackSongsResult){} - -AllThemeMediaResult AllThemeMediaResult::fromJson(QJsonObject source) { - AllThemeMediaResult instance; - instance.setFromJson(source); - return instance; -} - - -void AllThemeMediaResult::setFromJson(QJsonObject source) { - m_themeVideosResult = Jellyfin::Support::fromJsonValue>(source["ThemeVideosResult"]); - m_themeSongsResult = Jellyfin::Support::fromJsonValue>(source["ThemeSongsResult"]); - m_soundtrackSongsResult = Jellyfin::Support::fromJsonValue>(source["SoundtrackSongsResult"]); - -} - -QJsonObject AllThemeMediaResult::toJson() { - QJsonObject result; - result["ThemeVideosResult"] = Jellyfin::Support::toJsonValue>(m_themeVideosResult); - result["ThemeSongsResult"] = Jellyfin::Support::toJsonValue>(m_themeSongsResult); - result["SoundtrackSongsResult"] = Jellyfin::Support::toJsonValue>(m_soundtrackSongsResult); - - return result; -} - -QSharedPointer AllThemeMediaResult::themeVideosResult() const { return m_themeVideosResult; } - -void AllThemeMediaResult::setThemeVideosResult(QSharedPointer newThemeVideosResult) { - m_themeVideosResult = newThemeVideosResult; -} -QSharedPointer AllThemeMediaResult::themeSongsResult() const { return m_themeSongsResult; } - -void AllThemeMediaResult::setThemeSongsResult(QSharedPointer newThemeSongsResult) { - m_themeSongsResult = newThemeSongsResult; -} -QSharedPointer AllThemeMediaResult::soundtrackSongsResult() const { return m_soundtrackSongsResult; } - -void AllThemeMediaResult::setSoundtrackSongsResult(QSharedPointer newSoundtrackSongsResult) { - m_soundtrackSongsResult = newSoundtrackSongsResult; -} - -} // NS DTO - -namespace Support { - -using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult; - -template <> -AllThemeMediaResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AllThemeMediaResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/architecture.cpp b/core/src/DTO/architecture.cpp deleted file mode 100644 index 8f8cd84..0000000 --- a/core/src/DTO/architecture.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ArchitectureClass::ArchitectureClass() {} - - -} // NS DTO - -namespace Support { - -using Architecture = Jellyfin::DTO::Architecture; - -template <> -Architecture fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return Architecture::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("X86")) { - return Architecture::X86; - } - if (str == QStringLiteral("X64")) { - return Architecture::X64; - } - if (str == QStringLiteral("Arm")) { - return Architecture::Arm; - } - if (str == QStringLiteral("Arm64")) { - return Architecture::Arm64; - } - if (str == QStringLiteral("Wasm")) { - return Architecture::Wasm; - } - - return Architecture::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/artistinfo.cpp b/core/src/DTO/artistinfo.cpp deleted file mode 100644 index d838824..0000000 --- a/core/src/DTO/artistinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ArtistInfo::ArtistInfo() {} -ArtistInfo::ArtistInfo(const ArtistInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated), - m_songInfos(other.m_songInfos){} - -ArtistInfo ArtistInfo::fromJson(QJsonObject source) { - ArtistInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ArtistInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - m_songInfos = Jellyfin::Support::fromJsonValue>>(source["SongInfos"]); - -} - -QJsonObject ArtistInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - result["SongInfos"] = Jellyfin::Support::toJsonValue>>(m_songInfos); - - return result; -} - -QString ArtistInfo::name() const { return m_name; } - -void ArtistInfo::setName(QString newName) { - m_name = newName; -} -QString ArtistInfo::path() const { return m_path; } - -void ArtistInfo::setPath(QString newPath) { - m_path = newPath; -} -QString ArtistInfo::metadataLanguage() const { return m_metadataLanguage; } - -void ArtistInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString ArtistInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void ArtistInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject ArtistInfo::providerIds() const { return m_providerIds; } - -void ArtistInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 ArtistInfo::year() const { return m_year; } - -void ArtistInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 ArtistInfo::indexNumber() const { return m_indexNumber; } - -void ArtistInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 ArtistInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void ArtistInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime ArtistInfo::premiereDate() const { return m_premiereDate; } - -void ArtistInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool ArtistInfo::isAutomated() const { return m_isAutomated; } - -void ArtistInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} -QList> ArtistInfo::songInfos() const { return m_songInfos; } - -void ArtistInfo::setSongInfos(QList> newSongInfos) { - m_songInfos = newSongInfos; -} - -} // NS DTO - -namespace Support { - -using ArtistInfo = Jellyfin::DTO::ArtistInfo; - -template <> -ArtistInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ArtistInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/artistinforemotesearchquery.cpp b/core/src/DTO/artistinforemotesearchquery.cpp deleted file mode 100644 index d0c0e54..0000000 --- a/core/src/DTO/artistinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ArtistInfoRemoteSearchQuery::ArtistInfoRemoteSearchQuery() {} -ArtistInfoRemoteSearchQuery::ArtistInfoRemoteSearchQuery(const ArtistInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -ArtistInfoRemoteSearchQuery ArtistInfoRemoteSearchQuery::fromJson(QJsonObject source) { - ArtistInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void ArtistInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject ArtistInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer ArtistInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void ArtistInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid ArtistInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void ArtistInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString ArtistInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void ArtistInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool ArtistInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void ArtistInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using ArtistInfoRemoteSearchQuery = Jellyfin::DTO::ArtistInfoRemoteSearchQuery; - -template <> -ArtistInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ArtistInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/authenticateuserbyname.cpp b/core/src/DTO/authenticateuserbyname.cpp deleted file mode 100644 index 59f6f03..0000000 --- a/core/src/DTO/authenticateuserbyname.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AuthenticateUserByName::AuthenticateUserByName() {} -AuthenticateUserByName::AuthenticateUserByName(const AuthenticateUserByName &other) : - m_username(other.m_username), - m_pw(other.m_pw), - m_password(other.m_password){} - -AuthenticateUserByName AuthenticateUserByName::fromJson(QJsonObject source) { - AuthenticateUserByName instance; - instance.setFromJson(source); - return instance; -} - - -void AuthenticateUserByName::setFromJson(QJsonObject source) { - m_username = Jellyfin::Support::fromJsonValue(source["Username"]); - m_pw = Jellyfin::Support::fromJsonValue(source["Pw"]); - m_password = Jellyfin::Support::fromJsonValue(source["Password"]); - -} - -QJsonObject AuthenticateUserByName::toJson() { - QJsonObject result; - result["Username"] = Jellyfin::Support::toJsonValue(m_username); - result["Pw"] = Jellyfin::Support::toJsonValue(m_pw); - result["Password"] = Jellyfin::Support::toJsonValue(m_password); - - return result; -} - -QString AuthenticateUserByName::username() const { return m_username; } - -void AuthenticateUserByName::setUsername(QString newUsername) { - m_username = newUsername; -} -QString AuthenticateUserByName::pw() const { return m_pw; } - -void AuthenticateUserByName::setPw(QString newPw) { - m_pw = newPw; -} -QString AuthenticateUserByName::password() const { return m_password; } - -void AuthenticateUserByName::setPassword(QString newPassword) { - m_password = newPassword; -} - -} // NS DTO - -namespace Support { - -using AuthenticateUserByName = Jellyfin::DTO::AuthenticateUserByName; - -template <> -AuthenticateUserByName fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AuthenticateUserByName::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/authenticationinfo.cpp b/core/src/DTO/authenticationinfo.cpp deleted file mode 100644 index 1058332..0000000 --- a/core/src/DTO/authenticationinfo.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AuthenticationInfo::AuthenticationInfo() {} -AuthenticationInfo::AuthenticationInfo(const AuthenticationInfo &other) : - m_jellyfinId(other.m_jellyfinId), - m_accessToken(other.m_accessToken), - m_deviceId(other.m_deviceId), - m_appName(other.m_appName), - m_appVersion(other.m_appVersion), - m_deviceName(other.m_deviceName), - m_userId(other.m_userId), - m_isActive(other.m_isActive), - m_dateCreated(other.m_dateCreated), - m_dateRevoked(other.m_dateRevoked), - m_dateLastActivity(other.m_dateLastActivity), - m_userName(other.m_userName){} - -AuthenticationInfo AuthenticationInfo::fromJson(QJsonObject source) { - AuthenticationInfo instance; - instance.setFromJson(source); - return instance; -} - - -void AuthenticationInfo::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_accessToken = Jellyfin::Support::fromJsonValue(source["AccessToken"]); - m_deviceId = Jellyfin::Support::fromJsonValue(source["DeviceId"]); - m_appName = Jellyfin::Support::fromJsonValue(source["AppName"]); - m_appVersion = Jellyfin::Support::fromJsonValue(source["AppVersion"]); - m_deviceName = Jellyfin::Support::fromJsonValue(source["DeviceName"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_isActive = Jellyfin::Support::fromJsonValue(source["IsActive"]); - m_dateCreated = Jellyfin::Support::fromJsonValue(source["DateCreated"]); - m_dateRevoked = Jellyfin::Support::fromJsonValue(source["DateRevoked"]); - m_dateLastActivity = Jellyfin::Support::fromJsonValue(source["DateLastActivity"]); - m_userName = Jellyfin::Support::fromJsonValue(source["UserName"]); - -} - -QJsonObject AuthenticationInfo::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["AccessToken"] = Jellyfin::Support::toJsonValue(m_accessToken); - result["DeviceId"] = Jellyfin::Support::toJsonValue(m_deviceId); - result["AppName"] = Jellyfin::Support::toJsonValue(m_appName); - result["AppVersion"] = Jellyfin::Support::toJsonValue(m_appVersion); - result["DeviceName"] = Jellyfin::Support::toJsonValue(m_deviceName); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["IsActive"] = Jellyfin::Support::toJsonValue(m_isActive); - result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); - result["DateRevoked"] = Jellyfin::Support::toJsonValue(m_dateRevoked); - result["DateLastActivity"] = Jellyfin::Support::toJsonValue(m_dateLastActivity); - result["UserName"] = Jellyfin::Support::toJsonValue(m_userName); - - return result; -} - -qint64 AuthenticationInfo::jellyfinId() const { return m_jellyfinId; } - -void AuthenticationInfo::setJellyfinId(qint64 newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString AuthenticationInfo::accessToken() const { return m_accessToken; } - -void AuthenticationInfo::setAccessToken(QString newAccessToken) { - m_accessToken = newAccessToken; -} -QString AuthenticationInfo::deviceId() const { return m_deviceId; } - -void AuthenticationInfo::setDeviceId(QString newDeviceId) { - m_deviceId = newDeviceId; -} -QString AuthenticationInfo::appName() const { return m_appName; } - -void AuthenticationInfo::setAppName(QString newAppName) { - m_appName = newAppName; -} -QString AuthenticationInfo::appVersion() const { return m_appVersion; } - -void AuthenticationInfo::setAppVersion(QString newAppVersion) { - m_appVersion = newAppVersion; -} -QString AuthenticationInfo::deviceName() const { return m_deviceName; } - -void AuthenticationInfo::setDeviceName(QString newDeviceName) { - m_deviceName = newDeviceName; -} -QUuid AuthenticationInfo::userId() const { return m_userId; } - -void AuthenticationInfo::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -bool AuthenticationInfo::isActive() const { return m_isActive; } - -void AuthenticationInfo::setIsActive(bool newIsActive) { - m_isActive = newIsActive; -} -QDateTime AuthenticationInfo::dateCreated() const { return m_dateCreated; } - -void AuthenticationInfo::setDateCreated(QDateTime newDateCreated) { - m_dateCreated = newDateCreated; -} -QDateTime AuthenticationInfo::dateRevoked() const { return m_dateRevoked; } - -void AuthenticationInfo::setDateRevoked(QDateTime newDateRevoked) { - m_dateRevoked = newDateRevoked; -} -QDateTime AuthenticationInfo::dateLastActivity() const { return m_dateLastActivity; } - -void AuthenticationInfo::setDateLastActivity(QDateTime newDateLastActivity) { - m_dateLastActivity = newDateLastActivity; -} -QString AuthenticationInfo::userName() const { return m_userName; } - -void AuthenticationInfo::setUserName(QString newUserName) { - m_userName = newUserName; -} - -} // NS DTO - -namespace Support { - -using AuthenticationInfo = Jellyfin::DTO::AuthenticationInfo; - -template <> -AuthenticationInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AuthenticationInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/authenticationinfoqueryresult.cpp b/core/src/DTO/authenticationinfoqueryresult.cpp deleted file mode 100644 index 0e213b3..0000000 --- a/core/src/DTO/authenticationinfoqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AuthenticationInfoQueryResult::AuthenticationInfoQueryResult() {} -AuthenticationInfoQueryResult::AuthenticationInfoQueryResult(const AuthenticationInfoQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -AuthenticationInfoQueryResult AuthenticationInfoQueryResult::fromJson(QJsonObject source) { - AuthenticationInfoQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void AuthenticationInfoQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject AuthenticationInfoQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> AuthenticationInfoQueryResult::items() const { return m_items; } - -void AuthenticationInfoQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 AuthenticationInfoQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void AuthenticationInfoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 AuthenticationInfoQueryResult::startIndex() const { return m_startIndex; } - -void AuthenticationInfoQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using AuthenticationInfoQueryResult = Jellyfin::DTO::AuthenticationInfoQueryResult; - -template <> -AuthenticationInfoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AuthenticationInfoQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/authenticationresult.cpp b/core/src/DTO/authenticationresult.cpp deleted file mode 100644 index 68bde64..0000000 --- a/core/src/DTO/authenticationresult.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -AuthenticationResult::AuthenticationResult() {} -AuthenticationResult::AuthenticationResult(const AuthenticationResult &other) : - m_user(other.m_user), - m_sessionInfo(other.m_sessionInfo), - m_accessToken(other.m_accessToken), - m_serverId(other.m_serverId){} - -AuthenticationResult AuthenticationResult::fromJson(QJsonObject source) { - AuthenticationResult instance; - instance.setFromJson(source); - return instance; -} - - -void AuthenticationResult::setFromJson(QJsonObject source) { - m_user = Jellyfin::Support::fromJsonValue>(source["User"]); - m_sessionInfo = Jellyfin::Support::fromJsonValue>(source["SessionInfo"]); - m_accessToken = Jellyfin::Support::fromJsonValue(source["AccessToken"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - -} - -QJsonObject AuthenticationResult::toJson() { - QJsonObject result; - result["User"] = Jellyfin::Support::toJsonValue>(m_user); - result["SessionInfo"] = Jellyfin::Support::toJsonValue>(m_sessionInfo); - result["AccessToken"] = Jellyfin::Support::toJsonValue(m_accessToken); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - - return result; -} - -QSharedPointer AuthenticationResult::user() const { return m_user; } - -void AuthenticationResult::setUser(QSharedPointer newUser) { - m_user = newUser; -} -QSharedPointer AuthenticationResult::sessionInfo() const { return m_sessionInfo; } - -void AuthenticationResult::setSessionInfo(QSharedPointer newSessionInfo) { - m_sessionInfo = newSessionInfo; -} -QString AuthenticationResult::accessToken() const { return m_accessToken; } - -void AuthenticationResult::setAccessToken(QString newAccessToken) { - m_accessToken = newAccessToken; -} -QString AuthenticationResult::serverId() const { return m_serverId; } - -void AuthenticationResult::setServerId(QString newServerId) { - m_serverId = newServerId; -} - -} // NS DTO - -namespace Support { - -using AuthenticationResult = Jellyfin::DTO::AuthenticationResult; - -template <> -AuthenticationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return AuthenticationResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/baseitem.cpp b/core/src/DTO/baseitem.cpp deleted file mode 100644 index bedf534..0000000 --- a/core/src/DTO/baseitem.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BaseItem::BaseItem() {} -BaseItem::BaseItem(const BaseItem &other) : - m_size(other.m_size), - m_container(other.m_container), - m_dateLastSaved(other.m_dateLastSaved), - m_remoteTrailers(other.m_remoteTrailers), - m_isHD(other.m_isHD), - m_isShortcut(other.m_isShortcut), - m_shortcutPath(other.m_shortcutPath), - m_width(other.m_width), - m_height(other.m_height), - m_extraIds(other.m_extraIds), - m_supportsExternalTransfer(other.m_supportsExternalTransfer){} - -BaseItem BaseItem::fromJson(QJsonObject source) { - BaseItem instance; - instance.setFromJson(source); - return instance; -} - - -void BaseItem::setFromJson(QJsonObject source) { - m_size = Jellyfin::Support::fromJsonValue(source["Size"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_dateLastSaved = Jellyfin::Support::fromJsonValue(source["DateLastSaved"]); - m_remoteTrailers = Jellyfin::Support::fromJsonValue>>(source["RemoteTrailers"]); - m_isHD = Jellyfin::Support::fromJsonValue(source["IsHD"]); - m_isShortcut = Jellyfin::Support::fromJsonValue(source["IsShortcut"]); - m_shortcutPath = Jellyfin::Support::fromJsonValue(source["ShortcutPath"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_extraIds = Jellyfin::Support::fromJsonValue>(source["ExtraIds"]); - m_supportsExternalTransfer = Jellyfin::Support::fromJsonValue(source["SupportsExternalTransfer"]); - -} - -QJsonObject BaseItem::toJson() { - QJsonObject result; - result["Size"] = Jellyfin::Support::toJsonValue(m_size); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["DateLastSaved"] = Jellyfin::Support::toJsonValue(m_dateLastSaved); - result["RemoteTrailers"] = Jellyfin::Support::toJsonValue>>(m_remoteTrailers); - result["IsHD"] = Jellyfin::Support::toJsonValue(m_isHD); - result["IsShortcut"] = Jellyfin::Support::toJsonValue(m_isShortcut); - result["ShortcutPath"] = Jellyfin::Support::toJsonValue(m_shortcutPath); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["ExtraIds"] = Jellyfin::Support::toJsonValue>(m_extraIds); - result["SupportsExternalTransfer"] = Jellyfin::Support::toJsonValue(m_supportsExternalTransfer); - - return result; -} - -qint64 BaseItem::size() const { return m_size; } - -void BaseItem::setSize(qint64 newSize) { - m_size = newSize; -} -QString BaseItem::container() const { return m_container; } - -void BaseItem::setContainer(QString newContainer) { - m_container = newContainer; -} -QDateTime BaseItem::dateLastSaved() const { return m_dateLastSaved; } - -void BaseItem::setDateLastSaved(QDateTime newDateLastSaved) { - m_dateLastSaved = newDateLastSaved; -} -QList> BaseItem::remoteTrailers() const { return m_remoteTrailers; } - -void BaseItem::setRemoteTrailers(QList> newRemoteTrailers) { - m_remoteTrailers = newRemoteTrailers; -} -bool BaseItem::isHD() const { return m_isHD; } - -void BaseItem::setIsHD(bool newIsHD) { - m_isHD = newIsHD; -} -bool BaseItem::isShortcut() const { return m_isShortcut; } - -void BaseItem::setIsShortcut(bool newIsShortcut) { - m_isShortcut = newIsShortcut; -} -QString BaseItem::shortcutPath() const { return m_shortcutPath; } - -void BaseItem::setShortcutPath(QString newShortcutPath) { - m_shortcutPath = newShortcutPath; -} -qint32 BaseItem::width() const { return m_width; } - -void BaseItem::setWidth(qint32 newWidth) { - m_width = newWidth; -} -qint32 BaseItem::height() const { return m_height; } - -void BaseItem::setHeight(qint32 newHeight) { - m_height = newHeight; -} -QList BaseItem::extraIds() const { return m_extraIds; } - -void BaseItem::setExtraIds(QList newExtraIds) { - m_extraIds = newExtraIds; -} -bool BaseItem::supportsExternalTransfer() const { return m_supportsExternalTransfer; } - -void BaseItem::setSupportsExternalTransfer(bool newSupportsExternalTransfer) { - m_supportsExternalTransfer = newSupportsExternalTransfer; -} - -} // NS DTO - -namespace Support { - -using BaseItem = Jellyfin::DTO::BaseItem; - -template <> -BaseItem fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BaseItem::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/baseitemdto.cpp b/core/src/DTO/baseitemdto.cpp deleted file mode 100644 index e81727d..0000000 --- a/core/src/DTO/baseitemdto.cpp +++ /dev/null @@ -1,1277 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BaseItemDto::BaseItemDto() {} -BaseItemDto::BaseItemDto(const BaseItemDto &other) : - m_name(other.m_name), - m_originalTitle(other.m_originalTitle), - m_serverId(other.m_serverId), - m_jellyfinId(other.m_jellyfinId), - m_etag(other.m_etag), - m_sourceType(other.m_sourceType), - m_playlistItemId(other.m_playlistItemId), - m_dateCreated(other.m_dateCreated), - m_dateLastMediaAdded(other.m_dateLastMediaAdded), - m_extraType(other.m_extraType), - m_airsBeforeSeasonNumber(other.m_airsBeforeSeasonNumber), - m_airsAfterSeasonNumber(other.m_airsAfterSeasonNumber), - m_airsBeforeEpisodeNumber(other.m_airsBeforeEpisodeNumber), - m_canDelete(other.m_canDelete), - m_canDownload(other.m_canDownload), - m_hasSubtitles(other.m_hasSubtitles), - m_preferredMetadataLanguage(other.m_preferredMetadataLanguage), - m_preferredMetadataCountryCode(other.m_preferredMetadataCountryCode), - m_supportsSync(other.m_supportsSync), - m_container(other.m_container), - m_sortName(other.m_sortName), - m_forcedSortName(other.m_forcedSortName), - m_video3DFormat(other.m_video3DFormat), - m_premiereDate(other.m_premiereDate), - m_externalUrls(other.m_externalUrls), - m_mediaSources(other.m_mediaSources), - m_criticRating(other.m_criticRating), - m_productionLocations(other.m_productionLocations), - m_path(other.m_path), - m_enableMediaSourceDisplay(other.m_enableMediaSourceDisplay), - m_officialRating(other.m_officialRating), - m_customRating(other.m_customRating), - m_channelId(other.m_channelId), - m_channelName(other.m_channelName), - m_overview(other.m_overview), - m_taglines(other.m_taglines), - m_genres(other.m_genres), - m_communityRating(other.m_communityRating), - m_cumulativeRunTimeTicks(other.m_cumulativeRunTimeTicks), - m_runTimeTicks(other.m_runTimeTicks), - m_playAccess(other.m_playAccess), - m_aspectRatio(other.m_aspectRatio), - m_productionYear(other.m_productionYear), - m_isPlaceHolder(other.m_isPlaceHolder), - m_number(other.m_number), - m_channelNumber(other.m_channelNumber), - m_indexNumber(other.m_indexNumber), - m_indexNumberEnd(other.m_indexNumberEnd), - m_parentIndexNumber(other.m_parentIndexNumber), - m_remoteTrailers(other.m_remoteTrailers), - m_providerIds(other.m_providerIds), - m_isHD(other.m_isHD), - m_isFolder(other.m_isFolder), - m_parentId(other.m_parentId), - m_type(other.m_type), - m_people(other.m_people), - m_studios(other.m_studios), - m_genreItems(other.m_genreItems), - m_parentLogoItemId(other.m_parentLogoItemId), - m_parentBackdropItemId(other.m_parentBackdropItemId), - m_parentBackdropImageTags(other.m_parentBackdropImageTags), - m_localTrailerCount(other.m_localTrailerCount), - m_userData(other.m_userData), - m_recursiveItemCount(other.m_recursiveItemCount), - m_childCount(other.m_childCount), - m_seriesName(other.m_seriesName), - m_seriesId(other.m_seriesId), - m_seasonId(other.m_seasonId), - m_specialFeatureCount(other.m_specialFeatureCount), - m_displayPreferencesId(other.m_displayPreferencesId), - m_status(other.m_status), - m_airTime(other.m_airTime), - m_airDays(other.m_airDays), - m_tags(other.m_tags), - m_primaryImageAspectRatio(other.m_primaryImageAspectRatio), - m_artists(other.m_artists), - m_artistItems(other.m_artistItems), - m_album(other.m_album), - m_collectionType(other.m_collectionType), - m_displayOrder(other.m_displayOrder), - m_albumId(other.m_albumId), - m_albumPrimaryImageTag(other.m_albumPrimaryImageTag), - m_seriesPrimaryImageTag(other.m_seriesPrimaryImageTag), - m_albumArtist(other.m_albumArtist), - m_albumArtists(other.m_albumArtists), - m_seasonName(other.m_seasonName), - m_mediaStreams(other.m_mediaStreams), - m_videoType(other.m_videoType), - m_partCount(other.m_partCount), - m_mediaSourceCount(other.m_mediaSourceCount), - m_imageTags(other.m_imageTags), - m_backdropImageTags(other.m_backdropImageTags), - m_screenshotImageTags(other.m_screenshotImageTags), - m_parentLogoImageTag(other.m_parentLogoImageTag), - m_parentArtItemId(other.m_parentArtItemId), - m_parentArtImageTag(other.m_parentArtImageTag), - m_seriesThumbImageTag(other.m_seriesThumbImageTag), - m_imageBlurHashes(other.m_imageBlurHashes), - m_seriesStudio(other.m_seriesStudio), - m_parentThumbItemId(other.m_parentThumbItemId), - m_parentThumbImageTag(other.m_parentThumbImageTag), - m_parentPrimaryImageItemId(other.m_parentPrimaryImageItemId), - m_parentPrimaryImageTag(other.m_parentPrimaryImageTag), - m_chapters(other.m_chapters), - m_locationType(other.m_locationType), - m_isoType(other.m_isoType), - m_mediaType(other.m_mediaType), - m_endDate(other.m_endDate), - m_lockedFields(other.m_lockedFields), - m_trailerCount(other.m_trailerCount), - m_movieCount(other.m_movieCount), - m_seriesCount(other.m_seriesCount), - m_programCount(other.m_programCount), - m_episodeCount(other.m_episodeCount), - m_songCount(other.m_songCount), - m_albumCount(other.m_albumCount), - m_artistCount(other.m_artistCount), - m_musicVideoCount(other.m_musicVideoCount), - m_lockData(other.m_lockData), - m_width(other.m_width), - m_height(other.m_height), - m_cameraMake(other.m_cameraMake), - m_cameraModel(other.m_cameraModel), - m_software(other.m_software), - m_exposureTime(other.m_exposureTime), - m_focalLength(other.m_focalLength), - m_imageOrientation(other.m_imageOrientation), - m_aperture(other.m_aperture), - m_shutterSpeed(other.m_shutterSpeed), - m_latitude(other.m_latitude), - m_longitude(other.m_longitude), - m_altitude(other.m_altitude), - m_isoSpeedRating(other.m_isoSpeedRating), - m_seriesTimerId(other.m_seriesTimerId), - m_programId(other.m_programId), - m_channelPrimaryImageTag(other.m_channelPrimaryImageTag), - m_startDate(other.m_startDate), - m_completionPercentage(other.m_completionPercentage), - m_isRepeat(other.m_isRepeat), - m_episodeTitle(other.m_episodeTitle), - m_channelType(other.m_channelType), - m_audio(other.m_audio), - m_isMovie(other.m_isMovie), - m_isSports(other.m_isSports), - m_isSeries(other.m_isSeries), - m_isLive(other.m_isLive), - m_isNews(other.m_isNews), - m_isKids(other.m_isKids), - m_isPremiere(other.m_isPremiere), - m_timerId(other.m_timerId), - m_currentProgram(other.m_currentProgram){} - -BaseItemDto BaseItemDto::fromJson(QJsonObject source) { - BaseItemDto instance; - instance.setFromJson(source); - return instance; -} - - -void BaseItemDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_originalTitle = Jellyfin::Support::fromJsonValue(source["OriginalTitle"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_etag = Jellyfin::Support::fromJsonValue(source["Etag"]); - m_sourceType = Jellyfin::Support::fromJsonValue(source["SourceType"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - m_dateCreated = Jellyfin::Support::fromJsonValue(source["DateCreated"]); - m_dateLastMediaAdded = Jellyfin::Support::fromJsonValue(source["DateLastMediaAdded"]); - m_extraType = Jellyfin::Support::fromJsonValue(source["ExtraType"]); - m_airsBeforeSeasonNumber = Jellyfin::Support::fromJsonValue(source["AirsBeforeSeasonNumber"]); - m_airsAfterSeasonNumber = Jellyfin::Support::fromJsonValue(source["AirsAfterSeasonNumber"]); - m_airsBeforeEpisodeNumber = Jellyfin::Support::fromJsonValue(source["AirsBeforeEpisodeNumber"]); - m_canDelete = Jellyfin::Support::fromJsonValue(source["CanDelete"]); - m_canDownload = Jellyfin::Support::fromJsonValue(source["CanDownload"]); - m_hasSubtitles = Jellyfin::Support::fromJsonValue(source["HasSubtitles"]); - m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue(source["PreferredMetadataLanguage"]); - m_preferredMetadataCountryCode = Jellyfin::Support::fromJsonValue(source["PreferredMetadataCountryCode"]); - m_supportsSync = Jellyfin::Support::fromJsonValue(source["SupportsSync"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_sortName = Jellyfin::Support::fromJsonValue(source["SortName"]); - m_forcedSortName = Jellyfin::Support::fromJsonValue(source["ForcedSortName"]); - m_video3DFormat = Jellyfin::Support::fromJsonValue(source["Video3DFormat"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_externalUrls = Jellyfin::Support::fromJsonValue>>(source["ExternalUrls"]); - m_mediaSources = Jellyfin::Support::fromJsonValue>>(source["MediaSources"]); - m_criticRating = Jellyfin::Support::fromJsonValue(source["CriticRating"]); - m_productionLocations = Jellyfin::Support::fromJsonValue(source["ProductionLocations"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_enableMediaSourceDisplay = Jellyfin::Support::fromJsonValue(source["EnableMediaSourceDisplay"]); - m_officialRating = Jellyfin::Support::fromJsonValue(source["OfficialRating"]); - m_customRating = Jellyfin::Support::fromJsonValue(source["CustomRating"]); - m_channelId = Jellyfin::Support::fromJsonValue(source["ChannelId"]); - m_channelName = Jellyfin::Support::fromJsonValue(source["ChannelName"]); - m_overview = Jellyfin::Support::fromJsonValue(source["Overview"]); - m_taglines = Jellyfin::Support::fromJsonValue(source["Taglines"]); - m_genres = Jellyfin::Support::fromJsonValue(source["Genres"]); - m_communityRating = Jellyfin::Support::fromJsonValue(source["CommunityRating"]); - m_cumulativeRunTimeTicks = Jellyfin::Support::fromJsonValue(source["CumulativeRunTimeTicks"]); - m_runTimeTicks = Jellyfin::Support::fromJsonValue(source["RunTimeTicks"]); - m_playAccess = Jellyfin::Support::fromJsonValue(source["PlayAccess"]); - m_aspectRatio = Jellyfin::Support::fromJsonValue(source["AspectRatio"]); - m_productionYear = Jellyfin::Support::fromJsonValue(source["ProductionYear"]); - m_isPlaceHolder = Jellyfin::Support::fromJsonValue(source["IsPlaceHolder"]); - m_number = Jellyfin::Support::fromJsonValue(source["Number"]); - m_channelNumber = Jellyfin::Support::fromJsonValue(source["ChannelNumber"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_indexNumberEnd = Jellyfin::Support::fromJsonValue(source["IndexNumberEnd"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_remoteTrailers = Jellyfin::Support::fromJsonValue>>(source["RemoteTrailers"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_isHD = Jellyfin::Support::fromJsonValue(source["IsHD"]); - m_isFolder = Jellyfin::Support::fromJsonValue(source["IsFolder"]); - m_parentId = Jellyfin::Support::fromJsonValue(source["ParentId"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_people = Jellyfin::Support::fromJsonValue>>(source["People"]); - m_studios = Jellyfin::Support::fromJsonValue>>(source["Studios"]); - m_genreItems = Jellyfin::Support::fromJsonValue>>(source["GenreItems"]); - m_parentLogoItemId = Jellyfin::Support::fromJsonValue(source["ParentLogoItemId"]); - m_parentBackdropItemId = Jellyfin::Support::fromJsonValue(source["ParentBackdropItemId"]); - m_parentBackdropImageTags = Jellyfin::Support::fromJsonValue(source["ParentBackdropImageTags"]); - m_localTrailerCount = Jellyfin::Support::fromJsonValue(source["LocalTrailerCount"]); - m_userData = Jellyfin::Support::fromJsonValue>(source["UserData"]); - m_recursiveItemCount = Jellyfin::Support::fromJsonValue(source["RecursiveItemCount"]); - m_childCount = Jellyfin::Support::fromJsonValue(source["ChildCount"]); - m_seriesName = Jellyfin::Support::fromJsonValue(source["SeriesName"]); - m_seriesId = Jellyfin::Support::fromJsonValue(source["SeriesId"]); - m_seasonId = Jellyfin::Support::fromJsonValue(source["SeasonId"]); - m_specialFeatureCount = Jellyfin::Support::fromJsonValue(source["SpecialFeatureCount"]); - m_displayPreferencesId = Jellyfin::Support::fromJsonValue(source["DisplayPreferencesId"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - m_airTime = Jellyfin::Support::fromJsonValue(source["AirTime"]); - m_airDays = Jellyfin::Support::fromJsonValue>(source["AirDays"]); - m_tags = Jellyfin::Support::fromJsonValue(source["Tags"]); - m_primaryImageAspectRatio = Jellyfin::Support::fromJsonValue(source["PrimaryImageAspectRatio"]); - m_artists = Jellyfin::Support::fromJsonValue(source["Artists"]); - m_artistItems = Jellyfin::Support::fromJsonValue>>(source["ArtistItems"]); - m_album = Jellyfin::Support::fromJsonValue(source["Album"]); - m_collectionType = Jellyfin::Support::fromJsonValue(source["CollectionType"]); - m_displayOrder = Jellyfin::Support::fromJsonValue(source["DisplayOrder"]); - m_albumId = Jellyfin::Support::fromJsonValue(source["AlbumId"]); - m_albumPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["AlbumPrimaryImageTag"]); - m_seriesPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["SeriesPrimaryImageTag"]); - m_albumArtist = Jellyfin::Support::fromJsonValue(source["AlbumArtist"]); - m_albumArtists = Jellyfin::Support::fromJsonValue>>(source["AlbumArtists"]); - m_seasonName = Jellyfin::Support::fromJsonValue(source["SeasonName"]); - m_mediaStreams = Jellyfin::Support::fromJsonValue>>(source["MediaStreams"]); - m_videoType = Jellyfin::Support::fromJsonValue(source["VideoType"]); - m_partCount = Jellyfin::Support::fromJsonValue(source["PartCount"]); - m_mediaSourceCount = Jellyfin::Support::fromJsonValue(source["MediaSourceCount"]); - m_imageTags = Jellyfin::Support::fromJsonValue(source["ImageTags"]); - m_backdropImageTags = Jellyfin::Support::fromJsonValue(source["BackdropImageTags"]); - m_screenshotImageTags = Jellyfin::Support::fromJsonValue(source["ScreenshotImageTags"]); - m_parentLogoImageTag = Jellyfin::Support::fromJsonValue(source["ParentLogoImageTag"]); - m_parentArtItemId = Jellyfin::Support::fromJsonValue(source["ParentArtItemId"]); - m_parentArtImageTag = Jellyfin::Support::fromJsonValue(source["ParentArtImageTag"]); - m_seriesThumbImageTag = Jellyfin::Support::fromJsonValue(source["SeriesThumbImageTag"]); - m_imageBlurHashes = Jellyfin::Support::fromJsonValue(source["ImageBlurHashes"]); - m_seriesStudio = Jellyfin::Support::fromJsonValue(source["SeriesStudio"]); - m_parentThumbItemId = Jellyfin::Support::fromJsonValue(source["ParentThumbItemId"]); - m_parentThumbImageTag = Jellyfin::Support::fromJsonValue(source["ParentThumbImageTag"]); - m_parentPrimaryImageItemId = Jellyfin::Support::fromJsonValue(source["ParentPrimaryImageItemId"]); - m_parentPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["ParentPrimaryImageTag"]); - m_chapters = Jellyfin::Support::fromJsonValue>>(source["Chapters"]); - m_locationType = Jellyfin::Support::fromJsonValue(source["LocationType"]); - m_isoType = Jellyfin::Support::fromJsonValue(source["IsoType"]); - m_mediaType = Jellyfin::Support::fromJsonValue(source["MediaType"]); - m_endDate = Jellyfin::Support::fromJsonValue(source["EndDate"]); - m_lockedFields = Jellyfin::Support::fromJsonValue>(source["LockedFields"]); - m_trailerCount = Jellyfin::Support::fromJsonValue(source["TrailerCount"]); - m_movieCount = Jellyfin::Support::fromJsonValue(source["MovieCount"]); - m_seriesCount = Jellyfin::Support::fromJsonValue(source["SeriesCount"]); - m_programCount = Jellyfin::Support::fromJsonValue(source["ProgramCount"]); - m_episodeCount = Jellyfin::Support::fromJsonValue(source["EpisodeCount"]); - m_songCount = Jellyfin::Support::fromJsonValue(source["SongCount"]); - m_albumCount = Jellyfin::Support::fromJsonValue(source["AlbumCount"]); - m_artistCount = Jellyfin::Support::fromJsonValue(source["ArtistCount"]); - m_musicVideoCount = Jellyfin::Support::fromJsonValue(source["MusicVideoCount"]); - m_lockData = Jellyfin::Support::fromJsonValue(source["LockData"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_cameraMake = Jellyfin::Support::fromJsonValue(source["CameraMake"]); - m_cameraModel = Jellyfin::Support::fromJsonValue(source["CameraModel"]); - m_software = Jellyfin::Support::fromJsonValue(source["Software"]); - m_exposureTime = Jellyfin::Support::fromJsonValue(source["ExposureTime"]); - m_focalLength = Jellyfin::Support::fromJsonValue(source["FocalLength"]); - m_imageOrientation = Jellyfin::Support::fromJsonValue(source["ImageOrientation"]); - m_aperture = Jellyfin::Support::fromJsonValue(source["Aperture"]); - m_shutterSpeed = Jellyfin::Support::fromJsonValue(source["ShutterSpeed"]); - m_latitude = Jellyfin::Support::fromJsonValue(source["Latitude"]); - m_longitude = Jellyfin::Support::fromJsonValue(source["Longitude"]); - m_altitude = Jellyfin::Support::fromJsonValue(source["Altitude"]); - m_isoSpeedRating = Jellyfin::Support::fromJsonValue(source["IsoSpeedRating"]); - m_seriesTimerId = Jellyfin::Support::fromJsonValue(source["SeriesTimerId"]); - m_programId = Jellyfin::Support::fromJsonValue(source["ProgramId"]); - m_channelPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["ChannelPrimaryImageTag"]); - m_startDate = Jellyfin::Support::fromJsonValue(source["StartDate"]); - m_completionPercentage = Jellyfin::Support::fromJsonValue(source["CompletionPercentage"]); - m_isRepeat = Jellyfin::Support::fromJsonValue(source["IsRepeat"]); - m_episodeTitle = Jellyfin::Support::fromJsonValue(source["EpisodeTitle"]); - m_channelType = Jellyfin::Support::fromJsonValue(source["ChannelType"]); - m_audio = Jellyfin::Support::fromJsonValue(source["Audio"]); - m_isMovie = Jellyfin::Support::fromJsonValue(source["IsMovie"]); - m_isSports = Jellyfin::Support::fromJsonValue(source["IsSports"]); - m_isSeries = Jellyfin::Support::fromJsonValue(source["IsSeries"]); - m_isLive = Jellyfin::Support::fromJsonValue(source["IsLive"]); - m_isNews = Jellyfin::Support::fromJsonValue(source["IsNews"]); - m_isKids = Jellyfin::Support::fromJsonValue(source["IsKids"]); - m_isPremiere = Jellyfin::Support::fromJsonValue(source["IsPremiere"]); - m_timerId = Jellyfin::Support::fromJsonValue(source["TimerId"]); - m_currentProgram = Jellyfin::Support::fromJsonValue>(source["CurrentProgram"]); - -} - -QJsonObject BaseItemDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["OriginalTitle"] = Jellyfin::Support::toJsonValue(m_originalTitle); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Etag"] = Jellyfin::Support::toJsonValue(m_etag); - result["SourceType"] = Jellyfin::Support::toJsonValue(m_sourceType); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); - result["DateLastMediaAdded"] = Jellyfin::Support::toJsonValue(m_dateLastMediaAdded); - result["ExtraType"] = Jellyfin::Support::toJsonValue(m_extraType); - result["AirsBeforeSeasonNumber"] = Jellyfin::Support::toJsonValue(m_airsBeforeSeasonNumber); - result["AirsAfterSeasonNumber"] = Jellyfin::Support::toJsonValue(m_airsAfterSeasonNumber); - result["AirsBeforeEpisodeNumber"] = Jellyfin::Support::toJsonValue(m_airsBeforeEpisodeNumber); - result["CanDelete"] = Jellyfin::Support::toJsonValue(m_canDelete); - result["CanDownload"] = Jellyfin::Support::toJsonValue(m_canDownload); - result["HasSubtitles"] = Jellyfin::Support::toJsonValue(m_hasSubtitles); - result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue(m_preferredMetadataLanguage); - result["PreferredMetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_preferredMetadataCountryCode); - result["SupportsSync"] = Jellyfin::Support::toJsonValue(m_supportsSync); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["SortName"] = Jellyfin::Support::toJsonValue(m_sortName); - result["ForcedSortName"] = Jellyfin::Support::toJsonValue(m_forcedSortName); - result["Video3DFormat"] = Jellyfin::Support::toJsonValue(m_video3DFormat); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["ExternalUrls"] = Jellyfin::Support::toJsonValue>>(m_externalUrls); - result["MediaSources"] = Jellyfin::Support::toJsonValue>>(m_mediaSources); - result["CriticRating"] = Jellyfin::Support::toJsonValue(m_criticRating); - result["ProductionLocations"] = Jellyfin::Support::toJsonValue(m_productionLocations); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["EnableMediaSourceDisplay"] = Jellyfin::Support::toJsonValue(m_enableMediaSourceDisplay); - result["OfficialRating"] = Jellyfin::Support::toJsonValue(m_officialRating); - result["CustomRating"] = Jellyfin::Support::toJsonValue(m_customRating); - result["ChannelId"] = Jellyfin::Support::toJsonValue(m_channelId); - result["ChannelName"] = Jellyfin::Support::toJsonValue(m_channelName); - result["Overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["Taglines"] = Jellyfin::Support::toJsonValue(m_taglines); - result["Genres"] = Jellyfin::Support::toJsonValue(m_genres); - result["CommunityRating"] = Jellyfin::Support::toJsonValue(m_communityRating); - result["CumulativeRunTimeTicks"] = Jellyfin::Support::toJsonValue(m_cumulativeRunTimeTicks); - result["RunTimeTicks"] = Jellyfin::Support::toJsonValue(m_runTimeTicks); - result["PlayAccess"] = Jellyfin::Support::toJsonValue(m_playAccess); - result["AspectRatio"] = Jellyfin::Support::toJsonValue(m_aspectRatio); - result["ProductionYear"] = Jellyfin::Support::toJsonValue(m_productionYear); - result["IsPlaceHolder"] = Jellyfin::Support::toJsonValue(m_isPlaceHolder); - result["Number"] = Jellyfin::Support::toJsonValue(m_number); - result["ChannelNumber"] = Jellyfin::Support::toJsonValue(m_channelNumber); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue(m_indexNumberEnd); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["RemoteTrailers"] = Jellyfin::Support::toJsonValue>>(m_remoteTrailers); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["IsHD"] = Jellyfin::Support::toJsonValue(m_isHD); - result["IsFolder"] = Jellyfin::Support::toJsonValue(m_isFolder); - result["ParentId"] = Jellyfin::Support::toJsonValue(m_parentId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["People"] = Jellyfin::Support::toJsonValue>>(m_people); - result["Studios"] = Jellyfin::Support::toJsonValue>>(m_studios); - result["GenreItems"] = Jellyfin::Support::toJsonValue>>(m_genreItems); - result["ParentLogoItemId"] = Jellyfin::Support::toJsonValue(m_parentLogoItemId); - result["ParentBackdropItemId"] = Jellyfin::Support::toJsonValue(m_parentBackdropItemId); - result["ParentBackdropImageTags"] = Jellyfin::Support::toJsonValue(m_parentBackdropImageTags); - result["LocalTrailerCount"] = Jellyfin::Support::toJsonValue(m_localTrailerCount); - result["UserData"] = Jellyfin::Support::toJsonValue>(m_userData); - result["RecursiveItemCount"] = Jellyfin::Support::toJsonValue(m_recursiveItemCount); - result["ChildCount"] = Jellyfin::Support::toJsonValue(m_childCount); - result["SeriesName"] = Jellyfin::Support::toJsonValue(m_seriesName); - result["SeriesId"] = Jellyfin::Support::toJsonValue(m_seriesId); - result["SeasonId"] = Jellyfin::Support::toJsonValue(m_seasonId); - result["SpecialFeatureCount"] = Jellyfin::Support::toJsonValue(m_specialFeatureCount); - result["DisplayPreferencesId"] = Jellyfin::Support::toJsonValue(m_displayPreferencesId); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - result["AirTime"] = Jellyfin::Support::toJsonValue(m_airTime); - result["AirDays"] = Jellyfin::Support::toJsonValue>(m_airDays); - result["Tags"] = Jellyfin::Support::toJsonValue(m_tags); - result["PrimaryImageAspectRatio"] = Jellyfin::Support::toJsonValue(m_primaryImageAspectRatio); - result["Artists"] = Jellyfin::Support::toJsonValue(m_artists); - result["ArtistItems"] = Jellyfin::Support::toJsonValue>>(m_artistItems); - result["Album"] = Jellyfin::Support::toJsonValue(m_album); - result["CollectionType"] = Jellyfin::Support::toJsonValue(m_collectionType); - result["DisplayOrder"] = Jellyfin::Support::toJsonValue(m_displayOrder); - result["AlbumId"] = Jellyfin::Support::toJsonValue(m_albumId); - result["AlbumPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_albumPrimaryImageTag); - result["SeriesPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_seriesPrimaryImageTag); - result["AlbumArtist"] = Jellyfin::Support::toJsonValue(m_albumArtist); - result["AlbumArtists"] = Jellyfin::Support::toJsonValue>>(m_albumArtists); - result["SeasonName"] = Jellyfin::Support::toJsonValue(m_seasonName); - result["MediaStreams"] = Jellyfin::Support::toJsonValue>>(m_mediaStreams); - result["VideoType"] = Jellyfin::Support::toJsonValue(m_videoType); - result["PartCount"] = Jellyfin::Support::toJsonValue(m_partCount); - result["MediaSourceCount"] = Jellyfin::Support::toJsonValue(m_mediaSourceCount); - result["ImageTags"] = Jellyfin::Support::toJsonValue(m_imageTags); - result["BackdropImageTags"] = Jellyfin::Support::toJsonValue(m_backdropImageTags); - result["ScreenshotImageTags"] = Jellyfin::Support::toJsonValue(m_screenshotImageTags); - result["ParentLogoImageTag"] = Jellyfin::Support::toJsonValue(m_parentLogoImageTag); - result["ParentArtItemId"] = Jellyfin::Support::toJsonValue(m_parentArtItemId); - result["ParentArtImageTag"] = Jellyfin::Support::toJsonValue(m_parentArtImageTag); - result["SeriesThumbImageTag"] = Jellyfin::Support::toJsonValue(m_seriesThumbImageTag); - result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue(m_imageBlurHashes); - result["SeriesStudio"] = Jellyfin::Support::toJsonValue(m_seriesStudio); - result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue(m_parentThumbItemId); - result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue(m_parentThumbImageTag); - result["ParentPrimaryImageItemId"] = Jellyfin::Support::toJsonValue(m_parentPrimaryImageItemId); - result["ParentPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_parentPrimaryImageTag); - result["Chapters"] = Jellyfin::Support::toJsonValue>>(m_chapters); - result["LocationType"] = Jellyfin::Support::toJsonValue(m_locationType); - result["IsoType"] = Jellyfin::Support::toJsonValue(m_isoType); - result["MediaType"] = Jellyfin::Support::toJsonValue(m_mediaType); - result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); - result["LockedFields"] = Jellyfin::Support::toJsonValue>(m_lockedFields); - result["TrailerCount"] = Jellyfin::Support::toJsonValue(m_trailerCount); - result["MovieCount"] = Jellyfin::Support::toJsonValue(m_movieCount); - result["SeriesCount"] = Jellyfin::Support::toJsonValue(m_seriesCount); - result["ProgramCount"] = Jellyfin::Support::toJsonValue(m_programCount); - result["EpisodeCount"] = Jellyfin::Support::toJsonValue(m_episodeCount); - result["SongCount"] = Jellyfin::Support::toJsonValue(m_songCount); - result["AlbumCount"] = Jellyfin::Support::toJsonValue(m_albumCount); - result["ArtistCount"] = Jellyfin::Support::toJsonValue(m_artistCount); - result["MusicVideoCount"] = Jellyfin::Support::toJsonValue(m_musicVideoCount); - result["LockData"] = Jellyfin::Support::toJsonValue(m_lockData); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["CameraMake"] = Jellyfin::Support::toJsonValue(m_cameraMake); - result["CameraModel"] = Jellyfin::Support::toJsonValue(m_cameraModel); - result["Software"] = Jellyfin::Support::toJsonValue(m_software); - result["ExposureTime"] = Jellyfin::Support::toJsonValue(m_exposureTime); - result["FocalLength"] = Jellyfin::Support::toJsonValue(m_focalLength); - result["ImageOrientation"] = Jellyfin::Support::toJsonValue(m_imageOrientation); - result["Aperture"] = Jellyfin::Support::toJsonValue(m_aperture); - result["ShutterSpeed"] = Jellyfin::Support::toJsonValue(m_shutterSpeed); - result["Latitude"] = Jellyfin::Support::toJsonValue(m_latitude); - result["Longitude"] = Jellyfin::Support::toJsonValue(m_longitude); - result["Altitude"] = Jellyfin::Support::toJsonValue(m_altitude); - result["IsoSpeedRating"] = Jellyfin::Support::toJsonValue(m_isoSpeedRating); - result["SeriesTimerId"] = Jellyfin::Support::toJsonValue(m_seriesTimerId); - result["ProgramId"] = Jellyfin::Support::toJsonValue(m_programId); - result["ChannelPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_channelPrimaryImageTag); - result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); - result["CompletionPercentage"] = Jellyfin::Support::toJsonValue(m_completionPercentage); - result["IsRepeat"] = Jellyfin::Support::toJsonValue(m_isRepeat); - result["EpisodeTitle"] = Jellyfin::Support::toJsonValue(m_episodeTitle); - result["ChannelType"] = Jellyfin::Support::toJsonValue(m_channelType); - result["Audio"] = Jellyfin::Support::toJsonValue(m_audio); - result["IsMovie"] = Jellyfin::Support::toJsonValue(m_isMovie); - result["IsSports"] = Jellyfin::Support::toJsonValue(m_isSports); - result["IsSeries"] = Jellyfin::Support::toJsonValue(m_isSeries); - result["IsLive"] = Jellyfin::Support::toJsonValue(m_isLive); - result["IsNews"] = Jellyfin::Support::toJsonValue(m_isNews); - result["IsKids"] = Jellyfin::Support::toJsonValue(m_isKids); - result["IsPremiere"] = Jellyfin::Support::toJsonValue(m_isPremiere); - result["TimerId"] = Jellyfin::Support::toJsonValue(m_timerId); - result["CurrentProgram"] = Jellyfin::Support::toJsonValue>(m_currentProgram); - - return result; -} - -QString BaseItemDto::name() const { return m_name; } - -void BaseItemDto::setName(QString newName) { - m_name = newName; -} -QString BaseItemDto::originalTitle() const { return m_originalTitle; } - -void BaseItemDto::setOriginalTitle(QString newOriginalTitle) { - m_originalTitle = newOriginalTitle; -} -QString BaseItemDto::serverId() const { return m_serverId; } - -void BaseItemDto::setServerId(QString newServerId) { - m_serverId = newServerId; -} -QUuid BaseItemDto::jellyfinId() const { return m_jellyfinId; } - -void BaseItemDto::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString BaseItemDto::etag() const { return m_etag; } - -void BaseItemDto::setEtag(QString newEtag) { - m_etag = newEtag; -} -QString BaseItemDto::sourceType() const { return m_sourceType; } - -void BaseItemDto::setSourceType(QString newSourceType) { - m_sourceType = newSourceType; -} -QString BaseItemDto::playlistItemId() const { return m_playlistItemId; } - -void BaseItemDto::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} -QDateTime BaseItemDto::dateCreated() const { return m_dateCreated; } - -void BaseItemDto::setDateCreated(QDateTime newDateCreated) { - m_dateCreated = newDateCreated; -} -QDateTime BaseItemDto::dateLastMediaAdded() const { return m_dateLastMediaAdded; } - -void BaseItemDto::setDateLastMediaAdded(QDateTime newDateLastMediaAdded) { - m_dateLastMediaAdded = newDateLastMediaAdded; -} -QString BaseItemDto::extraType() const { return m_extraType; } - -void BaseItemDto::setExtraType(QString newExtraType) { - m_extraType = newExtraType; -} -qint32 BaseItemDto::airsBeforeSeasonNumber() const { return m_airsBeforeSeasonNumber; } - -void BaseItemDto::setAirsBeforeSeasonNumber(qint32 newAirsBeforeSeasonNumber) { - m_airsBeforeSeasonNumber = newAirsBeforeSeasonNumber; -} -qint32 BaseItemDto::airsAfterSeasonNumber() const { return m_airsAfterSeasonNumber; } - -void BaseItemDto::setAirsAfterSeasonNumber(qint32 newAirsAfterSeasonNumber) { - m_airsAfterSeasonNumber = newAirsAfterSeasonNumber; -} -qint32 BaseItemDto::airsBeforeEpisodeNumber() const { return m_airsBeforeEpisodeNumber; } - -void BaseItemDto::setAirsBeforeEpisodeNumber(qint32 newAirsBeforeEpisodeNumber) { - m_airsBeforeEpisodeNumber = newAirsBeforeEpisodeNumber; -} -bool BaseItemDto::canDelete() const { return m_canDelete; } - -void BaseItemDto::setCanDelete(bool newCanDelete) { - m_canDelete = newCanDelete; -} -bool BaseItemDto::canDownload() const { return m_canDownload; } - -void BaseItemDto::setCanDownload(bool newCanDownload) { - m_canDownload = newCanDownload; -} -bool BaseItemDto::hasSubtitles() const { return m_hasSubtitles; } - -void BaseItemDto::setHasSubtitles(bool newHasSubtitles) { - m_hasSubtitles = newHasSubtitles; -} -QString BaseItemDto::preferredMetadataLanguage() const { return m_preferredMetadataLanguage; } - -void BaseItemDto::setPreferredMetadataLanguage(QString newPreferredMetadataLanguage) { - m_preferredMetadataLanguage = newPreferredMetadataLanguage; -} -QString BaseItemDto::preferredMetadataCountryCode() const { return m_preferredMetadataCountryCode; } - -void BaseItemDto::setPreferredMetadataCountryCode(QString newPreferredMetadataCountryCode) { - m_preferredMetadataCountryCode = newPreferredMetadataCountryCode; -} -bool BaseItemDto::supportsSync() const { return m_supportsSync; } - -void BaseItemDto::setSupportsSync(bool newSupportsSync) { - m_supportsSync = newSupportsSync; -} -QString BaseItemDto::container() const { return m_container; } - -void BaseItemDto::setContainer(QString newContainer) { - m_container = newContainer; -} -QString BaseItemDto::sortName() const { return m_sortName; } - -void BaseItemDto::setSortName(QString newSortName) { - m_sortName = newSortName; -} -QString BaseItemDto::forcedSortName() const { return m_forcedSortName; } - -void BaseItemDto::setForcedSortName(QString newForcedSortName) { - m_forcedSortName = newForcedSortName; -} -Video3DFormat BaseItemDto::video3DFormat() const { return m_video3DFormat; } - -void BaseItemDto::setVideo3DFormat(Video3DFormat newVideo3DFormat) { - m_video3DFormat = newVideo3DFormat; -} -QDateTime BaseItemDto::premiereDate() const { return m_premiereDate; } - -void BaseItemDto::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -QList> BaseItemDto::externalUrls() const { return m_externalUrls; } - -void BaseItemDto::setExternalUrls(QList> newExternalUrls) { - m_externalUrls = newExternalUrls; -} -QList> BaseItemDto::mediaSources() const { return m_mediaSources; } - -void BaseItemDto::setMediaSources(QList> newMediaSources) { - m_mediaSources = newMediaSources; -} -float BaseItemDto::criticRating() const { return m_criticRating; } - -void BaseItemDto::setCriticRating(float newCriticRating) { - m_criticRating = newCriticRating; -} -QStringList BaseItemDto::productionLocations() const { return m_productionLocations; } - -void BaseItemDto::setProductionLocations(QStringList newProductionLocations) { - m_productionLocations = newProductionLocations; -} -QString BaseItemDto::path() const { return m_path; } - -void BaseItemDto::setPath(QString newPath) { - m_path = newPath; -} -bool BaseItemDto::enableMediaSourceDisplay() const { return m_enableMediaSourceDisplay; } - -void BaseItemDto::setEnableMediaSourceDisplay(bool newEnableMediaSourceDisplay) { - m_enableMediaSourceDisplay = newEnableMediaSourceDisplay; -} -QString BaseItemDto::officialRating() const { return m_officialRating; } - -void BaseItemDto::setOfficialRating(QString newOfficialRating) { - m_officialRating = newOfficialRating; -} -QString BaseItemDto::customRating() const { return m_customRating; } - -void BaseItemDto::setCustomRating(QString newCustomRating) { - m_customRating = newCustomRating; -} -QUuid BaseItemDto::channelId() const { return m_channelId; } - -void BaseItemDto::setChannelId(QUuid newChannelId) { - m_channelId = newChannelId; -} -QString BaseItemDto::channelName() const { return m_channelName; } - -void BaseItemDto::setChannelName(QString newChannelName) { - m_channelName = newChannelName; -} -QString BaseItemDto::overview() const { return m_overview; } - -void BaseItemDto::setOverview(QString newOverview) { - m_overview = newOverview; -} -QStringList BaseItemDto::taglines() const { return m_taglines; } - -void BaseItemDto::setTaglines(QStringList newTaglines) { - m_taglines = newTaglines; -} -QStringList BaseItemDto::genres() const { return m_genres; } - -void BaseItemDto::setGenres(QStringList newGenres) { - m_genres = newGenres; -} -float BaseItemDto::communityRating() const { return m_communityRating; } - -void BaseItemDto::setCommunityRating(float newCommunityRating) { - m_communityRating = newCommunityRating; -} -qint64 BaseItemDto::cumulativeRunTimeTicks() const { return m_cumulativeRunTimeTicks; } - -void BaseItemDto::setCumulativeRunTimeTicks(qint64 newCumulativeRunTimeTicks) { - m_cumulativeRunTimeTicks = newCumulativeRunTimeTicks; -} -qint64 BaseItemDto::runTimeTicks() const { return m_runTimeTicks; } - -void BaseItemDto::setRunTimeTicks(qint64 newRunTimeTicks) { - m_runTimeTicks = newRunTimeTicks; -} -PlayAccess BaseItemDto::playAccess() const { return m_playAccess; } - -void BaseItemDto::setPlayAccess(PlayAccess newPlayAccess) { - m_playAccess = newPlayAccess; -} -QString BaseItemDto::aspectRatio() const { return m_aspectRatio; } - -void BaseItemDto::setAspectRatio(QString newAspectRatio) { - m_aspectRatio = newAspectRatio; -} -qint32 BaseItemDto::productionYear() const { return m_productionYear; } - -void BaseItemDto::setProductionYear(qint32 newProductionYear) { - m_productionYear = newProductionYear; -} -bool BaseItemDto::isPlaceHolder() const { return m_isPlaceHolder; } - -void BaseItemDto::setIsPlaceHolder(bool newIsPlaceHolder) { - m_isPlaceHolder = newIsPlaceHolder; -} -QString BaseItemDto::number() const { return m_number; } - -void BaseItemDto::setNumber(QString newNumber) { - m_number = newNumber; -} -QString BaseItemDto::channelNumber() const { return m_channelNumber; } - -void BaseItemDto::setChannelNumber(QString newChannelNumber) { - m_channelNumber = newChannelNumber; -} -qint32 BaseItemDto::indexNumber() const { return m_indexNumber; } - -void BaseItemDto::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 BaseItemDto::indexNumberEnd() const { return m_indexNumberEnd; } - -void BaseItemDto::setIndexNumberEnd(qint32 newIndexNumberEnd) { - m_indexNumberEnd = newIndexNumberEnd; -} -qint32 BaseItemDto::parentIndexNumber() const { return m_parentIndexNumber; } - -void BaseItemDto::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QList> BaseItemDto::remoteTrailers() const { return m_remoteTrailers; } - -void BaseItemDto::setRemoteTrailers(QList> newRemoteTrailers) { - m_remoteTrailers = newRemoteTrailers; -} -QJsonObject BaseItemDto::providerIds() const { return m_providerIds; } - -void BaseItemDto::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -bool BaseItemDto::isHD() const { return m_isHD; } - -void BaseItemDto::setIsHD(bool newIsHD) { - m_isHD = newIsHD; -} -bool BaseItemDto::isFolder() const { return m_isFolder; } - -void BaseItemDto::setIsFolder(bool newIsFolder) { - m_isFolder = newIsFolder; -} -QUuid BaseItemDto::parentId() const { return m_parentId; } - -void BaseItemDto::setParentId(QUuid newParentId) { - m_parentId = newParentId; -} -QString BaseItemDto::type() const { return m_type; } - -void BaseItemDto::setType(QString newType) { - m_type = newType; -} -QList> BaseItemDto::people() const { return m_people; } - -void BaseItemDto::setPeople(QList> newPeople) { - m_people = newPeople; -} -QList> BaseItemDto::studios() const { return m_studios; } - -void BaseItemDto::setStudios(QList> newStudios) { - m_studios = newStudios; -} -QList> BaseItemDto::genreItems() const { return m_genreItems; } - -void BaseItemDto::setGenreItems(QList> newGenreItems) { - m_genreItems = newGenreItems; -} -QString BaseItemDto::parentLogoItemId() const { return m_parentLogoItemId; } - -void BaseItemDto::setParentLogoItemId(QString newParentLogoItemId) { - m_parentLogoItemId = newParentLogoItemId; -} -QString BaseItemDto::parentBackdropItemId() const { return m_parentBackdropItemId; } - -void BaseItemDto::setParentBackdropItemId(QString newParentBackdropItemId) { - m_parentBackdropItemId = newParentBackdropItemId; -} -QStringList BaseItemDto::parentBackdropImageTags() const { return m_parentBackdropImageTags; } - -void BaseItemDto::setParentBackdropImageTags(QStringList newParentBackdropImageTags) { - m_parentBackdropImageTags = newParentBackdropImageTags; -} -qint32 BaseItemDto::localTrailerCount() const { return m_localTrailerCount; } - -void BaseItemDto::setLocalTrailerCount(qint32 newLocalTrailerCount) { - m_localTrailerCount = newLocalTrailerCount; -} -QSharedPointer BaseItemDto::userData() const { return m_userData; } - -void BaseItemDto::setUserData(QSharedPointer newUserData) { - m_userData = newUserData; -} -qint32 BaseItemDto::recursiveItemCount() const { return m_recursiveItemCount; } - -void BaseItemDto::setRecursiveItemCount(qint32 newRecursiveItemCount) { - m_recursiveItemCount = newRecursiveItemCount; -} -qint32 BaseItemDto::childCount() const { return m_childCount; } - -void BaseItemDto::setChildCount(qint32 newChildCount) { - m_childCount = newChildCount; -} -QString BaseItemDto::seriesName() const { return m_seriesName; } - -void BaseItemDto::setSeriesName(QString newSeriesName) { - m_seriesName = newSeriesName; -} -QUuid BaseItemDto::seriesId() const { return m_seriesId; } - -void BaseItemDto::setSeriesId(QUuid newSeriesId) { - m_seriesId = newSeriesId; -} -QUuid BaseItemDto::seasonId() const { return m_seasonId; } - -void BaseItemDto::setSeasonId(QUuid newSeasonId) { - m_seasonId = newSeasonId; -} -qint32 BaseItemDto::specialFeatureCount() const { return m_specialFeatureCount; } - -void BaseItemDto::setSpecialFeatureCount(qint32 newSpecialFeatureCount) { - m_specialFeatureCount = newSpecialFeatureCount; -} -QString BaseItemDto::displayPreferencesId() const { return m_displayPreferencesId; } - -void BaseItemDto::setDisplayPreferencesId(QString newDisplayPreferencesId) { - m_displayPreferencesId = newDisplayPreferencesId; -} -QString BaseItemDto::status() const { return m_status; } - -void BaseItemDto::setStatus(QString newStatus) { - m_status = newStatus; -} -QString BaseItemDto::airTime() const { return m_airTime; } - -void BaseItemDto::setAirTime(QString newAirTime) { - m_airTime = newAirTime; -} -QList BaseItemDto::airDays() const { return m_airDays; } - -void BaseItemDto::setAirDays(QList newAirDays) { - m_airDays = newAirDays; -} -QStringList BaseItemDto::tags() const { return m_tags; } - -void BaseItemDto::setTags(QStringList newTags) { - m_tags = newTags; -} -double BaseItemDto::primaryImageAspectRatio() const { return m_primaryImageAspectRatio; } - -void BaseItemDto::setPrimaryImageAspectRatio(double newPrimaryImageAspectRatio) { - m_primaryImageAspectRatio = newPrimaryImageAspectRatio; -} -QStringList BaseItemDto::artists() const { return m_artists; } - -void BaseItemDto::setArtists(QStringList newArtists) { - m_artists = newArtists; -} -QList> BaseItemDto::artistItems() const { return m_artistItems; } - -void BaseItemDto::setArtistItems(QList> newArtistItems) { - m_artistItems = newArtistItems; -} -QString BaseItemDto::album() const { return m_album; } - -void BaseItemDto::setAlbum(QString newAlbum) { - m_album = newAlbum; -} -QString BaseItemDto::collectionType() const { return m_collectionType; } - -void BaseItemDto::setCollectionType(QString newCollectionType) { - m_collectionType = newCollectionType; -} -QString BaseItemDto::displayOrder() const { return m_displayOrder; } - -void BaseItemDto::setDisplayOrder(QString newDisplayOrder) { - m_displayOrder = newDisplayOrder; -} -QUuid BaseItemDto::albumId() const { return m_albumId; } - -void BaseItemDto::setAlbumId(QUuid newAlbumId) { - m_albumId = newAlbumId; -} -QString BaseItemDto::albumPrimaryImageTag() const { return m_albumPrimaryImageTag; } - -void BaseItemDto::setAlbumPrimaryImageTag(QString newAlbumPrimaryImageTag) { - m_albumPrimaryImageTag = newAlbumPrimaryImageTag; -} -QString BaseItemDto::seriesPrimaryImageTag() const { return m_seriesPrimaryImageTag; } - -void BaseItemDto::setSeriesPrimaryImageTag(QString newSeriesPrimaryImageTag) { - m_seriesPrimaryImageTag = newSeriesPrimaryImageTag; -} -QString BaseItemDto::albumArtist() const { return m_albumArtist; } - -void BaseItemDto::setAlbumArtist(QString newAlbumArtist) { - m_albumArtist = newAlbumArtist; -} -QList> BaseItemDto::albumArtists() const { return m_albumArtists; } - -void BaseItemDto::setAlbumArtists(QList> newAlbumArtists) { - m_albumArtists = newAlbumArtists; -} -QString BaseItemDto::seasonName() const { return m_seasonName; } - -void BaseItemDto::setSeasonName(QString newSeasonName) { - m_seasonName = newSeasonName; -} -QList> BaseItemDto::mediaStreams() const { return m_mediaStreams; } - -void BaseItemDto::setMediaStreams(QList> newMediaStreams) { - m_mediaStreams = newMediaStreams; -} -VideoType BaseItemDto::videoType() const { return m_videoType; } - -void BaseItemDto::setVideoType(VideoType newVideoType) { - m_videoType = newVideoType; -} -qint32 BaseItemDto::partCount() const { return m_partCount; } - -void BaseItemDto::setPartCount(qint32 newPartCount) { - m_partCount = newPartCount; -} -qint32 BaseItemDto::mediaSourceCount() const { return m_mediaSourceCount; } - -void BaseItemDto::setMediaSourceCount(qint32 newMediaSourceCount) { - m_mediaSourceCount = newMediaSourceCount; -} -QJsonObject BaseItemDto::imageTags() const { return m_imageTags; } - -void BaseItemDto::setImageTags(QJsonObject newImageTags) { - m_imageTags = newImageTags; -} -QStringList BaseItemDto::backdropImageTags() const { return m_backdropImageTags; } - -void BaseItemDto::setBackdropImageTags(QStringList newBackdropImageTags) { - m_backdropImageTags = newBackdropImageTags; -} -QStringList BaseItemDto::screenshotImageTags() const { return m_screenshotImageTags; } - -void BaseItemDto::setScreenshotImageTags(QStringList newScreenshotImageTags) { - m_screenshotImageTags = newScreenshotImageTags; -} -QString BaseItemDto::parentLogoImageTag() const { return m_parentLogoImageTag; } - -void BaseItemDto::setParentLogoImageTag(QString newParentLogoImageTag) { - m_parentLogoImageTag = newParentLogoImageTag; -} -QString BaseItemDto::parentArtItemId() const { return m_parentArtItemId; } - -void BaseItemDto::setParentArtItemId(QString newParentArtItemId) { - m_parentArtItemId = newParentArtItemId; -} -QString BaseItemDto::parentArtImageTag() const { return m_parentArtImageTag; } - -void BaseItemDto::setParentArtImageTag(QString newParentArtImageTag) { - m_parentArtImageTag = newParentArtImageTag; -} -QString BaseItemDto::seriesThumbImageTag() const { return m_seriesThumbImageTag; } - -void BaseItemDto::setSeriesThumbImageTag(QString newSeriesThumbImageTag) { - m_seriesThumbImageTag = newSeriesThumbImageTag; -} -QJsonObject BaseItemDto::imageBlurHashes() const { return m_imageBlurHashes; } - -void BaseItemDto::setImageBlurHashes(QJsonObject newImageBlurHashes) { - m_imageBlurHashes = newImageBlurHashes; -} -QString BaseItemDto::seriesStudio() const { return m_seriesStudio; } - -void BaseItemDto::setSeriesStudio(QString newSeriesStudio) { - m_seriesStudio = newSeriesStudio; -} -QString BaseItemDto::parentThumbItemId() const { return m_parentThumbItemId; } - -void BaseItemDto::setParentThumbItemId(QString newParentThumbItemId) { - m_parentThumbItemId = newParentThumbItemId; -} -QString BaseItemDto::parentThumbImageTag() const { return m_parentThumbImageTag; } - -void BaseItemDto::setParentThumbImageTag(QString newParentThumbImageTag) { - m_parentThumbImageTag = newParentThumbImageTag; -} -QString BaseItemDto::parentPrimaryImageItemId() const { return m_parentPrimaryImageItemId; } - -void BaseItemDto::setParentPrimaryImageItemId(QString newParentPrimaryImageItemId) { - m_parentPrimaryImageItemId = newParentPrimaryImageItemId; -} -QString BaseItemDto::parentPrimaryImageTag() const { return m_parentPrimaryImageTag; } - -void BaseItemDto::setParentPrimaryImageTag(QString newParentPrimaryImageTag) { - m_parentPrimaryImageTag = newParentPrimaryImageTag; -} -QList> BaseItemDto::chapters() const { return m_chapters; } - -void BaseItemDto::setChapters(QList> newChapters) { - m_chapters = newChapters; -} -LocationType BaseItemDto::locationType() const { return m_locationType; } - -void BaseItemDto::setLocationType(LocationType newLocationType) { - m_locationType = newLocationType; -} -IsoType BaseItemDto::isoType() const { return m_isoType; } - -void BaseItemDto::setIsoType(IsoType newIsoType) { - m_isoType = newIsoType; -} -QString BaseItemDto::mediaType() const { return m_mediaType; } - -void BaseItemDto::setMediaType(QString newMediaType) { - m_mediaType = newMediaType; -} -QDateTime BaseItemDto::endDate() const { return m_endDate; } - -void BaseItemDto::setEndDate(QDateTime newEndDate) { - m_endDate = newEndDate; -} -QList BaseItemDto::lockedFields() const { return m_lockedFields; } - -void BaseItemDto::setLockedFields(QList newLockedFields) { - m_lockedFields = newLockedFields; -} -qint32 BaseItemDto::trailerCount() const { return m_trailerCount; } - -void BaseItemDto::setTrailerCount(qint32 newTrailerCount) { - m_trailerCount = newTrailerCount; -} -qint32 BaseItemDto::movieCount() const { return m_movieCount; } - -void BaseItemDto::setMovieCount(qint32 newMovieCount) { - m_movieCount = newMovieCount; -} -qint32 BaseItemDto::seriesCount() const { return m_seriesCount; } - -void BaseItemDto::setSeriesCount(qint32 newSeriesCount) { - m_seriesCount = newSeriesCount; -} -qint32 BaseItemDto::programCount() const { return m_programCount; } - -void BaseItemDto::setProgramCount(qint32 newProgramCount) { - m_programCount = newProgramCount; -} -qint32 BaseItemDto::episodeCount() const { return m_episodeCount; } - -void BaseItemDto::setEpisodeCount(qint32 newEpisodeCount) { - m_episodeCount = newEpisodeCount; -} -qint32 BaseItemDto::songCount() const { return m_songCount; } - -void BaseItemDto::setSongCount(qint32 newSongCount) { - m_songCount = newSongCount; -} -qint32 BaseItemDto::albumCount() const { return m_albumCount; } - -void BaseItemDto::setAlbumCount(qint32 newAlbumCount) { - m_albumCount = newAlbumCount; -} -qint32 BaseItemDto::artistCount() const { return m_artistCount; } - -void BaseItemDto::setArtistCount(qint32 newArtistCount) { - m_artistCount = newArtistCount; -} -qint32 BaseItemDto::musicVideoCount() const { return m_musicVideoCount; } - -void BaseItemDto::setMusicVideoCount(qint32 newMusicVideoCount) { - m_musicVideoCount = newMusicVideoCount; -} -bool BaseItemDto::lockData() const { return m_lockData; } - -void BaseItemDto::setLockData(bool newLockData) { - m_lockData = newLockData; -} -qint32 BaseItemDto::width() const { return m_width; } - -void BaseItemDto::setWidth(qint32 newWidth) { - m_width = newWidth; -} -qint32 BaseItemDto::height() const { return m_height; } - -void BaseItemDto::setHeight(qint32 newHeight) { - m_height = newHeight; -} -QString BaseItemDto::cameraMake() const { return m_cameraMake; } - -void BaseItemDto::setCameraMake(QString newCameraMake) { - m_cameraMake = newCameraMake; -} -QString BaseItemDto::cameraModel() const { return m_cameraModel; } - -void BaseItemDto::setCameraModel(QString newCameraModel) { - m_cameraModel = newCameraModel; -} -QString BaseItemDto::software() const { return m_software; } - -void BaseItemDto::setSoftware(QString newSoftware) { - m_software = newSoftware; -} -double BaseItemDto::exposureTime() const { return m_exposureTime; } - -void BaseItemDto::setExposureTime(double newExposureTime) { - m_exposureTime = newExposureTime; -} -double BaseItemDto::focalLength() const { return m_focalLength; } - -void BaseItemDto::setFocalLength(double newFocalLength) { - m_focalLength = newFocalLength; -} -ImageOrientation BaseItemDto::imageOrientation() const { return m_imageOrientation; } - -void BaseItemDto::setImageOrientation(ImageOrientation newImageOrientation) { - m_imageOrientation = newImageOrientation; -} -double BaseItemDto::aperture() const { return m_aperture; } - -void BaseItemDto::setAperture(double newAperture) { - m_aperture = newAperture; -} -double BaseItemDto::shutterSpeed() const { return m_shutterSpeed; } - -void BaseItemDto::setShutterSpeed(double newShutterSpeed) { - m_shutterSpeed = newShutterSpeed; -} -double BaseItemDto::latitude() const { return m_latitude; } - -void BaseItemDto::setLatitude(double newLatitude) { - m_latitude = newLatitude; -} -double BaseItemDto::longitude() const { return m_longitude; } - -void BaseItemDto::setLongitude(double newLongitude) { - m_longitude = newLongitude; -} -double BaseItemDto::altitude() const { return m_altitude; } - -void BaseItemDto::setAltitude(double newAltitude) { - m_altitude = newAltitude; -} -qint32 BaseItemDto::isoSpeedRating() const { return m_isoSpeedRating; } - -void BaseItemDto::setIsoSpeedRating(qint32 newIsoSpeedRating) { - m_isoSpeedRating = newIsoSpeedRating; -} -QString BaseItemDto::seriesTimerId() const { return m_seriesTimerId; } - -void BaseItemDto::setSeriesTimerId(QString newSeriesTimerId) { - m_seriesTimerId = newSeriesTimerId; -} -QString BaseItemDto::programId() const { return m_programId; } - -void BaseItemDto::setProgramId(QString newProgramId) { - m_programId = newProgramId; -} -QString BaseItemDto::channelPrimaryImageTag() const { return m_channelPrimaryImageTag; } - -void BaseItemDto::setChannelPrimaryImageTag(QString newChannelPrimaryImageTag) { - m_channelPrimaryImageTag = newChannelPrimaryImageTag; -} -QDateTime BaseItemDto::startDate() const { return m_startDate; } - -void BaseItemDto::setStartDate(QDateTime newStartDate) { - m_startDate = newStartDate; -} -double BaseItemDto::completionPercentage() const { return m_completionPercentage; } - -void BaseItemDto::setCompletionPercentage(double newCompletionPercentage) { - m_completionPercentage = newCompletionPercentage; -} -bool BaseItemDto::isRepeat() const { return m_isRepeat; } - -void BaseItemDto::setIsRepeat(bool newIsRepeat) { - m_isRepeat = newIsRepeat; -} -QString BaseItemDto::episodeTitle() const { return m_episodeTitle; } - -void BaseItemDto::setEpisodeTitle(QString newEpisodeTitle) { - m_episodeTitle = newEpisodeTitle; -} -ChannelType BaseItemDto::channelType() const { return m_channelType; } - -void BaseItemDto::setChannelType(ChannelType newChannelType) { - m_channelType = newChannelType; -} -ProgramAudio BaseItemDto::audio() const { return m_audio; } - -void BaseItemDto::setAudio(ProgramAudio newAudio) { - m_audio = newAudio; -} -bool BaseItemDto::isMovie() const { return m_isMovie; } - -void BaseItemDto::setIsMovie(bool newIsMovie) { - m_isMovie = newIsMovie; -} -bool BaseItemDto::isSports() const { return m_isSports; } - -void BaseItemDto::setIsSports(bool newIsSports) { - m_isSports = newIsSports; -} -bool BaseItemDto::isSeries() const { return m_isSeries; } - -void BaseItemDto::setIsSeries(bool newIsSeries) { - m_isSeries = newIsSeries; -} -bool BaseItemDto::isLive() const { return m_isLive; } - -void BaseItemDto::setIsLive(bool newIsLive) { - m_isLive = newIsLive; -} -bool BaseItemDto::isNews() const { return m_isNews; } - -void BaseItemDto::setIsNews(bool newIsNews) { - m_isNews = newIsNews; -} -bool BaseItemDto::isKids() const { return m_isKids; } - -void BaseItemDto::setIsKids(bool newIsKids) { - m_isKids = newIsKids; -} -bool BaseItemDto::isPremiere() const { return m_isPremiere; } - -void BaseItemDto::setIsPremiere(bool newIsPremiere) { - m_isPremiere = newIsPremiere; -} -QString BaseItemDto::timerId() const { return m_timerId; } - -void BaseItemDto::setTimerId(QString newTimerId) { - m_timerId = newTimerId; -} -QSharedPointer BaseItemDto::currentProgram() const { return m_currentProgram; } - -void BaseItemDto::setCurrentProgram(QSharedPointer newCurrentProgram) { - m_currentProgram = newCurrentProgram; -} - -} // NS DTO - -namespace Support { - -using BaseItemDto = Jellyfin::DTO::BaseItemDto; - -template <> -BaseItemDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BaseItemDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/baseitemdtoqueryresult.cpp b/core/src/DTO/baseitemdtoqueryresult.cpp deleted file mode 100644 index 41c5580..0000000 --- a/core/src/DTO/baseitemdtoqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BaseItemDtoQueryResult::BaseItemDtoQueryResult() {} -BaseItemDtoQueryResult::BaseItemDtoQueryResult(const BaseItemDtoQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -BaseItemDtoQueryResult BaseItemDtoQueryResult::fromJson(QJsonObject source) { - BaseItemDtoQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void BaseItemDtoQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject BaseItemDtoQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> BaseItemDtoQueryResult::items() const { return m_items; } - -void BaseItemDtoQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 BaseItemDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void BaseItemDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 BaseItemDtoQueryResult::startIndex() const { return m_startIndex; } - -void BaseItemDtoQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using BaseItemDtoQueryResult = Jellyfin::DTO::BaseItemDtoQueryResult; - -template <> -BaseItemDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BaseItemDtoQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/baseitemperson.cpp b/core/src/DTO/baseitemperson.cpp deleted file mode 100644 index f66328e..0000000 --- a/core/src/DTO/baseitemperson.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BaseItemPerson::BaseItemPerson() {} -BaseItemPerson::BaseItemPerson(const BaseItemPerson &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId), - m_role(other.m_role), - m_type(other.m_type), - m_primaryImageTag(other.m_primaryImageTag), - m_imageBlurHashes(other.m_imageBlurHashes){} - -BaseItemPerson BaseItemPerson::fromJson(QJsonObject source) { - BaseItemPerson instance; - instance.setFromJson(source); - return instance; -} - - -void BaseItemPerson::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_role = Jellyfin::Support::fromJsonValue(source["Role"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_primaryImageTag = Jellyfin::Support::fromJsonValue(source["PrimaryImageTag"]); - m_imageBlurHashes = Jellyfin::Support::fromJsonValue(source["ImageBlurHashes"]); - -} - -QJsonObject BaseItemPerson::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Role"] = Jellyfin::Support::toJsonValue(m_role); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_primaryImageTag); - result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue(m_imageBlurHashes); - - return result; -} - -QString BaseItemPerson::name() const { return m_name; } - -void BaseItemPerson::setName(QString newName) { - m_name = newName; -} -QString BaseItemPerson::jellyfinId() const { return m_jellyfinId; } - -void BaseItemPerson::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString BaseItemPerson::role() const { return m_role; } - -void BaseItemPerson::setRole(QString newRole) { - m_role = newRole; -} -QString BaseItemPerson::type() const { return m_type; } - -void BaseItemPerson::setType(QString newType) { - m_type = newType; -} -QString BaseItemPerson::primaryImageTag() const { return m_primaryImageTag; } - -void BaseItemPerson::setPrimaryImageTag(QString newPrimaryImageTag) { - m_primaryImageTag = newPrimaryImageTag; -} -QJsonObject BaseItemPerson::imageBlurHashes() const { return m_imageBlurHashes; } - -void BaseItemPerson::setImageBlurHashes(QJsonObject newImageBlurHashes) { - m_imageBlurHashes = newImageBlurHashes; -} - -} // NS DTO - -namespace Support { - -using BaseItemPerson = Jellyfin::DTO::BaseItemPerson; - -template <> -BaseItemPerson fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BaseItemPerson::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/basepluginconfiguration.cpp b/core/src/DTO/basepluginconfiguration.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/core/src/DTO/bookinfo.cpp b/core/src/DTO/bookinfo.cpp deleted file mode 100644 index e3ab926..0000000 --- a/core/src/DTO/bookinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BookInfo::BookInfo() {} -BookInfo::BookInfo(const BookInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated), - m_seriesName(other.m_seriesName){} - -BookInfo BookInfo::fromJson(QJsonObject source) { - BookInfo instance; - instance.setFromJson(source); - return instance; -} - - -void BookInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - m_seriesName = Jellyfin::Support::fromJsonValue(source["SeriesName"]); - -} - -QJsonObject BookInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - result["SeriesName"] = Jellyfin::Support::toJsonValue(m_seriesName); - - return result; -} - -QString BookInfo::name() const { return m_name; } - -void BookInfo::setName(QString newName) { - m_name = newName; -} -QString BookInfo::path() const { return m_path; } - -void BookInfo::setPath(QString newPath) { - m_path = newPath; -} -QString BookInfo::metadataLanguage() const { return m_metadataLanguage; } - -void BookInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString BookInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void BookInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject BookInfo::providerIds() const { return m_providerIds; } - -void BookInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 BookInfo::year() const { return m_year; } - -void BookInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 BookInfo::indexNumber() const { return m_indexNumber; } - -void BookInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 BookInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void BookInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime BookInfo::premiereDate() const { return m_premiereDate; } - -void BookInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool BookInfo::isAutomated() const { return m_isAutomated; } - -void BookInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} -QString BookInfo::seriesName() const { return m_seriesName; } - -void BookInfo::setSeriesName(QString newSeriesName) { - m_seriesName = newSeriesName; -} - -} // NS DTO - -namespace Support { - -using BookInfo = Jellyfin::DTO::BookInfo; - -template <> -BookInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BookInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/bookinforemotesearchquery.cpp b/core/src/DTO/bookinforemotesearchquery.cpp deleted file mode 100644 index 8a4b527..0000000 --- a/core/src/DTO/bookinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BookInfoRemoteSearchQuery::BookInfoRemoteSearchQuery() {} -BookInfoRemoteSearchQuery::BookInfoRemoteSearchQuery(const BookInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -BookInfoRemoteSearchQuery BookInfoRemoteSearchQuery::fromJson(QJsonObject source) { - BookInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void BookInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject BookInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer BookInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void BookInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid BookInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void BookInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString BookInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void BookInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool BookInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void BookInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using BookInfoRemoteSearchQuery = Jellyfin::DTO::BookInfoRemoteSearchQuery; - -template <> -BookInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BookInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/boxsetinfo.cpp b/core/src/DTO/boxsetinfo.cpp deleted file mode 100644 index 515003b..0000000 --- a/core/src/DTO/boxsetinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BoxSetInfo::BoxSetInfo() {} -BoxSetInfo::BoxSetInfo(const BoxSetInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated){} - -BoxSetInfo BoxSetInfo::fromJson(QJsonObject source) { - BoxSetInfo instance; - instance.setFromJson(source); - return instance; -} - - -void BoxSetInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - -} - -QJsonObject BoxSetInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - - return result; -} - -QString BoxSetInfo::name() const { return m_name; } - -void BoxSetInfo::setName(QString newName) { - m_name = newName; -} -QString BoxSetInfo::path() const { return m_path; } - -void BoxSetInfo::setPath(QString newPath) { - m_path = newPath; -} -QString BoxSetInfo::metadataLanguage() const { return m_metadataLanguage; } - -void BoxSetInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString BoxSetInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void BoxSetInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject BoxSetInfo::providerIds() const { return m_providerIds; } - -void BoxSetInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 BoxSetInfo::year() const { return m_year; } - -void BoxSetInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 BoxSetInfo::indexNumber() const { return m_indexNumber; } - -void BoxSetInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 BoxSetInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void BoxSetInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime BoxSetInfo::premiereDate() const { return m_premiereDate; } - -void BoxSetInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool BoxSetInfo::isAutomated() const { return m_isAutomated; } - -void BoxSetInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} - -} // NS DTO - -namespace Support { - -using BoxSetInfo = Jellyfin::DTO::BoxSetInfo; - -template <> -BoxSetInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BoxSetInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/boxsetinforemotesearchquery.cpp b/core/src/DTO/boxsetinforemotesearchquery.cpp deleted file mode 100644 index e8f8284..0000000 --- a/core/src/DTO/boxsetinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BoxSetInfoRemoteSearchQuery::BoxSetInfoRemoteSearchQuery() {} -BoxSetInfoRemoteSearchQuery::BoxSetInfoRemoteSearchQuery(const BoxSetInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -BoxSetInfoRemoteSearchQuery BoxSetInfoRemoteSearchQuery::fromJson(QJsonObject source) { - BoxSetInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void BoxSetInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject BoxSetInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer BoxSetInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void BoxSetInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid BoxSetInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void BoxSetInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString BoxSetInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void BoxSetInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool BoxSetInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void BoxSetInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using BoxSetInfoRemoteSearchQuery = Jellyfin::DTO::BoxSetInfoRemoteSearchQuery; - -template <> -BoxSetInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BoxSetInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/brandingoptions.cpp b/core/src/DTO/brandingoptions.cpp deleted file mode 100644 index cebea83..0000000 --- a/core/src/DTO/brandingoptions.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BrandingOptions::BrandingOptions() {} -BrandingOptions::BrandingOptions(const BrandingOptions &other) : - m_loginDisclaimer(other.m_loginDisclaimer), - m_customCss(other.m_customCss){} - -BrandingOptions BrandingOptions::fromJson(QJsonObject source) { - BrandingOptions instance; - instance.setFromJson(source); - return instance; -} - - -void BrandingOptions::setFromJson(QJsonObject source) { - m_loginDisclaimer = Jellyfin::Support::fromJsonValue(source["LoginDisclaimer"]); - m_customCss = Jellyfin::Support::fromJsonValue(source["CustomCss"]); - -} - -QJsonObject BrandingOptions::toJson() { - QJsonObject result; - result["LoginDisclaimer"] = Jellyfin::Support::toJsonValue(m_loginDisclaimer); - result["CustomCss"] = Jellyfin::Support::toJsonValue(m_customCss); - - return result; -} - -QString BrandingOptions::loginDisclaimer() const { return m_loginDisclaimer; } - -void BrandingOptions::setLoginDisclaimer(QString newLoginDisclaimer) { - m_loginDisclaimer = newLoginDisclaimer; -} -QString BrandingOptions::customCss() const { return m_customCss; } - -void BrandingOptions::setCustomCss(QString newCustomCss) { - m_customCss = newCustomCss; -} - -} // NS DTO - -namespace Support { - -using BrandingOptions = Jellyfin::DTO::BrandingOptions; - -template <> -BrandingOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BrandingOptions::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/bufferrequestdto.cpp b/core/src/DTO/bufferrequestdto.cpp deleted file mode 100644 index 6b91118..0000000 --- a/core/src/DTO/bufferrequestdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -BufferRequestDto::BufferRequestDto() {} -BufferRequestDto::BufferRequestDto(const BufferRequestDto &other) : - m_when(other.m_when), - m_positionTicks(other.m_positionTicks), - m_isPlaying(other.m_isPlaying), - m_playlistItemId(other.m_playlistItemId){} - -BufferRequestDto BufferRequestDto::fromJson(QJsonObject source) { - BufferRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void BufferRequestDto::setFromJson(QJsonObject source) { - m_when = Jellyfin::Support::fromJsonValue(source["When"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_isPlaying = Jellyfin::Support::fromJsonValue(source["IsPlaying"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject BufferRequestDto::toJson() { - QJsonObject result; - result["When"] = Jellyfin::Support::toJsonValue(m_when); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["IsPlaying"] = Jellyfin::Support::toJsonValue(m_isPlaying); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QDateTime BufferRequestDto::when() const { return m_when; } - -void BufferRequestDto::setWhen(QDateTime newWhen) { - m_when = newWhen; -} -qint64 BufferRequestDto::positionTicks() const { return m_positionTicks; } - -void BufferRequestDto::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -bool BufferRequestDto::isPlaying() const { return m_isPlaying; } - -void BufferRequestDto::setIsPlaying(bool newIsPlaying) { - m_isPlaying = newIsPlaying; -} -QUuid BufferRequestDto::playlistItemId() const { return m_playlistItemId; } - -void BufferRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using BufferRequestDto = Jellyfin::DTO::BufferRequestDto; - -template <> -BufferRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return BufferRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channelfeatures.cpp b/core/src/DTO/channelfeatures.cpp deleted file mode 100644 index f632928..0000000 --- a/core/src/DTO/channelfeatures.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelFeatures::ChannelFeatures() {} -ChannelFeatures::ChannelFeatures(const ChannelFeatures &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId), - m_canSearch(other.m_canSearch), - m_mediaTypes(other.m_mediaTypes), - m_contentTypes(other.m_contentTypes), - m_maxPageSize(other.m_maxPageSize), - m_autoRefreshLevels(other.m_autoRefreshLevels), - m_defaultSortFields(other.m_defaultSortFields), - m_supportsSortOrderToggle(other.m_supportsSortOrderToggle), - m_supportsLatestMedia(other.m_supportsLatestMedia), - m_canFilter(other.m_canFilter), - m_supportsContentDownloading(other.m_supportsContentDownloading){} - -ChannelFeatures ChannelFeatures::fromJson(QJsonObject source) { - ChannelFeatures instance; - instance.setFromJson(source); - return instance; -} - - -void ChannelFeatures::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_canSearch = Jellyfin::Support::fromJsonValue(source["CanSearch"]); - m_mediaTypes = Jellyfin::Support::fromJsonValue>(source["MediaTypes"]); - m_contentTypes = Jellyfin::Support::fromJsonValue>(source["ContentTypes"]); - m_maxPageSize = Jellyfin::Support::fromJsonValue(source["MaxPageSize"]); - m_autoRefreshLevels = Jellyfin::Support::fromJsonValue(source["AutoRefreshLevels"]); - m_defaultSortFields = Jellyfin::Support::fromJsonValue>(source["DefaultSortFields"]); - m_supportsSortOrderToggle = Jellyfin::Support::fromJsonValue(source["SupportsSortOrderToggle"]); - m_supportsLatestMedia = Jellyfin::Support::fromJsonValue(source["SupportsLatestMedia"]); - m_canFilter = Jellyfin::Support::fromJsonValue(source["CanFilter"]); - m_supportsContentDownloading = Jellyfin::Support::fromJsonValue(source["SupportsContentDownloading"]); - -} - -QJsonObject ChannelFeatures::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["CanSearch"] = Jellyfin::Support::toJsonValue(m_canSearch); - result["MediaTypes"] = Jellyfin::Support::toJsonValue>(m_mediaTypes); - result["ContentTypes"] = Jellyfin::Support::toJsonValue>(m_contentTypes); - result["MaxPageSize"] = Jellyfin::Support::toJsonValue(m_maxPageSize); - result["AutoRefreshLevels"] = Jellyfin::Support::toJsonValue(m_autoRefreshLevels); - result["DefaultSortFields"] = Jellyfin::Support::toJsonValue>(m_defaultSortFields); - result["SupportsSortOrderToggle"] = Jellyfin::Support::toJsonValue(m_supportsSortOrderToggle); - result["SupportsLatestMedia"] = Jellyfin::Support::toJsonValue(m_supportsLatestMedia); - result["CanFilter"] = Jellyfin::Support::toJsonValue(m_canFilter); - result["SupportsContentDownloading"] = Jellyfin::Support::toJsonValue(m_supportsContentDownloading); - - return result; -} - -QString ChannelFeatures::name() const { return m_name; } - -void ChannelFeatures::setName(QString newName) { - m_name = newName; -} -QString ChannelFeatures::jellyfinId() const { return m_jellyfinId; } - -void ChannelFeatures::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -bool ChannelFeatures::canSearch() const { return m_canSearch; } - -void ChannelFeatures::setCanSearch(bool newCanSearch) { - m_canSearch = newCanSearch; -} -QList ChannelFeatures::mediaTypes() const { return m_mediaTypes; } - -void ChannelFeatures::setMediaTypes(QList newMediaTypes) { - m_mediaTypes = newMediaTypes; -} -QList ChannelFeatures::contentTypes() const { return m_contentTypes; } - -void ChannelFeatures::setContentTypes(QList newContentTypes) { - m_contentTypes = newContentTypes; -} -qint32 ChannelFeatures::maxPageSize() const { return m_maxPageSize; } - -void ChannelFeatures::setMaxPageSize(qint32 newMaxPageSize) { - m_maxPageSize = newMaxPageSize; -} -qint32 ChannelFeatures::autoRefreshLevels() const { return m_autoRefreshLevels; } - -void ChannelFeatures::setAutoRefreshLevels(qint32 newAutoRefreshLevels) { - m_autoRefreshLevels = newAutoRefreshLevels; -} -QList ChannelFeatures::defaultSortFields() const { return m_defaultSortFields; } - -void ChannelFeatures::setDefaultSortFields(QList newDefaultSortFields) { - m_defaultSortFields = newDefaultSortFields; -} -bool ChannelFeatures::supportsSortOrderToggle() const { return m_supportsSortOrderToggle; } - -void ChannelFeatures::setSupportsSortOrderToggle(bool newSupportsSortOrderToggle) { - m_supportsSortOrderToggle = newSupportsSortOrderToggle; -} -bool ChannelFeatures::supportsLatestMedia() const { return m_supportsLatestMedia; } - -void ChannelFeatures::setSupportsLatestMedia(bool newSupportsLatestMedia) { - m_supportsLatestMedia = newSupportsLatestMedia; -} -bool ChannelFeatures::canFilter() const { return m_canFilter; } - -void ChannelFeatures::setCanFilter(bool newCanFilter) { - m_canFilter = newCanFilter; -} -bool ChannelFeatures::supportsContentDownloading() const { return m_supportsContentDownloading; } - -void ChannelFeatures::setSupportsContentDownloading(bool newSupportsContentDownloading) { - m_supportsContentDownloading = newSupportsContentDownloading; -} - -} // NS DTO - -namespace Support { - -using ChannelFeatures = Jellyfin::DTO::ChannelFeatures; - -template <> -ChannelFeatures fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ChannelFeatures::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channelitemsortfield.cpp b/core/src/DTO/channelitemsortfield.cpp deleted file mode 100644 index 986a9cd..0000000 --- a/core/src/DTO/channelitemsortfield.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelItemSortFieldClass::ChannelItemSortFieldClass() {} - - -} // NS DTO - -namespace Support { - -using ChannelItemSortField = Jellyfin::DTO::ChannelItemSortField; - -template <> -ChannelItemSortField fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ChannelItemSortField::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Name")) { - return ChannelItemSortField::Name; - } - if (str == QStringLiteral("CommunityRating")) { - return ChannelItemSortField::CommunityRating; - } - if (str == QStringLiteral("PremiereDate")) { - return ChannelItemSortField::PremiereDate; - } - if (str == QStringLiteral("DateCreated")) { - return ChannelItemSortField::DateCreated; - } - if (str == QStringLiteral("Runtime")) { - return ChannelItemSortField::Runtime; - } - if (str == QStringLiteral("PlayCount")) { - return ChannelItemSortField::PlayCount; - } - if (str == QStringLiteral("CommunityPlayCount")) { - return ChannelItemSortField::CommunityPlayCount; - } - - return ChannelItemSortField::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channelmappingoptionsdto.cpp b/core/src/DTO/channelmappingoptionsdto.cpp deleted file mode 100644 index 410c41e..0000000 --- a/core/src/DTO/channelmappingoptionsdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelMappingOptionsDto::ChannelMappingOptionsDto() {} -ChannelMappingOptionsDto::ChannelMappingOptionsDto(const ChannelMappingOptionsDto &other) : - m_tunerChannels(other.m_tunerChannels), - m_providerChannels(other.m_providerChannels), - m_mappings(other.m_mappings), - m_providerName(other.m_providerName){} - -ChannelMappingOptionsDto ChannelMappingOptionsDto::fromJson(QJsonObject source) { - ChannelMappingOptionsDto instance; - instance.setFromJson(source); - return instance; -} - - -void ChannelMappingOptionsDto::setFromJson(QJsonObject source) { - m_tunerChannels = Jellyfin::Support::fromJsonValue>>(source["TunerChannels"]); - m_providerChannels = Jellyfin::Support::fromJsonValue>>(source["ProviderChannels"]); - m_mappings = Jellyfin::Support::fromJsonValue>>(source["Mappings"]); - m_providerName = Jellyfin::Support::fromJsonValue(source["ProviderName"]); - -} - -QJsonObject ChannelMappingOptionsDto::toJson() { - QJsonObject result; - result["TunerChannels"] = Jellyfin::Support::toJsonValue>>(m_tunerChannels); - result["ProviderChannels"] = Jellyfin::Support::toJsonValue>>(m_providerChannels); - result["Mappings"] = Jellyfin::Support::toJsonValue>>(m_mappings); - result["ProviderName"] = Jellyfin::Support::toJsonValue(m_providerName); - - return result; -} - -QList> ChannelMappingOptionsDto::tunerChannels() const { return m_tunerChannels; } - -void ChannelMappingOptionsDto::setTunerChannels(QList> newTunerChannels) { - m_tunerChannels = newTunerChannels; -} -QList> ChannelMappingOptionsDto::providerChannels() const { return m_providerChannels; } - -void ChannelMappingOptionsDto::setProviderChannels(QList> newProviderChannels) { - m_providerChannels = newProviderChannels; -} -QList> ChannelMappingOptionsDto::mappings() const { return m_mappings; } - -void ChannelMappingOptionsDto::setMappings(QList> newMappings) { - m_mappings = newMappings; -} -QString ChannelMappingOptionsDto::providerName() const { return m_providerName; } - -void ChannelMappingOptionsDto::setProviderName(QString newProviderName) { - m_providerName = newProviderName; -} - -} // NS DTO - -namespace Support { - -using ChannelMappingOptionsDto = Jellyfin::DTO::ChannelMappingOptionsDto; - -template <> -ChannelMappingOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ChannelMappingOptionsDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channelmediacontenttype.cpp b/core/src/DTO/channelmediacontenttype.cpp deleted file mode 100644 index 926a763..0000000 --- a/core/src/DTO/channelmediacontenttype.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelMediaContentTypeClass::ChannelMediaContentTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ChannelMediaContentType = Jellyfin::DTO::ChannelMediaContentType; - -template <> -ChannelMediaContentType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ChannelMediaContentType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Clip")) { - return ChannelMediaContentType::Clip; - } - if (str == QStringLiteral("Podcast")) { - return ChannelMediaContentType::Podcast; - } - if (str == QStringLiteral("Trailer")) { - return ChannelMediaContentType::Trailer; - } - if (str == QStringLiteral("Movie")) { - return ChannelMediaContentType::Movie; - } - if (str == QStringLiteral("Episode")) { - return ChannelMediaContentType::Episode; - } - if (str == QStringLiteral("Song")) { - return ChannelMediaContentType::Song; - } - if (str == QStringLiteral("MovieExtra")) { - return ChannelMediaContentType::MovieExtra; - } - if (str == QStringLiteral("TvExtra")) { - return ChannelMediaContentType::TvExtra; - } - - return ChannelMediaContentType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channelmediatype.cpp b/core/src/DTO/channelmediatype.cpp deleted file mode 100644 index 2ae2018..0000000 --- a/core/src/DTO/channelmediatype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelMediaTypeClass::ChannelMediaTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ChannelMediaType = Jellyfin::DTO::ChannelMediaType; - -template <> -ChannelMediaType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ChannelMediaType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Audio")) { - return ChannelMediaType::Audio; - } - if (str == QStringLiteral("Video")) { - return ChannelMediaType::Video; - } - if (str == QStringLiteral("Photo")) { - return ChannelMediaType::Photo; - } - - return ChannelMediaType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/channeltype.cpp b/core/src/DTO/channeltype.cpp deleted file mode 100644 index 770cb15..0000000 --- a/core/src/DTO/channeltype.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChannelTypeClass::ChannelTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ChannelType = Jellyfin::DTO::ChannelType; - -template <> -ChannelType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ChannelType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("TV")) { - return ChannelType::TV; - } - if (str == QStringLiteral("Radio")) { - return ChannelType::Radio; - } - - return ChannelType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/chapterinfo.cpp b/core/src/DTO/chapterinfo.cpp deleted file mode 100644 index d306128..0000000 --- a/core/src/DTO/chapterinfo.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ChapterInfo::ChapterInfo() {} -ChapterInfo::ChapterInfo(const ChapterInfo &other) : - m_startPositionTicks(other.m_startPositionTicks), - m_name(other.m_name), - m_imagePath(other.m_imagePath), - m_imageDateModified(other.m_imageDateModified), - m_imageTag(other.m_imageTag){} - -ChapterInfo ChapterInfo::fromJson(QJsonObject source) { - ChapterInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ChapterInfo::setFromJson(QJsonObject source) { - m_startPositionTicks = Jellyfin::Support::fromJsonValue(source["StartPositionTicks"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_imagePath = Jellyfin::Support::fromJsonValue(source["ImagePath"]); - m_imageDateModified = Jellyfin::Support::fromJsonValue(source["ImageDateModified"]); - m_imageTag = Jellyfin::Support::fromJsonValue(source["ImageTag"]); - -} - -QJsonObject ChapterInfo::toJson() { - QJsonObject result; - result["StartPositionTicks"] = Jellyfin::Support::toJsonValue(m_startPositionTicks); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ImagePath"] = Jellyfin::Support::toJsonValue(m_imagePath); - result["ImageDateModified"] = Jellyfin::Support::toJsonValue(m_imageDateModified); - result["ImageTag"] = Jellyfin::Support::toJsonValue(m_imageTag); - - return result; -} - -qint64 ChapterInfo::startPositionTicks() const { return m_startPositionTicks; } - -void ChapterInfo::setStartPositionTicks(qint64 newStartPositionTicks) { - m_startPositionTicks = newStartPositionTicks; -} -QString ChapterInfo::name() const { return m_name; } - -void ChapterInfo::setName(QString newName) { - m_name = newName; -} -QString ChapterInfo::imagePath() const { return m_imagePath; } - -void ChapterInfo::setImagePath(QString newImagePath) { - m_imagePath = newImagePath; -} -QDateTime ChapterInfo::imageDateModified() const { return m_imageDateModified; } - -void ChapterInfo::setImageDateModified(QDateTime newImageDateModified) { - m_imageDateModified = newImageDateModified; -} -QString ChapterInfo::imageTag() const { return m_imageTag; } - -void ChapterInfo::setImageTag(QString newImageTag) { - m_imageTag = newImageTag; -} - -} // NS DTO - -namespace Support { - -using ChapterInfo = Jellyfin::DTO::ChapterInfo; - -template <> -ChapterInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ChapterInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/clientcapabilities.cpp b/core/src/DTO/clientcapabilities.cpp deleted file mode 100644 index 4f40eae..0000000 --- a/core/src/DTO/clientcapabilities.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ClientCapabilities::ClientCapabilities() {} -ClientCapabilities::ClientCapabilities(const ClientCapabilities &other) : - m_playableMediaTypes(other.m_playableMediaTypes), - m_supportedCommands(other.m_supportedCommands), - m_supportsMediaControl(other.m_supportsMediaControl), - m_supportsContentUploading(other.m_supportsContentUploading), - m_messageCallbackUrl(other.m_messageCallbackUrl), - m_supportsPersistentIdentifier(other.m_supportsPersistentIdentifier), - m_supportsSync(other.m_supportsSync), - m_deviceProfile(other.m_deviceProfile), - m_appStoreUrl(other.m_appStoreUrl), - m_iconUrl(other.m_iconUrl){} - -ClientCapabilities ClientCapabilities::fromJson(QJsonObject source) { - ClientCapabilities instance; - instance.setFromJson(source); - return instance; -} - - -void ClientCapabilities::setFromJson(QJsonObject source) { - m_playableMediaTypes = Jellyfin::Support::fromJsonValue(source["PlayableMediaTypes"]); - m_supportedCommands = Jellyfin::Support::fromJsonValue>(source["SupportedCommands"]); - m_supportsMediaControl = Jellyfin::Support::fromJsonValue(source["SupportsMediaControl"]); - m_supportsContentUploading = Jellyfin::Support::fromJsonValue(source["SupportsContentUploading"]); - m_messageCallbackUrl = Jellyfin::Support::fromJsonValue(source["MessageCallbackUrl"]); - m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue(source["SupportsPersistentIdentifier"]); - m_supportsSync = Jellyfin::Support::fromJsonValue(source["SupportsSync"]); - m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); - m_appStoreUrl = Jellyfin::Support::fromJsonValue(source["AppStoreUrl"]); - m_iconUrl = Jellyfin::Support::fromJsonValue(source["IconUrl"]); - -} - -QJsonObject ClientCapabilities::toJson() { - QJsonObject result; - result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); - result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); - result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue(m_supportsMediaControl); - result["SupportsContentUploading"] = Jellyfin::Support::toJsonValue(m_supportsContentUploading); - result["MessageCallbackUrl"] = Jellyfin::Support::toJsonValue(m_messageCallbackUrl); - result["SupportsPersistentIdentifier"] = Jellyfin::Support::toJsonValue(m_supportsPersistentIdentifier); - result["SupportsSync"] = Jellyfin::Support::toJsonValue(m_supportsSync); - result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); - result["AppStoreUrl"] = Jellyfin::Support::toJsonValue(m_appStoreUrl); - result["IconUrl"] = Jellyfin::Support::toJsonValue(m_iconUrl); - - return result; -} - -QStringList ClientCapabilities::playableMediaTypes() const { return m_playableMediaTypes; } - -void ClientCapabilities::setPlayableMediaTypes(QStringList newPlayableMediaTypes) { - m_playableMediaTypes = newPlayableMediaTypes; -} -QList ClientCapabilities::supportedCommands() const { return m_supportedCommands; } - -void ClientCapabilities::setSupportedCommands(QList newSupportedCommands) { - m_supportedCommands = newSupportedCommands; -} -bool ClientCapabilities::supportsMediaControl() const { return m_supportsMediaControl; } - -void ClientCapabilities::setSupportsMediaControl(bool newSupportsMediaControl) { - m_supportsMediaControl = newSupportsMediaControl; -} -bool ClientCapabilities::supportsContentUploading() const { return m_supportsContentUploading; } - -void ClientCapabilities::setSupportsContentUploading(bool newSupportsContentUploading) { - m_supportsContentUploading = newSupportsContentUploading; -} -QString ClientCapabilities::messageCallbackUrl() const { return m_messageCallbackUrl; } - -void ClientCapabilities::setMessageCallbackUrl(QString newMessageCallbackUrl) { - m_messageCallbackUrl = newMessageCallbackUrl; -} -bool ClientCapabilities::supportsPersistentIdentifier() const { return m_supportsPersistentIdentifier; } - -void ClientCapabilities::setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier) { - m_supportsPersistentIdentifier = newSupportsPersistentIdentifier; -} -bool ClientCapabilities::supportsSync() const { return m_supportsSync; } - -void ClientCapabilities::setSupportsSync(bool newSupportsSync) { - m_supportsSync = newSupportsSync; -} -QSharedPointer ClientCapabilities::deviceProfile() const { return m_deviceProfile; } - -void ClientCapabilities::setDeviceProfile(QSharedPointer newDeviceProfile) { - m_deviceProfile = newDeviceProfile; -} -QString ClientCapabilities::appStoreUrl() const { return m_appStoreUrl; } - -void ClientCapabilities::setAppStoreUrl(QString newAppStoreUrl) { - m_appStoreUrl = newAppStoreUrl; -} -QString ClientCapabilities::iconUrl() const { return m_iconUrl; } - -void ClientCapabilities::setIconUrl(QString newIconUrl) { - m_iconUrl = newIconUrl; -} - -} // NS DTO - -namespace Support { - -using ClientCapabilities = Jellyfin::DTO::ClientCapabilities; - -template <> -ClientCapabilities fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ClientCapabilities::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/clientcapabilitiesdto.cpp b/core/src/DTO/clientcapabilitiesdto.cpp deleted file mode 100644 index a37b75a..0000000 --- a/core/src/DTO/clientcapabilitiesdto.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ClientCapabilitiesDto::ClientCapabilitiesDto() {} -ClientCapabilitiesDto::ClientCapabilitiesDto(const ClientCapabilitiesDto &other) : - m_playableMediaTypes(other.m_playableMediaTypes), - m_supportedCommands(other.m_supportedCommands), - m_supportsMediaControl(other.m_supportsMediaControl), - m_supportsContentUploading(other.m_supportsContentUploading), - m_messageCallbackUrl(other.m_messageCallbackUrl), - m_supportsPersistentIdentifier(other.m_supportsPersistentIdentifier), - m_supportsSync(other.m_supportsSync), - m_deviceProfile(other.m_deviceProfile), - m_appStoreUrl(other.m_appStoreUrl), - m_iconUrl(other.m_iconUrl){} - -ClientCapabilitiesDto ClientCapabilitiesDto::fromJson(QJsonObject source) { - ClientCapabilitiesDto instance; - instance.setFromJson(source); - return instance; -} - - -void ClientCapabilitiesDto::setFromJson(QJsonObject source) { - m_playableMediaTypes = Jellyfin::Support::fromJsonValue(source["PlayableMediaTypes"]); - m_supportedCommands = Jellyfin::Support::fromJsonValue>(source["SupportedCommands"]); - m_supportsMediaControl = Jellyfin::Support::fromJsonValue(source["SupportsMediaControl"]); - m_supportsContentUploading = Jellyfin::Support::fromJsonValue(source["SupportsContentUploading"]); - m_messageCallbackUrl = Jellyfin::Support::fromJsonValue(source["MessageCallbackUrl"]); - m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue(source["SupportsPersistentIdentifier"]); - m_supportsSync = Jellyfin::Support::fromJsonValue(source["SupportsSync"]); - m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); - m_appStoreUrl = Jellyfin::Support::fromJsonValue(source["AppStoreUrl"]); - m_iconUrl = Jellyfin::Support::fromJsonValue(source["IconUrl"]); - -} - -QJsonObject ClientCapabilitiesDto::toJson() { - QJsonObject result; - result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); - result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); - result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue(m_supportsMediaControl); - result["SupportsContentUploading"] = Jellyfin::Support::toJsonValue(m_supportsContentUploading); - result["MessageCallbackUrl"] = Jellyfin::Support::toJsonValue(m_messageCallbackUrl); - result["SupportsPersistentIdentifier"] = Jellyfin::Support::toJsonValue(m_supportsPersistentIdentifier); - result["SupportsSync"] = Jellyfin::Support::toJsonValue(m_supportsSync); - result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); - result["AppStoreUrl"] = Jellyfin::Support::toJsonValue(m_appStoreUrl); - result["IconUrl"] = Jellyfin::Support::toJsonValue(m_iconUrl); - - return result; -} - -QStringList ClientCapabilitiesDto::playableMediaTypes() const { return m_playableMediaTypes; } - -void ClientCapabilitiesDto::setPlayableMediaTypes(QStringList newPlayableMediaTypes) { - m_playableMediaTypes = newPlayableMediaTypes; -} -QList ClientCapabilitiesDto::supportedCommands() const { return m_supportedCommands; } - -void ClientCapabilitiesDto::setSupportedCommands(QList newSupportedCommands) { - m_supportedCommands = newSupportedCommands; -} -bool ClientCapabilitiesDto::supportsMediaControl() const { return m_supportsMediaControl; } - -void ClientCapabilitiesDto::setSupportsMediaControl(bool newSupportsMediaControl) { - m_supportsMediaControl = newSupportsMediaControl; -} -bool ClientCapabilitiesDto::supportsContentUploading() const { return m_supportsContentUploading; } - -void ClientCapabilitiesDto::setSupportsContentUploading(bool newSupportsContentUploading) { - m_supportsContentUploading = newSupportsContentUploading; -} -QString ClientCapabilitiesDto::messageCallbackUrl() const { return m_messageCallbackUrl; } - -void ClientCapabilitiesDto::setMessageCallbackUrl(QString newMessageCallbackUrl) { - m_messageCallbackUrl = newMessageCallbackUrl; -} -bool ClientCapabilitiesDto::supportsPersistentIdentifier() const { return m_supportsPersistentIdentifier; } - -void ClientCapabilitiesDto::setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier) { - m_supportsPersistentIdentifier = newSupportsPersistentIdentifier; -} -bool ClientCapabilitiesDto::supportsSync() const { return m_supportsSync; } - -void ClientCapabilitiesDto::setSupportsSync(bool newSupportsSync) { - m_supportsSync = newSupportsSync; -} -QSharedPointer ClientCapabilitiesDto::deviceProfile() const { return m_deviceProfile; } - -void ClientCapabilitiesDto::setDeviceProfile(QSharedPointer newDeviceProfile) { - m_deviceProfile = newDeviceProfile; -} -QString ClientCapabilitiesDto::appStoreUrl() const { return m_appStoreUrl; } - -void ClientCapabilitiesDto::setAppStoreUrl(QString newAppStoreUrl) { - m_appStoreUrl = newAppStoreUrl; -} -QString ClientCapabilitiesDto::iconUrl() const { return m_iconUrl; } - -void ClientCapabilitiesDto::setIconUrl(QString newIconUrl) { - m_iconUrl = newIconUrl; -} - -} // NS DTO - -namespace Support { - -using ClientCapabilitiesDto = Jellyfin::DTO::ClientCapabilitiesDto; - -template <> -ClientCapabilitiesDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ClientCapabilitiesDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/codecprofile.cpp b/core/src/DTO/codecprofile.cpp deleted file mode 100644 index 5ca7571..0000000 --- a/core/src/DTO/codecprofile.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CodecProfile::CodecProfile() {} -CodecProfile::CodecProfile(const CodecProfile &other) : - m_type(other.m_type), - m_conditions(other.m_conditions), - m_applyConditions(other.m_applyConditions), - m_codec(other.m_codec), - m_container(other.m_container){} - -CodecProfile CodecProfile::fromJson(QJsonObject source) { - CodecProfile instance; - instance.setFromJson(source); - return instance; -} - - -void CodecProfile::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_conditions = Jellyfin::Support::fromJsonValue>>(source["Conditions"]); - m_applyConditions = Jellyfin::Support::fromJsonValue>>(source["ApplyConditions"]); - m_codec = Jellyfin::Support::fromJsonValue(source["Codec"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - -} - -QJsonObject CodecProfile::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Conditions"] = Jellyfin::Support::toJsonValue>>(m_conditions); - result["ApplyConditions"] = Jellyfin::Support::toJsonValue>>(m_applyConditions); - result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - - return result; -} - -CodecType CodecProfile::type() const { return m_type; } - -void CodecProfile::setType(CodecType newType) { - m_type = newType; -} -QList> CodecProfile::conditions() const { return m_conditions; } - -void CodecProfile::setConditions(QList> newConditions) { - m_conditions = newConditions; -} -QList> CodecProfile::applyConditions() const { return m_applyConditions; } - -void CodecProfile::setApplyConditions(QList> newApplyConditions) { - m_applyConditions = newApplyConditions; -} -QString CodecProfile::codec() const { return m_codec; } - -void CodecProfile::setCodec(QString newCodec) { - m_codec = newCodec; -} -QString CodecProfile::container() const { return m_container; } - -void CodecProfile::setContainer(QString newContainer) { - m_container = newContainer; -} - -} // NS DTO - -namespace Support { - -using CodecProfile = Jellyfin::DTO::CodecProfile; - -template <> -CodecProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CodecProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/codectype.cpp b/core/src/DTO/codectype.cpp deleted file mode 100644 index 5675a4f..0000000 --- a/core/src/DTO/codectype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CodecTypeClass::CodecTypeClass() {} - - -} // NS DTO - -namespace Support { - -using CodecType = Jellyfin::DTO::CodecType; - -template <> -CodecType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return CodecType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Video")) { - return CodecType::Video; - } - if (str == QStringLiteral("VideoAudio")) { - return CodecType::VideoAudio; - } - if (str == QStringLiteral("Audio")) { - return CodecType::Audio; - } - - return CodecType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/collectioncreationresult.cpp b/core/src/DTO/collectioncreationresult.cpp deleted file mode 100644 index e5ee2b7..0000000 --- a/core/src/DTO/collectioncreationresult.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CollectionCreationResult::CollectionCreationResult() {} -CollectionCreationResult::CollectionCreationResult(const CollectionCreationResult &other) : - m_jellyfinId(other.m_jellyfinId){} - -CollectionCreationResult CollectionCreationResult::fromJson(QJsonObject source) { - CollectionCreationResult instance; - instance.setFromJson(source); - return instance; -} - - -void CollectionCreationResult::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject CollectionCreationResult::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QUuid CollectionCreationResult::jellyfinId() const { return m_jellyfinId; } - -void CollectionCreationResult::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using CollectionCreationResult = Jellyfin::DTO::CollectionCreationResult; - -template <> -CollectionCreationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CollectionCreationResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/configurationpageinfo.cpp b/core/src/DTO/configurationpageinfo.cpp deleted file mode 100644 index 0fafa02..0000000 --- a/core/src/DTO/configurationpageinfo.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ConfigurationPageInfo::ConfigurationPageInfo() {} -ConfigurationPageInfo::ConfigurationPageInfo(const ConfigurationPageInfo &other) : - m_name(other.m_name), - m_enableInMainMenu(other.m_enableInMainMenu), - m_menuSection(other.m_menuSection), - m_menuIcon(other.m_menuIcon), - m_displayName(other.m_displayName), - m_configurationPageType(other.m_configurationPageType), - m_pluginId(other.m_pluginId){} - -ConfigurationPageInfo ConfigurationPageInfo::fromJson(QJsonObject source) { - ConfigurationPageInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ConfigurationPageInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_enableInMainMenu = Jellyfin::Support::fromJsonValue(source["EnableInMainMenu"]); - m_menuSection = Jellyfin::Support::fromJsonValue(source["MenuSection"]); - m_menuIcon = Jellyfin::Support::fromJsonValue(source["MenuIcon"]); - m_displayName = Jellyfin::Support::fromJsonValue(source["DisplayName"]); - m_configurationPageType = Jellyfin::Support::fromJsonValue(source["ConfigurationPageType"]); - m_pluginId = Jellyfin::Support::fromJsonValue(source["PluginId"]); - -} - -QJsonObject ConfigurationPageInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["EnableInMainMenu"] = Jellyfin::Support::toJsonValue(m_enableInMainMenu); - result["MenuSection"] = Jellyfin::Support::toJsonValue(m_menuSection); - result["MenuIcon"] = Jellyfin::Support::toJsonValue(m_menuIcon); - result["DisplayName"] = Jellyfin::Support::toJsonValue(m_displayName); - result["ConfigurationPageType"] = Jellyfin::Support::toJsonValue(m_configurationPageType); - result["PluginId"] = Jellyfin::Support::toJsonValue(m_pluginId); - - return result; -} - -QString ConfigurationPageInfo::name() const { return m_name; } - -void ConfigurationPageInfo::setName(QString newName) { - m_name = newName; -} -bool ConfigurationPageInfo::enableInMainMenu() const { return m_enableInMainMenu; } - -void ConfigurationPageInfo::setEnableInMainMenu(bool newEnableInMainMenu) { - m_enableInMainMenu = newEnableInMainMenu; -} -QString ConfigurationPageInfo::menuSection() const { return m_menuSection; } - -void ConfigurationPageInfo::setMenuSection(QString newMenuSection) { - m_menuSection = newMenuSection; -} -QString ConfigurationPageInfo::menuIcon() const { return m_menuIcon; } - -void ConfigurationPageInfo::setMenuIcon(QString newMenuIcon) { - m_menuIcon = newMenuIcon; -} -QString ConfigurationPageInfo::displayName() const { return m_displayName; } - -void ConfigurationPageInfo::setDisplayName(QString newDisplayName) { - m_displayName = newDisplayName; -} -ConfigurationPageType ConfigurationPageInfo::configurationPageType() const { return m_configurationPageType; } - -void ConfigurationPageInfo::setConfigurationPageType(ConfigurationPageType newConfigurationPageType) { - m_configurationPageType = newConfigurationPageType; -} -QUuid ConfigurationPageInfo::pluginId() const { return m_pluginId; } - -void ConfigurationPageInfo::setPluginId(QUuid newPluginId) { - m_pluginId = newPluginId; -} - -} // NS DTO - -namespace Support { - -using ConfigurationPageInfo = Jellyfin::DTO::ConfigurationPageInfo; - -template <> -ConfigurationPageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ConfigurationPageInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/configurationpagetype.cpp b/core/src/DTO/configurationpagetype.cpp deleted file mode 100644 index 59c4ecc..0000000 --- a/core/src/DTO/configurationpagetype.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ConfigurationPageTypeClass::ConfigurationPageTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType; - -template <> -ConfigurationPageType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ConfigurationPageType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("PluginConfiguration")) { - return ConfigurationPageType::PluginConfiguration; - } - if (str == QStringLiteral("None")) { - return ConfigurationPageType::None; - } - - return ConfigurationPageType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/containerprofile.cpp b/core/src/DTO/containerprofile.cpp deleted file mode 100644 index c094eb0..0000000 --- a/core/src/DTO/containerprofile.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ContainerProfile::ContainerProfile() {} -ContainerProfile::ContainerProfile(const ContainerProfile &other) : - m_type(other.m_type), - m_conditions(other.m_conditions), - m_container(other.m_container){} - -ContainerProfile ContainerProfile::fromJson(QJsonObject source) { - ContainerProfile instance; - instance.setFromJson(source); - return instance; -} - - -void ContainerProfile::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_conditions = Jellyfin::Support::fromJsonValue>>(source["Conditions"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - -} - -QJsonObject ContainerProfile::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Conditions"] = Jellyfin::Support::toJsonValue>>(m_conditions); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - - return result; -} - -DlnaProfileType ContainerProfile::type() const { return m_type; } - -void ContainerProfile::setType(DlnaProfileType newType) { - m_type = newType; -} -QList> ContainerProfile::conditions() const { return m_conditions; } - -void ContainerProfile::setConditions(QList> newConditions) { - m_conditions = newConditions; -} -QString ContainerProfile::container() const { return m_container; } - -void ContainerProfile::setContainer(QString newContainer) { - m_container = newContainer; -} - -} // NS DTO - -namespace Support { - -using ContainerProfile = Jellyfin::DTO::ContainerProfile; - -template <> -ContainerProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ContainerProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/controlresponse.cpp b/core/src/DTO/controlresponse.cpp deleted file mode 100644 index f7777d9..0000000 --- a/core/src/DTO/controlresponse.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ControlResponse::ControlResponse() {} -ControlResponse::ControlResponse(const ControlResponse &other) : - m_headers(other.m_headers), - m_xml(other.m_xml), - m_isSuccessful(other.m_isSuccessful){} - -ControlResponse ControlResponse::fromJson(QJsonObject source) { - ControlResponse instance; - instance.setFromJson(source); - return instance; -} - - -void ControlResponse::setFromJson(QJsonObject source) { - m_headers = Jellyfin::Support::fromJsonValue(source["Headers"]); - m_xml = Jellyfin::Support::fromJsonValue(source["Xml"]); - m_isSuccessful = Jellyfin::Support::fromJsonValue(source["IsSuccessful"]); - -} - -QJsonObject ControlResponse::toJson() { - QJsonObject result; - result["Headers"] = Jellyfin::Support::toJsonValue(m_headers); - result["Xml"] = Jellyfin::Support::toJsonValue(m_xml); - result["IsSuccessful"] = Jellyfin::Support::toJsonValue(m_isSuccessful); - - return result; -} - -QJsonObject ControlResponse::headers() const { return m_headers; } - -void ControlResponse::setHeaders(QJsonObject newHeaders) { - m_headers = newHeaders; -} -QString ControlResponse::xml() const { return m_xml; } - -void ControlResponse::setXml(QString newXml) { - m_xml = newXml; -} -bool ControlResponse::isSuccessful() const { return m_isSuccessful; } - -void ControlResponse::setIsSuccessful(bool newIsSuccessful) { - m_isSuccessful = newIsSuccessful; -} - -} // NS DTO - -namespace Support { - -using ControlResponse = Jellyfin::DTO::ControlResponse; - -template <> -ControlResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ControlResponse::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/countryinfo.cpp b/core/src/DTO/countryinfo.cpp deleted file mode 100644 index a678718..0000000 --- a/core/src/DTO/countryinfo.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CountryInfo::CountryInfo() {} -CountryInfo::CountryInfo(const CountryInfo &other) : - m_name(other.m_name), - m_displayName(other.m_displayName), - m_twoLetterISORegionName(other.m_twoLetterISORegionName), - m_threeLetterISORegionName(other.m_threeLetterISORegionName){} - -CountryInfo CountryInfo::fromJson(QJsonObject source) { - CountryInfo instance; - instance.setFromJson(source); - return instance; -} - - -void CountryInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_displayName = Jellyfin::Support::fromJsonValue(source["DisplayName"]); - m_twoLetterISORegionName = Jellyfin::Support::fromJsonValue(source["TwoLetterISORegionName"]); - m_threeLetterISORegionName = Jellyfin::Support::fromJsonValue(source["ThreeLetterISORegionName"]); - -} - -QJsonObject CountryInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["DisplayName"] = Jellyfin::Support::toJsonValue(m_displayName); - result["TwoLetterISORegionName"] = Jellyfin::Support::toJsonValue(m_twoLetterISORegionName); - result["ThreeLetterISORegionName"] = Jellyfin::Support::toJsonValue(m_threeLetterISORegionName); - - return result; -} - -QString CountryInfo::name() const { return m_name; } - -void CountryInfo::setName(QString newName) { - m_name = newName; -} -QString CountryInfo::displayName() const { return m_displayName; } - -void CountryInfo::setDisplayName(QString newDisplayName) { - m_displayName = newDisplayName; -} -QString CountryInfo::twoLetterISORegionName() const { return m_twoLetterISORegionName; } - -void CountryInfo::setTwoLetterISORegionName(QString newTwoLetterISORegionName) { - m_twoLetterISORegionName = newTwoLetterISORegionName; -} -QString CountryInfo::threeLetterISORegionName() const { return m_threeLetterISORegionName; } - -void CountryInfo::setThreeLetterISORegionName(QString newThreeLetterISORegionName) { - m_threeLetterISORegionName = newThreeLetterISORegionName; -} - -} // NS DTO - -namespace Support { - -using CountryInfo = Jellyfin::DTO::CountryInfo; - -template <> -CountryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CountryInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/createplaylistdto.cpp b/core/src/DTO/createplaylistdto.cpp deleted file mode 100644 index f0568bd..0000000 --- a/core/src/DTO/createplaylistdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CreatePlaylistDto::CreatePlaylistDto() {} -CreatePlaylistDto::CreatePlaylistDto(const CreatePlaylistDto &other) : - m_name(other.m_name), - m_ids(other.m_ids), - m_userId(other.m_userId), - m_mediaType(other.m_mediaType){} - -CreatePlaylistDto CreatePlaylistDto::fromJson(QJsonObject source) { - CreatePlaylistDto instance; - instance.setFromJson(source); - return instance; -} - - -void CreatePlaylistDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_ids = Jellyfin::Support::fromJsonValue>(source["Ids"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_mediaType = Jellyfin::Support::fromJsonValue(source["MediaType"]); - -} - -QJsonObject CreatePlaylistDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Ids"] = Jellyfin::Support::toJsonValue>(m_ids); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["MediaType"] = Jellyfin::Support::toJsonValue(m_mediaType); - - return result; -} - -QString CreatePlaylistDto::name() const { return m_name; } - -void CreatePlaylistDto::setName(QString newName) { - m_name = newName; -} -QList CreatePlaylistDto::ids() const { return m_ids; } - -void CreatePlaylistDto::setIds(QList newIds) { - m_ids = newIds; -} -QUuid CreatePlaylistDto::userId() const { return m_userId; } - -void CreatePlaylistDto::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QString CreatePlaylistDto::mediaType() const { return m_mediaType; } - -void CreatePlaylistDto::setMediaType(QString newMediaType) { - m_mediaType = newMediaType; -} - -} // NS DTO - -namespace Support { - -using CreatePlaylistDto = Jellyfin::DTO::CreatePlaylistDto; - -template <> -CreatePlaylistDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CreatePlaylistDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/createuserbyname.cpp b/core/src/DTO/createuserbyname.cpp deleted file mode 100644 index c2531f3..0000000 --- a/core/src/DTO/createuserbyname.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CreateUserByName::CreateUserByName() {} -CreateUserByName::CreateUserByName(const CreateUserByName &other) : - m_name(other.m_name), - m_password(other.m_password){} - -CreateUserByName CreateUserByName::fromJson(QJsonObject source) { - CreateUserByName instance; - instance.setFromJson(source); - return instance; -} - - -void CreateUserByName::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_password = Jellyfin::Support::fromJsonValue(source["Password"]); - -} - -QJsonObject CreateUserByName::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Password"] = Jellyfin::Support::toJsonValue(m_password); - - return result; -} - -QString CreateUserByName::name() const { return m_name; } - -void CreateUserByName::setName(QString newName) { - m_name = newName; -} -QString CreateUserByName::password() const { return m_password; } - -void CreateUserByName::setPassword(QString newPassword) { - m_password = newPassword; -} - -} // NS DTO - -namespace Support { - -using CreateUserByName = Jellyfin::DTO::CreateUserByName; - -template <> -CreateUserByName fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CreateUserByName::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/culturedto.cpp b/core/src/DTO/culturedto.cpp deleted file mode 100644 index de0c870..0000000 --- a/core/src/DTO/culturedto.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -CultureDto::CultureDto() {} -CultureDto::CultureDto(const CultureDto &other) : - m_name(other.m_name), - m_displayName(other.m_displayName), - m_twoLetterISOLanguageName(other.m_twoLetterISOLanguageName), - m_threeLetterISOLanguageName(other.m_threeLetterISOLanguageName), - m_threeLetterISOLanguageNames(other.m_threeLetterISOLanguageNames){} - -CultureDto CultureDto::fromJson(QJsonObject source) { - CultureDto instance; - instance.setFromJson(source); - return instance; -} - - -void CultureDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_displayName = Jellyfin::Support::fromJsonValue(source["DisplayName"]); - m_twoLetterISOLanguageName = Jellyfin::Support::fromJsonValue(source["TwoLetterISOLanguageName"]); - m_threeLetterISOLanguageName = Jellyfin::Support::fromJsonValue(source["ThreeLetterISOLanguageName"]); - m_threeLetterISOLanguageNames = Jellyfin::Support::fromJsonValue(source["ThreeLetterISOLanguageNames"]); - -} - -QJsonObject CultureDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["DisplayName"] = Jellyfin::Support::toJsonValue(m_displayName); - result["TwoLetterISOLanguageName"] = Jellyfin::Support::toJsonValue(m_twoLetterISOLanguageName); - result["ThreeLetterISOLanguageName"] = Jellyfin::Support::toJsonValue(m_threeLetterISOLanguageName); - result["ThreeLetterISOLanguageNames"] = Jellyfin::Support::toJsonValue(m_threeLetterISOLanguageNames); - - return result; -} - -QString CultureDto::name() const { return m_name; } - -void CultureDto::setName(QString newName) { - m_name = newName; -} -QString CultureDto::displayName() const { return m_displayName; } - -void CultureDto::setDisplayName(QString newDisplayName) { - m_displayName = newDisplayName; -} -QString CultureDto::twoLetterISOLanguageName() const { return m_twoLetterISOLanguageName; } - -void CultureDto::setTwoLetterISOLanguageName(QString newTwoLetterISOLanguageName) { - m_twoLetterISOLanguageName = newTwoLetterISOLanguageName; -} -QString CultureDto::threeLetterISOLanguageName() const { return m_threeLetterISOLanguageName; } - -void CultureDto::setThreeLetterISOLanguageName(QString newThreeLetterISOLanguageName) { - m_threeLetterISOLanguageName = newThreeLetterISOLanguageName; -} -QStringList CultureDto::threeLetterISOLanguageNames() const { return m_threeLetterISOLanguageNames; } - -void CultureDto::setThreeLetterISOLanguageNames(QStringList newThreeLetterISOLanguageNames) { - m_threeLetterISOLanguageNames = newThreeLetterISOLanguageNames; -} - -} // NS DTO - -namespace Support { - -using CultureDto = Jellyfin::DTO::CultureDto; - -template <> -CultureDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return CultureDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/dayofweek.cpp b/core/src/DTO/dayofweek.cpp deleted file mode 100644 index a6cc5a2..0000000 --- a/core/src/DTO/dayofweek.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DayOfWeekClass::DayOfWeekClass() {} - - -} // NS DTO - -namespace Support { - -using DayOfWeek = Jellyfin::DTO::DayOfWeek; - -template <> -DayOfWeek fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return DayOfWeek::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Sunday")) { - return DayOfWeek::Sunday; - } - if (str == QStringLiteral("Monday")) { - return DayOfWeek::Monday; - } - if (str == QStringLiteral("Tuesday")) { - return DayOfWeek::Tuesday; - } - if (str == QStringLiteral("Wednesday")) { - return DayOfWeek::Wednesday; - } - if (str == QStringLiteral("Thursday")) { - return DayOfWeek::Thursday; - } - if (str == QStringLiteral("Friday")) { - return DayOfWeek::Friday; - } - if (str == QStringLiteral("Saturday")) { - return DayOfWeek::Saturday; - } - - return DayOfWeek::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/daypattern.cpp b/core/src/DTO/daypattern.cpp deleted file mode 100644 index 72cf83e..0000000 --- a/core/src/DTO/daypattern.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DayPatternClass::DayPatternClass() {} - - -} // NS DTO - -namespace Support { - -using DayPattern = Jellyfin::DTO::DayPattern; - -template <> -DayPattern fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return DayPattern::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Daily")) { - return DayPattern::Daily; - } - if (str == QStringLiteral("Weekdays")) { - return DayPattern::Weekdays; - } - if (str == QStringLiteral("Weekends")) { - return DayPattern::Weekends; - } - - return DayPattern::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/defaultdirectorybrowserinfodto.cpp b/core/src/DTO/defaultdirectorybrowserinfodto.cpp deleted file mode 100644 index cd2677f..0000000 --- a/core/src/DTO/defaultdirectorybrowserinfodto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DefaultDirectoryBrowserInfoDto::DefaultDirectoryBrowserInfoDto() {} -DefaultDirectoryBrowserInfoDto::DefaultDirectoryBrowserInfoDto(const DefaultDirectoryBrowserInfoDto &other) : - m_path(other.m_path){} - -DefaultDirectoryBrowserInfoDto DefaultDirectoryBrowserInfoDto::fromJson(QJsonObject source) { - DefaultDirectoryBrowserInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void DefaultDirectoryBrowserInfoDto::setFromJson(QJsonObject source) { - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - -} - -QJsonObject DefaultDirectoryBrowserInfoDto::toJson() { - QJsonObject result; - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - - return result; -} - -QString DefaultDirectoryBrowserInfoDto::path() const { return m_path; } - -void DefaultDirectoryBrowserInfoDto::setPath(QString newPath) { - m_path = newPath; -} - -} // NS DTO - -namespace Support { - -using DefaultDirectoryBrowserInfoDto = Jellyfin::DTO::DefaultDirectoryBrowserInfoDto; - -template <> -DefaultDirectoryBrowserInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DefaultDirectoryBrowserInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceidentification.cpp b/core/src/DTO/deviceidentification.cpp deleted file mode 100644 index f8eef9b..0000000 --- a/core/src/DTO/deviceidentification.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceIdentification::DeviceIdentification() {} -DeviceIdentification::DeviceIdentification(const DeviceIdentification &other) : - m_friendlyName(other.m_friendlyName), - m_modelNumber(other.m_modelNumber), - m_serialNumber(other.m_serialNumber), - m_modelName(other.m_modelName), - m_modelDescription(other.m_modelDescription), - m_modelUrl(other.m_modelUrl), - m_manufacturer(other.m_manufacturer), - m_manufacturerUrl(other.m_manufacturerUrl), - m_headers(other.m_headers){} - -DeviceIdentification DeviceIdentification::fromJson(QJsonObject source) { - DeviceIdentification instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceIdentification::setFromJson(QJsonObject source) { - m_friendlyName = Jellyfin::Support::fromJsonValue(source["FriendlyName"]); - m_modelNumber = Jellyfin::Support::fromJsonValue(source["ModelNumber"]); - m_serialNumber = Jellyfin::Support::fromJsonValue(source["SerialNumber"]); - m_modelName = Jellyfin::Support::fromJsonValue(source["ModelName"]); - m_modelDescription = Jellyfin::Support::fromJsonValue(source["ModelDescription"]); - m_modelUrl = Jellyfin::Support::fromJsonValue(source["ModelUrl"]); - m_manufacturer = Jellyfin::Support::fromJsonValue(source["Manufacturer"]); - m_manufacturerUrl = Jellyfin::Support::fromJsonValue(source["ManufacturerUrl"]); - m_headers = Jellyfin::Support::fromJsonValue>>(source["Headers"]); - -} - -QJsonObject DeviceIdentification::toJson() { - QJsonObject result; - result["FriendlyName"] = Jellyfin::Support::toJsonValue(m_friendlyName); - result["ModelNumber"] = Jellyfin::Support::toJsonValue(m_modelNumber); - result["SerialNumber"] = Jellyfin::Support::toJsonValue(m_serialNumber); - result["ModelName"] = Jellyfin::Support::toJsonValue(m_modelName); - result["ModelDescription"] = Jellyfin::Support::toJsonValue(m_modelDescription); - result["ModelUrl"] = Jellyfin::Support::toJsonValue(m_modelUrl); - result["Manufacturer"] = Jellyfin::Support::toJsonValue(m_manufacturer); - result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue(m_manufacturerUrl); - result["Headers"] = Jellyfin::Support::toJsonValue>>(m_headers); - - return result; -} - -QString DeviceIdentification::friendlyName() const { return m_friendlyName; } - -void DeviceIdentification::setFriendlyName(QString newFriendlyName) { - m_friendlyName = newFriendlyName; -} -QString DeviceIdentification::modelNumber() const { return m_modelNumber; } - -void DeviceIdentification::setModelNumber(QString newModelNumber) { - m_modelNumber = newModelNumber; -} -QString DeviceIdentification::serialNumber() const { return m_serialNumber; } - -void DeviceIdentification::setSerialNumber(QString newSerialNumber) { - m_serialNumber = newSerialNumber; -} -QString DeviceIdentification::modelName() const { return m_modelName; } - -void DeviceIdentification::setModelName(QString newModelName) { - m_modelName = newModelName; -} -QString DeviceIdentification::modelDescription() const { return m_modelDescription; } - -void DeviceIdentification::setModelDescription(QString newModelDescription) { - m_modelDescription = newModelDescription; -} -QString DeviceIdentification::modelUrl() const { return m_modelUrl; } - -void DeviceIdentification::setModelUrl(QString newModelUrl) { - m_modelUrl = newModelUrl; -} -QString DeviceIdentification::manufacturer() const { return m_manufacturer; } - -void DeviceIdentification::setManufacturer(QString newManufacturer) { - m_manufacturer = newManufacturer; -} -QString DeviceIdentification::manufacturerUrl() const { return m_manufacturerUrl; } - -void DeviceIdentification::setManufacturerUrl(QString newManufacturerUrl) { - m_manufacturerUrl = newManufacturerUrl; -} -QList> DeviceIdentification::headers() const { return m_headers; } - -void DeviceIdentification::setHeaders(QList> newHeaders) { - m_headers = newHeaders; -} - -} // NS DTO - -namespace Support { - -using DeviceIdentification = Jellyfin::DTO::DeviceIdentification; - -template <> -DeviceIdentification fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceIdentification::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceinfo.cpp b/core/src/DTO/deviceinfo.cpp deleted file mode 100644 index 37c4542..0000000 --- a/core/src/DTO/deviceinfo.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceInfo::DeviceInfo() {} -DeviceInfo::DeviceInfo(const DeviceInfo &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId), - m_lastUserName(other.m_lastUserName), - m_appName(other.m_appName), - m_appVersion(other.m_appVersion), - m_lastUserId(other.m_lastUserId), - m_dateLastActivity(other.m_dateLastActivity), - m_capabilities(other.m_capabilities), - m_iconUrl(other.m_iconUrl){} - -DeviceInfo DeviceInfo::fromJson(QJsonObject source) { - DeviceInfo instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_lastUserName = Jellyfin::Support::fromJsonValue(source["LastUserName"]); - m_appName = Jellyfin::Support::fromJsonValue(source["AppName"]); - m_appVersion = Jellyfin::Support::fromJsonValue(source["AppVersion"]); - m_lastUserId = Jellyfin::Support::fromJsonValue(source["LastUserId"]); - m_dateLastActivity = Jellyfin::Support::fromJsonValue(source["DateLastActivity"]); - m_capabilities = Jellyfin::Support::fromJsonValue>(source["Capabilities"]); - m_iconUrl = Jellyfin::Support::fromJsonValue(source["IconUrl"]); - -} - -QJsonObject DeviceInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["LastUserName"] = Jellyfin::Support::toJsonValue(m_lastUserName); - result["AppName"] = Jellyfin::Support::toJsonValue(m_appName); - result["AppVersion"] = Jellyfin::Support::toJsonValue(m_appVersion); - result["LastUserId"] = Jellyfin::Support::toJsonValue(m_lastUserId); - result["DateLastActivity"] = Jellyfin::Support::toJsonValue(m_dateLastActivity); - result["Capabilities"] = Jellyfin::Support::toJsonValue>(m_capabilities); - result["IconUrl"] = Jellyfin::Support::toJsonValue(m_iconUrl); - - return result; -} - -QString DeviceInfo::name() const { return m_name; } - -void DeviceInfo::setName(QString newName) { - m_name = newName; -} -QString DeviceInfo::jellyfinId() const { return m_jellyfinId; } - -void DeviceInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString DeviceInfo::lastUserName() const { return m_lastUserName; } - -void DeviceInfo::setLastUserName(QString newLastUserName) { - m_lastUserName = newLastUserName; -} -QString DeviceInfo::appName() const { return m_appName; } - -void DeviceInfo::setAppName(QString newAppName) { - m_appName = newAppName; -} -QString DeviceInfo::appVersion() const { return m_appVersion; } - -void DeviceInfo::setAppVersion(QString newAppVersion) { - m_appVersion = newAppVersion; -} -QUuid DeviceInfo::lastUserId() const { return m_lastUserId; } - -void DeviceInfo::setLastUserId(QUuid newLastUserId) { - m_lastUserId = newLastUserId; -} -QDateTime DeviceInfo::dateLastActivity() const { return m_dateLastActivity; } - -void DeviceInfo::setDateLastActivity(QDateTime newDateLastActivity) { - m_dateLastActivity = newDateLastActivity; -} -QSharedPointer DeviceInfo::capabilities() const { return m_capabilities; } - -void DeviceInfo::setCapabilities(QSharedPointer newCapabilities) { - m_capabilities = newCapabilities; -} -QString DeviceInfo::iconUrl() const { return m_iconUrl; } - -void DeviceInfo::setIconUrl(QString newIconUrl) { - m_iconUrl = newIconUrl; -} - -} // NS DTO - -namespace Support { - -using DeviceInfo = Jellyfin::DTO::DeviceInfo; - -template <> -DeviceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceinfoqueryresult.cpp b/core/src/DTO/deviceinfoqueryresult.cpp deleted file mode 100644 index 7866bcb..0000000 --- a/core/src/DTO/deviceinfoqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceInfoQueryResult::DeviceInfoQueryResult() {} -DeviceInfoQueryResult::DeviceInfoQueryResult(const DeviceInfoQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -DeviceInfoQueryResult DeviceInfoQueryResult::fromJson(QJsonObject source) { - DeviceInfoQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceInfoQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject DeviceInfoQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> DeviceInfoQueryResult::items() const { return m_items; } - -void DeviceInfoQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 DeviceInfoQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void DeviceInfoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 DeviceInfoQueryResult::startIndex() const { return m_startIndex; } - -void DeviceInfoQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult; - -template <> -DeviceInfoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceInfoQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceoptions.cpp b/core/src/DTO/deviceoptions.cpp deleted file mode 100644 index da47ea7..0000000 --- a/core/src/DTO/deviceoptions.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceOptions::DeviceOptions() {} -DeviceOptions::DeviceOptions(const DeviceOptions &other) : - m_customName(other.m_customName){} - -DeviceOptions DeviceOptions::fromJson(QJsonObject source) { - DeviceOptions instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceOptions::setFromJson(QJsonObject source) { - m_customName = Jellyfin::Support::fromJsonValue(source["CustomName"]); - -} - -QJsonObject DeviceOptions::toJson() { - QJsonObject result; - result["CustomName"] = Jellyfin::Support::toJsonValue(m_customName); - - return result; -} - -QString DeviceOptions::customName() const { return m_customName; } - -void DeviceOptions::setCustomName(QString newCustomName) { - m_customName = newCustomName; -} - -} // NS DTO - -namespace Support { - -using DeviceOptions = Jellyfin::DTO::DeviceOptions; - -template <> -DeviceOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceOptions::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceprofile.cpp b/core/src/DTO/deviceprofile.cpp deleted file mode 100644 index 7f570bf..0000000 --- a/core/src/DTO/deviceprofile.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceProfile::DeviceProfile() {} -DeviceProfile::DeviceProfile(const DeviceProfile &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId), - m_identification(other.m_identification), - m_friendlyName(other.m_friendlyName), - m_manufacturer(other.m_manufacturer), - m_manufacturerUrl(other.m_manufacturerUrl), - m_modelName(other.m_modelName), - m_modelDescription(other.m_modelDescription), - m_modelNumber(other.m_modelNumber), - m_modelUrl(other.m_modelUrl), - m_serialNumber(other.m_serialNumber), - m_enableAlbumArtInDidl(other.m_enableAlbumArtInDidl), - m_enableSingleAlbumArtLimit(other.m_enableSingleAlbumArtLimit), - m_enableSingleSubtitleLimit(other.m_enableSingleSubtitleLimit), - m_supportedMediaTypes(other.m_supportedMediaTypes), - m_userId(other.m_userId), - m_albumArtPn(other.m_albumArtPn), - m_maxAlbumArtWidth(other.m_maxAlbumArtWidth), - m_maxAlbumArtHeight(other.m_maxAlbumArtHeight), - m_maxIconWidth(other.m_maxIconWidth), - m_maxIconHeight(other.m_maxIconHeight), - m_maxStreamingBitrate(other.m_maxStreamingBitrate), - m_maxStaticBitrate(other.m_maxStaticBitrate), - m_musicStreamingTranscodingBitrate(other.m_musicStreamingTranscodingBitrate), - m_maxStaticMusicBitrate(other.m_maxStaticMusicBitrate), - m_sonyAggregationFlags(other.m_sonyAggregationFlags), - m_protocolInfo(other.m_protocolInfo), - m_timelineOffsetSeconds(other.m_timelineOffsetSeconds), - m_requiresPlainVideoItems(other.m_requiresPlainVideoItems), - m_requiresPlainFolders(other.m_requiresPlainFolders), - m_enableMSMediaReceiverRegistrar(other.m_enableMSMediaReceiverRegistrar), - m_ignoreTranscodeByteRangeRequests(other.m_ignoreTranscodeByteRangeRequests), - m_xmlRootAttributes(other.m_xmlRootAttributes), - m_directPlayProfiles(other.m_directPlayProfiles), - m_transcodingProfiles(other.m_transcodingProfiles), - m_containerProfiles(other.m_containerProfiles), - m_codecProfiles(other.m_codecProfiles), - m_responseProfiles(other.m_responseProfiles), - m_subtitleProfiles(other.m_subtitleProfiles){} - -DeviceProfile DeviceProfile::fromJson(QJsonObject source) { - DeviceProfile instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceProfile::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_identification = Jellyfin::Support::fromJsonValue>(source["Identification"]); - m_friendlyName = Jellyfin::Support::fromJsonValue(source["FriendlyName"]); - m_manufacturer = Jellyfin::Support::fromJsonValue(source["Manufacturer"]); - m_manufacturerUrl = Jellyfin::Support::fromJsonValue(source["ManufacturerUrl"]); - m_modelName = Jellyfin::Support::fromJsonValue(source["ModelName"]); - m_modelDescription = Jellyfin::Support::fromJsonValue(source["ModelDescription"]); - m_modelNumber = Jellyfin::Support::fromJsonValue(source["ModelNumber"]); - m_modelUrl = Jellyfin::Support::fromJsonValue(source["ModelUrl"]); - m_serialNumber = Jellyfin::Support::fromJsonValue(source["SerialNumber"]); - m_enableAlbumArtInDidl = Jellyfin::Support::fromJsonValue(source["EnableAlbumArtInDidl"]); - m_enableSingleAlbumArtLimit = Jellyfin::Support::fromJsonValue(source["EnableSingleAlbumArtLimit"]); - m_enableSingleSubtitleLimit = Jellyfin::Support::fromJsonValue(source["EnableSingleSubtitleLimit"]); - m_supportedMediaTypes = Jellyfin::Support::fromJsonValue(source["SupportedMediaTypes"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_albumArtPn = Jellyfin::Support::fromJsonValue(source["AlbumArtPn"]); - m_maxAlbumArtWidth = Jellyfin::Support::fromJsonValue(source["MaxAlbumArtWidth"]); - m_maxAlbumArtHeight = Jellyfin::Support::fromJsonValue(source["MaxAlbumArtHeight"]); - m_maxIconWidth = Jellyfin::Support::fromJsonValue(source["MaxIconWidth"]); - m_maxIconHeight = Jellyfin::Support::fromJsonValue(source["MaxIconHeight"]); - m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue(source["MaxStreamingBitrate"]); - m_maxStaticBitrate = Jellyfin::Support::fromJsonValue(source["MaxStaticBitrate"]); - m_musicStreamingTranscodingBitrate = Jellyfin::Support::fromJsonValue(source["MusicStreamingTranscodingBitrate"]); - m_maxStaticMusicBitrate = Jellyfin::Support::fromJsonValue(source["MaxStaticMusicBitrate"]); - m_sonyAggregationFlags = Jellyfin::Support::fromJsonValue(source["SonyAggregationFlags"]); - m_protocolInfo = Jellyfin::Support::fromJsonValue(source["ProtocolInfo"]); - m_timelineOffsetSeconds = Jellyfin::Support::fromJsonValue(source["TimelineOffsetSeconds"]); - m_requiresPlainVideoItems = Jellyfin::Support::fromJsonValue(source["RequiresPlainVideoItems"]); - m_requiresPlainFolders = Jellyfin::Support::fromJsonValue(source["RequiresPlainFolders"]); - m_enableMSMediaReceiverRegistrar = Jellyfin::Support::fromJsonValue(source["EnableMSMediaReceiverRegistrar"]); - m_ignoreTranscodeByteRangeRequests = Jellyfin::Support::fromJsonValue(source["IgnoreTranscodeByteRangeRequests"]); - m_xmlRootAttributes = Jellyfin::Support::fromJsonValue>>(source["XmlRootAttributes"]); - m_directPlayProfiles = Jellyfin::Support::fromJsonValue>>(source["DirectPlayProfiles"]); - m_transcodingProfiles = Jellyfin::Support::fromJsonValue>>(source["TranscodingProfiles"]); - m_containerProfiles = Jellyfin::Support::fromJsonValue>>(source["ContainerProfiles"]); - m_codecProfiles = Jellyfin::Support::fromJsonValue>>(source["CodecProfiles"]); - m_responseProfiles = Jellyfin::Support::fromJsonValue>>(source["ResponseProfiles"]); - m_subtitleProfiles = Jellyfin::Support::fromJsonValue>>(source["SubtitleProfiles"]); - -} - -QJsonObject DeviceProfile::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Identification"] = Jellyfin::Support::toJsonValue>(m_identification); - result["FriendlyName"] = Jellyfin::Support::toJsonValue(m_friendlyName); - result["Manufacturer"] = Jellyfin::Support::toJsonValue(m_manufacturer); - result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue(m_manufacturerUrl); - result["ModelName"] = Jellyfin::Support::toJsonValue(m_modelName); - result["ModelDescription"] = Jellyfin::Support::toJsonValue(m_modelDescription); - result["ModelNumber"] = Jellyfin::Support::toJsonValue(m_modelNumber); - result["ModelUrl"] = Jellyfin::Support::toJsonValue(m_modelUrl); - result["SerialNumber"] = Jellyfin::Support::toJsonValue(m_serialNumber); - result["EnableAlbumArtInDidl"] = Jellyfin::Support::toJsonValue(m_enableAlbumArtInDidl); - result["EnableSingleAlbumArtLimit"] = Jellyfin::Support::toJsonValue(m_enableSingleAlbumArtLimit); - result["EnableSingleSubtitleLimit"] = Jellyfin::Support::toJsonValue(m_enableSingleSubtitleLimit); - result["SupportedMediaTypes"] = Jellyfin::Support::toJsonValue(m_supportedMediaTypes); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["AlbumArtPn"] = Jellyfin::Support::toJsonValue(m_albumArtPn); - result["MaxAlbumArtWidth"] = Jellyfin::Support::toJsonValue(m_maxAlbumArtWidth); - result["MaxAlbumArtHeight"] = Jellyfin::Support::toJsonValue(m_maxAlbumArtHeight); - result["MaxIconWidth"] = Jellyfin::Support::toJsonValue(m_maxIconWidth); - result["MaxIconHeight"] = Jellyfin::Support::toJsonValue(m_maxIconHeight); - result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue(m_maxStreamingBitrate); - result["MaxStaticBitrate"] = Jellyfin::Support::toJsonValue(m_maxStaticBitrate); - result["MusicStreamingTranscodingBitrate"] = Jellyfin::Support::toJsonValue(m_musicStreamingTranscodingBitrate); - result["MaxStaticMusicBitrate"] = Jellyfin::Support::toJsonValue(m_maxStaticMusicBitrate); - result["SonyAggregationFlags"] = Jellyfin::Support::toJsonValue(m_sonyAggregationFlags); - result["ProtocolInfo"] = Jellyfin::Support::toJsonValue(m_protocolInfo); - result["TimelineOffsetSeconds"] = Jellyfin::Support::toJsonValue(m_timelineOffsetSeconds); - result["RequiresPlainVideoItems"] = Jellyfin::Support::toJsonValue(m_requiresPlainVideoItems); - result["RequiresPlainFolders"] = Jellyfin::Support::toJsonValue(m_requiresPlainFolders); - result["EnableMSMediaReceiverRegistrar"] = Jellyfin::Support::toJsonValue(m_enableMSMediaReceiverRegistrar); - result["IgnoreTranscodeByteRangeRequests"] = Jellyfin::Support::toJsonValue(m_ignoreTranscodeByteRangeRequests); - result["XmlRootAttributes"] = Jellyfin::Support::toJsonValue>>(m_xmlRootAttributes); - result["DirectPlayProfiles"] = Jellyfin::Support::toJsonValue>>(m_directPlayProfiles); - result["TranscodingProfiles"] = Jellyfin::Support::toJsonValue>>(m_transcodingProfiles); - result["ContainerProfiles"] = Jellyfin::Support::toJsonValue>>(m_containerProfiles); - result["CodecProfiles"] = Jellyfin::Support::toJsonValue>>(m_codecProfiles); - result["ResponseProfiles"] = Jellyfin::Support::toJsonValue>>(m_responseProfiles); - result["SubtitleProfiles"] = Jellyfin::Support::toJsonValue>>(m_subtitleProfiles); - - return result; -} - -QString DeviceProfile::name() const { return m_name; } - -void DeviceProfile::setName(QString newName) { - m_name = newName; -} -QString DeviceProfile::jellyfinId() const { return m_jellyfinId; } - -void DeviceProfile::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QSharedPointer DeviceProfile::identification() const { return m_identification; } - -void DeviceProfile::setIdentification(QSharedPointer newIdentification) { - m_identification = newIdentification; -} -QString DeviceProfile::friendlyName() const { return m_friendlyName; } - -void DeviceProfile::setFriendlyName(QString newFriendlyName) { - m_friendlyName = newFriendlyName; -} -QString DeviceProfile::manufacturer() const { return m_manufacturer; } - -void DeviceProfile::setManufacturer(QString newManufacturer) { - m_manufacturer = newManufacturer; -} -QString DeviceProfile::manufacturerUrl() const { return m_manufacturerUrl; } - -void DeviceProfile::setManufacturerUrl(QString newManufacturerUrl) { - m_manufacturerUrl = newManufacturerUrl; -} -QString DeviceProfile::modelName() const { return m_modelName; } - -void DeviceProfile::setModelName(QString newModelName) { - m_modelName = newModelName; -} -QString DeviceProfile::modelDescription() const { return m_modelDescription; } - -void DeviceProfile::setModelDescription(QString newModelDescription) { - m_modelDescription = newModelDescription; -} -QString DeviceProfile::modelNumber() const { return m_modelNumber; } - -void DeviceProfile::setModelNumber(QString newModelNumber) { - m_modelNumber = newModelNumber; -} -QString DeviceProfile::modelUrl() const { return m_modelUrl; } - -void DeviceProfile::setModelUrl(QString newModelUrl) { - m_modelUrl = newModelUrl; -} -QString DeviceProfile::serialNumber() const { return m_serialNumber; } - -void DeviceProfile::setSerialNumber(QString newSerialNumber) { - m_serialNumber = newSerialNumber; -} -bool DeviceProfile::enableAlbumArtInDidl() const { return m_enableAlbumArtInDidl; } - -void DeviceProfile::setEnableAlbumArtInDidl(bool newEnableAlbumArtInDidl) { - m_enableAlbumArtInDidl = newEnableAlbumArtInDidl; -} -bool DeviceProfile::enableSingleAlbumArtLimit() const { return m_enableSingleAlbumArtLimit; } - -void DeviceProfile::setEnableSingleAlbumArtLimit(bool newEnableSingleAlbumArtLimit) { - m_enableSingleAlbumArtLimit = newEnableSingleAlbumArtLimit; -} -bool DeviceProfile::enableSingleSubtitleLimit() const { return m_enableSingleSubtitleLimit; } - -void DeviceProfile::setEnableSingleSubtitleLimit(bool newEnableSingleSubtitleLimit) { - m_enableSingleSubtitleLimit = newEnableSingleSubtitleLimit; -} -QString DeviceProfile::supportedMediaTypes() const { return m_supportedMediaTypes; } - -void DeviceProfile::setSupportedMediaTypes(QString newSupportedMediaTypes) { - m_supportedMediaTypes = newSupportedMediaTypes; -} -QString DeviceProfile::userId() const { return m_userId; } - -void DeviceProfile::setUserId(QString newUserId) { - m_userId = newUserId; -} -QString DeviceProfile::albumArtPn() const { return m_albumArtPn; } - -void DeviceProfile::setAlbumArtPn(QString newAlbumArtPn) { - m_albumArtPn = newAlbumArtPn; -} -qint32 DeviceProfile::maxAlbumArtWidth() const { return m_maxAlbumArtWidth; } - -void DeviceProfile::setMaxAlbumArtWidth(qint32 newMaxAlbumArtWidth) { - m_maxAlbumArtWidth = newMaxAlbumArtWidth; -} -qint32 DeviceProfile::maxAlbumArtHeight() const { return m_maxAlbumArtHeight; } - -void DeviceProfile::setMaxAlbumArtHeight(qint32 newMaxAlbumArtHeight) { - m_maxAlbumArtHeight = newMaxAlbumArtHeight; -} -qint32 DeviceProfile::maxIconWidth() const { return m_maxIconWidth; } - -void DeviceProfile::setMaxIconWidth(qint32 newMaxIconWidth) { - m_maxIconWidth = newMaxIconWidth; -} -qint32 DeviceProfile::maxIconHeight() const { return m_maxIconHeight; } - -void DeviceProfile::setMaxIconHeight(qint32 newMaxIconHeight) { - m_maxIconHeight = newMaxIconHeight; -} -qint32 DeviceProfile::maxStreamingBitrate() const { return m_maxStreamingBitrate; } - -void DeviceProfile::setMaxStreamingBitrate(qint32 newMaxStreamingBitrate) { - m_maxStreamingBitrate = newMaxStreamingBitrate; -} -qint32 DeviceProfile::maxStaticBitrate() const { return m_maxStaticBitrate; } - -void DeviceProfile::setMaxStaticBitrate(qint32 newMaxStaticBitrate) { - m_maxStaticBitrate = newMaxStaticBitrate; -} -qint32 DeviceProfile::musicStreamingTranscodingBitrate() const { return m_musicStreamingTranscodingBitrate; } - -void DeviceProfile::setMusicStreamingTranscodingBitrate(qint32 newMusicStreamingTranscodingBitrate) { - m_musicStreamingTranscodingBitrate = newMusicStreamingTranscodingBitrate; -} -qint32 DeviceProfile::maxStaticMusicBitrate() const { return m_maxStaticMusicBitrate; } - -void DeviceProfile::setMaxStaticMusicBitrate(qint32 newMaxStaticMusicBitrate) { - m_maxStaticMusicBitrate = newMaxStaticMusicBitrate; -} -QString DeviceProfile::sonyAggregationFlags() const { return m_sonyAggregationFlags; } - -void DeviceProfile::setSonyAggregationFlags(QString newSonyAggregationFlags) { - m_sonyAggregationFlags = newSonyAggregationFlags; -} -QString DeviceProfile::protocolInfo() const { return m_protocolInfo; } - -void DeviceProfile::setProtocolInfo(QString newProtocolInfo) { - m_protocolInfo = newProtocolInfo; -} -qint32 DeviceProfile::timelineOffsetSeconds() const { return m_timelineOffsetSeconds; } - -void DeviceProfile::setTimelineOffsetSeconds(qint32 newTimelineOffsetSeconds) { - m_timelineOffsetSeconds = newTimelineOffsetSeconds; -} -bool DeviceProfile::requiresPlainVideoItems() const { return m_requiresPlainVideoItems; } - -void DeviceProfile::setRequiresPlainVideoItems(bool newRequiresPlainVideoItems) { - m_requiresPlainVideoItems = newRequiresPlainVideoItems; -} -bool DeviceProfile::requiresPlainFolders() const { return m_requiresPlainFolders; } - -void DeviceProfile::setRequiresPlainFolders(bool newRequiresPlainFolders) { - m_requiresPlainFolders = newRequiresPlainFolders; -} -bool DeviceProfile::enableMSMediaReceiverRegistrar() const { return m_enableMSMediaReceiverRegistrar; } - -void DeviceProfile::setEnableMSMediaReceiverRegistrar(bool newEnableMSMediaReceiverRegistrar) { - m_enableMSMediaReceiverRegistrar = newEnableMSMediaReceiverRegistrar; -} -bool DeviceProfile::ignoreTranscodeByteRangeRequests() const { return m_ignoreTranscodeByteRangeRequests; } - -void DeviceProfile::setIgnoreTranscodeByteRangeRequests(bool newIgnoreTranscodeByteRangeRequests) { - m_ignoreTranscodeByteRangeRequests = newIgnoreTranscodeByteRangeRequests; -} -QList> DeviceProfile::xmlRootAttributes() const { return m_xmlRootAttributes; } - -void DeviceProfile::setXmlRootAttributes(QList> newXmlRootAttributes) { - m_xmlRootAttributes = newXmlRootAttributes; -} -QList> DeviceProfile::directPlayProfiles() const { return m_directPlayProfiles; } - -void DeviceProfile::setDirectPlayProfiles(QList> newDirectPlayProfiles) { - m_directPlayProfiles = newDirectPlayProfiles; -} -QList> DeviceProfile::transcodingProfiles() const { return m_transcodingProfiles; } - -void DeviceProfile::setTranscodingProfiles(QList> newTranscodingProfiles) { - m_transcodingProfiles = newTranscodingProfiles; -} -QList> DeviceProfile::containerProfiles() const { return m_containerProfiles; } - -void DeviceProfile::setContainerProfiles(QList> newContainerProfiles) { - m_containerProfiles = newContainerProfiles; -} -QList> DeviceProfile::codecProfiles() const { return m_codecProfiles; } - -void DeviceProfile::setCodecProfiles(QList> newCodecProfiles) { - m_codecProfiles = newCodecProfiles; -} -QList> DeviceProfile::responseProfiles() const { return m_responseProfiles; } - -void DeviceProfile::setResponseProfiles(QList> newResponseProfiles) { - m_responseProfiles = newResponseProfiles; -} -QList> DeviceProfile::subtitleProfiles() const { return m_subtitleProfiles; } - -void DeviceProfile::setSubtitleProfiles(QList> newSubtitleProfiles) { - m_subtitleProfiles = newSubtitleProfiles; -} - -} // NS DTO - -namespace Support { - -using DeviceProfile = Jellyfin::DTO::DeviceProfile; - -template <> -DeviceProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceprofileinfo.cpp b/core/src/DTO/deviceprofileinfo.cpp deleted file mode 100644 index 6ca223d..0000000 --- a/core/src/DTO/deviceprofileinfo.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceProfileInfo::DeviceProfileInfo() {} -DeviceProfileInfo::DeviceProfileInfo(const DeviceProfileInfo &other) : - m_jellyfinId(other.m_jellyfinId), - m_name(other.m_name), - m_type(other.m_type){} - -DeviceProfileInfo DeviceProfileInfo::fromJson(QJsonObject source) { - DeviceProfileInfo instance; - instance.setFromJson(source); - return instance; -} - - -void DeviceProfileInfo::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - -} - -QJsonObject DeviceProfileInfo::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - - return result; -} - -QString DeviceProfileInfo::jellyfinId() const { return m_jellyfinId; } - -void DeviceProfileInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString DeviceProfileInfo::name() const { return m_name; } - -void DeviceProfileInfo::setName(QString newName) { - m_name = newName; -} -DeviceProfileType DeviceProfileInfo::type() const { return m_type; } - -void DeviceProfileInfo::setType(DeviceProfileType newType) { - m_type = newType; -} - -} // NS DTO - -namespace Support { - -using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo; - -template <> -DeviceProfileInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DeviceProfileInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/deviceprofiletype.cpp b/core/src/DTO/deviceprofiletype.cpp deleted file mode 100644 index 796b8ac..0000000 --- a/core/src/DTO/deviceprofiletype.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DeviceProfileTypeClass::DeviceProfileTypeClass() {} - - -} // NS DTO - -namespace Support { - -using DeviceProfileType = Jellyfin::DTO::DeviceProfileType; - -template <> -DeviceProfileType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return DeviceProfileType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("System")) { - return DeviceProfileType::System; - } - if (str == QStringLiteral("User")) { - return DeviceProfileType::User; - } - - return DeviceProfileType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/directplayprofile.cpp b/core/src/DTO/directplayprofile.cpp deleted file mode 100644 index 39cd1d3..0000000 --- a/core/src/DTO/directplayprofile.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DirectPlayProfile::DirectPlayProfile() {} -DirectPlayProfile::DirectPlayProfile(const DirectPlayProfile &other) : - m_container(other.m_container), - m_audioCodec(other.m_audioCodec), - m_videoCodec(other.m_videoCodec), - m_type(other.m_type){} - -DirectPlayProfile DirectPlayProfile::fromJson(QJsonObject source) { - DirectPlayProfile instance; - instance.setFromJson(source); - return instance; -} - - -void DirectPlayProfile::setFromJson(QJsonObject source) { - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_audioCodec = Jellyfin::Support::fromJsonValue(source["AudioCodec"]); - m_videoCodec = Jellyfin::Support::fromJsonValue(source["VideoCodec"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - -} - -QJsonObject DirectPlayProfile::toJson() { - QJsonObject result; - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); - result["VideoCodec"] = Jellyfin::Support::toJsonValue(m_videoCodec); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - - return result; -} - -QString DirectPlayProfile::container() const { return m_container; } - -void DirectPlayProfile::setContainer(QString newContainer) { - m_container = newContainer; -} -QString DirectPlayProfile::audioCodec() const { return m_audioCodec; } - -void DirectPlayProfile::setAudioCodec(QString newAudioCodec) { - m_audioCodec = newAudioCodec; -} -QString DirectPlayProfile::videoCodec() const { return m_videoCodec; } - -void DirectPlayProfile::setVideoCodec(QString newVideoCodec) { - m_videoCodec = newVideoCodec; -} -DlnaProfileType DirectPlayProfile::type() const { return m_type; } - -void DirectPlayProfile::setType(DlnaProfileType newType) { - m_type = newType; -} - -} // NS DTO - -namespace Support { - -using DirectPlayProfile = Jellyfin::DTO::DirectPlayProfile; - -template <> -DirectPlayProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DirectPlayProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/displaypreferencesdto.cpp b/core/src/DTO/displaypreferencesdto.cpp deleted file mode 100644 index 5c0840c..0000000 --- a/core/src/DTO/displaypreferencesdto.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DisplayPreferencesDto::DisplayPreferencesDto() {} -DisplayPreferencesDto::DisplayPreferencesDto(const DisplayPreferencesDto &other) : - m_jellyfinId(other.m_jellyfinId), - m_viewType(other.m_viewType), - m_sortBy(other.m_sortBy), - m_indexBy(other.m_indexBy), - m_rememberIndexing(other.m_rememberIndexing), - m_primaryImageHeight(other.m_primaryImageHeight), - m_primaryImageWidth(other.m_primaryImageWidth), - m_customPrefs(other.m_customPrefs), - m_scrollDirection(other.m_scrollDirection), - m_showBackdrop(other.m_showBackdrop), - m_rememberSorting(other.m_rememberSorting), - m_sortOrder(other.m_sortOrder), - m_showSidebar(other.m_showSidebar), - m_client(other.m_client){} - -DisplayPreferencesDto DisplayPreferencesDto::fromJson(QJsonObject source) { - DisplayPreferencesDto instance; - instance.setFromJson(source); - return instance; -} - - -void DisplayPreferencesDto::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_viewType = Jellyfin::Support::fromJsonValue(source["ViewType"]); - m_sortBy = Jellyfin::Support::fromJsonValue(source["SortBy"]); - m_indexBy = Jellyfin::Support::fromJsonValue(source["IndexBy"]); - m_rememberIndexing = Jellyfin::Support::fromJsonValue(source["RememberIndexing"]); - m_primaryImageHeight = Jellyfin::Support::fromJsonValue(source["PrimaryImageHeight"]); - m_primaryImageWidth = Jellyfin::Support::fromJsonValue(source["PrimaryImageWidth"]); - m_customPrefs = Jellyfin::Support::fromJsonValue(source["CustomPrefs"]); - m_scrollDirection = Jellyfin::Support::fromJsonValue(source["ScrollDirection"]); - m_showBackdrop = Jellyfin::Support::fromJsonValue(source["ShowBackdrop"]); - m_rememberSorting = Jellyfin::Support::fromJsonValue(source["RememberSorting"]); - m_sortOrder = Jellyfin::Support::fromJsonValue(source["SortOrder"]); - m_showSidebar = Jellyfin::Support::fromJsonValue(source["ShowSidebar"]); - m_client = Jellyfin::Support::fromJsonValue(source["Client"]); - -} - -QJsonObject DisplayPreferencesDto::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["ViewType"] = Jellyfin::Support::toJsonValue(m_viewType); - result["SortBy"] = Jellyfin::Support::toJsonValue(m_sortBy); - result["IndexBy"] = Jellyfin::Support::toJsonValue(m_indexBy); - result["RememberIndexing"] = Jellyfin::Support::toJsonValue(m_rememberIndexing); - result["PrimaryImageHeight"] = Jellyfin::Support::toJsonValue(m_primaryImageHeight); - result["PrimaryImageWidth"] = Jellyfin::Support::toJsonValue(m_primaryImageWidth); - result["CustomPrefs"] = Jellyfin::Support::toJsonValue(m_customPrefs); - result["ScrollDirection"] = Jellyfin::Support::toJsonValue(m_scrollDirection); - result["ShowBackdrop"] = Jellyfin::Support::toJsonValue(m_showBackdrop); - result["RememberSorting"] = Jellyfin::Support::toJsonValue(m_rememberSorting); - result["SortOrder"] = Jellyfin::Support::toJsonValue(m_sortOrder); - result["ShowSidebar"] = Jellyfin::Support::toJsonValue(m_showSidebar); - result["Client"] = Jellyfin::Support::toJsonValue(m_client); - - return result; -} - -QString DisplayPreferencesDto::jellyfinId() const { return m_jellyfinId; } - -void DisplayPreferencesDto::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString DisplayPreferencesDto::viewType() const { return m_viewType; } - -void DisplayPreferencesDto::setViewType(QString newViewType) { - m_viewType = newViewType; -} -QString DisplayPreferencesDto::sortBy() const { return m_sortBy; } - -void DisplayPreferencesDto::setSortBy(QString newSortBy) { - m_sortBy = newSortBy; -} -QString DisplayPreferencesDto::indexBy() const { return m_indexBy; } - -void DisplayPreferencesDto::setIndexBy(QString newIndexBy) { - m_indexBy = newIndexBy; -} -bool DisplayPreferencesDto::rememberIndexing() const { return m_rememberIndexing; } - -void DisplayPreferencesDto::setRememberIndexing(bool newRememberIndexing) { - m_rememberIndexing = newRememberIndexing; -} -qint32 DisplayPreferencesDto::primaryImageHeight() const { return m_primaryImageHeight; } - -void DisplayPreferencesDto::setPrimaryImageHeight(qint32 newPrimaryImageHeight) { - m_primaryImageHeight = newPrimaryImageHeight; -} -qint32 DisplayPreferencesDto::primaryImageWidth() const { return m_primaryImageWidth; } - -void DisplayPreferencesDto::setPrimaryImageWidth(qint32 newPrimaryImageWidth) { - m_primaryImageWidth = newPrimaryImageWidth; -} -QJsonObject DisplayPreferencesDto::customPrefs() const { return m_customPrefs; } - -void DisplayPreferencesDto::setCustomPrefs(QJsonObject newCustomPrefs) { - m_customPrefs = newCustomPrefs; -} -ScrollDirection DisplayPreferencesDto::scrollDirection() const { return m_scrollDirection; } - -void DisplayPreferencesDto::setScrollDirection(ScrollDirection newScrollDirection) { - m_scrollDirection = newScrollDirection; -} -bool DisplayPreferencesDto::showBackdrop() const { return m_showBackdrop; } - -void DisplayPreferencesDto::setShowBackdrop(bool newShowBackdrop) { - m_showBackdrop = newShowBackdrop; -} -bool DisplayPreferencesDto::rememberSorting() const { return m_rememberSorting; } - -void DisplayPreferencesDto::setRememberSorting(bool newRememberSorting) { - m_rememberSorting = newRememberSorting; -} -SortOrder DisplayPreferencesDto::sortOrder() const { return m_sortOrder; } - -void DisplayPreferencesDto::setSortOrder(SortOrder newSortOrder) { - m_sortOrder = newSortOrder; -} -bool DisplayPreferencesDto::showSidebar() const { return m_showSidebar; } - -void DisplayPreferencesDto::setShowSidebar(bool newShowSidebar) { - m_showSidebar = newShowSidebar; -} -QString DisplayPreferencesDto::client() const { return m_client; } - -void DisplayPreferencesDto::setClient(QString newClient) { - m_client = newClient; -} - -} // NS DTO - -namespace Support { - -using DisplayPreferencesDto = Jellyfin::DTO::DisplayPreferencesDto; - -template <> -DisplayPreferencesDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return DisplayPreferencesDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/dlnaprofiletype.cpp b/core/src/DTO/dlnaprofiletype.cpp deleted file mode 100644 index ab20d98..0000000 --- a/core/src/DTO/dlnaprofiletype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DlnaProfileTypeClass::DlnaProfileTypeClass() {} - - -} // NS DTO - -namespace Support { - -using DlnaProfileType = Jellyfin::DTO::DlnaProfileType; - -template <> -DlnaProfileType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return DlnaProfileType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Audio")) { - return DlnaProfileType::Audio; - } - if (str == QStringLiteral("Video")) { - return DlnaProfileType::Video; - } - if (str == QStringLiteral("Photo")) { - return DlnaProfileType::Photo; - } - - return DlnaProfileType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/dynamicdayofweek.cpp b/core/src/DTO/dynamicdayofweek.cpp deleted file mode 100644 index ae9580e..0000000 --- a/core/src/DTO/dynamicdayofweek.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -DynamicDayOfWeekClass::DynamicDayOfWeekClass() {} - - -} // NS DTO - -namespace Support { - -using DynamicDayOfWeek = Jellyfin::DTO::DynamicDayOfWeek; - -template <> -DynamicDayOfWeek fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return DynamicDayOfWeek::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Sunday")) { - return DynamicDayOfWeek::Sunday; - } - if (str == QStringLiteral("Monday")) { - return DynamicDayOfWeek::Monday; - } - if (str == QStringLiteral("Tuesday")) { - return DynamicDayOfWeek::Tuesday; - } - if (str == QStringLiteral("Wednesday")) { - return DynamicDayOfWeek::Wednesday; - } - if (str == QStringLiteral("Thursday")) { - return DynamicDayOfWeek::Thursday; - } - if (str == QStringLiteral("Friday")) { - return DynamicDayOfWeek::Friday; - } - if (str == QStringLiteral("Saturday")) { - return DynamicDayOfWeek::Saturday; - } - if (str == QStringLiteral("Everyday")) { - return DynamicDayOfWeek::Everyday; - } - if (str == QStringLiteral("Weekday")) { - return DynamicDayOfWeek::Weekday; - } - if (str == QStringLiteral("Weekend")) { - return DynamicDayOfWeek::Weekend; - } - - return DynamicDayOfWeek::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/encodingcontext.cpp b/core/src/DTO/encodingcontext.cpp deleted file mode 100644 index fa583af..0000000 --- a/core/src/DTO/encodingcontext.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -EncodingContextClass::EncodingContextClass() {} - - -} // NS DTO - -namespace Support { - -using EncodingContext = Jellyfin::DTO::EncodingContext; - -template <> -EncodingContext fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return EncodingContext::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Streaming")) { - return EncodingContext::Streaming; - } - if (str == QStringLiteral("Static")) { - return EncodingContext::Static; - } - - return EncodingContext::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/endpointinfo.cpp b/core/src/DTO/endpointinfo.cpp deleted file mode 100644 index fc198c4..0000000 --- a/core/src/DTO/endpointinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -EndPointInfo::EndPointInfo() {} -EndPointInfo::EndPointInfo(const EndPointInfo &other) : - m_isLocal(other.m_isLocal), - m_isInNetwork(other.m_isInNetwork){} - -EndPointInfo EndPointInfo::fromJson(QJsonObject source) { - EndPointInfo instance; - instance.setFromJson(source); - return instance; -} - - -void EndPointInfo::setFromJson(QJsonObject source) { - m_isLocal = Jellyfin::Support::fromJsonValue(source["IsLocal"]); - m_isInNetwork = Jellyfin::Support::fromJsonValue(source["IsInNetwork"]); - -} - -QJsonObject EndPointInfo::toJson() { - QJsonObject result; - result["IsLocal"] = Jellyfin::Support::toJsonValue(m_isLocal); - result["IsInNetwork"] = Jellyfin::Support::toJsonValue(m_isInNetwork); - - return result; -} - -bool EndPointInfo::isLocal() const { return m_isLocal; } - -void EndPointInfo::setIsLocal(bool newIsLocal) { - m_isLocal = newIsLocal; -} -bool EndPointInfo::isInNetwork() const { return m_isInNetwork; } - -void EndPointInfo::setIsInNetwork(bool newIsInNetwork) { - m_isInNetwork = newIsInNetwork; -} - -} // NS DTO - -namespace Support { - -using EndPointInfo = Jellyfin::DTO::EndPointInfo; - -template <> -EndPointInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return EndPointInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/externalidinfo.cpp b/core/src/DTO/externalidinfo.cpp deleted file mode 100644 index 5248e33..0000000 --- a/core/src/DTO/externalidinfo.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ExternalIdInfo::ExternalIdInfo() {} -ExternalIdInfo::ExternalIdInfo(const ExternalIdInfo &other) : - m_name(other.m_name), - m_key(other.m_key), - m_type(other.m_type), - m_urlFormatString(other.m_urlFormatString){} - -ExternalIdInfo ExternalIdInfo::fromJson(QJsonObject source) { - ExternalIdInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ExternalIdInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_key = Jellyfin::Support::fromJsonValue(source["Key"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_urlFormatString = Jellyfin::Support::fromJsonValue(source["UrlFormatString"]); - -} - -QJsonObject ExternalIdInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Key"] = Jellyfin::Support::toJsonValue(m_key); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["UrlFormatString"] = Jellyfin::Support::toJsonValue(m_urlFormatString); - - return result; -} - -QString ExternalIdInfo::name() const { return m_name; } - -void ExternalIdInfo::setName(QString newName) { - m_name = newName; -} -QString ExternalIdInfo::key() const { return m_key; } - -void ExternalIdInfo::setKey(QString newKey) { - m_key = newKey; -} -ExternalIdMediaType ExternalIdInfo::type() const { return m_type; } - -void ExternalIdInfo::setType(ExternalIdMediaType newType) { - m_type = newType; -} -QString ExternalIdInfo::urlFormatString() const { return m_urlFormatString; } - -void ExternalIdInfo::setUrlFormatString(QString newUrlFormatString) { - m_urlFormatString = newUrlFormatString; -} - -} // NS DTO - -namespace Support { - -using ExternalIdInfo = Jellyfin::DTO::ExternalIdInfo; - -template <> -ExternalIdInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ExternalIdInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/externalidmediatype.cpp b/core/src/DTO/externalidmediatype.cpp deleted file mode 100644 index 62cb928..0000000 --- a/core/src/DTO/externalidmediatype.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ExternalIdMediaTypeClass::ExternalIdMediaTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ExternalIdMediaType = Jellyfin::DTO::ExternalIdMediaType; - -template <> -ExternalIdMediaType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ExternalIdMediaType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Album")) { - return ExternalIdMediaType::Album; - } - if (str == QStringLiteral("AlbumArtist")) { - return ExternalIdMediaType::AlbumArtist; - } - if (str == QStringLiteral("Artist")) { - return ExternalIdMediaType::Artist; - } - if (str == QStringLiteral("BoxSet")) { - return ExternalIdMediaType::BoxSet; - } - if (str == QStringLiteral("Episode")) { - return ExternalIdMediaType::Episode; - } - if (str == QStringLiteral("Movie")) { - return ExternalIdMediaType::Movie; - } - if (str == QStringLiteral("OtherArtist")) { - return ExternalIdMediaType::OtherArtist; - } - if (str == QStringLiteral("Person")) { - return ExternalIdMediaType::Person; - } - if (str == QStringLiteral("ReleaseGroup")) { - return ExternalIdMediaType::ReleaseGroup; - } - if (str == QStringLiteral("Season")) { - return ExternalIdMediaType::Season; - } - if (str == QStringLiteral("Series")) { - return ExternalIdMediaType::Series; - } - if (str == QStringLiteral("Track")) { - return ExternalIdMediaType::Track; - } - - return ExternalIdMediaType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/externalurl.cpp b/core/src/DTO/externalurl.cpp deleted file mode 100644 index 4d63aef..0000000 --- a/core/src/DTO/externalurl.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ExternalUrl::ExternalUrl() {} -ExternalUrl::ExternalUrl(const ExternalUrl &other) : - m_name(other.m_name), - m_url(other.m_url){} - -ExternalUrl ExternalUrl::fromJson(QJsonObject source) { - ExternalUrl instance; - instance.setFromJson(source); - return instance; -} - - -void ExternalUrl::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - -} - -QJsonObject ExternalUrl::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - - return result; -} - -QString ExternalUrl::name() const { return m_name; } - -void ExternalUrl::setName(QString newName) { - m_name = newName; -} -QString ExternalUrl::url() const { return m_url; } - -void ExternalUrl::setUrl(QString newUrl) { - m_url = newUrl; -} - -} // NS DTO - -namespace Support { - -using ExternalUrl = Jellyfin::DTO::ExternalUrl; - -template <> -ExternalUrl fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ExternalUrl::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/ffmpeglocation.cpp b/core/src/DTO/ffmpeglocation.cpp deleted file mode 100644 index 77f082e..0000000 --- a/core/src/DTO/ffmpeglocation.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -FFmpegLocationClass::FFmpegLocationClass() {} - - -} // NS DTO - -namespace Support { - -using FFmpegLocation = Jellyfin::DTO::FFmpegLocation; - -template <> -FFmpegLocation fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return FFmpegLocation::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("NotFound")) { - return FFmpegLocation::NotFound; - } - if (str == QStringLiteral("SetByArgument")) { - return FFmpegLocation::SetByArgument; - } - if (str == QStringLiteral("Custom")) { - return FFmpegLocation::Custom; - } - if (str == QStringLiteral("System")) { - return FFmpegLocation::System; - } - - return FFmpegLocation::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/filesystementryinfo.cpp b/core/src/DTO/filesystementryinfo.cpp deleted file mode 100644 index ffc1d53..0000000 --- a/core/src/DTO/filesystementryinfo.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -FileSystemEntryInfo::FileSystemEntryInfo() {} -FileSystemEntryInfo::FileSystemEntryInfo(const FileSystemEntryInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_type(other.m_type){} - -FileSystemEntryInfo FileSystemEntryInfo::fromJson(QJsonObject source) { - FileSystemEntryInfo instance; - instance.setFromJson(source); - return instance; -} - - -void FileSystemEntryInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - -} - -QJsonObject FileSystemEntryInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - - return result; -} - -QString FileSystemEntryInfo::name() const { return m_name; } - -void FileSystemEntryInfo::setName(QString newName) { - m_name = newName; -} -QString FileSystemEntryInfo::path() const { return m_path; } - -void FileSystemEntryInfo::setPath(QString newPath) { - m_path = newPath; -} -FileSystemEntryType FileSystemEntryInfo::type() const { return m_type; } - -void FileSystemEntryInfo::setType(FileSystemEntryType newType) { - m_type = newType; -} - -} // NS DTO - -namespace Support { - -using FileSystemEntryInfo = Jellyfin::DTO::FileSystemEntryInfo; - -template <> -FileSystemEntryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return FileSystemEntryInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/filesystementrytype.cpp b/core/src/DTO/filesystementrytype.cpp deleted file mode 100644 index 28f44cc..0000000 --- a/core/src/DTO/filesystementrytype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -FileSystemEntryTypeClass::FileSystemEntryTypeClass() {} - - -} // NS DTO - -namespace Support { - -using FileSystemEntryType = Jellyfin::DTO::FileSystemEntryType; - -template <> -FileSystemEntryType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return FileSystemEntryType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("File")) { - return FileSystemEntryType::File; - } - if (str == QStringLiteral("Directory")) { - return FileSystemEntryType::Directory; - } - if (str == QStringLiteral("NetworkComputer")) { - return FileSystemEntryType::NetworkComputer; - } - if (str == QStringLiteral("NetworkShare")) { - return FileSystemEntryType::NetworkShare; - } - - return FileSystemEntryType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/fontfile.cpp b/core/src/DTO/fontfile.cpp deleted file mode 100644 index 864b2fd..0000000 --- a/core/src/DTO/fontfile.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -FontFile::FontFile() {} -FontFile::FontFile(const FontFile &other) : - m_name(other.m_name), - m_size(other.m_size), - m_dateCreated(other.m_dateCreated), - m_dateModified(other.m_dateModified){} - -FontFile FontFile::fromJson(QJsonObject source) { - FontFile instance; - instance.setFromJson(source); - return instance; -} - - -void FontFile::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_size = Jellyfin::Support::fromJsonValue(source["Size"]); - m_dateCreated = Jellyfin::Support::fromJsonValue(source["DateCreated"]); - m_dateModified = Jellyfin::Support::fromJsonValue(source["DateModified"]); - -} - -QJsonObject FontFile::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Size"] = Jellyfin::Support::toJsonValue(m_size); - result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); - result["DateModified"] = Jellyfin::Support::toJsonValue(m_dateModified); - - return result; -} - -QString FontFile::name() const { return m_name; } - -void FontFile::setName(QString newName) { - m_name = newName; -} -qint64 FontFile::size() const { return m_size; } - -void FontFile::setSize(qint64 newSize) { - m_size = newSize; -} -QDateTime FontFile::dateCreated() const { return m_dateCreated; } - -void FontFile::setDateCreated(QDateTime newDateCreated) { - m_dateCreated = newDateCreated; -} -QDateTime FontFile::dateModified() const { return m_dateModified; } - -void FontFile::setDateModified(QDateTime newDateModified) { - m_dateModified = newDateModified; -} - -} // NS DTO - -namespace Support { - -using FontFile = Jellyfin::DTO::FontFile; - -template <> -FontFile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return FontFile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/forgotpasswordaction.cpp b/core/src/DTO/forgotpasswordaction.cpp deleted file mode 100644 index 052c614..0000000 --- a/core/src/DTO/forgotpasswordaction.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ForgotPasswordActionClass::ForgotPasswordActionClass() {} - - -} // NS DTO - -namespace Support { - -using ForgotPasswordAction = Jellyfin::DTO::ForgotPasswordAction; - -template <> -ForgotPasswordAction fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ForgotPasswordAction::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("ContactAdmin")) { - return ForgotPasswordAction::ContactAdmin; - } - if (str == QStringLiteral("PinCode")) { - return ForgotPasswordAction::PinCode; - } - if (str == QStringLiteral("InNetworkRequired")) { - return ForgotPasswordAction::InNetworkRequired; - } - - return ForgotPasswordAction::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/forgotpassworddto.cpp b/core/src/DTO/forgotpassworddto.cpp deleted file mode 100644 index f105aa4..0000000 --- a/core/src/DTO/forgotpassworddto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ForgotPasswordDto::ForgotPasswordDto() {} -ForgotPasswordDto::ForgotPasswordDto(const ForgotPasswordDto &other) : - m_enteredUsername(other.m_enteredUsername){} - -ForgotPasswordDto ForgotPasswordDto::fromJson(QJsonObject source) { - ForgotPasswordDto instance; - instance.setFromJson(source); - return instance; -} - - -void ForgotPasswordDto::setFromJson(QJsonObject source) { - m_enteredUsername = Jellyfin::Support::fromJsonValue(source["EnteredUsername"]); - -} - -QJsonObject ForgotPasswordDto::toJson() { - QJsonObject result; - result["EnteredUsername"] = Jellyfin::Support::toJsonValue(m_enteredUsername); - - return result; -} - -QString ForgotPasswordDto::enteredUsername() const { return m_enteredUsername; } - -void ForgotPasswordDto::setEnteredUsername(QString newEnteredUsername) { - m_enteredUsername = newEnteredUsername; -} - -} // NS DTO - -namespace Support { - -using ForgotPasswordDto = Jellyfin::DTO::ForgotPasswordDto; - -template <> -ForgotPasswordDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ForgotPasswordDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/forgotpasswordresult.cpp b/core/src/DTO/forgotpasswordresult.cpp deleted file mode 100644 index 51ef9ea..0000000 --- a/core/src/DTO/forgotpasswordresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ForgotPasswordResult::ForgotPasswordResult() {} -ForgotPasswordResult::ForgotPasswordResult(const ForgotPasswordResult &other) : - m_action(other.m_action), - m_pinFile(other.m_pinFile), - m_pinExpirationDate(other.m_pinExpirationDate){} - -ForgotPasswordResult ForgotPasswordResult::fromJson(QJsonObject source) { - ForgotPasswordResult instance; - instance.setFromJson(source); - return instance; -} - - -void ForgotPasswordResult::setFromJson(QJsonObject source) { - m_action = Jellyfin::Support::fromJsonValue(source["Action"]); - m_pinFile = Jellyfin::Support::fromJsonValue(source["PinFile"]); - m_pinExpirationDate = Jellyfin::Support::fromJsonValue(source["PinExpirationDate"]); - -} - -QJsonObject ForgotPasswordResult::toJson() { - QJsonObject result; - result["Action"] = Jellyfin::Support::toJsonValue(m_action); - result["PinFile"] = Jellyfin::Support::toJsonValue(m_pinFile); - result["PinExpirationDate"] = Jellyfin::Support::toJsonValue(m_pinExpirationDate); - - return result; -} - -ForgotPasswordAction ForgotPasswordResult::action() const { return m_action; } - -void ForgotPasswordResult::setAction(ForgotPasswordAction newAction) { - m_action = newAction; -} -QString ForgotPasswordResult::pinFile() const { return m_pinFile; } - -void ForgotPasswordResult::setPinFile(QString newPinFile) { - m_pinFile = newPinFile; -} -QDateTime ForgotPasswordResult::pinExpirationDate() const { return m_pinExpirationDate; } - -void ForgotPasswordResult::setPinExpirationDate(QDateTime newPinExpirationDate) { - m_pinExpirationDate = newPinExpirationDate; -} - -} // NS DTO - -namespace Support { - -using ForgotPasswordResult = Jellyfin::DTO::ForgotPasswordResult; - -template <> -ForgotPasswordResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ForgotPasswordResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/generalcommand.cpp b/core/src/DTO/generalcommand.cpp deleted file mode 100644 index 6fc9a58..0000000 --- a/core/src/DTO/generalcommand.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GeneralCommand::GeneralCommand() {} -GeneralCommand::GeneralCommand(const GeneralCommand &other) : - m_name(other.m_name), - m_controllingUserId(other.m_controllingUserId), - m_arguments(other.m_arguments){} - -GeneralCommand GeneralCommand::fromJson(QJsonObject source) { - GeneralCommand instance; - instance.setFromJson(source); - return instance; -} - - -void GeneralCommand::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_controllingUserId = Jellyfin::Support::fromJsonValue(source["ControllingUserId"]); - m_arguments = Jellyfin::Support::fromJsonValue(source["Arguments"]); - -} - -QJsonObject GeneralCommand::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ControllingUserId"] = Jellyfin::Support::toJsonValue(m_controllingUserId); - result["Arguments"] = Jellyfin::Support::toJsonValue(m_arguments); - - return result; -} - -GeneralCommandType GeneralCommand::name() const { return m_name; } - -void GeneralCommand::setName(GeneralCommandType newName) { - m_name = newName; -} -QUuid GeneralCommand::controllingUserId() const { return m_controllingUserId; } - -void GeneralCommand::setControllingUserId(QUuid newControllingUserId) { - m_controllingUserId = newControllingUserId; -} -QJsonObject GeneralCommand::arguments() const { return m_arguments; } - -void GeneralCommand::setArguments(QJsonObject newArguments) { - m_arguments = newArguments; -} - -} // NS DTO - -namespace Support { - -using GeneralCommand = Jellyfin::DTO::GeneralCommand; - -template <> -GeneralCommand fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return GeneralCommand::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/generalcommandtype.cpp b/core/src/DTO/generalcommandtype.cpp deleted file mode 100644 index 6044b97..0000000 --- a/core/src/DTO/generalcommandtype.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GeneralCommandTypeClass::GeneralCommandTypeClass() {} - - -} // NS DTO - -namespace Support { - -using GeneralCommandType = Jellyfin::DTO::GeneralCommandType; - -template <> -GeneralCommandType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GeneralCommandType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("MoveUp")) { - return GeneralCommandType::MoveUp; - } - if (str == QStringLiteral("MoveDown")) { - return GeneralCommandType::MoveDown; - } - if (str == QStringLiteral("MoveLeft")) { - return GeneralCommandType::MoveLeft; - } - if (str == QStringLiteral("MoveRight")) { - return GeneralCommandType::MoveRight; - } - if (str == QStringLiteral("PageUp")) { - return GeneralCommandType::PageUp; - } - if (str == QStringLiteral("PageDown")) { - return GeneralCommandType::PageDown; - } - if (str == QStringLiteral("PreviousLetter")) { - return GeneralCommandType::PreviousLetter; - } - if (str == QStringLiteral("NextLetter")) { - return GeneralCommandType::NextLetter; - } - if (str == QStringLiteral("ToggleOsd")) { - return GeneralCommandType::ToggleOsd; - } - if (str == QStringLiteral("ToggleContextMenu")) { - return GeneralCommandType::ToggleContextMenu; - } - if (str == QStringLiteral("Select")) { - return GeneralCommandType::Select; - } - if (str == QStringLiteral("Back")) { - return GeneralCommandType::Back; - } - if (str == QStringLiteral("TakeScreenshot")) { - return GeneralCommandType::TakeScreenshot; - } - if (str == QStringLiteral("SendKey")) { - return GeneralCommandType::SendKey; - } - if (str == QStringLiteral("SendString")) { - return GeneralCommandType::SendString; - } - if (str == QStringLiteral("GoHome")) { - return GeneralCommandType::GoHome; - } - if (str == QStringLiteral("GoToSettings")) { - return GeneralCommandType::GoToSettings; - } - if (str == QStringLiteral("VolumeUp")) { - return GeneralCommandType::VolumeUp; - } - if (str == QStringLiteral("VolumeDown")) { - return GeneralCommandType::VolumeDown; - } - if (str == QStringLiteral("Mute")) { - return GeneralCommandType::Mute; - } - if (str == QStringLiteral("Unmute")) { - return GeneralCommandType::Unmute; - } - if (str == QStringLiteral("ToggleMute")) { - return GeneralCommandType::ToggleMute; - } - if (str == QStringLiteral("SetVolume")) { - return GeneralCommandType::SetVolume; - } - if (str == QStringLiteral("SetAudioStreamIndex")) { - return GeneralCommandType::SetAudioStreamIndex; - } - if (str == QStringLiteral("SetSubtitleStreamIndex")) { - return GeneralCommandType::SetSubtitleStreamIndex; - } - if (str == QStringLiteral("ToggleFullscreen")) { - return GeneralCommandType::ToggleFullscreen; - } - if (str == QStringLiteral("DisplayContent")) { - return GeneralCommandType::DisplayContent; - } - if (str == QStringLiteral("GoToSearch")) { - return GeneralCommandType::GoToSearch; - } - if (str == QStringLiteral("DisplayMessage")) { - return GeneralCommandType::DisplayMessage; - } - if (str == QStringLiteral("SetRepeatMode")) { - return GeneralCommandType::SetRepeatMode; - } - if (str == QStringLiteral("ChannelUp")) { - return GeneralCommandType::ChannelUp; - } - if (str == QStringLiteral("ChannelDown")) { - return GeneralCommandType::ChannelDown; - } - if (str == QStringLiteral("Guide")) { - return GeneralCommandType::Guide; - } - if (str == QStringLiteral("ToggleStats")) { - return GeneralCommandType::ToggleStats; - } - if (str == QStringLiteral("PlayMediaSource")) { - return GeneralCommandType::PlayMediaSource; - } - if (str == QStringLiteral("PlayTrailers")) { - return GeneralCommandType::PlayTrailers; - } - if (str == QStringLiteral("SetShuffleQueue")) { - return GeneralCommandType::SetShuffleQueue; - } - if (str == QStringLiteral("PlayState")) { - return GeneralCommandType::PlayState; - } - if (str == QStringLiteral("PlayNext")) { - return GeneralCommandType::PlayNext; - } - if (str == QStringLiteral("ToggleOsdMenu")) { - return GeneralCommandType::ToggleOsdMenu; - } - if (str == QStringLiteral("Play")) { - return GeneralCommandType::Play; - } - - return GeneralCommandType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/getprogramsdto.cpp b/core/src/DTO/getprogramsdto.cpp deleted file mode 100644 index 5d79bfc..0000000 --- a/core/src/DTO/getprogramsdto.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GetProgramsDto::GetProgramsDto() {} -GetProgramsDto::GetProgramsDto(const GetProgramsDto &other) : - m_channelIds(other.m_channelIds), - m_userId(other.m_userId), - m_minStartDate(other.m_minStartDate), - m_hasAired(other.m_hasAired), - m_isAiring(other.m_isAiring), - m_maxStartDate(other.m_maxStartDate), - m_minEndDate(other.m_minEndDate), - m_maxEndDate(other.m_maxEndDate), - m_isMovie(other.m_isMovie), - m_isSeries(other.m_isSeries), - m_isNews(other.m_isNews), - m_isKids(other.m_isKids), - m_isSports(other.m_isSports), - m_startIndex(other.m_startIndex), - m_limit(other.m_limit), - m_sortBy(other.m_sortBy), - m_sortOrder(other.m_sortOrder), - m_genres(other.m_genres), - m_genreIds(other.m_genreIds), - m_enableImages(other.m_enableImages), - m_enableTotalRecordCount(other.m_enableTotalRecordCount), - m_imageTypeLimit(other.m_imageTypeLimit), - m_enableImageTypes(other.m_enableImageTypes), - m_enableUserData(other.m_enableUserData), - m_seriesTimerId(other.m_seriesTimerId), - m_librarySeriesId(other.m_librarySeriesId), - m_fields(other.m_fields){} - -GetProgramsDto GetProgramsDto::fromJson(QJsonObject source) { - GetProgramsDto instance; - instance.setFromJson(source); - return instance; -} - - -void GetProgramsDto::setFromJson(QJsonObject source) { - m_channelIds = Jellyfin::Support::fromJsonValue>(source["ChannelIds"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_minStartDate = Jellyfin::Support::fromJsonValue(source["MinStartDate"]); - m_hasAired = Jellyfin::Support::fromJsonValue(source["HasAired"]); - m_isAiring = Jellyfin::Support::fromJsonValue(source["IsAiring"]); - m_maxStartDate = Jellyfin::Support::fromJsonValue(source["MaxStartDate"]); - m_minEndDate = Jellyfin::Support::fromJsonValue(source["MinEndDate"]); - m_maxEndDate = Jellyfin::Support::fromJsonValue(source["MaxEndDate"]); - m_isMovie = Jellyfin::Support::fromJsonValue(source["IsMovie"]); - m_isSeries = Jellyfin::Support::fromJsonValue(source["IsSeries"]); - m_isNews = Jellyfin::Support::fromJsonValue(source["IsNews"]); - m_isKids = Jellyfin::Support::fromJsonValue(source["IsKids"]); - m_isSports = Jellyfin::Support::fromJsonValue(source["IsSports"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - m_limit = Jellyfin::Support::fromJsonValue(source["Limit"]); - m_sortBy = Jellyfin::Support::fromJsonValue(source["SortBy"]); - m_sortOrder = Jellyfin::Support::fromJsonValue(source["SortOrder"]); - m_genres = Jellyfin::Support::fromJsonValue(source["Genres"]); - m_genreIds = Jellyfin::Support::fromJsonValue>(source["GenreIds"]); - m_enableImages = Jellyfin::Support::fromJsonValue(source["EnableImages"]); - m_enableTotalRecordCount = Jellyfin::Support::fromJsonValue(source["EnableTotalRecordCount"]); - m_imageTypeLimit = Jellyfin::Support::fromJsonValue(source["ImageTypeLimit"]); - m_enableImageTypes = Jellyfin::Support::fromJsonValue>(source["EnableImageTypes"]); - m_enableUserData = Jellyfin::Support::fromJsonValue(source["EnableUserData"]); - m_seriesTimerId = Jellyfin::Support::fromJsonValue(source["SeriesTimerId"]); - m_librarySeriesId = Jellyfin::Support::fromJsonValue(source["LibrarySeriesId"]); - m_fields = Jellyfin::Support::fromJsonValue>(source["Fields"]); - -} - -QJsonObject GetProgramsDto::toJson() { - QJsonObject result; - result["ChannelIds"] = Jellyfin::Support::toJsonValue>(m_channelIds); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["MinStartDate"] = Jellyfin::Support::toJsonValue(m_minStartDate); - result["HasAired"] = Jellyfin::Support::toJsonValue(m_hasAired); - result["IsAiring"] = Jellyfin::Support::toJsonValue(m_isAiring); - result["MaxStartDate"] = Jellyfin::Support::toJsonValue(m_maxStartDate); - result["MinEndDate"] = Jellyfin::Support::toJsonValue(m_minEndDate); - result["MaxEndDate"] = Jellyfin::Support::toJsonValue(m_maxEndDate); - result["IsMovie"] = Jellyfin::Support::toJsonValue(m_isMovie); - result["IsSeries"] = Jellyfin::Support::toJsonValue(m_isSeries); - result["IsNews"] = Jellyfin::Support::toJsonValue(m_isNews); - result["IsKids"] = Jellyfin::Support::toJsonValue(m_isKids); - result["IsSports"] = Jellyfin::Support::toJsonValue(m_isSports); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - result["Limit"] = Jellyfin::Support::toJsonValue(m_limit); - result["SortBy"] = Jellyfin::Support::toJsonValue(m_sortBy); - result["SortOrder"] = Jellyfin::Support::toJsonValue(m_sortOrder); - result["Genres"] = Jellyfin::Support::toJsonValue(m_genres); - result["GenreIds"] = Jellyfin::Support::toJsonValue>(m_genreIds); - result["EnableImages"] = Jellyfin::Support::toJsonValue(m_enableImages); - result["EnableTotalRecordCount"] = Jellyfin::Support::toJsonValue(m_enableTotalRecordCount); - result["ImageTypeLimit"] = Jellyfin::Support::toJsonValue(m_imageTypeLimit); - result["EnableImageTypes"] = Jellyfin::Support::toJsonValue>(m_enableImageTypes); - result["EnableUserData"] = Jellyfin::Support::toJsonValue(m_enableUserData); - result["SeriesTimerId"] = Jellyfin::Support::toJsonValue(m_seriesTimerId); - result["LibrarySeriesId"] = Jellyfin::Support::toJsonValue(m_librarySeriesId); - result["Fields"] = Jellyfin::Support::toJsonValue>(m_fields); - - return result; -} - -QList GetProgramsDto::channelIds() const { return m_channelIds; } - -void GetProgramsDto::setChannelIds(QList newChannelIds) { - m_channelIds = newChannelIds; -} -QUuid GetProgramsDto::userId() const { return m_userId; } - -void GetProgramsDto::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QDateTime GetProgramsDto::minStartDate() const { return m_minStartDate; } - -void GetProgramsDto::setMinStartDate(QDateTime newMinStartDate) { - m_minStartDate = newMinStartDate; -} -bool GetProgramsDto::hasAired() const { return m_hasAired; } - -void GetProgramsDto::setHasAired(bool newHasAired) { - m_hasAired = newHasAired; -} -bool GetProgramsDto::isAiring() const { return m_isAiring; } - -void GetProgramsDto::setIsAiring(bool newIsAiring) { - m_isAiring = newIsAiring; -} -QDateTime GetProgramsDto::maxStartDate() const { return m_maxStartDate; } - -void GetProgramsDto::setMaxStartDate(QDateTime newMaxStartDate) { - m_maxStartDate = newMaxStartDate; -} -QDateTime GetProgramsDto::minEndDate() const { return m_minEndDate; } - -void GetProgramsDto::setMinEndDate(QDateTime newMinEndDate) { - m_minEndDate = newMinEndDate; -} -QDateTime GetProgramsDto::maxEndDate() const { return m_maxEndDate; } - -void GetProgramsDto::setMaxEndDate(QDateTime newMaxEndDate) { - m_maxEndDate = newMaxEndDate; -} -bool GetProgramsDto::isMovie() const { return m_isMovie; } - -void GetProgramsDto::setIsMovie(bool newIsMovie) { - m_isMovie = newIsMovie; -} -bool GetProgramsDto::isSeries() const { return m_isSeries; } - -void GetProgramsDto::setIsSeries(bool newIsSeries) { - m_isSeries = newIsSeries; -} -bool GetProgramsDto::isNews() const { return m_isNews; } - -void GetProgramsDto::setIsNews(bool newIsNews) { - m_isNews = newIsNews; -} -bool GetProgramsDto::isKids() const { return m_isKids; } - -void GetProgramsDto::setIsKids(bool newIsKids) { - m_isKids = newIsKids; -} -bool GetProgramsDto::isSports() const { return m_isSports; } - -void GetProgramsDto::setIsSports(bool newIsSports) { - m_isSports = newIsSports; -} -qint32 GetProgramsDto::startIndex() const { return m_startIndex; } - -void GetProgramsDto::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} -qint32 GetProgramsDto::limit() const { return m_limit; } - -void GetProgramsDto::setLimit(qint32 newLimit) { - m_limit = newLimit; -} -QString GetProgramsDto::sortBy() const { return m_sortBy; } - -void GetProgramsDto::setSortBy(QString newSortBy) { - m_sortBy = newSortBy; -} -QString GetProgramsDto::sortOrder() const { return m_sortOrder; } - -void GetProgramsDto::setSortOrder(QString newSortOrder) { - m_sortOrder = newSortOrder; -} -QStringList GetProgramsDto::genres() const { return m_genres; } - -void GetProgramsDto::setGenres(QStringList newGenres) { - m_genres = newGenres; -} -QList GetProgramsDto::genreIds() const { return m_genreIds; } - -void GetProgramsDto::setGenreIds(QList newGenreIds) { - m_genreIds = newGenreIds; -} -bool GetProgramsDto::enableImages() const { return m_enableImages; } - -void GetProgramsDto::setEnableImages(bool newEnableImages) { - m_enableImages = newEnableImages; -} -bool GetProgramsDto::enableTotalRecordCount() const { return m_enableTotalRecordCount; } - -void GetProgramsDto::setEnableTotalRecordCount(bool newEnableTotalRecordCount) { - m_enableTotalRecordCount = newEnableTotalRecordCount; -} -qint32 GetProgramsDto::imageTypeLimit() const { return m_imageTypeLimit; } - -void GetProgramsDto::setImageTypeLimit(qint32 newImageTypeLimit) { - m_imageTypeLimit = newImageTypeLimit; -} -QList GetProgramsDto::enableImageTypes() const { return m_enableImageTypes; } - -void GetProgramsDto::setEnableImageTypes(QList newEnableImageTypes) { - m_enableImageTypes = newEnableImageTypes; -} -bool GetProgramsDto::enableUserData() const { return m_enableUserData; } - -void GetProgramsDto::setEnableUserData(bool newEnableUserData) { - m_enableUserData = newEnableUserData; -} -QString GetProgramsDto::seriesTimerId() const { return m_seriesTimerId; } - -void GetProgramsDto::setSeriesTimerId(QString newSeriesTimerId) { - m_seriesTimerId = newSeriesTimerId; -} -QUuid GetProgramsDto::librarySeriesId() const { return m_librarySeriesId; } - -void GetProgramsDto::setLibrarySeriesId(QUuid newLibrarySeriesId) { - m_librarySeriesId = newLibrarySeriesId; -} -QList GetProgramsDto::fields() const { return m_fields; } - -void GetProgramsDto::setFields(QList newFields) { - m_fields = newFields; -} - -} // NS DTO - -namespace Support { - -using GetProgramsDto = Jellyfin::DTO::GetProgramsDto; - -template <> -GetProgramsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return GetProgramsDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/groupinfodto.cpp b/core/src/DTO/groupinfodto.cpp deleted file mode 100644 index adf7d72..0000000 --- a/core/src/DTO/groupinfodto.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupInfoDto::GroupInfoDto() {} -GroupInfoDto::GroupInfoDto(const GroupInfoDto &other) : - m_groupId(other.m_groupId), - m_groupName(other.m_groupName), - m_state(other.m_state), - m_participants(other.m_participants), - m_lastUpdatedAt(other.m_lastUpdatedAt){} - -GroupInfoDto GroupInfoDto::fromJson(QJsonObject source) { - GroupInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void GroupInfoDto::setFromJson(QJsonObject source) { - m_groupId = Jellyfin::Support::fromJsonValue(source["GroupId"]); - m_groupName = Jellyfin::Support::fromJsonValue(source["GroupName"]); - m_state = Jellyfin::Support::fromJsonValue(source["State"]); - m_participants = Jellyfin::Support::fromJsonValue(source["Participants"]); - m_lastUpdatedAt = Jellyfin::Support::fromJsonValue(source["LastUpdatedAt"]); - -} - -QJsonObject GroupInfoDto::toJson() { - QJsonObject result; - result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); - result["GroupName"] = Jellyfin::Support::toJsonValue(m_groupName); - result["State"] = Jellyfin::Support::toJsonValue(m_state); - result["Participants"] = Jellyfin::Support::toJsonValue(m_participants); - result["LastUpdatedAt"] = Jellyfin::Support::toJsonValue(m_lastUpdatedAt); - - return result; -} - -QUuid GroupInfoDto::groupId() const { return m_groupId; } - -void GroupInfoDto::setGroupId(QUuid newGroupId) { - m_groupId = newGroupId; -} -QString GroupInfoDto::groupName() const { return m_groupName; } - -void GroupInfoDto::setGroupName(QString newGroupName) { - m_groupName = newGroupName; -} -GroupStateType GroupInfoDto::state() const { return m_state; } - -void GroupInfoDto::setState(GroupStateType newState) { - m_state = newState; -} -QStringList GroupInfoDto::participants() const { return m_participants; } - -void GroupInfoDto::setParticipants(QStringList newParticipants) { - m_participants = newParticipants; -} -QDateTime GroupInfoDto::lastUpdatedAt() const { return m_lastUpdatedAt; } - -void GroupInfoDto::setLastUpdatedAt(QDateTime newLastUpdatedAt) { - m_lastUpdatedAt = newLastUpdatedAt; -} - -} // NS DTO - -namespace Support { - -using GroupInfoDto = Jellyfin::DTO::GroupInfoDto; - -template <> -GroupInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return GroupInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/groupqueuemode.cpp b/core/src/DTO/groupqueuemode.cpp deleted file mode 100644 index fd1b9b6..0000000 --- a/core/src/DTO/groupqueuemode.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupQueueModeClass::GroupQueueModeClass() {} - - -} // NS DTO - -namespace Support { - -using GroupQueueMode = Jellyfin::DTO::GroupQueueMode; - -template <> -GroupQueueMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GroupQueueMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Queue")) { - return GroupQueueMode::Queue; - } - if (str == QStringLiteral("QueueNext")) { - return GroupQueueMode::QueueNext; - } - - return GroupQueueMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/grouprepeatmode.cpp b/core/src/DTO/grouprepeatmode.cpp deleted file mode 100644 index 3e6a2c5..0000000 --- a/core/src/DTO/grouprepeatmode.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupRepeatModeClass::GroupRepeatModeClass() {} - - -} // NS DTO - -namespace Support { - -using GroupRepeatMode = Jellyfin::DTO::GroupRepeatMode; - -template <> -GroupRepeatMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GroupRepeatMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("RepeatOne")) { - return GroupRepeatMode::RepeatOne; - } - if (str == QStringLiteral("RepeatAll")) { - return GroupRepeatMode::RepeatAll; - } - if (str == QStringLiteral("RepeatNone")) { - return GroupRepeatMode::RepeatNone; - } - - return GroupRepeatMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/groupshufflemode.cpp b/core/src/DTO/groupshufflemode.cpp deleted file mode 100644 index afa8593..0000000 --- a/core/src/DTO/groupshufflemode.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupShuffleModeClass::GroupShuffleModeClass() {} - - -} // NS DTO - -namespace Support { - -using GroupShuffleMode = Jellyfin::DTO::GroupShuffleMode; - -template <> -GroupShuffleMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GroupShuffleMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Sorted")) { - return GroupShuffleMode::Sorted; - } - if (str == QStringLiteral("Shuffle")) { - return GroupShuffleMode::Shuffle; - } - - return GroupShuffleMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/groupstatetype.cpp b/core/src/DTO/groupstatetype.cpp deleted file mode 100644 index b476740..0000000 --- a/core/src/DTO/groupstatetype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupStateTypeClass::GroupStateTypeClass() {} - - -} // NS DTO - -namespace Support { - -using GroupStateType = Jellyfin::DTO::GroupStateType; - -template <> -GroupStateType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GroupStateType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Idle")) { - return GroupStateType::Idle; - } - if (str == QStringLiteral("Waiting")) { - return GroupStateType::Waiting; - } - if (str == QStringLiteral("Paused")) { - return GroupStateType::Paused; - } - if (str == QStringLiteral("Playing")) { - return GroupStateType::Playing; - } - - return GroupStateType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/groupupdatetype.cpp b/core/src/DTO/groupupdatetype.cpp deleted file mode 100644 index a7b56de..0000000 --- a/core/src/DTO/groupupdatetype.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GroupUpdateTypeClass::GroupUpdateTypeClass() {} - - -} // NS DTO - -namespace Support { - -using GroupUpdateType = Jellyfin::DTO::GroupUpdateType; - -template <> -GroupUpdateType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return GroupUpdateType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("UserJoined")) { - return GroupUpdateType::UserJoined; - } - if (str == QStringLiteral("UserLeft")) { - return GroupUpdateType::UserLeft; - } - if (str == QStringLiteral("GroupJoined")) { - return GroupUpdateType::GroupJoined; - } - if (str == QStringLiteral("GroupLeft")) { - return GroupUpdateType::GroupLeft; - } - if (str == QStringLiteral("StateUpdate")) { - return GroupUpdateType::StateUpdate; - } - if (str == QStringLiteral("PlayQueue")) { - return GroupUpdateType::PlayQueue; - } - if (str == QStringLiteral("NotInGroup")) { - return GroupUpdateType::NotInGroup; - } - if (str == QStringLiteral("GroupDoesNotExist")) { - return GroupUpdateType::GroupDoesNotExist; - } - if (str == QStringLiteral("CreateGroupDenied")) { - return GroupUpdateType::CreateGroupDenied; - } - if (str == QStringLiteral("JoinGroupDenied")) { - return GroupUpdateType::JoinGroupDenied; - } - if (str == QStringLiteral("LibraryAccessDenied")) { - return GroupUpdateType::LibraryAccessDenied; - } - - return GroupUpdateType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/guideinfo.cpp b/core/src/DTO/guideinfo.cpp deleted file mode 100644 index 3b91240..0000000 --- a/core/src/DTO/guideinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -GuideInfo::GuideInfo() {} -GuideInfo::GuideInfo(const GuideInfo &other) : - m_startDate(other.m_startDate), - m_endDate(other.m_endDate){} - -GuideInfo GuideInfo::fromJson(QJsonObject source) { - GuideInfo instance; - instance.setFromJson(source); - return instance; -} - - -void GuideInfo::setFromJson(QJsonObject source) { - m_startDate = Jellyfin::Support::fromJsonValue(source["StartDate"]); - m_endDate = Jellyfin::Support::fromJsonValue(source["EndDate"]); - -} - -QJsonObject GuideInfo::toJson() { - QJsonObject result; - result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); - result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); - - return result; -} - -QDateTime GuideInfo::startDate() const { return m_startDate; } - -void GuideInfo::setStartDate(QDateTime newStartDate) { - m_startDate = newStartDate; -} -QDateTime GuideInfo::endDate() const { return m_endDate; } - -void GuideInfo::setEndDate(QDateTime newEndDate) { - m_endDate = newEndDate; -} - -} // NS DTO - -namespace Support { - -using GuideInfo = Jellyfin::DTO::GuideInfo; - -template <> -GuideInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return GuideInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/headermatchtype.cpp b/core/src/DTO/headermatchtype.cpp deleted file mode 100644 index 03e8c02..0000000 --- a/core/src/DTO/headermatchtype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -HeaderMatchTypeClass::HeaderMatchTypeClass() {} - - -} // NS DTO - -namespace Support { - -using HeaderMatchType = Jellyfin::DTO::HeaderMatchType; - -template <> -HeaderMatchType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return HeaderMatchType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Equals")) { - return HeaderMatchType::Equals; - } - if (str == QStringLiteral("Regex")) { - return HeaderMatchType::Regex; - } - if (str == QStringLiteral("Substring")) { - return HeaderMatchType::Substring; - } - - return HeaderMatchType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/httpheaderinfo.cpp b/core/src/DTO/httpheaderinfo.cpp deleted file mode 100644 index a33f12c..0000000 --- a/core/src/DTO/httpheaderinfo.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -HttpHeaderInfo::HttpHeaderInfo() {} -HttpHeaderInfo::HttpHeaderInfo(const HttpHeaderInfo &other) : - m_name(other.m_name), - m_value(other.m_value), - m_match(other.m_match){} - -HttpHeaderInfo HttpHeaderInfo::fromJson(QJsonObject source) { - HttpHeaderInfo instance; - instance.setFromJson(source); - return instance; -} - - -void HttpHeaderInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - m_match = Jellyfin::Support::fromJsonValue(source["Match"]); - -} - -QJsonObject HttpHeaderInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - result["Match"] = Jellyfin::Support::toJsonValue(m_match); - - return result; -} - -QString HttpHeaderInfo::name() const { return m_name; } - -void HttpHeaderInfo::setName(QString newName) { - m_name = newName; -} -QString HttpHeaderInfo::value() const { return m_value; } - -void HttpHeaderInfo::setValue(QString newValue) { - m_value = newValue; -} -HeaderMatchType HttpHeaderInfo::match() const { return m_match; } - -void HttpHeaderInfo::setMatch(HeaderMatchType newMatch) { - m_match = newMatch; -} - -} // NS DTO - -namespace Support { - -using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo; - -template <> -HttpHeaderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return HttpHeaderInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/ignorewaitrequestdto.cpp b/core/src/DTO/ignorewaitrequestdto.cpp deleted file mode 100644 index 784a2cd..0000000 --- a/core/src/DTO/ignorewaitrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -IgnoreWaitRequestDto::IgnoreWaitRequestDto() {} -IgnoreWaitRequestDto::IgnoreWaitRequestDto(const IgnoreWaitRequestDto &other) : - m_ignoreWait(other.m_ignoreWait){} - -IgnoreWaitRequestDto IgnoreWaitRequestDto::fromJson(QJsonObject source) { - IgnoreWaitRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void IgnoreWaitRequestDto::setFromJson(QJsonObject source) { - m_ignoreWait = Jellyfin::Support::fromJsonValue(source["IgnoreWait"]); - -} - -QJsonObject IgnoreWaitRequestDto::toJson() { - QJsonObject result; - result["IgnoreWait"] = Jellyfin::Support::toJsonValue(m_ignoreWait); - - return result; -} - -bool IgnoreWaitRequestDto::ignoreWait() const { return m_ignoreWait; } - -void IgnoreWaitRequestDto::setIgnoreWait(bool newIgnoreWait) { - m_ignoreWait = newIgnoreWait; -} - -} // NS DTO - -namespace Support { - -using IgnoreWaitRequestDto = Jellyfin::DTO::IgnoreWaitRequestDto; - -template <> -IgnoreWaitRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return IgnoreWaitRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imagebynameinfo.cpp b/core/src/DTO/imagebynameinfo.cpp deleted file mode 100644 index a7f33bf..0000000 --- a/core/src/DTO/imagebynameinfo.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageByNameInfo::ImageByNameInfo() {} -ImageByNameInfo::ImageByNameInfo(const ImageByNameInfo &other) : - m_name(other.m_name), - m_theme(other.m_theme), - m_context(other.m_context), - m_fileLength(other.m_fileLength), - m_format(other.m_format){} - -ImageByNameInfo ImageByNameInfo::fromJson(QJsonObject source) { - ImageByNameInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ImageByNameInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_theme = Jellyfin::Support::fromJsonValue(source["Theme"]); - m_context = Jellyfin::Support::fromJsonValue(source["Context"]); - m_fileLength = Jellyfin::Support::fromJsonValue(source["FileLength"]); - m_format = Jellyfin::Support::fromJsonValue(source["Format"]); - -} - -QJsonObject ImageByNameInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Theme"] = Jellyfin::Support::toJsonValue(m_theme); - result["Context"] = Jellyfin::Support::toJsonValue(m_context); - result["FileLength"] = Jellyfin::Support::toJsonValue(m_fileLength); - result["Format"] = Jellyfin::Support::toJsonValue(m_format); - - return result; -} - -QString ImageByNameInfo::name() const { return m_name; } - -void ImageByNameInfo::setName(QString newName) { - m_name = newName; -} -QString ImageByNameInfo::theme() const { return m_theme; } - -void ImageByNameInfo::setTheme(QString newTheme) { - m_theme = newTheme; -} -QString ImageByNameInfo::context() const { return m_context; } - -void ImageByNameInfo::setContext(QString newContext) { - m_context = newContext; -} -qint64 ImageByNameInfo::fileLength() const { return m_fileLength; } - -void ImageByNameInfo::setFileLength(qint64 newFileLength) { - m_fileLength = newFileLength; -} -QString ImageByNameInfo::format() const { return m_format; } - -void ImageByNameInfo::setFormat(QString newFormat) { - m_format = newFormat; -} - -} // NS DTO - -namespace Support { - -using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo; - -template <> -ImageByNameInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ImageByNameInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imageformat.cpp b/core/src/DTO/imageformat.cpp deleted file mode 100644 index 0fa3f0c..0000000 --- a/core/src/DTO/imageformat.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageFormatClass::ImageFormatClass() {} - - -} // NS DTO - -namespace Support { - -using ImageFormat = Jellyfin::DTO::ImageFormat; - -template <> -ImageFormat fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ImageFormat::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Bmp")) { - return ImageFormat::Bmp; - } - if (str == QStringLiteral("Gif")) { - return ImageFormat::Gif; - } - if (str == QStringLiteral("Jpg")) { - return ImageFormat::Jpg; - } - if (str == QStringLiteral("Png")) { - return ImageFormat::Png; - } - if (str == QStringLiteral("Webp")) { - return ImageFormat::Webp; - } - - return ImageFormat::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imageinfo.cpp b/core/src/DTO/imageinfo.cpp deleted file mode 100644 index f10db1f..0000000 --- a/core/src/DTO/imageinfo.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageInfo::ImageInfo() {} -ImageInfo::ImageInfo(const ImageInfo &other) : - m_imageType(other.m_imageType), - m_imageIndex(other.m_imageIndex), - m_imageTag(other.m_imageTag), - m_path(other.m_path), - m_blurHash(other.m_blurHash), - m_height(other.m_height), - m_width(other.m_width), - m_size(other.m_size){} - -ImageInfo ImageInfo::fromJson(QJsonObject source) { - ImageInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ImageInfo::setFromJson(QJsonObject source) { - m_imageType = Jellyfin::Support::fromJsonValue(source["ImageType"]); - m_imageIndex = Jellyfin::Support::fromJsonValue(source["ImageIndex"]); - m_imageTag = Jellyfin::Support::fromJsonValue(source["ImageTag"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_blurHash = Jellyfin::Support::fromJsonValue(source["BlurHash"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_size = Jellyfin::Support::fromJsonValue(source["Size"]); - -} - -QJsonObject ImageInfo::toJson() { - QJsonObject result; - result["ImageType"] = Jellyfin::Support::toJsonValue(m_imageType); - result["ImageIndex"] = Jellyfin::Support::toJsonValue(m_imageIndex); - result["ImageTag"] = Jellyfin::Support::toJsonValue(m_imageTag); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["BlurHash"] = Jellyfin::Support::toJsonValue(m_blurHash); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["Size"] = Jellyfin::Support::toJsonValue(m_size); - - return result; -} - -ImageType ImageInfo::imageType() const { return m_imageType; } - -void ImageInfo::setImageType(ImageType newImageType) { - m_imageType = newImageType; -} -qint32 ImageInfo::imageIndex() const { return m_imageIndex; } - -void ImageInfo::setImageIndex(qint32 newImageIndex) { - m_imageIndex = newImageIndex; -} -QString ImageInfo::imageTag() const { return m_imageTag; } - -void ImageInfo::setImageTag(QString newImageTag) { - m_imageTag = newImageTag; -} -QString ImageInfo::path() const { return m_path; } - -void ImageInfo::setPath(QString newPath) { - m_path = newPath; -} -QString ImageInfo::blurHash() const { return m_blurHash; } - -void ImageInfo::setBlurHash(QString newBlurHash) { - m_blurHash = newBlurHash; -} -qint32 ImageInfo::height() const { return m_height; } - -void ImageInfo::setHeight(qint32 newHeight) { - m_height = newHeight; -} -qint32 ImageInfo::width() const { return m_width; } - -void ImageInfo::setWidth(qint32 newWidth) { - m_width = newWidth; -} -qint64 ImageInfo::size() const { return m_size; } - -void ImageInfo::setSize(qint64 newSize) { - m_size = newSize; -} - -} // NS DTO - -namespace Support { - -using ImageInfo = Jellyfin::DTO::ImageInfo; - -template <> -ImageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ImageInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imageoption.cpp b/core/src/DTO/imageoption.cpp deleted file mode 100644 index 8a6f813..0000000 --- a/core/src/DTO/imageoption.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageOption::ImageOption() {} -ImageOption::ImageOption(const ImageOption &other) : - m_type(other.m_type), - m_limit(other.m_limit), - m_minWidth(other.m_minWidth){} - -ImageOption ImageOption::fromJson(QJsonObject source) { - ImageOption instance; - instance.setFromJson(source); - return instance; -} - - -void ImageOption::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_limit = Jellyfin::Support::fromJsonValue(source["Limit"]); - m_minWidth = Jellyfin::Support::fromJsonValue(source["MinWidth"]); - -} - -QJsonObject ImageOption::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Limit"] = Jellyfin::Support::toJsonValue(m_limit); - result["MinWidth"] = Jellyfin::Support::toJsonValue(m_minWidth); - - return result; -} - -ImageType ImageOption::type() const { return m_type; } - -void ImageOption::setType(ImageType newType) { - m_type = newType; -} -qint32 ImageOption::limit() const { return m_limit; } - -void ImageOption::setLimit(qint32 newLimit) { - m_limit = newLimit; -} -qint32 ImageOption::minWidth() const { return m_minWidth; } - -void ImageOption::setMinWidth(qint32 newMinWidth) { - m_minWidth = newMinWidth; -} - -} // NS DTO - -namespace Support { - -using ImageOption = Jellyfin::DTO::ImageOption; - -template <> -ImageOption fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ImageOption::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imageorientation.cpp b/core/src/DTO/imageorientation.cpp deleted file mode 100644 index d10d00d..0000000 --- a/core/src/DTO/imageorientation.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageOrientationClass::ImageOrientationClass() {} - - -} // NS DTO - -namespace Support { - -using ImageOrientation = Jellyfin::DTO::ImageOrientation; - -template <> -ImageOrientation fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ImageOrientation::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("TopLeft")) { - return ImageOrientation::TopLeft; - } - if (str == QStringLiteral("TopRight")) { - return ImageOrientation::TopRight; - } - if (str == QStringLiteral("BottomRight")) { - return ImageOrientation::BottomRight; - } - if (str == QStringLiteral("BottomLeft")) { - return ImageOrientation::BottomLeft; - } - if (str == QStringLiteral("LeftTop")) { - return ImageOrientation::LeftTop; - } - if (str == QStringLiteral("RightTop")) { - return ImageOrientation::RightTop; - } - if (str == QStringLiteral("RightBottom")) { - return ImageOrientation::RightBottom; - } - if (str == QStringLiteral("LeftBottom")) { - return ImageOrientation::LeftBottom; - } - - return ImageOrientation::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imageproviderinfo.cpp b/core/src/DTO/imageproviderinfo.cpp deleted file mode 100644 index 368800d..0000000 --- a/core/src/DTO/imageproviderinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageProviderInfo::ImageProviderInfo() {} -ImageProviderInfo::ImageProviderInfo(const ImageProviderInfo &other) : - m_name(other.m_name), - m_supportedImages(other.m_supportedImages){} - -ImageProviderInfo ImageProviderInfo::fromJson(QJsonObject source) { - ImageProviderInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ImageProviderInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_supportedImages = Jellyfin::Support::fromJsonValue>(source["SupportedImages"]); - -} - -QJsonObject ImageProviderInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["SupportedImages"] = Jellyfin::Support::toJsonValue>(m_supportedImages); - - return result; -} - -QString ImageProviderInfo::name() const { return m_name; } - -void ImageProviderInfo::setName(QString newName) { - m_name = newName; -} -QList ImageProviderInfo::supportedImages() const { return m_supportedImages; } - -void ImageProviderInfo::setSupportedImages(QList newSupportedImages) { - m_supportedImages = newSupportedImages; -} - -} // NS DTO - -namespace Support { - -using ImageProviderInfo = Jellyfin::DTO::ImageProviderInfo; - -template <> -ImageProviderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ImageProviderInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imagesavingconvention.cpp b/core/src/DTO/imagesavingconvention.cpp deleted file mode 100644 index 991562d..0000000 --- a/core/src/DTO/imagesavingconvention.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageSavingConventionClass::ImageSavingConventionClass() {} - - -} // NS DTO - -namespace Support { - -using ImageSavingConvention = Jellyfin::DTO::ImageSavingConvention; - -template <> -ImageSavingConvention fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ImageSavingConvention::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Legacy")) { - return ImageSavingConvention::Legacy; - } - if (str == QStringLiteral("Compatible")) { - return ImageSavingConvention::Compatible; - } - - return ImageSavingConvention::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/imagetype.cpp b/core/src/DTO/imagetype.cpp deleted file mode 100644 index 2753532..0000000 --- a/core/src/DTO/imagetype.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ImageTypeClass::ImageTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ImageType = Jellyfin::DTO::ImageType; - -template <> -ImageType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ImageType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Primary")) { - return ImageType::Primary; - } - if (str == QStringLiteral("Art")) { - return ImageType::Art; - } - if (str == QStringLiteral("Backdrop")) { - return ImageType::Backdrop; - } - if (str == QStringLiteral("Banner")) { - return ImageType::Banner; - } - if (str == QStringLiteral("Logo")) { - return ImageType::Logo; - } - if (str == QStringLiteral("Thumb")) { - return ImageType::Thumb; - } - if (str == QStringLiteral("Disc")) { - return ImageType::Disc; - } - if (str == QStringLiteral("Box")) { - return ImageType::Box; - } - if (str == QStringLiteral("Screenshot")) { - return ImageType::Screenshot; - } - if (str == QStringLiteral("Menu")) { - return ImageType::Menu; - } - if (str == QStringLiteral("Chapter")) { - return ImageType::Chapter; - } - if (str == QStringLiteral("BoxRear")) { - return ImageType::BoxRear; - } - if (str == QStringLiteral("Profile")) { - return ImageType::Profile; - } - - return ImageType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/installationinfo.cpp b/core/src/DTO/installationinfo.cpp deleted file mode 100644 index ffee3cc..0000000 --- a/core/src/DTO/installationinfo.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -InstallationInfo::InstallationInfo() {} -InstallationInfo::InstallationInfo(const InstallationInfo &other) : - m_guid(other.m_guid), - m_name(other.m_name), - m_version(other.m_version), - m_changelog(other.m_changelog), - m_sourceUrl(other.m_sourceUrl), - m_checksum(other.m_checksum){} - -InstallationInfo InstallationInfo::fromJson(QJsonObject source) { - InstallationInfo instance; - instance.setFromJson(source); - return instance; -} - - -void InstallationInfo::setFromJson(QJsonObject source) { - m_guid = Jellyfin::Support::fromJsonValue(source["Guid"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_version = Jellyfin::Support::fromJsonValue>(source["Version"]); - m_changelog = Jellyfin::Support::fromJsonValue(source["Changelog"]); - m_sourceUrl = Jellyfin::Support::fromJsonValue(source["SourceUrl"]); - m_checksum = Jellyfin::Support::fromJsonValue(source["Checksum"]); - -} - -QJsonObject InstallationInfo::toJson() { - QJsonObject result; - result["Guid"] = Jellyfin::Support::toJsonValue(m_guid); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Version"] = Jellyfin::Support::toJsonValue>(m_version); - result["Changelog"] = Jellyfin::Support::toJsonValue(m_changelog); - result["SourceUrl"] = Jellyfin::Support::toJsonValue(m_sourceUrl); - result["Checksum"] = Jellyfin::Support::toJsonValue(m_checksum); - - return result; -} - -QUuid InstallationInfo::guid() const { return m_guid; } - -void InstallationInfo::setGuid(QUuid newGuid) { - m_guid = newGuid; -} -QString InstallationInfo::name() const { return m_name; } - -void InstallationInfo::setName(QString newName) { - m_name = newName; -} -QSharedPointer InstallationInfo::version() const { return m_version; } - -void InstallationInfo::setVersion(QSharedPointer newVersion) { - m_version = newVersion; -} -QString InstallationInfo::changelog() const { return m_changelog; } - -void InstallationInfo::setChangelog(QString newChangelog) { - m_changelog = newChangelog; -} -QString InstallationInfo::sourceUrl() const { return m_sourceUrl; } - -void InstallationInfo::setSourceUrl(QString newSourceUrl) { - m_sourceUrl = newSourceUrl; -} -QString InstallationInfo::checksum() const { return m_checksum; } - -void InstallationInfo::setChecksum(QString newChecksum) { - m_checksum = newChecksum; -} - -} // NS DTO - -namespace Support { - -using InstallationInfo = Jellyfin::DTO::InstallationInfo; - -template <> -InstallationInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return InstallationInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/iplugin.cpp b/core/src/DTO/iplugin.cpp deleted file mode 100644 index 16f9a58..0000000 --- a/core/src/DTO/iplugin.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -IPlugin::IPlugin() {} -IPlugin::IPlugin(const IPlugin &other) : - m_name(other.m_name), - m_description(other.m_description), - m_jellyfinId(other.m_jellyfinId), - m_version(other.m_version), - m_assemblyFilePath(other.m_assemblyFilePath), - m_canUninstall(other.m_canUninstall), - m_dataFolderPath(other.m_dataFolderPath){} - -IPlugin IPlugin::fromJson(QJsonObject source) { - IPlugin instance; - instance.setFromJson(source); - return instance; -} - - -void IPlugin::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_description = Jellyfin::Support::fromJsonValue(source["Description"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_version = Jellyfin::Support::fromJsonValue>(source["Version"]); - m_assemblyFilePath = Jellyfin::Support::fromJsonValue(source["AssemblyFilePath"]); - m_canUninstall = Jellyfin::Support::fromJsonValue(source["CanUninstall"]); - m_dataFolderPath = Jellyfin::Support::fromJsonValue(source["DataFolderPath"]); - -} - -QJsonObject IPlugin::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Description"] = Jellyfin::Support::toJsonValue(m_description); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Version"] = Jellyfin::Support::toJsonValue>(m_version); - result["AssemblyFilePath"] = Jellyfin::Support::toJsonValue(m_assemblyFilePath); - result["CanUninstall"] = Jellyfin::Support::toJsonValue(m_canUninstall); - result["DataFolderPath"] = Jellyfin::Support::toJsonValue(m_dataFolderPath); - - return result; -} - -QString IPlugin::name() const { return m_name; } - -void IPlugin::setName(QString newName) { - m_name = newName; -} -QString IPlugin::description() const { return m_description; } - -void IPlugin::setDescription(QString newDescription) { - m_description = newDescription; -} -QUuid IPlugin::jellyfinId() const { return m_jellyfinId; } - -void IPlugin::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QSharedPointer IPlugin::version() const { return m_version; } - -void IPlugin::setVersion(QSharedPointer newVersion) { - m_version = newVersion; -} -QString IPlugin::assemblyFilePath() const { return m_assemblyFilePath; } - -void IPlugin::setAssemblyFilePath(QString newAssemblyFilePath) { - m_assemblyFilePath = newAssemblyFilePath; -} -bool IPlugin::canUninstall() const { return m_canUninstall; } - -void IPlugin::setCanUninstall(bool newCanUninstall) { - m_canUninstall = newCanUninstall; -} -QString IPlugin::dataFolderPath() const { return m_dataFolderPath; } - -void IPlugin::setDataFolderPath(QString newDataFolderPath) { - m_dataFolderPath = newDataFolderPath; -} - -} // NS DTO - -namespace Support { - -using IPlugin = Jellyfin::DTO::IPlugin; - -template <> -IPlugin fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return IPlugin::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/isotype.cpp b/core/src/DTO/isotype.cpp deleted file mode 100644 index a944193..0000000 --- a/core/src/DTO/isotype.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -IsoTypeClass::IsoTypeClass() {} - - -} // NS DTO - -namespace Support { - -using IsoType = Jellyfin::DTO::IsoType; - -template <> -IsoType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return IsoType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Dvd")) { - return IsoType::Dvd; - } - if (str == QStringLiteral("BluRay")) { - return IsoType::BluRay; - } - - return IsoType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/itemcounts.cpp b/core/src/DTO/itemcounts.cpp deleted file mode 100644 index 767d0c1..0000000 --- a/core/src/DTO/itemcounts.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ItemCounts::ItemCounts() {} -ItemCounts::ItemCounts(const ItemCounts &other) : - m_movieCount(other.m_movieCount), - m_seriesCount(other.m_seriesCount), - m_episodeCount(other.m_episodeCount), - m_artistCount(other.m_artistCount), - m_programCount(other.m_programCount), - m_trailerCount(other.m_trailerCount), - m_songCount(other.m_songCount), - m_albumCount(other.m_albumCount), - m_musicVideoCount(other.m_musicVideoCount), - m_boxSetCount(other.m_boxSetCount), - m_bookCount(other.m_bookCount), - m_itemCount(other.m_itemCount){} - -ItemCounts ItemCounts::fromJson(QJsonObject source) { - ItemCounts instance; - instance.setFromJson(source); - return instance; -} - - -void ItemCounts::setFromJson(QJsonObject source) { - m_movieCount = Jellyfin::Support::fromJsonValue(source["MovieCount"]); - m_seriesCount = Jellyfin::Support::fromJsonValue(source["SeriesCount"]); - m_episodeCount = Jellyfin::Support::fromJsonValue(source["EpisodeCount"]); - m_artistCount = Jellyfin::Support::fromJsonValue(source["ArtistCount"]); - m_programCount = Jellyfin::Support::fromJsonValue(source["ProgramCount"]); - m_trailerCount = Jellyfin::Support::fromJsonValue(source["TrailerCount"]); - m_songCount = Jellyfin::Support::fromJsonValue(source["SongCount"]); - m_albumCount = Jellyfin::Support::fromJsonValue(source["AlbumCount"]); - m_musicVideoCount = Jellyfin::Support::fromJsonValue(source["MusicVideoCount"]); - m_boxSetCount = Jellyfin::Support::fromJsonValue(source["BoxSetCount"]); - m_bookCount = Jellyfin::Support::fromJsonValue(source["BookCount"]); - m_itemCount = Jellyfin::Support::fromJsonValue(source["ItemCount"]); - -} - -QJsonObject ItemCounts::toJson() { - QJsonObject result; - result["MovieCount"] = Jellyfin::Support::toJsonValue(m_movieCount); - result["SeriesCount"] = Jellyfin::Support::toJsonValue(m_seriesCount); - result["EpisodeCount"] = Jellyfin::Support::toJsonValue(m_episodeCount); - result["ArtistCount"] = Jellyfin::Support::toJsonValue(m_artistCount); - result["ProgramCount"] = Jellyfin::Support::toJsonValue(m_programCount); - result["TrailerCount"] = Jellyfin::Support::toJsonValue(m_trailerCount); - result["SongCount"] = Jellyfin::Support::toJsonValue(m_songCount); - result["AlbumCount"] = Jellyfin::Support::toJsonValue(m_albumCount); - result["MusicVideoCount"] = Jellyfin::Support::toJsonValue(m_musicVideoCount); - result["BoxSetCount"] = Jellyfin::Support::toJsonValue(m_boxSetCount); - result["BookCount"] = Jellyfin::Support::toJsonValue(m_bookCount); - result["ItemCount"] = Jellyfin::Support::toJsonValue(m_itemCount); - - return result; -} - -qint32 ItemCounts::movieCount() const { return m_movieCount; } - -void ItemCounts::setMovieCount(qint32 newMovieCount) { - m_movieCount = newMovieCount; -} -qint32 ItemCounts::seriesCount() const { return m_seriesCount; } - -void ItemCounts::setSeriesCount(qint32 newSeriesCount) { - m_seriesCount = newSeriesCount; -} -qint32 ItemCounts::episodeCount() const { return m_episodeCount; } - -void ItemCounts::setEpisodeCount(qint32 newEpisodeCount) { - m_episodeCount = newEpisodeCount; -} -qint32 ItemCounts::artistCount() const { return m_artistCount; } - -void ItemCounts::setArtistCount(qint32 newArtistCount) { - m_artistCount = newArtistCount; -} -qint32 ItemCounts::programCount() const { return m_programCount; } - -void ItemCounts::setProgramCount(qint32 newProgramCount) { - m_programCount = newProgramCount; -} -qint32 ItemCounts::trailerCount() const { return m_trailerCount; } - -void ItemCounts::setTrailerCount(qint32 newTrailerCount) { - m_trailerCount = newTrailerCount; -} -qint32 ItemCounts::songCount() const { return m_songCount; } - -void ItemCounts::setSongCount(qint32 newSongCount) { - m_songCount = newSongCount; -} -qint32 ItemCounts::albumCount() const { return m_albumCount; } - -void ItemCounts::setAlbumCount(qint32 newAlbumCount) { - m_albumCount = newAlbumCount; -} -qint32 ItemCounts::musicVideoCount() const { return m_musicVideoCount; } - -void ItemCounts::setMusicVideoCount(qint32 newMusicVideoCount) { - m_musicVideoCount = newMusicVideoCount; -} -qint32 ItemCounts::boxSetCount() const { return m_boxSetCount; } - -void ItemCounts::setBoxSetCount(qint32 newBoxSetCount) { - m_boxSetCount = newBoxSetCount; -} -qint32 ItemCounts::bookCount() const { return m_bookCount; } - -void ItemCounts::setBookCount(qint32 newBookCount) { - m_bookCount = newBookCount; -} -qint32 ItemCounts::itemCount() const { return m_itemCount; } - -void ItemCounts::setItemCount(qint32 newItemCount) { - m_itemCount = newItemCount; -} - -} // NS DTO - -namespace Support { - -using ItemCounts = Jellyfin::DTO::ItemCounts; - -template <> -ItemCounts fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ItemCounts::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/itemfields.cpp b/core/src/DTO/itemfields.cpp deleted file mode 100644 index 1b91f62..0000000 --- a/core/src/DTO/itemfields.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ItemFieldsClass::ItemFieldsClass() {} - - -} // NS DTO - -namespace Support { - -using ItemFields = Jellyfin::DTO::ItemFields; - -template <> -ItemFields fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ItemFields::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("AirTime")) { - return ItemFields::AirTime; - } - if (str == QStringLiteral("CanDelete")) { - return ItemFields::CanDelete; - } - if (str == QStringLiteral("CanDownload")) { - return ItemFields::CanDownload; - } - if (str == QStringLiteral("ChannelInfo")) { - return ItemFields::ChannelInfo; - } - if (str == QStringLiteral("Chapters")) { - return ItemFields::Chapters; - } - if (str == QStringLiteral("ChildCount")) { - return ItemFields::ChildCount; - } - if (str == QStringLiteral("CumulativeRunTimeTicks")) { - return ItemFields::CumulativeRunTimeTicks; - } - if (str == QStringLiteral("CustomRating")) { - return ItemFields::CustomRating; - } - if (str == QStringLiteral("DateCreated")) { - return ItemFields::DateCreated; - } - if (str == QStringLiteral("DateLastMediaAdded")) { - return ItemFields::DateLastMediaAdded; - } - if (str == QStringLiteral("DisplayPreferencesId")) { - return ItemFields::DisplayPreferencesId; - } - if (str == QStringLiteral("Etag")) { - return ItemFields::Etag; - } - if (str == QStringLiteral("ExternalUrls")) { - return ItemFields::ExternalUrls; - } - if (str == QStringLiteral("Genres")) { - return ItemFields::Genres; - } - if (str == QStringLiteral("HomePageUrl")) { - return ItemFields::HomePageUrl; - } - if (str == QStringLiteral("ItemCounts")) { - return ItemFields::ItemCounts; - } - if (str == QStringLiteral("MediaSourceCount")) { - return ItemFields::MediaSourceCount; - } - if (str == QStringLiteral("MediaSources")) { - return ItemFields::MediaSources; - } - if (str == QStringLiteral("OriginalTitle")) { - return ItemFields::OriginalTitle; - } - if (str == QStringLiteral("Overview")) { - return ItemFields::Overview; - } - if (str == QStringLiteral("ParentId")) { - return ItemFields::ParentId; - } - if (str == QStringLiteral("Path")) { - return ItemFields::Path; - } - if (str == QStringLiteral("People")) { - return ItemFields::People; - } - if (str == QStringLiteral("PlayAccess")) { - return ItemFields::PlayAccess; - } - if (str == QStringLiteral("ProductionLocations")) { - return ItemFields::ProductionLocations; - } - if (str == QStringLiteral("ProviderIds")) { - return ItemFields::ProviderIds; - } - if (str == QStringLiteral("PrimaryImageAspectRatio")) { - return ItemFields::PrimaryImageAspectRatio; - } - if (str == QStringLiteral("RecursiveItemCount")) { - return ItemFields::RecursiveItemCount; - } - if (str == QStringLiteral("Settings")) { - return ItemFields::Settings; - } - if (str == QStringLiteral("ScreenshotImageTags")) { - return ItemFields::ScreenshotImageTags; - } - if (str == QStringLiteral("SeriesPrimaryImage")) { - return ItemFields::SeriesPrimaryImage; - } - if (str == QStringLiteral("SeriesStudio")) { - return ItemFields::SeriesStudio; - } - if (str == QStringLiteral("SortName")) { - return ItemFields::SortName; - } - if (str == QStringLiteral("SpecialEpisodeNumbers")) { - return ItemFields::SpecialEpisodeNumbers; - } - if (str == QStringLiteral("Studios")) { - return ItemFields::Studios; - } - if (str == QStringLiteral("BasicSyncInfo")) { - return ItemFields::BasicSyncInfo; - } - if (str == QStringLiteral("SyncInfo")) { - return ItemFields::SyncInfo; - } - if (str == QStringLiteral("Taglines")) { - return ItemFields::Taglines; - } - if (str == QStringLiteral("Tags")) { - return ItemFields::Tags; - } - if (str == QStringLiteral("RemoteTrailers")) { - return ItemFields::RemoteTrailers; - } - if (str == QStringLiteral("MediaStreams")) { - return ItemFields::MediaStreams; - } - if (str == QStringLiteral("SeasonUserData")) { - return ItemFields::SeasonUserData; - } - if (str == QStringLiteral("ServiceName")) { - return ItemFields::ServiceName; - } - if (str == QStringLiteral("ThemeSongIds")) { - return ItemFields::ThemeSongIds; - } - if (str == QStringLiteral("ThemeVideoIds")) { - return ItemFields::ThemeVideoIds; - } - if (str == QStringLiteral("ExternalEtag")) { - return ItemFields::ExternalEtag; - } - if (str == QStringLiteral("PresentationUniqueKey")) { - return ItemFields::PresentationUniqueKey; - } - if (str == QStringLiteral("InheritedParentalRatingValue")) { - return ItemFields::InheritedParentalRatingValue; - } - if (str == QStringLiteral("ExternalSeriesId")) { - return ItemFields::ExternalSeriesId; - } - if (str == QStringLiteral("SeriesPresentationUniqueKey")) { - return ItemFields::SeriesPresentationUniqueKey; - } - if (str == QStringLiteral("DateLastRefreshed")) { - return ItemFields::DateLastRefreshed; - } - if (str == QStringLiteral("DateLastSaved")) { - return ItemFields::DateLastSaved; - } - if (str == QStringLiteral("RefreshState")) { - return ItemFields::RefreshState; - } - if (str == QStringLiteral("ChannelImage")) { - return ItemFields::ChannelImage; - } - if (str == QStringLiteral("EnableMediaSourceDisplay")) { - return ItemFields::EnableMediaSourceDisplay; - } - if (str == QStringLiteral("Width")) { - return ItemFields::Width; - } - if (str == QStringLiteral("Height")) { - return ItemFields::Height; - } - if (str == QStringLiteral("ExtraIds")) { - return ItemFields::ExtraIds; - } - if (str == QStringLiteral("LocalTrailerCount")) { - return ItemFields::LocalTrailerCount; - } - if (str == QStringLiteral("IsHD")) { - return ItemFields::IsHD; - } - if (str == QStringLiteral("SpecialFeatureCount")) { - return ItemFields::SpecialFeatureCount; - } - - return ItemFields::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/itemfilter.cpp b/core/src/DTO/itemfilter.cpp deleted file mode 100644 index f60a779..0000000 --- a/core/src/DTO/itemfilter.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ItemFilterClass::ItemFilterClass() {} - - -} // NS DTO - -namespace Support { - -using ItemFilter = Jellyfin::DTO::ItemFilter; - -template <> -ItemFilter fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ItemFilter::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("IsFolder")) { - return ItemFilter::IsFolder; - } - if (str == QStringLiteral("IsNotFolder")) { - return ItemFilter::IsNotFolder; - } - if (str == QStringLiteral("IsUnplayed")) { - return ItemFilter::IsUnplayed; - } - if (str == QStringLiteral("IsPlayed")) { - return ItemFilter::IsPlayed; - } - if (str == QStringLiteral("IsFavorite")) { - return ItemFilter::IsFavorite; - } - if (str == QStringLiteral("IsResumable")) { - return ItemFilter::IsResumable; - } - if (str == QStringLiteral("Likes")) { - return ItemFilter::Likes; - } - if (str == QStringLiteral("Dislikes")) { - return ItemFilter::Dislikes; - } - if (str == QStringLiteral("IsFavoriteOrLikes")) { - return ItemFilter::IsFavoriteOrLikes; - } - - return ItemFilter::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/joingrouprequestdto.cpp b/core/src/DTO/joingrouprequestdto.cpp deleted file mode 100644 index f60169d..0000000 --- a/core/src/DTO/joingrouprequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -JoinGroupRequestDto::JoinGroupRequestDto() {} -JoinGroupRequestDto::JoinGroupRequestDto(const JoinGroupRequestDto &other) : - m_groupId(other.m_groupId){} - -JoinGroupRequestDto JoinGroupRequestDto::fromJson(QJsonObject source) { - JoinGroupRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void JoinGroupRequestDto::setFromJson(QJsonObject source) { - m_groupId = Jellyfin::Support::fromJsonValue(source["GroupId"]); - -} - -QJsonObject JoinGroupRequestDto::toJson() { - QJsonObject result; - result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); - - return result; -} - -QUuid JoinGroupRequestDto::groupId() const { return m_groupId; } - -void JoinGroupRequestDto::setGroupId(QUuid newGroupId) { - m_groupId = newGroupId; -} - -} // NS DTO - -namespace Support { - -using JoinGroupRequestDto = Jellyfin::DTO::JoinGroupRequestDto; - -template <> -JoinGroupRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return JoinGroupRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/keepuntil.cpp b/core/src/DTO/keepuntil.cpp deleted file mode 100644 index ac7945a..0000000 --- a/core/src/DTO/keepuntil.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -KeepUntilClass::KeepUntilClass() {} - - -} // NS DTO - -namespace Support { - -using KeepUntil = Jellyfin::DTO::KeepUntil; - -template <> -KeepUntil fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return KeepUntil::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("UntilDeleted")) { - return KeepUntil::UntilDeleted; - } - if (str == QStringLiteral("UntilSpaceNeeded")) { - return KeepUntil::UntilSpaceNeeded; - } - if (str == QStringLiteral("UntilWatched")) { - return KeepUntil::UntilWatched; - } - if (str == QStringLiteral("UntilDate")) { - return KeepUntil::UntilDate; - } - - return KeepUntil::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/libraryoptioninfodto.cpp b/core/src/DTO/libraryoptioninfodto.cpp deleted file mode 100644 index 31401de..0000000 --- a/core/src/DTO/libraryoptioninfodto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LibraryOptionInfoDto::LibraryOptionInfoDto() {} -LibraryOptionInfoDto::LibraryOptionInfoDto(const LibraryOptionInfoDto &other) : - m_name(other.m_name), - m_defaultEnabled(other.m_defaultEnabled){} - -LibraryOptionInfoDto LibraryOptionInfoDto::fromJson(QJsonObject source) { - LibraryOptionInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void LibraryOptionInfoDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_defaultEnabled = Jellyfin::Support::fromJsonValue(source["DefaultEnabled"]); - -} - -QJsonObject LibraryOptionInfoDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["DefaultEnabled"] = Jellyfin::Support::toJsonValue(m_defaultEnabled); - - return result; -} - -QString LibraryOptionInfoDto::name() const { return m_name; } - -void LibraryOptionInfoDto::setName(QString newName) { - m_name = newName; -} -bool LibraryOptionInfoDto::defaultEnabled() const { return m_defaultEnabled; } - -void LibraryOptionInfoDto::setDefaultEnabled(bool newDefaultEnabled) { - m_defaultEnabled = newDefaultEnabled; -} - -} // NS DTO - -namespace Support { - -using LibraryOptionInfoDto = Jellyfin::DTO::LibraryOptionInfoDto; - -template <> -LibraryOptionInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LibraryOptionInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/libraryoptions.cpp b/core/src/DTO/libraryoptions.cpp deleted file mode 100644 index bbe284d..0000000 --- a/core/src/DTO/libraryoptions.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LibraryOptions::LibraryOptions() {} -LibraryOptions::LibraryOptions(const LibraryOptions &other) : - m_enablePhotos(other.m_enablePhotos), - m_enableRealtimeMonitor(other.m_enableRealtimeMonitor), - m_enableChapterImageExtraction(other.m_enableChapterImageExtraction), - m_extractChapterImagesDuringLibraryScan(other.m_extractChapterImagesDuringLibraryScan), - m_pathInfos(other.m_pathInfos), - m_saveLocalMetadata(other.m_saveLocalMetadata), - m_enableInternetProviders(other.m_enableInternetProviders), - m_enableAutomaticSeriesGrouping(other.m_enableAutomaticSeriesGrouping), - m_enableEmbeddedTitles(other.m_enableEmbeddedTitles), - m_enableEmbeddedEpisodeInfos(other.m_enableEmbeddedEpisodeInfos), - m_automaticRefreshIntervalDays(other.m_automaticRefreshIntervalDays), - m_preferredMetadataLanguage(other.m_preferredMetadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_seasonZeroDisplayName(other.m_seasonZeroDisplayName), - m_metadataSavers(other.m_metadataSavers), - m_disabledLocalMetadataReaders(other.m_disabledLocalMetadataReaders), - m_localMetadataReaderOrder(other.m_localMetadataReaderOrder), - m_disabledSubtitleFetchers(other.m_disabledSubtitleFetchers), - m_subtitleFetcherOrder(other.m_subtitleFetcherOrder), - m_skipSubtitlesIfEmbeddedSubtitlesPresent(other.m_skipSubtitlesIfEmbeddedSubtitlesPresent), - m_skipSubtitlesIfAudioTrackMatches(other.m_skipSubtitlesIfAudioTrackMatches), - m_subtitleDownloadLanguages(other.m_subtitleDownloadLanguages), - m_requirePerfectSubtitleMatch(other.m_requirePerfectSubtitleMatch), - m_saveSubtitlesWithMedia(other.m_saveSubtitlesWithMedia), - m_typeOptions(other.m_typeOptions){} - -LibraryOptions LibraryOptions::fromJson(QJsonObject source) { - LibraryOptions instance; - instance.setFromJson(source); - return instance; -} - - -void LibraryOptions::setFromJson(QJsonObject source) { - m_enablePhotos = Jellyfin::Support::fromJsonValue(source["EnablePhotos"]); - m_enableRealtimeMonitor = Jellyfin::Support::fromJsonValue(source["EnableRealtimeMonitor"]); - m_enableChapterImageExtraction = Jellyfin::Support::fromJsonValue(source["EnableChapterImageExtraction"]); - m_extractChapterImagesDuringLibraryScan = Jellyfin::Support::fromJsonValue(source["ExtractChapterImagesDuringLibraryScan"]); - m_pathInfos = Jellyfin::Support::fromJsonValue>>(source["PathInfos"]); - m_saveLocalMetadata = Jellyfin::Support::fromJsonValue(source["SaveLocalMetadata"]); - m_enableInternetProviders = Jellyfin::Support::fromJsonValue(source["EnableInternetProviders"]); - m_enableAutomaticSeriesGrouping = Jellyfin::Support::fromJsonValue(source["EnableAutomaticSeriesGrouping"]); - m_enableEmbeddedTitles = Jellyfin::Support::fromJsonValue(source["EnableEmbeddedTitles"]); - m_enableEmbeddedEpisodeInfos = Jellyfin::Support::fromJsonValue(source["EnableEmbeddedEpisodeInfos"]); - m_automaticRefreshIntervalDays = Jellyfin::Support::fromJsonValue(source["AutomaticRefreshIntervalDays"]); - m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue(source["PreferredMetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_seasonZeroDisplayName = Jellyfin::Support::fromJsonValue(source["SeasonZeroDisplayName"]); - m_metadataSavers = Jellyfin::Support::fromJsonValue(source["MetadataSavers"]); - m_disabledLocalMetadataReaders = Jellyfin::Support::fromJsonValue(source["DisabledLocalMetadataReaders"]); - m_localMetadataReaderOrder = Jellyfin::Support::fromJsonValue(source["LocalMetadataReaderOrder"]); - m_disabledSubtitleFetchers = Jellyfin::Support::fromJsonValue(source["DisabledSubtitleFetchers"]); - m_subtitleFetcherOrder = Jellyfin::Support::fromJsonValue(source["SubtitleFetcherOrder"]); - m_skipSubtitlesIfEmbeddedSubtitlesPresent = Jellyfin::Support::fromJsonValue(source["SkipSubtitlesIfEmbeddedSubtitlesPresent"]); - m_skipSubtitlesIfAudioTrackMatches = Jellyfin::Support::fromJsonValue(source["SkipSubtitlesIfAudioTrackMatches"]); - m_subtitleDownloadLanguages = Jellyfin::Support::fromJsonValue(source["SubtitleDownloadLanguages"]); - m_requirePerfectSubtitleMatch = Jellyfin::Support::fromJsonValue(source["RequirePerfectSubtitleMatch"]); - m_saveSubtitlesWithMedia = Jellyfin::Support::fromJsonValue(source["SaveSubtitlesWithMedia"]); - m_typeOptions = Jellyfin::Support::fromJsonValue>>(source["TypeOptions"]); - -} - -QJsonObject LibraryOptions::toJson() { - QJsonObject result; - result["EnablePhotos"] = Jellyfin::Support::toJsonValue(m_enablePhotos); - result["EnableRealtimeMonitor"] = Jellyfin::Support::toJsonValue(m_enableRealtimeMonitor); - result["EnableChapterImageExtraction"] = Jellyfin::Support::toJsonValue(m_enableChapterImageExtraction); - result["ExtractChapterImagesDuringLibraryScan"] = Jellyfin::Support::toJsonValue(m_extractChapterImagesDuringLibraryScan); - result["PathInfos"] = Jellyfin::Support::toJsonValue>>(m_pathInfos); - result["SaveLocalMetadata"] = Jellyfin::Support::toJsonValue(m_saveLocalMetadata); - result["EnableInternetProviders"] = Jellyfin::Support::toJsonValue(m_enableInternetProviders); - result["EnableAutomaticSeriesGrouping"] = Jellyfin::Support::toJsonValue(m_enableAutomaticSeriesGrouping); - result["EnableEmbeddedTitles"] = Jellyfin::Support::toJsonValue(m_enableEmbeddedTitles); - result["EnableEmbeddedEpisodeInfos"] = Jellyfin::Support::toJsonValue(m_enableEmbeddedEpisodeInfos); - result["AutomaticRefreshIntervalDays"] = Jellyfin::Support::toJsonValue(m_automaticRefreshIntervalDays); - result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue(m_preferredMetadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["SeasonZeroDisplayName"] = Jellyfin::Support::toJsonValue(m_seasonZeroDisplayName); - result["MetadataSavers"] = Jellyfin::Support::toJsonValue(m_metadataSavers); - result["DisabledLocalMetadataReaders"] = Jellyfin::Support::toJsonValue(m_disabledLocalMetadataReaders); - result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue(m_localMetadataReaderOrder); - result["DisabledSubtitleFetchers"] = Jellyfin::Support::toJsonValue(m_disabledSubtitleFetchers); - result["SubtitleFetcherOrder"] = Jellyfin::Support::toJsonValue(m_subtitleFetcherOrder); - result["SkipSubtitlesIfEmbeddedSubtitlesPresent"] = Jellyfin::Support::toJsonValue(m_skipSubtitlesIfEmbeddedSubtitlesPresent); - result["SkipSubtitlesIfAudioTrackMatches"] = Jellyfin::Support::toJsonValue(m_skipSubtitlesIfAudioTrackMatches); - result["SubtitleDownloadLanguages"] = Jellyfin::Support::toJsonValue(m_subtitleDownloadLanguages); - result["RequirePerfectSubtitleMatch"] = Jellyfin::Support::toJsonValue(m_requirePerfectSubtitleMatch); - result["SaveSubtitlesWithMedia"] = Jellyfin::Support::toJsonValue(m_saveSubtitlesWithMedia); - result["TypeOptions"] = Jellyfin::Support::toJsonValue>>(m_typeOptions); - - return result; -} - -bool LibraryOptions::enablePhotos() const { return m_enablePhotos; } - -void LibraryOptions::setEnablePhotos(bool newEnablePhotos) { - m_enablePhotos = newEnablePhotos; -} -bool LibraryOptions::enableRealtimeMonitor() const { return m_enableRealtimeMonitor; } - -void LibraryOptions::setEnableRealtimeMonitor(bool newEnableRealtimeMonitor) { - m_enableRealtimeMonitor = newEnableRealtimeMonitor; -} -bool LibraryOptions::enableChapterImageExtraction() const { return m_enableChapterImageExtraction; } - -void LibraryOptions::setEnableChapterImageExtraction(bool newEnableChapterImageExtraction) { - m_enableChapterImageExtraction = newEnableChapterImageExtraction; -} -bool LibraryOptions::extractChapterImagesDuringLibraryScan() const { return m_extractChapterImagesDuringLibraryScan; } - -void LibraryOptions::setExtractChapterImagesDuringLibraryScan(bool newExtractChapterImagesDuringLibraryScan) { - m_extractChapterImagesDuringLibraryScan = newExtractChapterImagesDuringLibraryScan; -} -QList> LibraryOptions::pathInfos() const { return m_pathInfos; } - -void LibraryOptions::setPathInfos(QList> newPathInfos) { - m_pathInfos = newPathInfos; -} -bool LibraryOptions::saveLocalMetadata() const { return m_saveLocalMetadata; } - -void LibraryOptions::setSaveLocalMetadata(bool newSaveLocalMetadata) { - m_saveLocalMetadata = newSaveLocalMetadata; -} -bool LibraryOptions::enableInternetProviders() const { return m_enableInternetProviders; } - -void LibraryOptions::setEnableInternetProviders(bool newEnableInternetProviders) { - m_enableInternetProviders = newEnableInternetProviders; -} -bool LibraryOptions::enableAutomaticSeriesGrouping() const { return m_enableAutomaticSeriesGrouping; } - -void LibraryOptions::setEnableAutomaticSeriesGrouping(bool newEnableAutomaticSeriesGrouping) { - m_enableAutomaticSeriesGrouping = newEnableAutomaticSeriesGrouping; -} -bool LibraryOptions::enableEmbeddedTitles() const { return m_enableEmbeddedTitles; } - -void LibraryOptions::setEnableEmbeddedTitles(bool newEnableEmbeddedTitles) { - m_enableEmbeddedTitles = newEnableEmbeddedTitles; -} -bool LibraryOptions::enableEmbeddedEpisodeInfos() const { return m_enableEmbeddedEpisodeInfos; } - -void LibraryOptions::setEnableEmbeddedEpisodeInfos(bool newEnableEmbeddedEpisodeInfos) { - m_enableEmbeddedEpisodeInfos = newEnableEmbeddedEpisodeInfos; -} -qint32 LibraryOptions::automaticRefreshIntervalDays() const { return m_automaticRefreshIntervalDays; } - -void LibraryOptions::setAutomaticRefreshIntervalDays(qint32 newAutomaticRefreshIntervalDays) { - m_automaticRefreshIntervalDays = newAutomaticRefreshIntervalDays; -} -QString LibraryOptions::preferredMetadataLanguage() const { return m_preferredMetadataLanguage; } - -void LibraryOptions::setPreferredMetadataLanguage(QString newPreferredMetadataLanguage) { - m_preferredMetadataLanguage = newPreferredMetadataLanguage; -} -QString LibraryOptions::metadataCountryCode() const { return m_metadataCountryCode; } - -void LibraryOptions::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QString LibraryOptions::seasonZeroDisplayName() const { return m_seasonZeroDisplayName; } - -void LibraryOptions::setSeasonZeroDisplayName(QString newSeasonZeroDisplayName) { - m_seasonZeroDisplayName = newSeasonZeroDisplayName; -} -QStringList LibraryOptions::metadataSavers() const { return m_metadataSavers; } - -void LibraryOptions::setMetadataSavers(QStringList newMetadataSavers) { - m_metadataSavers = newMetadataSavers; -} -QStringList LibraryOptions::disabledLocalMetadataReaders() const { return m_disabledLocalMetadataReaders; } - -void LibraryOptions::setDisabledLocalMetadataReaders(QStringList newDisabledLocalMetadataReaders) { - m_disabledLocalMetadataReaders = newDisabledLocalMetadataReaders; -} -QStringList LibraryOptions::localMetadataReaderOrder() const { return m_localMetadataReaderOrder; } - -void LibraryOptions::setLocalMetadataReaderOrder(QStringList newLocalMetadataReaderOrder) { - m_localMetadataReaderOrder = newLocalMetadataReaderOrder; -} -QStringList LibraryOptions::disabledSubtitleFetchers() const { return m_disabledSubtitleFetchers; } - -void LibraryOptions::setDisabledSubtitleFetchers(QStringList newDisabledSubtitleFetchers) { - m_disabledSubtitleFetchers = newDisabledSubtitleFetchers; -} -QStringList LibraryOptions::subtitleFetcherOrder() const { return m_subtitleFetcherOrder; } - -void LibraryOptions::setSubtitleFetcherOrder(QStringList newSubtitleFetcherOrder) { - m_subtitleFetcherOrder = newSubtitleFetcherOrder; -} -bool LibraryOptions::skipSubtitlesIfEmbeddedSubtitlesPresent() const { return m_skipSubtitlesIfEmbeddedSubtitlesPresent; } - -void LibraryOptions::setSkipSubtitlesIfEmbeddedSubtitlesPresent(bool newSkipSubtitlesIfEmbeddedSubtitlesPresent) { - m_skipSubtitlesIfEmbeddedSubtitlesPresent = newSkipSubtitlesIfEmbeddedSubtitlesPresent; -} -bool LibraryOptions::skipSubtitlesIfAudioTrackMatches() const { return m_skipSubtitlesIfAudioTrackMatches; } - -void LibraryOptions::setSkipSubtitlesIfAudioTrackMatches(bool newSkipSubtitlesIfAudioTrackMatches) { - m_skipSubtitlesIfAudioTrackMatches = newSkipSubtitlesIfAudioTrackMatches; -} -QStringList LibraryOptions::subtitleDownloadLanguages() const { return m_subtitleDownloadLanguages; } - -void LibraryOptions::setSubtitleDownloadLanguages(QStringList newSubtitleDownloadLanguages) { - m_subtitleDownloadLanguages = newSubtitleDownloadLanguages; -} -bool LibraryOptions::requirePerfectSubtitleMatch() const { return m_requirePerfectSubtitleMatch; } - -void LibraryOptions::setRequirePerfectSubtitleMatch(bool newRequirePerfectSubtitleMatch) { - m_requirePerfectSubtitleMatch = newRequirePerfectSubtitleMatch; -} -bool LibraryOptions::saveSubtitlesWithMedia() const { return m_saveSubtitlesWithMedia; } - -void LibraryOptions::setSaveSubtitlesWithMedia(bool newSaveSubtitlesWithMedia) { - m_saveSubtitlesWithMedia = newSaveSubtitlesWithMedia; -} -QList> LibraryOptions::typeOptions() const { return m_typeOptions; } - -void LibraryOptions::setTypeOptions(QList> newTypeOptions) { - m_typeOptions = newTypeOptions; -} - -} // NS DTO - -namespace Support { - -using LibraryOptions = Jellyfin::DTO::LibraryOptions; - -template <> -LibraryOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LibraryOptions::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/libraryoptionsresultdto.cpp b/core/src/DTO/libraryoptionsresultdto.cpp deleted file mode 100644 index 93413c4..0000000 --- a/core/src/DTO/libraryoptionsresultdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LibraryOptionsResultDto::LibraryOptionsResultDto() {} -LibraryOptionsResultDto::LibraryOptionsResultDto(const LibraryOptionsResultDto &other) : - m_metadataSavers(other.m_metadataSavers), - m_metadataReaders(other.m_metadataReaders), - m_subtitleFetchers(other.m_subtitleFetchers), - m_typeOptions(other.m_typeOptions){} - -LibraryOptionsResultDto LibraryOptionsResultDto::fromJson(QJsonObject source) { - LibraryOptionsResultDto instance; - instance.setFromJson(source); - return instance; -} - - -void LibraryOptionsResultDto::setFromJson(QJsonObject source) { - m_metadataSavers = Jellyfin::Support::fromJsonValue>>(source["MetadataSavers"]); - m_metadataReaders = Jellyfin::Support::fromJsonValue>>(source["MetadataReaders"]); - m_subtitleFetchers = Jellyfin::Support::fromJsonValue>>(source["SubtitleFetchers"]); - m_typeOptions = Jellyfin::Support::fromJsonValue>>(source["TypeOptions"]); - -} - -QJsonObject LibraryOptionsResultDto::toJson() { - QJsonObject result; - result["MetadataSavers"] = Jellyfin::Support::toJsonValue>>(m_metadataSavers); - result["MetadataReaders"] = Jellyfin::Support::toJsonValue>>(m_metadataReaders); - result["SubtitleFetchers"] = Jellyfin::Support::toJsonValue>>(m_subtitleFetchers); - result["TypeOptions"] = Jellyfin::Support::toJsonValue>>(m_typeOptions); - - return result; -} - -QList> LibraryOptionsResultDto::metadataSavers() const { return m_metadataSavers; } - -void LibraryOptionsResultDto::setMetadataSavers(QList> newMetadataSavers) { - m_metadataSavers = newMetadataSavers; -} -QList> LibraryOptionsResultDto::metadataReaders() const { return m_metadataReaders; } - -void LibraryOptionsResultDto::setMetadataReaders(QList> newMetadataReaders) { - m_metadataReaders = newMetadataReaders; -} -QList> LibraryOptionsResultDto::subtitleFetchers() const { return m_subtitleFetchers; } - -void LibraryOptionsResultDto::setSubtitleFetchers(QList> newSubtitleFetchers) { - m_subtitleFetchers = newSubtitleFetchers; -} -QList> LibraryOptionsResultDto::typeOptions() const { return m_typeOptions; } - -void LibraryOptionsResultDto::setTypeOptions(QList> newTypeOptions) { - m_typeOptions = newTypeOptions; -} - -} // NS DTO - -namespace Support { - -using LibraryOptionsResultDto = Jellyfin::DTO::LibraryOptionsResultDto; - -template <> -LibraryOptionsResultDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LibraryOptionsResultDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/librarytypeoptionsdto.cpp b/core/src/DTO/librarytypeoptionsdto.cpp deleted file mode 100644 index f23e570..0000000 --- a/core/src/DTO/librarytypeoptionsdto.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LibraryTypeOptionsDto::LibraryTypeOptionsDto() {} -LibraryTypeOptionsDto::LibraryTypeOptionsDto(const LibraryTypeOptionsDto &other) : - m_type(other.m_type), - m_metadataFetchers(other.m_metadataFetchers), - m_imageFetchers(other.m_imageFetchers), - m_supportedImageTypes(other.m_supportedImageTypes), - m_defaultImageOptions(other.m_defaultImageOptions){} - -LibraryTypeOptionsDto LibraryTypeOptionsDto::fromJson(QJsonObject source) { - LibraryTypeOptionsDto instance; - instance.setFromJson(source); - return instance; -} - - -void LibraryTypeOptionsDto::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_metadataFetchers = Jellyfin::Support::fromJsonValue>>(source["MetadataFetchers"]); - m_imageFetchers = Jellyfin::Support::fromJsonValue>>(source["ImageFetchers"]); - m_supportedImageTypes = Jellyfin::Support::fromJsonValue>(source["SupportedImageTypes"]); - m_defaultImageOptions = Jellyfin::Support::fromJsonValue>>(source["DefaultImageOptions"]); - -} - -QJsonObject LibraryTypeOptionsDto::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["MetadataFetchers"] = Jellyfin::Support::toJsonValue>>(m_metadataFetchers); - result["ImageFetchers"] = Jellyfin::Support::toJsonValue>>(m_imageFetchers); - result["SupportedImageTypes"] = Jellyfin::Support::toJsonValue>(m_supportedImageTypes); - result["DefaultImageOptions"] = Jellyfin::Support::toJsonValue>>(m_defaultImageOptions); - - return result; -} - -QString LibraryTypeOptionsDto::type() const { return m_type; } - -void LibraryTypeOptionsDto::setType(QString newType) { - m_type = newType; -} -QList> LibraryTypeOptionsDto::metadataFetchers() const { return m_metadataFetchers; } - -void LibraryTypeOptionsDto::setMetadataFetchers(QList> newMetadataFetchers) { - m_metadataFetchers = newMetadataFetchers; -} -QList> LibraryTypeOptionsDto::imageFetchers() const { return m_imageFetchers; } - -void LibraryTypeOptionsDto::setImageFetchers(QList> newImageFetchers) { - m_imageFetchers = newImageFetchers; -} -QList LibraryTypeOptionsDto::supportedImageTypes() const { return m_supportedImageTypes; } - -void LibraryTypeOptionsDto::setSupportedImageTypes(QList newSupportedImageTypes) { - m_supportedImageTypes = newSupportedImageTypes; -} -QList> LibraryTypeOptionsDto::defaultImageOptions() const { return m_defaultImageOptions; } - -void LibraryTypeOptionsDto::setDefaultImageOptions(QList> newDefaultImageOptions) { - m_defaultImageOptions = newDefaultImageOptions; -} - -} // NS DTO - -namespace Support { - -using LibraryTypeOptionsDto = Jellyfin::DTO::LibraryTypeOptionsDto; - -template <> -LibraryTypeOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LibraryTypeOptionsDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/libraryupdateinfo.cpp b/core/src/DTO/libraryupdateinfo.cpp deleted file mode 100644 index d97d955..0000000 --- a/core/src/DTO/libraryupdateinfo.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LibraryUpdateInfo::LibraryUpdateInfo() {} -LibraryUpdateInfo::LibraryUpdateInfo(const LibraryUpdateInfo &other) : - m_foldersAddedTo(other.m_foldersAddedTo), - m_foldersRemovedFrom(other.m_foldersRemovedFrom), - m_itemsAdded(other.m_itemsAdded), - m_itemsRemoved(other.m_itemsRemoved), - m_itemsUpdated(other.m_itemsUpdated), - m_collectionFolders(other.m_collectionFolders), - m_isEmpty(other.m_isEmpty){} - -LibraryUpdateInfo LibraryUpdateInfo::fromJson(QJsonObject source) { - LibraryUpdateInfo instance; - instance.setFromJson(source); - return instance; -} - - -void LibraryUpdateInfo::setFromJson(QJsonObject source) { - m_foldersAddedTo = Jellyfin::Support::fromJsonValue(source["FoldersAddedTo"]); - m_foldersRemovedFrom = Jellyfin::Support::fromJsonValue(source["FoldersRemovedFrom"]); - m_itemsAdded = Jellyfin::Support::fromJsonValue(source["ItemsAdded"]); - m_itemsRemoved = Jellyfin::Support::fromJsonValue(source["ItemsRemoved"]); - m_itemsUpdated = Jellyfin::Support::fromJsonValue(source["ItemsUpdated"]); - m_collectionFolders = Jellyfin::Support::fromJsonValue(source["CollectionFolders"]); - m_isEmpty = Jellyfin::Support::fromJsonValue(source["IsEmpty"]); - -} - -QJsonObject LibraryUpdateInfo::toJson() { - QJsonObject result; - result["FoldersAddedTo"] = Jellyfin::Support::toJsonValue(m_foldersAddedTo); - result["FoldersRemovedFrom"] = Jellyfin::Support::toJsonValue(m_foldersRemovedFrom); - result["ItemsAdded"] = Jellyfin::Support::toJsonValue(m_itemsAdded); - result["ItemsRemoved"] = Jellyfin::Support::toJsonValue(m_itemsRemoved); - result["ItemsUpdated"] = Jellyfin::Support::toJsonValue(m_itemsUpdated); - result["CollectionFolders"] = Jellyfin::Support::toJsonValue(m_collectionFolders); - result["IsEmpty"] = Jellyfin::Support::toJsonValue(m_isEmpty); - - return result; -} - -QStringList LibraryUpdateInfo::foldersAddedTo() const { return m_foldersAddedTo; } - -void LibraryUpdateInfo::setFoldersAddedTo(QStringList newFoldersAddedTo) { - m_foldersAddedTo = newFoldersAddedTo; -} -QStringList LibraryUpdateInfo::foldersRemovedFrom() const { return m_foldersRemovedFrom; } - -void LibraryUpdateInfo::setFoldersRemovedFrom(QStringList newFoldersRemovedFrom) { - m_foldersRemovedFrom = newFoldersRemovedFrom; -} -QStringList LibraryUpdateInfo::itemsAdded() const { return m_itemsAdded; } - -void LibraryUpdateInfo::setItemsAdded(QStringList newItemsAdded) { - m_itemsAdded = newItemsAdded; -} -QStringList LibraryUpdateInfo::itemsRemoved() const { return m_itemsRemoved; } - -void LibraryUpdateInfo::setItemsRemoved(QStringList newItemsRemoved) { - m_itemsRemoved = newItemsRemoved; -} -QStringList LibraryUpdateInfo::itemsUpdated() const { return m_itemsUpdated; } - -void LibraryUpdateInfo::setItemsUpdated(QStringList newItemsUpdated) { - m_itemsUpdated = newItemsUpdated; -} -QStringList LibraryUpdateInfo::collectionFolders() const { return m_collectionFolders; } - -void LibraryUpdateInfo::setCollectionFolders(QStringList newCollectionFolders) { - m_collectionFolders = newCollectionFolders; -} -bool LibraryUpdateInfo::isEmpty() const { return m_isEmpty; } - -void LibraryUpdateInfo::setIsEmpty(bool newIsEmpty) { - m_isEmpty = newIsEmpty; -} - -} // NS DTO - -namespace Support { - -using LibraryUpdateInfo = Jellyfin::DTO::LibraryUpdateInfo; - -template <> -LibraryUpdateInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LibraryUpdateInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/listingsproviderinfo.cpp b/core/src/DTO/listingsproviderinfo.cpp deleted file mode 100644 index f90ac0b..0000000 --- a/core/src/DTO/listingsproviderinfo.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ListingsProviderInfo::ListingsProviderInfo() {} -ListingsProviderInfo::ListingsProviderInfo(const ListingsProviderInfo &other) : - m_jellyfinId(other.m_jellyfinId), - m_type(other.m_type), - m_username(other.m_username), - m_password(other.m_password), - m_listingsId(other.m_listingsId), - m_zipCode(other.m_zipCode), - m_country(other.m_country), - m_path(other.m_path), - m_enabledTuners(other.m_enabledTuners), - m_enableAllTuners(other.m_enableAllTuners), - m_newsCategories(other.m_newsCategories), - m_sportsCategories(other.m_sportsCategories), - m_kidsCategories(other.m_kidsCategories), - m_movieCategories(other.m_movieCategories), - m_channelMappings(other.m_channelMappings), - m_moviePrefix(other.m_moviePrefix), - m_preferredLanguage(other.m_preferredLanguage), - m_userAgent(other.m_userAgent){} - -ListingsProviderInfo ListingsProviderInfo::fromJson(QJsonObject source) { - ListingsProviderInfo instance; - instance.setFromJson(source); - return instance; -} - - -void ListingsProviderInfo::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_username = Jellyfin::Support::fromJsonValue(source["Username"]); - m_password = Jellyfin::Support::fromJsonValue(source["Password"]); - m_listingsId = Jellyfin::Support::fromJsonValue(source["ListingsId"]); - m_zipCode = Jellyfin::Support::fromJsonValue(source["ZipCode"]); - m_country = Jellyfin::Support::fromJsonValue(source["Country"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_enabledTuners = Jellyfin::Support::fromJsonValue(source["EnabledTuners"]); - m_enableAllTuners = Jellyfin::Support::fromJsonValue(source["EnableAllTuners"]); - m_newsCategories = Jellyfin::Support::fromJsonValue(source["NewsCategories"]); - m_sportsCategories = Jellyfin::Support::fromJsonValue(source["SportsCategories"]); - m_kidsCategories = Jellyfin::Support::fromJsonValue(source["KidsCategories"]); - m_movieCategories = Jellyfin::Support::fromJsonValue(source["MovieCategories"]); - m_channelMappings = Jellyfin::Support::fromJsonValue>>(source["ChannelMappings"]); - m_moviePrefix = Jellyfin::Support::fromJsonValue(source["MoviePrefix"]); - m_preferredLanguage = Jellyfin::Support::fromJsonValue(source["PreferredLanguage"]); - m_userAgent = Jellyfin::Support::fromJsonValue(source["UserAgent"]); - -} - -QJsonObject ListingsProviderInfo::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Username"] = Jellyfin::Support::toJsonValue(m_username); - result["Password"] = Jellyfin::Support::toJsonValue(m_password); - result["ListingsId"] = Jellyfin::Support::toJsonValue(m_listingsId); - result["ZipCode"] = Jellyfin::Support::toJsonValue(m_zipCode); - result["Country"] = Jellyfin::Support::toJsonValue(m_country); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["EnabledTuners"] = Jellyfin::Support::toJsonValue(m_enabledTuners); - result["EnableAllTuners"] = Jellyfin::Support::toJsonValue(m_enableAllTuners); - result["NewsCategories"] = Jellyfin::Support::toJsonValue(m_newsCategories); - result["SportsCategories"] = Jellyfin::Support::toJsonValue(m_sportsCategories); - result["KidsCategories"] = Jellyfin::Support::toJsonValue(m_kidsCategories); - result["MovieCategories"] = Jellyfin::Support::toJsonValue(m_movieCategories); - result["ChannelMappings"] = Jellyfin::Support::toJsonValue>>(m_channelMappings); - result["MoviePrefix"] = Jellyfin::Support::toJsonValue(m_moviePrefix); - result["PreferredLanguage"] = Jellyfin::Support::toJsonValue(m_preferredLanguage); - result["UserAgent"] = Jellyfin::Support::toJsonValue(m_userAgent); - - return result; -} - -QString ListingsProviderInfo::jellyfinId() const { return m_jellyfinId; } - -void ListingsProviderInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString ListingsProviderInfo::type() const { return m_type; } - -void ListingsProviderInfo::setType(QString newType) { - m_type = newType; -} -QString ListingsProviderInfo::username() const { return m_username; } - -void ListingsProviderInfo::setUsername(QString newUsername) { - m_username = newUsername; -} -QString ListingsProviderInfo::password() const { return m_password; } - -void ListingsProviderInfo::setPassword(QString newPassword) { - m_password = newPassword; -} -QString ListingsProviderInfo::listingsId() const { return m_listingsId; } - -void ListingsProviderInfo::setListingsId(QString newListingsId) { - m_listingsId = newListingsId; -} -QString ListingsProviderInfo::zipCode() const { return m_zipCode; } - -void ListingsProviderInfo::setZipCode(QString newZipCode) { - m_zipCode = newZipCode; -} -QString ListingsProviderInfo::country() const { return m_country; } - -void ListingsProviderInfo::setCountry(QString newCountry) { - m_country = newCountry; -} -QString ListingsProviderInfo::path() const { return m_path; } - -void ListingsProviderInfo::setPath(QString newPath) { - m_path = newPath; -} -QStringList ListingsProviderInfo::enabledTuners() const { return m_enabledTuners; } - -void ListingsProviderInfo::setEnabledTuners(QStringList newEnabledTuners) { - m_enabledTuners = newEnabledTuners; -} -bool ListingsProviderInfo::enableAllTuners() const { return m_enableAllTuners; } - -void ListingsProviderInfo::setEnableAllTuners(bool newEnableAllTuners) { - m_enableAllTuners = newEnableAllTuners; -} -QStringList ListingsProviderInfo::newsCategories() const { return m_newsCategories; } - -void ListingsProviderInfo::setNewsCategories(QStringList newNewsCategories) { - m_newsCategories = newNewsCategories; -} -QStringList ListingsProviderInfo::sportsCategories() const { return m_sportsCategories; } - -void ListingsProviderInfo::setSportsCategories(QStringList newSportsCategories) { - m_sportsCategories = newSportsCategories; -} -QStringList ListingsProviderInfo::kidsCategories() const { return m_kidsCategories; } - -void ListingsProviderInfo::setKidsCategories(QStringList newKidsCategories) { - m_kidsCategories = newKidsCategories; -} -QStringList ListingsProviderInfo::movieCategories() const { return m_movieCategories; } - -void ListingsProviderInfo::setMovieCategories(QStringList newMovieCategories) { - m_movieCategories = newMovieCategories; -} -QList> ListingsProviderInfo::channelMappings() const { return m_channelMappings; } - -void ListingsProviderInfo::setChannelMappings(QList> newChannelMappings) { - m_channelMappings = newChannelMappings; -} -QString ListingsProviderInfo::moviePrefix() const { return m_moviePrefix; } - -void ListingsProviderInfo::setMoviePrefix(QString newMoviePrefix) { - m_moviePrefix = newMoviePrefix; -} -QString ListingsProviderInfo::preferredLanguage() const { return m_preferredLanguage; } - -void ListingsProviderInfo::setPreferredLanguage(QString newPreferredLanguage) { - m_preferredLanguage = newPreferredLanguage; -} -QString ListingsProviderInfo::userAgent() const { return m_userAgent; } - -void ListingsProviderInfo::setUserAgent(QString newUserAgent) { - m_userAgent = newUserAgent; -} - -} // NS DTO - -namespace Support { - -using ListingsProviderInfo = Jellyfin::DTO::ListingsProviderInfo; - -template <> -ListingsProviderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ListingsProviderInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/livestreamresponse.cpp b/core/src/DTO/livestreamresponse.cpp deleted file mode 100644 index 04ff98c..0000000 --- a/core/src/DTO/livestreamresponse.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LiveStreamResponse::LiveStreamResponse() {} -LiveStreamResponse::LiveStreamResponse(const LiveStreamResponse &other) : - m_mediaSource(other.m_mediaSource){} - -LiveStreamResponse LiveStreamResponse::fromJson(QJsonObject source) { - LiveStreamResponse instance; - instance.setFromJson(source); - return instance; -} - - -void LiveStreamResponse::setFromJson(QJsonObject source) { - m_mediaSource = Jellyfin::Support::fromJsonValue>(source["MediaSource"]); - -} - -QJsonObject LiveStreamResponse::toJson() { - QJsonObject result; - result["MediaSource"] = Jellyfin::Support::toJsonValue>(m_mediaSource); - - return result; -} - -QSharedPointer LiveStreamResponse::mediaSource() const { return m_mediaSource; } - -void LiveStreamResponse::setMediaSource(QSharedPointer newMediaSource) { - m_mediaSource = newMediaSource; -} - -} // NS DTO - -namespace Support { - -using LiveStreamResponse = Jellyfin::DTO::LiveStreamResponse; - -template <> -LiveStreamResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LiveStreamResponse::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/livetvinfo.cpp b/core/src/DTO/livetvinfo.cpp deleted file mode 100644 index 96853cf..0000000 --- a/core/src/DTO/livetvinfo.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LiveTvInfo::LiveTvInfo() {} -LiveTvInfo::LiveTvInfo(const LiveTvInfo &other) : - m_services(other.m_services), - m_isEnabled(other.m_isEnabled), - m_enabledUsers(other.m_enabledUsers){} - -LiveTvInfo LiveTvInfo::fromJson(QJsonObject source) { - LiveTvInfo instance; - instance.setFromJson(source); - return instance; -} - - -void LiveTvInfo::setFromJson(QJsonObject source) { - m_services = Jellyfin::Support::fromJsonValue>>(source["Services"]); - m_isEnabled = Jellyfin::Support::fromJsonValue(source["IsEnabled"]); - m_enabledUsers = Jellyfin::Support::fromJsonValue(source["EnabledUsers"]); - -} - -QJsonObject LiveTvInfo::toJson() { - QJsonObject result; - result["Services"] = Jellyfin::Support::toJsonValue>>(m_services); - result["IsEnabled"] = Jellyfin::Support::toJsonValue(m_isEnabled); - result["EnabledUsers"] = Jellyfin::Support::toJsonValue(m_enabledUsers); - - return result; -} - -QList> LiveTvInfo::services() const { return m_services; } - -void LiveTvInfo::setServices(QList> newServices) { - m_services = newServices; -} -bool LiveTvInfo::isEnabled() const { return m_isEnabled; } - -void LiveTvInfo::setIsEnabled(bool newIsEnabled) { - m_isEnabled = newIsEnabled; -} -QStringList LiveTvInfo::enabledUsers() const { return m_enabledUsers; } - -void LiveTvInfo::setEnabledUsers(QStringList newEnabledUsers) { - m_enabledUsers = newEnabledUsers; -} - -} // NS DTO - -namespace Support { - -using LiveTvInfo = Jellyfin::DTO::LiveTvInfo; - -template <> -LiveTvInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LiveTvInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/livetvserviceinfo.cpp b/core/src/DTO/livetvserviceinfo.cpp deleted file mode 100644 index dd396b3..0000000 --- a/core/src/DTO/livetvserviceinfo.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LiveTvServiceInfo::LiveTvServiceInfo() {} -LiveTvServiceInfo::LiveTvServiceInfo(const LiveTvServiceInfo &other) : - m_name(other.m_name), - m_homePageUrl(other.m_homePageUrl), - m_status(other.m_status), - m_statusMessage(other.m_statusMessage), - m_version(other.m_version), - m_hasUpdateAvailable(other.m_hasUpdateAvailable), - m_isVisible(other.m_isVisible), - m_tuners(other.m_tuners){} - -LiveTvServiceInfo LiveTvServiceInfo::fromJson(QJsonObject source) { - LiveTvServiceInfo instance; - instance.setFromJson(source); - return instance; -} - - -void LiveTvServiceInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_homePageUrl = Jellyfin::Support::fromJsonValue(source["HomePageUrl"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - m_statusMessage = Jellyfin::Support::fromJsonValue(source["StatusMessage"]); - m_version = Jellyfin::Support::fromJsonValue(source["Version"]); - m_hasUpdateAvailable = Jellyfin::Support::fromJsonValue(source["HasUpdateAvailable"]); - m_isVisible = Jellyfin::Support::fromJsonValue(source["IsVisible"]); - m_tuners = Jellyfin::Support::fromJsonValue(source["Tuners"]); - -} - -QJsonObject LiveTvServiceInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["HomePageUrl"] = Jellyfin::Support::toJsonValue(m_homePageUrl); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - result["StatusMessage"] = Jellyfin::Support::toJsonValue(m_statusMessage); - result["Version"] = Jellyfin::Support::toJsonValue(m_version); - result["HasUpdateAvailable"] = Jellyfin::Support::toJsonValue(m_hasUpdateAvailable); - result["IsVisible"] = Jellyfin::Support::toJsonValue(m_isVisible); - result["Tuners"] = Jellyfin::Support::toJsonValue(m_tuners); - - return result; -} - -QString LiveTvServiceInfo::name() const { return m_name; } - -void LiveTvServiceInfo::setName(QString newName) { - m_name = newName; -} -QString LiveTvServiceInfo::homePageUrl() const { return m_homePageUrl; } - -void LiveTvServiceInfo::setHomePageUrl(QString newHomePageUrl) { - m_homePageUrl = newHomePageUrl; -} -LiveTvServiceStatus LiveTvServiceInfo::status() const { return m_status; } - -void LiveTvServiceInfo::setStatus(LiveTvServiceStatus newStatus) { - m_status = newStatus; -} -QString LiveTvServiceInfo::statusMessage() const { return m_statusMessage; } - -void LiveTvServiceInfo::setStatusMessage(QString newStatusMessage) { - m_statusMessage = newStatusMessage; -} -QString LiveTvServiceInfo::version() const { return m_version; } - -void LiveTvServiceInfo::setVersion(QString newVersion) { - m_version = newVersion; -} -bool LiveTvServiceInfo::hasUpdateAvailable() const { return m_hasUpdateAvailable; } - -void LiveTvServiceInfo::setHasUpdateAvailable(bool newHasUpdateAvailable) { - m_hasUpdateAvailable = newHasUpdateAvailable; -} -bool LiveTvServiceInfo::isVisible() const { return m_isVisible; } - -void LiveTvServiceInfo::setIsVisible(bool newIsVisible) { - m_isVisible = newIsVisible; -} -QStringList LiveTvServiceInfo::tuners() const { return m_tuners; } - -void LiveTvServiceInfo::setTuners(QStringList newTuners) { - m_tuners = newTuners; -} - -} // NS DTO - -namespace Support { - -using LiveTvServiceInfo = Jellyfin::DTO::LiveTvServiceInfo; - -template <> -LiveTvServiceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LiveTvServiceInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/livetvservicestatus.cpp b/core/src/DTO/livetvservicestatus.cpp deleted file mode 100644 index 97e23b2..0000000 --- a/core/src/DTO/livetvservicestatus.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LiveTvServiceStatusClass::LiveTvServiceStatusClass() {} - - -} // NS DTO - -namespace Support { - -using LiveTvServiceStatus = Jellyfin::DTO::LiveTvServiceStatus; - -template <> -LiveTvServiceStatus fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return LiveTvServiceStatus::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Ok")) { - return LiveTvServiceStatus::Ok; - } - if (str == QStringLiteral("Unavailable")) { - return LiveTvServiceStatus::Unavailable; - } - - return LiveTvServiceStatus::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/localizationoption.cpp b/core/src/DTO/localizationoption.cpp deleted file mode 100644 index f12610b..0000000 --- a/core/src/DTO/localizationoption.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LocalizationOption::LocalizationOption() {} -LocalizationOption::LocalizationOption(const LocalizationOption &other) : - m_name(other.m_name), - m_value(other.m_value){} - -LocalizationOption LocalizationOption::fromJson(QJsonObject source) { - LocalizationOption instance; - instance.setFromJson(source); - return instance; -} - - -void LocalizationOption::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - -} - -QJsonObject LocalizationOption::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - - return result; -} - -QString LocalizationOption::name() const { return m_name; } - -void LocalizationOption::setName(QString newName) { - m_name = newName; -} -QString LocalizationOption::value() const { return m_value; } - -void LocalizationOption::setValue(QString newValue) { - m_value = newValue; -} - -} // NS DTO - -namespace Support { - -using LocalizationOption = Jellyfin::DTO::LocalizationOption; - -template <> -LocalizationOption fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LocalizationOption::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/locationtype.cpp b/core/src/DTO/locationtype.cpp deleted file mode 100644 index 4f98273..0000000 --- a/core/src/DTO/locationtype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LocationTypeClass::LocationTypeClass() {} - - -} // NS DTO - -namespace Support { - -using LocationType = Jellyfin::DTO::LocationType; - -template <> -LocationType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return LocationType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("FileSystem")) { - return LocationType::FileSystem; - } - if (str == QStringLiteral("Remote")) { - return LocationType::Remote; - } - if (str == QStringLiteral("Virtual")) { - return LocationType::Virtual; - } - if (str == QStringLiteral("Offline")) { - return LocationType::Offline; - } - - return LocationType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/logfile.cpp b/core/src/DTO/logfile.cpp deleted file mode 100644 index 3bb0f9e..0000000 --- a/core/src/DTO/logfile.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LogFile::LogFile() {} -LogFile::LogFile(const LogFile &other) : - m_dateCreated(other.m_dateCreated), - m_dateModified(other.m_dateModified), - m_size(other.m_size), - m_name(other.m_name){} - -LogFile LogFile::fromJson(QJsonObject source) { - LogFile instance; - instance.setFromJson(source); - return instance; -} - - -void LogFile::setFromJson(QJsonObject source) { - m_dateCreated = Jellyfin::Support::fromJsonValue(source["DateCreated"]); - m_dateModified = Jellyfin::Support::fromJsonValue(source["DateModified"]); - m_size = Jellyfin::Support::fromJsonValue(source["Size"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - -} - -QJsonObject LogFile::toJson() { - QJsonObject result; - result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); - result["DateModified"] = Jellyfin::Support::toJsonValue(m_dateModified); - result["Size"] = Jellyfin::Support::toJsonValue(m_size); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - - return result; -} - -QDateTime LogFile::dateCreated() const { return m_dateCreated; } - -void LogFile::setDateCreated(QDateTime newDateCreated) { - m_dateCreated = newDateCreated; -} -QDateTime LogFile::dateModified() const { return m_dateModified; } - -void LogFile::setDateModified(QDateTime newDateModified) { - m_dateModified = newDateModified; -} -qint64 LogFile::size() const { return m_size; } - -void LogFile::setSize(qint64 newSize) { - m_size = newSize; -} -QString LogFile::name() const { return m_name; } - -void LogFile::setName(QString newName) { - m_name = newName; -} - -} // NS DTO - -namespace Support { - -using LogFile = Jellyfin::DTO::LogFile; - -template <> -LogFile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return LogFile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/loglevel.cpp b/core/src/DTO/loglevel.cpp deleted file mode 100644 index 04af5dc..0000000 --- a/core/src/DTO/loglevel.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -LogLevelClass::LogLevelClass() {} - - -} // NS DTO - -namespace Support { - -using LogLevel = Jellyfin::DTO::LogLevel; - -template <> -LogLevel fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return LogLevel::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Trace")) { - return LogLevel::Trace; - } - if (str == QStringLiteral("Debug")) { - return LogLevel::Debug; - } - if (str == QStringLiteral("Information")) { - return LogLevel::Information; - } - if (str == QStringLiteral("Warning")) { - return LogLevel::Warning; - } - if (str == QStringLiteral("Error")) { - return LogLevel::Error; - } - if (str == QStringLiteral("Critical")) { - return LogLevel::Critical; - } - if (str == QStringLiteral("None")) { - return LogLevel::None; - } - - return LogLevel::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediaattachment.cpp b/core/src/DTO/mediaattachment.cpp deleted file mode 100644 index 1bab8c4..0000000 --- a/core/src/DTO/mediaattachment.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaAttachment::MediaAttachment() {} -MediaAttachment::MediaAttachment(const MediaAttachment &other) : - m_codec(other.m_codec), - m_codecTag(other.m_codecTag), - m_comment(other.m_comment), - m_index(other.m_index), - m_fileName(other.m_fileName), - m_mimeType(other.m_mimeType), - m_deliveryUrl(other.m_deliveryUrl){} - -MediaAttachment MediaAttachment::fromJson(QJsonObject source) { - MediaAttachment instance; - instance.setFromJson(source); - return instance; -} - - -void MediaAttachment::setFromJson(QJsonObject source) { - m_codec = Jellyfin::Support::fromJsonValue(source["Codec"]); - m_codecTag = Jellyfin::Support::fromJsonValue(source["CodecTag"]); - m_comment = Jellyfin::Support::fromJsonValue(source["Comment"]); - m_index = Jellyfin::Support::fromJsonValue(source["Index"]); - m_fileName = Jellyfin::Support::fromJsonValue(source["FileName"]); - m_mimeType = Jellyfin::Support::fromJsonValue(source["MimeType"]); - m_deliveryUrl = Jellyfin::Support::fromJsonValue(source["DeliveryUrl"]); - -} - -QJsonObject MediaAttachment::toJson() { - QJsonObject result; - result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); - result["CodecTag"] = Jellyfin::Support::toJsonValue(m_codecTag); - result["Comment"] = Jellyfin::Support::toJsonValue(m_comment); - result["Index"] = Jellyfin::Support::toJsonValue(m_index); - result["FileName"] = Jellyfin::Support::toJsonValue(m_fileName); - result["MimeType"] = Jellyfin::Support::toJsonValue(m_mimeType); - result["DeliveryUrl"] = Jellyfin::Support::toJsonValue(m_deliveryUrl); - - return result; -} - -QString MediaAttachment::codec() const { return m_codec; } - -void MediaAttachment::setCodec(QString newCodec) { - m_codec = newCodec; -} -QString MediaAttachment::codecTag() const { return m_codecTag; } - -void MediaAttachment::setCodecTag(QString newCodecTag) { - m_codecTag = newCodecTag; -} -QString MediaAttachment::comment() const { return m_comment; } - -void MediaAttachment::setComment(QString newComment) { - m_comment = newComment; -} -qint32 MediaAttachment::index() const { return m_index; } - -void MediaAttachment::setIndex(qint32 newIndex) { - m_index = newIndex; -} -QString MediaAttachment::fileName() const { return m_fileName; } - -void MediaAttachment::setFileName(QString newFileName) { - m_fileName = newFileName; -} -QString MediaAttachment::mimeType() const { return m_mimeType; } - -void MediaAttachment::setMimeType(QString newMimeType) { - m_mimeType = newMimeType; -} -QString MediaAttachment::deliveryUrl() const { return m_deliveryUrl; } - -void MediaAttachment::setDeliveryUrl(QString newDeliveryUrl) { - m_deliveryUrl = newDeliveryUrl; -} - -} // NS DTO - -namespace Support { - -using MediaAttachment = Jellyfin::DTO::MediaAttachment; - -template <> -MediaAttachment fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaAttachment::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediaencoderpathdto.cpp b/core/src/DTO/mediaencoderpathdto.cpp deleted file mode 100644 index 7476b96..0000000 --- a/core/src/DTO/mediaencoderpathdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaEncoderPathDto::MediaEncoderPathDto() {} -MediaEncoderPathDto::MediaEncoderPathDto(const MediaEncoderPathDto &other) : - m_path(other.m_path), - m_pathType(other.m_pathType){} - -MediaEncoderPathDto MediaEncoderPathDto::fromJson(QJsonObject source) { - MediaEncoderPathDto instance; - instance.setFromJson(source); - return instance; -} - - -void MediaEncoderPathDto::setFromJson(QJsonObject source) { - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_pathType = Jellyfin::Support::fromJsonValue(source["PathType"]); - -} - -QJsonObject MediaEncoderPathDto::toJson() { - QJsonObject result; - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["PathType"] = Jellyfin::Support::toJsonValue(m_pathType); - - return result; -} - -QString MediaEncoderPathDto::path() const { return m_path; } - -void MediaEncoderPathDto::setPath(QString newPath) { - m_path = newPath; -} -QString MediaEncoderPathDto::pathType() const { return m_pathType; } - -void MediaEncoderPathDto::setPathType(QString newPathType) { - m_pathType = newPathType; -} - -} // NS DTO - -namespace Support { - -using MediaEncoderPathDto = Jellyfin::DTO::MediaEncoderPathDto; - -template <> -MediaEncoderPathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaEncoderPathDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediapathdto.cpp b/core/src/DTO/mediapathdto.cpp deleted file mode 100644 index ffe4c27..0000000 --- a/core/src/DTO/mediapathdto.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaPathDto::MediaPathDto() {} -MediaPathDto::MediaPathDto(const MediaPathDto &other) : - m_name(other.m_name), - m_path(other.m_path), - m_pathInfo(other.m_pathInfo){} - -MediaPathDto MediaPathDto::fromJson(QJsonObject source) { - MediaPathDto instance; - instance.setFromJson(source); - return instance; -} - - -void MediaPathDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_pathInfo = Jellyfin::Support::fromJsonValue>(source["PathInfo"]); - -} - -QJsonObject MediaPathDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["PathInfo"] = Jellyfin::Support::toJsonValue>(m_pathInfo); - - return result; -} - -QString MediaPathDto::name() const { return m_name; } - -void MediaPathDto::setName(QString newName) { - m_name = newName; -} -QString MediaPathDto::path() const { return m_path; } - -void MediaPathDto::setPath(QString newPath) { - m_path = newPath; -} -QSharedPointer MediaPathDto::pathInfo() const { return m_pathInfo; } - -void MediaPathDto::setPathInfo(QSharedPointer newPathInfo) { - m_pathInfo = newPathInfo; -} - -} // NS DTO - -namespace Support { - -using MediaPathDto = Jellyfin::DTO::MediaPathDto; - -template <> -MediaPathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaPathDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediapathinfo.cpp b/core/src/DTO/mediapathinfo.cpp deleted file mode 100644 index 8f3a0f0..0000000 --- a/core/src/DTO/mediapathinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaPathInfo::MediaPathInfo() {} -MediaPathInfo::MediaPathInfo(const MediaPathInfo &other) : - m_path(other.m_path), - m_networkPath(other.m_networkPath){} - -MediaPathInfo MediaPathInfo::fromJson(QJsonObject source) { - MediaPathInfo instance; - instance.setFromJson(source); - return instance; -} - - -void MediaPathInfo::setFromJson(QJsonObject source) { - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_networkPath = Jellyfin::Support::fromJsonValue(source["NetworkPath"]); - -} - -QJsonObject MediaPathInfo::toJson() { - QJsonObject result; - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["NetworkPath"] = Jellyfin::Support::toJsonValue(m_networkPath); - - return result; -} - -QString MediaPathInfo::path() const { return m_path; } - -void MediaPathInfo::setPath(QString newPath) { - m_path = newPath; -} -QString MediaPathInfo::networkPath() const { return m_networkPath; } - -void MediaPathInfo::setNetworkPath(QString newNetworkPath) { - m_networkPath = newNetworkPath; -} - -} // NS DTO - -namespace Support { - -using MediaPathInfo = Jellyfin::DTO::MediaPathInfo; - -template <> -MediaPathInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaPathInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediaprotocol.cpp b/core/src/DTO/mediaprotocol.cpp deleted file mode 100644 index 21cde8a..0000000 --- a/core/src/DTO/mediaprotocol.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaProtocolClass::MediaProtocolClass() {} - - -} // NS DTO - -namespace Support { - -using MediaProtocol = Jellyfin::DTO::MediaProtocol; - -template <> -MediaProtocol fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return MediaProtocol::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("File")) { - return MediaProtocol::File; - } - if (str == QStringLiteral("Http")) { - return MediaProtocol::Http; - } - if (str == QStringLiteral("Rtmp")) { - return MediaProtocol::Rtmp; - } - if (str == QStringLiteral("Rtsp")) { - return MediaProtocol::Rtsp; - } - if (str == QStringLiteral("Udp")) { - return MediaProtocol::Udp; - } - if (str == QStringLiteral("Rtp")) { - return MediaProtocol::Rtp; - } - if (str == QStringLiteral("Ftp")) { - return MediaProtocol::Ftp; - } - - return MediaProtocol::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediasourceinfo.cpp b/core/src/DTO/mediasourceinfo.cpp deleted file mode 100644 index 8444afb..0000000 --- a/core/src/DTO/mediasourceinfo.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaSourceInfo::MediaSourceInfo() {} -MediaSourceInfo::MediaSourceInfo(const MediaSourceInfo &other) : - m_protocol(other.m_protocol), - m_jellyfinId(other.m_jellyfinId), - m_path(other.m_path), - m_encoderPath(other.m_encoderPath), - m_encoderProtocol(other.m_encoderProtocol), - m_type(other.m_type), - m_container(other.m_container), - m_size(other.m_size), - m_name(other.m_name), - m_isRemote(other.m_isRemote), - m_eTag(other.m_eTag), - m_runTimeTicks(other.m_runTimeTicks), - m_readAtNativeFramerate(other.m_readAtNativeFramerate), - m_ignoreDts(other.m_ignoreDts), - m_ignoreIndex(other.m_ignoreIndex), - m_genPtsInput(other.m_genPtsInput), - m_supportsTranscoding(other.m_supportsTranscoding), - m_supportsDirectStream(other.m_supportsDirectStream), - m_supportsDirectPlay(other.m_supportsDirectPlay), - m_isInfiniteStream(other.m_isInfiniteStream), - m_requiresOpening(other.m_requiresOpening), - m_openToken(other.m_openToken), - m_requiresClosing(other.m_requiresClosing), - m_liveStreamId(other.m_liveStreamId), - m_bufferMs(other.m_bufferMs), - m_requiresLooping(other.m_requiresLooping), - m_supportsProbing(other.m_supportsProbing), - m_videoType(other.m_videoType), - m_isoType(other.m_isoType), - m_video3DFormat(other.m_video3DFormat), - m_mediaStreams(other.m_mediaStreams), - m_mediaAttachments(other.m_mediaAttachments), - m_formats(other.m_formats), - m_bitrate(other.m_bitrate), - m_timestamp(other.m_timestamp), - m_requiredHttpHeaders(other.m_requiredHttpHeaders), - m_transcodingUrl(other.m_transcodingUrl), - m_transcodingSubProtocol(other.m_transcodingSubProtocol), - m_transcodingContainer(other.m_transcodingContainer), - m_analyzeDurationMs(other.m_analyzeDurationMs), - m_defaultAudioStreamIndex(other.m_defaultAudioStreamIndex), - m_defaultSubtitleStreamIndex(other.m_defaultSubtitleStreamIndex){} - -MediaSourceInfo MediaSourceInfo::fromJson(QJsonObject source) { - MediaSourceInfo instance; - instance.setFromJson(source); - return instance; -} - - -void MediaSourceInfo::setFromJson(QJsonObject source) { - m_protocol = Jellyfin::Support::fromJsonValue(source["Protocol"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_encoderPath = Jellyfin::Support::fromJsonValue(source["EncoderPath"]); - m_encoderProtocol = Jellyfin::Support::fromJsonValue(source["EncoderProtocol"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_size = Jellyfin::Support::fromJsonValue(source["Size"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_isRemote = Jellyfin::Support::fromJsonValue(source["IsRemote"]); - m_eTag = Jellyfin::Support::fromJsonValue(source["ETag"]); - m_runTimeTicks = Jellyfin::Support::fromJsonValue(source["RunTimeTicks"]); - m_readAtNativeFramerate = Jellyfin::Support::fromJsonValue(source["ReadAtNativeFramerate"]); - m_ignoreDts = Jellyfin::Support::fromJsonValue(source["IgnoreDts"]); - m_ignoreIndex = Jellyfin::Support::fromJsonValue(source["IgnoreIndex"]); - m_genPtsInput = Jellyfin::Support::fromJsonValue(source["GenPtsInput"]); - m_supportsTranscoding = Jellyfin::Support::fromJsonValue(source["SupportsTranscoding"]); - m_supportsDirectStream = Jellyfin::Support::fromJsonValue(source["SupportsDirectStream"]); - m_supportsDirectPlay = Jellyfin::Support::fromJsonValue(source["SupportsDirectPlay"]); - m_isInfiniteStream = Jellyfin::Support::fromJsonValue(source["IsInfiniteStream"]); - m_requiresOpening = Jellyfin::Support::fromJsonValue(source["RequiresOpening"]); - m_openToken = Jellyfin::Support::fromJsonValue(source["OpenToken"]); - m_requiresClosing = Jellyfin::Support::fromJsonValue(source["RequiresClosing"]); - m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); - m_bufferMs = Jellyfin::Support::fromJsonValue(source["BufferMs"]); - m_requiresLooping = Jellyfin::Support::fromJsonValue(source["RequiresLooping"]); - m_supportsProbing = Jellyfin::Support::fromJsonValue(source["SupportsProbing"]); - m_videoType = Jellyfin::Support::fromJsonValue(source["VideoType"]); - m_isoType = Jellyfin::Support::fromJsonValue(source["IsoType"]); - m_video3DFormat = Jellyfin::Support::fromJsonValue(source["Video3DFormat"]); - m_mediaStreams = Jellyfin::Support::fromJsonValue>>(source["MediaStreams"]); - m_mediaAttachments = Jellyfin::Support::fromJsonValue>>(source["MediaAttachments"]); - m_formats = Jellyfin::Support::fromJsonValue(source["Formats"]); - m_bitrate = Jellyfin::Support::fromJsonValue(source["Bitrate"]); - m_timestamp = Jellyfin::Support::fromJsonValue(source["Timestamp"]); - m_requiredHttpHeaders = Jellyfin::Support::fromJsonValue(source["RequiredHttpHeaders"]); - m_transcodingUrl = Jellyfin::Support::fromJsonValue(source["TranscodingUrl"]); - m_transcodingSubProtocol = Jellyfin::Support::fromJsonValue(source["TranscodingSubProtocol"]); - m_transcodingContainer = Jellyfin::Support::fromJsonValue(source["TranscodingContainer"]); - m_analyzeDurationMs = Jellyfin::Support::fromJsonValue(source["AnalyzeDurationMs"]); - m_defaultAudioStreamIndex = Jellyfin::Support::fromJsonValue(source["DefaultAudioStreamIndex"]); - m_defaultSubtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["DefaultSubtitleStreamIndex"]); - -} - -QJsonObject MediaSourceInfo::toJson() { - QJsonObject result; - result["Protocol"] = Jellyfin::Support::toJsonValue(m_protocol); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["EncoderPath"] = Jellyfin::Support::toJsonValue(m_encoderPath); - result["EncoderProtocol"] = Jellyfin::Support::toJsonValue(m_encoderProtocol); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["Size"] = Jellyfin::Support::toJsonValue(m_size); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["IsRemote"] = Jellyfin::Support::toJsonValue(m_isRemote); - result["ETag"] = Jellyfin::Support::toJsonValue(m_eTag); - result["RunTimeTicks"] = Jellyfin::Support::toJsonValue(m_runTimeTicks); - result["ReadAtNativeFramerate"] = Jellyfin::Support::toJsonValue(m_readAtNativeFramerate); - result["IgnoreDts"] = Jellyfin::Support::toJsonValue(m_ignoreDts); - result["IgnoreIndex"] = Jellyfin::Support::toJsonValue(m_ignoreIndex); - result["GenPtsInput"] = Jellyfin::Support::toJsonValue(m_genPtsInput); - result["SupportsTranscoding"] = Jellyfin::Support::toJsonValue(m_supportsTranscoding); - result["SupportsDirectStream"] = Jellyfin::Support::toJsonValue(m_supportsDirectStream); - result["SupportsDirectPlay"] = Jellyfin::Support::toJsonValue(m_supportsDirectPlay); - result["IsInfiniteStream"] = Jellyfin::Support::toJsonValue(m_isInfiniteStream); - result["RequiresOpening"] = Jellyfin::Support::toJsonValue(m_requiresOpening); - result["OpenToken"] = Jellyfin::Support::toJsonValue(m_openToken); - result["RequiresClosing"] = Jellyfin::Support::toJsonValue(m_requiresClosing); - result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); - result["BufferMs"] = Jellyfin::Support::toJsonValue(m_bufferMs); - result["RequiresLooping"] = Jellyfin::Support::toJsonValue(m_requiresLooping); - result["SupportsProbing"] = Jellyfin::Support::toJsonValue(m_supportsProbing); - result["VideoType"] = Jellyfin::Support::toJsonValue(m_videoType); - result["IsoType"] = Jellyfin::Support::toJsonValue(m_isoType); - result["Video3DFormat"] = Jellyfin::Support::toJsonValue(m_video3DFormat); - result["MediaStreams"] = Jellyfin::Support::toJsonValue>>(m_mediaStreams); - result["MediaAttachments"] = Jellyfin::Support::toJsonValue>>(m_mediaAttachments); - result["Formats"] = Jellyfin::Support::toJsonValue(m_formats); - result["Bitrate"] = Jellyfin::Support::toJsonValue(m_bitrate); - result["Timestamp"] = Jellyfin::Support::toJsonValue(m_timestamp); - result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue(m_requiredHttpHeaders); - result["TranscodingUrl"] = Jellyfin::Support::toJsonValue(m_transcodingUrl); - result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue(m_transcodingSubProtocol); - result["TranscodingContainer"] = Jellyfin::Support::toJsonValue(m_transcodingContainer); - result["AnalyzeDurationMs"] = Jellyfin::Support::toJsonValue(m_analyzeDurationMs); - result["DefaultAudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_defaultAudioStreamIndex); - result["DefaultSubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_defaultSubtitleStreamIndex); - - return result; -} - -MediaProtocol MediaSourceInfo::protocol() const { return m_protocol; } - -void MediaSourceInfo::setProtocol(MediaProtocol newProtocol) { - m_protocol = newProtocol; -} -QString MediaSourceInfo::jellyfinId() const { return m_jellyfinId; } - -void MediaSourceInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString MediaSourceInfo::path() const { return m_path; } - -void MediaSourceInfo::setPath(QString newPath) { - m_path = newPath; -} -QString MediaSourceInfo::encoderPath() const { return m_encoderPath; } - -void MediaSourceInfo::setEncoderPath(QString newEncoderPath) { - m_encoderPath = newEncoderPath; -} -MediaProtocol MediaSourceInfo::encoderProtocol() const { return m_encoderProtocol; } - -void MediaSourceInfo::setEncoderProtocol(MediaProtocol newEncoderProtocol) { - m_encoderProtocol = newEncoderProtocol; -} -MediaSourceType MediaSourceInfo::type() const { return m_type; } - -void MediaSourceInfo::setType(MediaSourceType newType) { - m_type = newType; -} -QString MediaSourceInfo::container() const { return m_container; } - -void MediaSourceInfo::setContainer(QString newContainer) { - m_container = newContainer; -} -qint64 MediaSourceInfo::size() const { return m_size; } - -void MediaSourceInfo::setSize(qint64 newSize) { - m_size = newSize; -} -QString MediaSourceInfo::name() const { return m_name; } - -void MediaSourceInfo::setName(QString newName) { - m_name = newName; -} -bool MediaSourceInfo::isRemote() const { return m_isRemote; } - -void MediaSourceInfo::setIsRemote(bool newIsRemote) { - m_isRemote = newIsRemote; -} -QString MediaSourceInfo::eTag() const { return m_eTag; } - -void MediaSourceInfo::setETag(QString newETag) { - m_eTag = newETag; -} -qint64 MediaSourceInfo::runTimeTicks() const { return m_runTimeTicks; } - -void MediaSourceInfo::setRunTimeTicks(qint64 newRunTimeTicks) { - m_runTimeTicks = newRunTimeTicks; -} -bool MediaSourceInfo::readAtNativeFramerate() const { return m_readAtNativeFramerate; } - -void MediaSourceInfo::setReadAtNativeFramerate(bool newReadAtNativeFramerate) { - m_readAtNativeFramerate = newReadAtNativeFramerate; -} -bool MediaSourceInfo::ignoreDts() const { return m_ignoreDts; } - -void MediaSourceInfo::setIgnoreDts(bool newIgnoreDts) { - m_ignoreDts = newIgnoreDts; -} -bool MediaSourceInfo::ignoreIndex() const { return m_ignoreIndex; } - -void MediaSourceInfo::setIgnoreIndex(bool newIgnoreIndex) { - m_ignoreIndex = newIgnoreIndex; -} -bool MediaSourceInfo::genPtsInput() const { return m_genPtsInput; } - -void MediaSourceInfo::setGenPtsInput(bool newGenPtsInput) { - m_genPtsInput = newGenPtsInput; -} -bool MediaSourceInfo::supportsTranscoding() const { return m_supportsTranscoding; } - -void MediaSourceInfo::setSupportsTranscoding(bool newSupportsTranscoding) { - m_supportsTranscoding = newSupportsTranscoding; -} -bool MediaSourceInfo::supportsDirectStream() const { return m_supportsDirectStream; } - -void MediaSourceInfo::setSupportsDirectStream(bool newSupportsDirectStream) { - m_supportsDirectStream = newSupportsDirectStream; -} -bool MediaSourceInfo::supportsDirectPlay() const { return m_supportsDirectPlay; } - -void MediaSourceInfo::setSupportsDirectPlay(bool newSupportsDirectPlay) { - m_supportsDirectPlay = newSupportsDirectPlay; -} -bool MediaSourceInfo::isInfiniteStream() const { return m_isInfiniteStream; } - -void MediaSourceInfo::setIsInfiniteStream(bool newIsInfiniteStream) { - m_isInfiniteStream = newIsInfiniteStream; -} -bool MediaSourceInfo::requiresOpening() const { return m_requiresOpening; } - -void MediaSourceInfo::setRequiresOpening(bool newRequiresOpening) { - m_requiresOpening = newRequiresOpening; -} -QString MediaSourceInfo::openToken() const { return m_openToken; } - -void MediaSourceInfo::setOpenToken(QString newOpenToken) { - m_openToken = newOpenToken; -} -bool MediaSourceInfo::requiresClosing() const { return m_requiresClosing; } - -void MediaSourceInfo::setRequiresClosing(bool newRequiresClosing) { - m_requiresClosing = newRequiresClosing; -} -QString MediaSourceInfo::liveStreamId() const { return m_liveStreamId; } - -void MediaSourceInfo::setLiveStreamId(QString newLiveStreamId) { - m_liveStreamId = newLiveStreamId; -} -qint32 MediaSourceInfo::bufferMs() const { return m_bufferMs; } - -void MediaSourceInfo::setBufferMs(qint32 newBufferMs) { - m_bufferMs = newBufferMs; -} -bool MediaSourceInfo::requiresLooping() const { return m_requiresLooping; } - -void MediaSourceInfo::setRequiresLooping(bool newRequiresLooping) { - m_requiresLooping = newRequiresLooping; -} -bool MediaSourceInfo::supportsProbing() const { return m_supportsProbing; } - -void MediaSourceInfo::setSupportsProbing(bool newSupportsProbing) { - m_supportsProbing = newSupportsProbing; -} -VideoType MediaSourceInfo::videoType() const { return m_videoType; } - -void MediaSourceInfo::setVideoType(VideoType newVideoType) { - m_videoType = newVideoType; -} -IsoType MediaSourceInfo::isoType() const { return m_isoType; } - -void MediaSourceInfo::setIsoType(IsoType newIsoType) { - m_isoType = newIsoType; -} -Video3DFormat MediaSourceInfo::video3DFormat() const { return m_video3DFormat; } - -void MediaSourceInfo::setVideo3DFormat(Video3DFormat newVideo3DFormat) { - m_video3DFormat = newVideo3DFormat; -} -QList> MediaSourceInfo::mediaStreams() const { return m_mediaStreams; } - -void MediaSourceInfo::setMediaStreams(QList> newMediaStreams) { - m_mediaStreams = newMediaStreams; -} -QList> MediaSourceInfo::mediaAttachments() const { return m_mediaAttachments; } - -void MediaSourceInfo::setMediaAttachments(QList> newMediaAttachments) { - m_mediaAttachments = newMediaAttachments; -} -QStringList MediaSourceInfo::formats() const { return m_formats; } - -void MediaSourceInfo::setFormats(QStringList newFormats) { - m_formats = newFormats; -} -qint32 MediaSourceInfo::bitrate() const { return m_bitrate; } - -void MediaSourceInfo::setBitrate(qint32 newBitrate) { - m_bitrate = newBitrate; -} -TransportStreamTimestamp MediaSourceInfo::timestamp() const { return m_timestamp; } - -void MediaSourceInfo::setTimestamp(TransportStreamTimestamp newTimestamp) { - m_timestamp = newTimestamp; -} -QJsonObject MediaSourceInfo::requiredHttpHeaders() const { return m_requiredHttpHeaders; } - -void MediaSourceInfo::setRequiredHttpHeaders(QJsonObject newRequiredHttpHeaders) { - m_requiredHttpHeaders = newRequiredHttpHeaders; -} -QString MediaSourceInfo::transcodingUrl() const { return m_transcodingUrl; } - -void MediaSourceInfo::setTranscodingUrl(QString newTranscodingUrl) { - m_transcodingUrl = newTranscodingUrl; -} -QString MediaSourceInfo::transcodingSubProtocol() const { return m_transcodingSubProtocol; } - -void MediaSourceInfo::setTranscodingSubProtocol(QString newTranscodingSubProtocol) { - m_transcodingSubProtocol = newTranscodingSubProtocol; -} -QString MediaSourceInfo::transcodingContainer() const { return m_transcodingContainer; } - -void MediaSourceInfo::setTranscodingContainer(QString newTranscodingContainer) { - m_transcodingContainer = newTranscodingContainer; -} -qint32 MediaSourceInfo::analyzeDurationMs() const { return m_analyzeDurationMs; } - -void MediaSourceInfo::setAnalyzeDurationMs(qint32 newAnalyzeDurationMs) { - m_analyzeDurationMs = newAnalyzeDurationMs; -} -qint32 MediaSourceInfo::defaultAudioStreamIndex() const { return m_defaultAudioStreamIndex; } - -void MediaSourceInfo::setDefaultAudioStreamIndex(qint32 newDefaultAudioStreamIndex) { - m_defaultAudioStreamIndex = newDefaultAudioStreamIndex; -} -qint32 MediaSourceInfo::defaultSubtitleStreamIndex() const { return m_defaultSubtitleStreamIndex; } - -void MediaSourceInfo::setDefaultSubtitleStreamIndex(qint32 newDefaultSubtitleStreamIndex) { - m_defaultSubtitleStreamIndex = newDefaultSubtitleStreamIndex; -} - -} // NS DTO - -namespace Support { - -using MediaSourceInfo = Jellyfin::DTO::MediaSourceInfo; - -template <> -MediaSourceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaSourceInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediasourcetype.cpp b/core/src/DTO/mediasourcetype.cpp deleted file mode 100644 index 80f9857..0000000 --- a/core/src/DTO/mediasourcetype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaSourceTypeClass::MediaSourceTypeClass() {} - - -} // NS DTO - -namespace Support { - -using MediaSourceType = Jellyfin::DTO::MediaSourceType; - -template <> -MediaSourceType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return MediaSourceType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Default")) { - return MediaSourceType::Default; - } - if (str == QStringLiteral("Grouping")) { - return MediaSourceType::Grouping; - } - if (str == QStringLiteral("Placeholder")) { - return MediaSourceType::Placeholder; - } - - return MediaSourceType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediastream.cpp b/core/src/DTO/mediastream.cpp deleted file mode 100644 index 57f2706..0000000 --- a/core/src/DTO/mediastream.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaStream::MediaStream() {} -MediaStream::MediaStream(const MediaStream &other) : - m_codec(other.m_codec), - m_codecTag(other.m_codecTag), - m_language(other.m_language), - m_colorRange(other.m_colorRange), - m_colorSpace(other.m_colorSpace), - m_colorTransfer(other.m_colorTransfer), - m_colorPrimaries(other.m_colorPrimaries), - m_comment(other.m_comment), - m_timeBase(other.m_timeBase), - m_codecTimeBase(other.m_codecTimeBase), - m_title(other.m_title), - m_videoRange(other.m_videoRange), - m_localizedUndefined(other.m_localizedUndefined), - m_localizedDefault(other.m_localizedDefault), - m_localizedForced(other.m_localizedForced), - m_displayTitle(other.m_displayTitle), - m_nalLengthSize(other.m_nalLengthSize), - m_isInterlaced(other.m_isInterlaced), - m_isAVC(other.m_isAVC), - m_channelLayout(other.m_channelLayout), - m_bitRate(other.m_bitRate), - m_bitDepth(other.m_bitDepth), - m_refFrames(other.m_refFrames), - m_packetLength(other.m_packetLength), - m_channels(other.m_channels), - m_sampleRate(other.m_sampleRate), - m_isDefault(other.m_isDefault), - m_isForced(other.m_isForced), - m_height(other.m_height), - m_width(other.m_width), - m_averageFrameRate(other.m_averageFrameRate), - m_realFrameRate(other.m_realFrameRate), - m_profile(other.m_profile), - m_type(other.m_type), - m_aspectRatio(other.m_aspectRatio), - m_index(other.m_index), - m_score(other.m_score), - m_isExternal(other.m_isExternal), - m_deliveryMethod(other.m_deliveryMethod), - m_deliveryUrl(other.m_deliveryUrl), - m_isExternalUrl(other.m_isExternalUrl), - m_isTextSubtitleStream(other.m_isTextSubtitleStream), - m_supportsExternalStream(other.m_supportsExternalStream), - m_path(other.m_path), - m_pixelFormat(other.m_pixelFormat), - m_level(other.m_level), - m_isAnamorphic(other.m_isAnamorphic){} - -MediaStream MediaStream::fromJson(QJsonObject source) { - MediaStream instance; - instance.setFromJson(source); - return instance; -} - - -void MediaStream::setFromJson(QJsonObject source) { - m_codec = Jellyfin::Support::fromJsonValue(source["Codec"]); - m_codecTag = Jellyfin::Support::fromJsonValue(source["CodecTag"]); - m_language = Jellyfin::Support::fromJsonValue(source["Language"]); - m_colorRange = Jellyfin::Support::fromJsonValue(source["ColorRange"]); - m_colorSpace = Jellyfin::Support::fromJsonValue(source["ColorSpace"]); - m_colorTransfer = Jellyfin::Support::fromJsonValue(source["ColorTransfer"]); - m_colorPrimaries = Jellyfin::Support::fromJsonValue(source["ColorPrimaries"]); - m_comment = Jellyfin::Support::fromJsonValue(source["Comment"]); - m_timeBase = Jellyfin::Support::fromJsonValue(source["TimeBase"]); - m_codecTimeBase = Jellyfin::Support::fromJsonValue(source["CodecTimeBase"]); - m_title = Jellyfin::Support::fromJsonValue(source["Title"]); - m_videoRange = Jellyfin::Support::fromJsonValue(source["VideoRange"]); - m_localizedUndefined = Jellyfin::Support::fromJsonValue(source["localizedUndefined"]); - m_localizedDefault = Jellyfin::Support::fromJsonValue(source["localizedDefault"]); - m_localizedForced = Jellyfin::Support::fromJsonValue(source["localizedForced"]); - m_displayTitle = Jellyfin::Support::fromJsonValue(source["DisplayTitle"]); - m_nalLengthSize = Jellyfin::Support::fromJsonValue(source["NalLengthSize"]); - m_isInterlaced = Jellyfin::Support::fromJsonValue(source["IsInterlaced"]); - m_isAVC = Jellyfin::Support::fromJsonValue(source["IsAVC"]); - m_channelLayout = Jellyfin::Support::fromJsonValue(source["ChannelLayout"]); - m_bitRate = Jellyfin::Support::fromJsonValue(source["BitRate"]); - m_bitDepth = Jellyfin::Support::fromJsonValue(source["BitDepth"]); - m_refFrames = Jellyfin::Support::fromJsonValue(source["RefFrames"]); - m_packetLength = Jellyfin::Support::fromJsonValue(source["PacketLength"]); - m_channels = Jellyfin::Support::fromJsonValue(source["Channels"]); - m_sampleRate = Jellyfin::Support::fromJsonValue(source["SampleRate"]); - m_isDefault = Jellyfin::Support::fromJsonValue(source["IsDefault"]); - m_isForced = Jellyfin::Support::fromJsonValue(source["IsForced"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_averageFrameRate = Jellyfin::Support::fromJsonValue(source["AverageFrameRate"]); - m_realFrameRate = Jellyfin::Support::fromJsonValue(source["RealFrameRate"]); - m_profile = Jellyfin::Support::fromJsonValue(source["Profile"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_aspectRatio = Jellyfin::Support::fromJsonValue(source["AspectRatio"]); - m_index = Jellyfin::Support::fromJsonValue(source["Index"]); - m_score = Jellyfin::Support::fromJsonValue(source["Score"]); - m_isExternal = Jellyfin::Support::fromJsonValue(source["IsExternal"]); - m_deliveryMethod = Jellyfin::Support::fromJsonValue(source["DeliveryMethod"]); - m_deliveryUrl = Jellyfin::Support::fromJsonValue(source["DeliveryUrl"]); - m_isExternalUrl = Jellyfin::Support::fromJsonValue(source["IsExternalUrl"]); - m_isTextSubtitleStream = Jellyfin::Support::fromJsonValue(source["IsTextSubtitleStream"]); - m_supportsExternalStream = Jellyfin::Support::fromJsonValue(source["SupportsExternalStream"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_pixelFormat = Jellyfin::Support::fromJsonValue(source["PixelFormat"]); - m_level = Jellyfin::Support::fromJsonValue(source["Level"]); - m_isAnamorphic = Jellyfin::Support::fromJsonValue(source["IsAnamorphic"]); - -} - -QJsonObject MediaStream::toJson() { - QJsonObject result; - result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); - result["CodecTag"] = Jellyfin::Support::toJsonValue(m_codecTag); - result["Language"] = Jellyfin::Support::toJsonValue(m_language); - result["ColorRange"] = Jellyfin::Support::toJsonValue(m_colorRange); - result["ColorSpace"] = Jellyfin::Support::toJsonValue(m_colorSpace); - result["ColorTransfer"] = Jellyfin::Support::toJsonValue(m_colorTransfer); - result["ColorPrimaries"] = Jellyfin::Support::toJsonValue(m_colorPrimaries); - result["Comment"] = Jellyfin::Support::toJsonValue(m_comment); - result["TimeBase"] = Jellyfin::Support::toJsonValue(m_timeBase); - result["CodecTimeBase"] = Jellyfin::Support::toJsonValue(m_codecTimeBase); - result["Title"] = Jellyfin::Support::toJsonValue(m_title); - result["VideoRange"] = Jellyfin::Support::toJsonValue(m_videoRange); - result["localizedUndefined"] = Jellyfin::Support::toJsonValue(m_localizedUndefined); - result["localizedDefault"] = Jellyfin::Support::toJsonValue(m_localizedDefault); - result["localizedForced"] = Jellyfin::Support::toJsonValue(m_localizedForced); - result["DisplayTitle"] = Jellyfin::Support::toJsonValue(m_displayTitle); - result["NalLengthSize"] = Jellyfin::Support::toJsonValue(m_nalLengthSize); - result["IsInterlaced"] = Jellyfin::Support::toJsonValue(m_isInterlaced); - result["IsAVC"] = Jellyfin::Support::toJsonValue(m_isAVC); - result["ChannelLayout"] = Jellyfin::Support::toJsonValue(m_channelLayout); - result["BitRate"] = Jellyfin::Support::toJsonValue(m_bitRate); - result["BitDepth"] = Jellyfin::Support::toJsonValue(m_bitDepth); - result["RefFrames"] = Jellyfin::Support::toJsonValue(m_refFrames); - result["PacketLength"] = Jellyfin::Support::toJsonValue(m_packetLength); - result["Channels"] = Jellyfin::Support::toJsonValue(m_channels); - result["SampleRate"] = Jellyfin::Support::toJsonValue(m_sampleRate); - result["IsDefault"] = Jellyfin::Support::toJsonValue(m_isDefault); - result["IsForced"] = Jellyfin::Support::toJsonValue(m_isForced); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["AverageFrameRate"] = Jellyfin::Support::toJsonValue(m_averageFrameRate); - result["RealFrameRate"] = Jellyfin::Support::toJsonValue(m_realFrameRate); - result["Profile"] = Jellyfin::Support::toJsonValue(m_profile); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["AspectRatio"] = Jellyfin::Support::toJsonValue(m_aspectRatio); - result["Index"] = Jellyfin::Support::toJsonValue(m_index); - result["Score"] = Jellyfin::Support::toJsonValue(m_score); - result["IsExternal"] = Jellyfin::Support::toJsonValue(m_isExternal); - result["DeliveryMethod"] = Jellyfin::Support::toJsonValue(m_deliveryMethod); - result["DeliveryUrl"] = Jellyfin::Support::toJsonValue(m_deliveryUrl); - result["IsExternalUrl"] = Jellyfin::Support::toJsonValue(m_isExternalUrl); - result["IsTextSubtitleStream"] = Jellyfin::Support::toJsonValue(m_isTextSubtitleStream); - result["SupportsExternalStream"] = Jellyfin::Support::toJsonValue(m_supportsExternalStream); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["PixelFormat"] = Jellyfin::Support::toJsonValue(m_pixelFormat); - result["Level"] = Jellyfin::Support::toJsonValue(m_level); - result["IsAnamorphic"] = Jellyfin::Support::toJsonValue(m_isAnamorphic); - - return result; -} - -QString MediaStream::codec() const { return m_codec; } - -void MediaStream::setCodec(QString newCodec) { - m_codec = newCodec; -} -QString MediaStream::codecTag() const { return m_codecTag; } - -void MediaStream::setCodecTag(QString newCodecTag) { - m_codecTag = newCodecTag; -} -QString MediaStream::language() const { return m_language; } - -void MediaStream::setLanguage(QString newLanguage) { - m_language = newLanguage; -} -QString MediaStream::colorRange() const { return m_colorRange; } - -void MediaStream::setColorRange(QString newColorRange) { - m_colorRange = newColorRange; -} -QString MediaStream::colorSpace() const { return m_colorSpace; } - -void MediaStream::setColorSpace(QString newColorSpace) { - m_colorSpace = newColorSpace; -} -QString MediaStream::colorTransfer() const { return m_colorTransfer; } - -void MediaStream::setColorTransfer(QString newColorTransfer) { - m_colorTransfer = newColorTransfer; -} -QString MediaStream::colorPrimaries() const { return m_colorPrimaries; } - -void MediaStream::setColorPrimaries(QString newColorPrimaries) { - m_colorPrimaries = newColorPrimaries; -} -QString MediaStream::comment() const { return m_comment; } - -void MediaStream::setComment(QString newComment) { - m_comment = newComment; -} -QString MediaStream::timeBase() const { return m_timeBase; } - -void MediaStream::setTimeBase(QString newTimeBase) { - m_timeBase = newTimeBase; -} -QString MediaStream::codecTimeBase() const { return m_codecTimeBase; } - -void MediaStream::setCodecTimeBase(QString newCodecTimeBase) { - m_codecTimeBase = newCodecTimeBase; -} -QString MediaStream::title() const { return m_title; } - -void MediaStream::setTitle(QString newTitle) { - m_title = newTitle; -} -QString MediaStream::videoRange() const { return m_videoRange; } - -void MediaStream::setVideoRange(QString newVideoRange) { - m_videoRange = newVideoRange; -} -QString MediaStream::localizedUndefined() const { return m_localizedUndefined; } - -void MediaStream::setLocalizedUndefined(QString newLocalizedUndefined) { - m_localizedUndefined = newLocalizedUndefined; -} -QString MediaStream::localizedDefault() const { return m_localizedDefault; } - -void MediaStream::setLocalizedDefault(QString newLocalizedDefault) { - m_localizedDefault = newLocalizedDefault; -} -QString MediaStream::localizedForced() const { return m_localizedForced; } - -void MediaStream::setLocalizedForced(QString newLocalizedForced) { - m_localizedForced = newLocalizedForced; -} -QString MediaStream::displayTitle() const { return m_displayTitle; } - -void MediaStream::setDisplayTitle(QString newDisplayTitle) { - m_displayTitle = newDisplayTitle; -} -QString MediaStream::nalLengthSize() const { return m_nalLengthSize; } - -void MediaStream::setNalLengthSize(QString newNalLengthSize) { - m_nalLengthSize = newNalLengthSize; -} -bool MediaStream::isInterlaced() const { return m_isInterlaced; } - -void MediaStream::setIsInterlaced(bool newIsInterlaced) { - m_isInterlaced = newIsInterlaced; -} -bool MediaStream::isAVC() const { return m_isAVC; } - -void MediaStream::setIsAVC(bool newIsAVC) { - m_isAVC = newIsAVC; -} -QString MediaStream::channelLayout() const { return m_channelLayout; } - -void MediaStream::setChannelLayout(QString newChannelLayout) { - m_channelLayout = newChannelLayout; -} -qint32 MediaStream::bitRate() const { return m_bitRate; } - -void MediaStream::setBitRate(qint32 newBitRate) { - m_bitRate = newBitRate; -} -qint32 MediaStream::bitDepth() const { return m_bitDepth; } - -void MediaStream::setBitDepth(qint32 newBitDepth) { - m_bitDepth = newBitDepth; -} -qint32 MediaStream::refFrames() const { return m_refFrames; } - -void MediaStream::setRefFrames(qint32 newRefFrames) { - m_refFrames = newRefFrames; -} -qint32 MediaStream::packetLength() const { return m_packetLength; } - -void MediaStream::setPacketLength(qint32 newPacketLength) { - m_packetLength = newPacketLength; -} -qint32 MediaStream::channels() const { return m_channels; } - -void MediaStream::setChannels(qint32 newChannels) { - m_channels = newChannels; -} -qint32 MediaStream::sampleRate() const { return m_sampleRate; } - -void MediaStream::setSampleRate(qint32 newSampleRate) { - m_sampleRate = newSampleRate; -} -bool MediaStream::isDefault() const { return m_isDefault; } - -void MediaStream::setIsDefault(bool newIsDefault) { - m_isDefault = newIsDefault; -} -bool MediaStream::isForced() const { return m_isForced; } - -void MediaStream::setIsForced(bool newIsForced) { - m_isForced = newIsForced; -} -qint32 MediaStream::height() const { return m_height; } - -void MediaStream::setHeight(qint32 newHeight) { - m_height = newHeight; -} -qint32 MediaStream::width() const { return m_width; } - -void MediaStream::setWidth(qint32 newWidth) { - m_width = newWidth; -} -float MediaStream::averageFrameRate() const { return m_averageFrameRate; } - -void MediaStream::setAverageFrameRate(float newAverageFrameRate) { - m_averageFrameRate = newAverageFrameRate; -} -float MediaStream::realFrameRate() const { return m_realFrameRate; } - -void MediaStream::setRealFrameRate(float newRealFrameRate) { - m_realFrameRate = newRealFrameRate; -} -QString MediaStream::profile() const { return m_profile; } - -void MediaStream::setProfile(QString newProfile) { - m_profile = newProfile; -} -MediaStreamType MediaStream::type() const { return m_type; } - -void MediaStream::setType(MediaStreamType newType) { - m_type = newType; -} -QString MediaStream::aspectRatio() const { return m_aspectRatio; } - -void MediaStream::setAspectRatio(QString newAspectRatio) { - m_aspectRatio = newAspectRatio; -} -qint32 MediaStream::index() const { return m_index; } - -void MediaStream::setIndex(qint32 newIndex) { - m_index = newIndex; -} -qint32 MediaStream::score() const { return m_score; } - -void MediaStream::setScore(qint32 newScore) { - m_score = newScore; -} -bool MediaStream::isExternal() const { return m_isExternal; } - -void MediaStream::setIsExternal(bool newIsExternal) { - m_isExternal = newIsExternal; -} -SubtitleDeliveryMethod MediaStream::deliveryMethod() const { return m_deliveryMethod; } - -void MediaStream::setDeliveryMethod(SubtitleDeliveryMethod newDeliveryMethod) { - m_deliveryMethod = newDeliveryMethod; -} -QString MediaStream::deliveryUrl() const { return m_deliveryUrl; } - -void MediaStream::setDeliveryUrl(QString newDeliveryUrl) { - m_deliveryUrl = newDeliveryUrl; -} -bool MediaStream::isExternalUrl() const { return m_isExternalUrl; } - -void MediaStream::setIsExternalUrl(bool newIsExternalUrl) { - m_isExternalUrl = newIsExternalUrl; -} -bool MediaStream::isTextSubtitleStream() const { return m_isTextSubtitleStream; } - -void MediaStream::setIsTextSubtitleStream(bool newIsTextSubtitleStream) { - m_isTextSubtitleStream = newIsTextSubtitleStream; -} -bool MediaStream::supportsExternalStream() const { return m_supportsExternalStream; } - -void MediaStream::setSupportsExternalStream(bool newSupportsExternalStream) { - m_supportsExternalStream = newSupportsExternalStream; -} -QString MediaStream::path() const { return m_path; } - -void MediaStream::setPath(QString newPath) { - m_path = newPath; -} -QString MediaStream::pixelFormat() const { return m_pixelFormat; } - -void MediaStream::setPixelFormat(QString newPixelFormat) { - m_pixelFormat = newPixelFormat; -} -double MediaStream::level() const { return m_level; } - -void MediaStream::setLevel(double newLevel) { - m_level = newLevel; -} -bool MediaStream::isAnamorphic() const { return m_isAnamorphic; } - -void MediaStream::setIsAnamorphic(bool newIsAnamorphic) { - m_isAnamorphic = newIsAnamorphic; -} - -} // NS DTO - -namespace Support { - -using MediaStream = Jellyfin::DTO::MediaStream; - -template <> -MediaStream fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaStream::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediastreamtype.cpp b/core/src/DTO/mediastreamtype.cpp deleted file mode 100644 index 8741706..0000000 --- a/core/src/DTO/mediastreamtype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaStreamTypeClass::MediaStreamTypeClass() {} - - -} // NS DTO - -namespace Support { - -using MediaStreamType = Jellyfin::DTO::MediaStreamType; - -template <> -MediaStreamType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return MediaStreamType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Audio")) { - return MediaStreamType::Audio; - } - if (str == QStringLiteral("Video")) { - return MediaStreamType::Video; - } - if (str == QStringLiteral("Subtitle")) { - return MediaStreamType::Subtitle; - } - if (str == QStringLiteral("EmbeddedImage")) { - return MediaStreamType::EmbeddedImage; - } - - return MediaStreamType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediaupdateinfodto.cpp b/core/src/DTO/mediaupdateinfodto.cpp deleted file mode 100644 index 6340e8a..0000000 --- a/core/src/DTO/mediaupdateinfodto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaUpdateInfoDto::MediaUpdateInfoDto() {} -MediaUpdateInfoDto::MediaUpdateInfoDto(const MediaUpdateInfoDto &other) : - m_path(other.m_path), - m_updateType(other.m_updateType){} - -MediaUpdateInfoDto MediaUpdateInfoDto::fromJson(QJsonObject source) { - MediaUpdateInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void MediaUpdateInfoDto::setFromJson(QJsonObject source) { - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_updateType = Jellyfin::Support::fromJsonValue(source["UpdateType"]); - -} - -QJsonObject MediaUpdateInfoDto::toJson() { - QJsonObject result; - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["UpdateType"] = Jellyfin::Support::toJsonValue(m_updateType); - - return result; -} - -QString MediaUpdateInfoDto::path() const { return m_path; } - -void MediaUpdateInfoDto::setPath(QString newPath) { - m_path = newPath; -} -QString MediaUpdateInfoDto::updateType() const { return m_updateType; } - -void MediaUpdateInfoDto::setUpdateType(QString newUpdateType) { - m_updateType = newUpdateType; -} - -} // NS DTO - -namespace Support { - -using MediaUpdateInfoDto = Jellyfin::DTO::MediaUpdateInfoDto; - -template <> -MediaUpdateInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaUpdateInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/mediaurl.cpp b/core/src/DTO/mediaurl.cpp deleted file mode 100644 index e2c7d2f..0000000 --- a/core/src/DTO/mediaurl.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MediaUrl::MediaUrl() {} -MediaUrl::MediaUrl(const MediaUrl &other) : - m_url(other.m_url), - m_name(other.m_name){} - -MediaUrl MediaUrl::fromJson(QJsonObject source) { - MediaUrl instance; - instance.setFromJson(source); - return instance; -} - - -void MediaUrl::setFromJson(QJsonObject source) { - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - -} - -QJsonObject MediaUrl::toJson() { - QJsonObject result; - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - - return result; -} - -QString MediaUrl::url() const { return m_url; } - -void MediaUrl::setUrl(QString newUrl) { - m_url = newUrl; -} -QString MediaUrl::name() const { return m_name; } - -void MediaUrl::setName(QString newName) { - m_name = newName; -} - -} // NS DTO - -namespace Support { - -using MediaUrl = Jellyfin::DTO::MediaUrl; - -template <> -MediaUrl fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MediaUrl::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/metadataeditorinfo.cpp b/core/src/DTO/metadataeditorinfo.cpp deleted file mode 100644 index 7bdcdfd..0000000 --- a/core/src/DTO/metadataeditorinfo.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MetadataEditorInfo::MetadataEditorInfo() {} -MetadataEditorInfo::MetadataEditorInfo(const MetadataEditorInfo &other) : - m_parentalRatingOptions(other.m_parentalRatingOptions), - m_countries(other.m_countries), - m_cultures(other.m_cultures), - m_externalIdInfos(other.m_externalIdInfos), - m_contentType(other.m_contentType), - m_contentTypeOptions(other.m_contentTypeOptions){} - -MetadataEditorInfo MetadataEditorInfo::fromJson(QJsonObject source) { - MetadataEditorInfo instance; - instance.setFromJson(source); - return instance; -} - - -void MetadataEditorInfo::setFromJson(QJsonObject source) { - m_parentalRatingOptions = Jellyfin::Support::fromJsonValue>>(source["ParentalRatingOptions"]); - m_countries = Jellyfin::Support::fromJsonValue>>(source["Countries"]); - m_cultures = Jellyfin::Support::fromJsonValue>>(source["Cultures"]); - m_externalIdInfos = Jellyfin::Support::fromJsonValue>>(source["ExternalIdInfos"]); - m_contentType = Jellyfin::Support::fromJsonValue(source["ContentType"]); - m_contentTypeOptions = Jellyfin::Support::fromJsonValue>>(source["ContentTypeOptions"]); - -} - -QJsonObject MetadataEditorInfo::toJson() { - QJsonObject result; - result["ParentalRatingOptions"] = Jellyfin::Support::toJsonValue>>(m_parentalRatingOptions); - result["Countries"] = Jellyfin::Support::toJsonValue>>(m_countries); - result["Cultures"] = Jellyfin::Support::toJsonValue>>(m_cultures); - result["ExternalIdInfos"] = Jellyfin::Support::toJsonValue>>(m_externalIdInfos); - result["ContentType"] = Jellyfin::Support::toJsonValue(m_contentType); - result["ContentTypeOptions"] = Jellyfin::Support::toJsonValue>>(m_contentTypeOptions); - - return result; -} - -QList> MetadataEditorInfo::parentalRatingOptions() const { return m_parentalRatingOptions; } - -void MetadataEditorInfo::setParentalRatingOptions(QList> newParentalRatingOptions) { - m_parentalRatingOptions = newParentalRatingOptions; -} -QList> MetadataEditorInfo::countries() const { return m_countries; } - -void MetadataEditorInfo::setCountries(QList> newCountries) { - m_countries = newCountries; -} -QList> MetadataEditorInfo::cultures() const { return m_cultures; } - -void MetadataEditorInfo::setCultures(QList> newCultures) { - m_cultures = newCultures; -} -QList> MetadataEditorInfo::externalIdInfos() const { return m_externalIdInfos; } - -void MetadataEditorInfo::setExternalIdInfos(QList> newExternalIdInfos) { - m_externalIdInfos = newExternalIdInfos; -} -QString MetadataEditorInfo::contentType() const { return m_contentType; } - -void MetadataEditorInfo::setContentType(QString newContentType) { - m_contentType = newContentType; -} -QList> MetadataEditorInfo::contentTypeOptions() const { return m_contentTypeOptions; } - -void MetadataEditorInfo::setContentTypeOptions(QList> newContentTypeOptions) { - m_contentTypeOptions = newContentTypeOptions; -} - -} // NS DTO - -namespace Support { - -using MetadataEditorInfo = Jellyfin::DTO::MetadataEditorInfo; - -template <> -MetadataEditorInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MetadataEditorInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/metadatafield.cpp b/core/src/DTO/metadatafield.cpp deleted file mode 100644 index 680c63b..0000000 --- a/core/src/DTO/metadatafield.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MetadataFieldClass::MetadataFieldClass() {} - - -} // NS DTO - -namespace Support { - -using MetadataField = Jellyfin::DTO::MetadataField; - -template <> -MetadataField fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return MetadataField::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Cast")) { - return MetadataField::Cast; - } - if (str == QStringLiteral("Genres")) { - return MetadataField::Genres; - } - if (str == QStringLiteral("ProductionLocations")) { - return MetadataField::ProductionLocations; - } - if (str == QStringLiteral("Studios")) { - return MetadataField::Studios; - } - if (str == QStringLiteral("Tags")) { - return MetadataField::Tags; - } - if (str == QStringLiteral("Name")) { - return MetadataField::Name; - } - if (str == QStringLiteral("Overview")) { - return MetadataField::Overview; - } - if (str == QStringLiteral("Runtime")) { - return MetadataField::Runtime; - } - if (str == QStringLiteral("OfficialRating")) { - return MetadataField::OfficialRating; - } - - return MetadataField::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/metadataoptions.cpp b/core/src/DTO/metadataoptions.cpp deleted file mode 100644 index 0291610..0000000 --- a/core/src/DTO/metadataoptions.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MetadataOptions::MetadataOptions() {} -MetadataOptions::MetadataOptions(const MetadataOptions &other) : - m_itemType(other.m_itemType), - m_disabledMetadataSavers(other.m_disabledMetadataSavers), - m_localMetadataReaderOrder(other.m_localMetadataReaderOrder), - m_disabledMetadataFetchers(other.m_disabledMetadataFetchers), - m_metadataFetcherOrder(other.m_metadataFetcherOrder), - m_disabledImageFetchers(other.m_disabledImageFetchers), - m_imageFetcherOrder(other.m_imageFetcherOrder){} - -MetadataOptions MetadataOptions::fromJson(QJsonObject source) { - MetadataOptions instance; - instance.setFromJson(source); - return instance; -} - - -void MetadataOptions::setFromJson(QJsonObject source) { - m_itemType = Jellyfin::Support::fromJsonValue(source["ItemType"]); - m_disabledMetadataSavers = Jellyfin::Support::fromJsonValue(source["DisabledMetadataSavers"]); - m_localMetadataReaderOrder = Jellyfin::Support::fromJsonValue(source["LocalMetadataReaderOrder"]); - m_disabledMetadataFetchers = Jellyfin::Support::fromJsonValue(source["DisabledMetadataFetchers"]); - m_metadataFetcherOrder = Jellyfin::Support::fromJsonValue(source["MetadataFetcherOrder"]); - m_disabledImageFetchers = Jellyfin::Support::fromJsonValue(source["DisabledImageFetchers"]); - m_imageFetcherOrder = Jellyfin::Support::fromJsonValue(source["ImageFetcherOrder"]); - -} - -QJsonObject MetadataOptions::toJson() { - QJsonObject result; - result["ItemType"] = Jellyfin::Support::toJsonValue(m_itemType); - result["DisabledMetadataSavers"] = Jellyfin::Support::toJsonValue(m_disabledMetadataSavers); - result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue(m_localMetadataReaderOrder); - result["DisabledMetadataFetchers"] = Jellyfin::Support::toJsonValue(m_disabledMetadataFetchers); - result["MetadataFetcherOrder"] = Jellyfin::Support::toJsonValue(m_metadataFetcherOrder); - result["DisabledImageFetchers"] = Jellyfin::Support::toJsonValue(m_disabledImageFetchers); - result["ImageFetcherOrder"] = Jellyfin::Support::toJsonValue(m_imageFetcherOrder); - - return result; -} - -QString MetadataOptions::itemType() const { return m_itemType; } - -void MetadataOptions::setItemType(QString newItemType) { - m_itemType = newItemType; -} -QStringList MetadataOptions::disabledMetadataSavers() const { return m_disabledMetadataSavers; } - -void MetadataOptions::setDisabledMetadataSavers(QStringList newDisabledMetadataSavers) { - m_disabledMetadataSavers = newDisabledMetadataSavers; -} -QStringList MetadataOptions::localMetadataReaderOrder() const { return m_localMetadataReaderOrder; } - -void MetadataOptions::setLocalMetadataReaderOrder(QStringList newLocalMetadataReaderOrder) { - m_localMetadataReaderOrder = newLocalMetadataReaderOrder; -} -QStringList MetadataOptions::disabledMetadataFetchers() const { return m_disabledMetadataFetchers; } - -void MetadataOptions::setDisabledMetadataFetchers(QStringList newDisabledMetadataFetchers) { - m_disabledMetadataFetchers = newDisabledMetadataFetchers; -} -QStringList MetadataOptions::metadataFetcherOrder() const { return m_metadataFetcherOrder; } - -void MetadataOptions::setMetadataFetcherOrder(QStringList newMetadataFetcherOrder) { - m_metadataFetcherOrder = newMetadataFetcherOrder; -} -QStringList MetadataOptions::disabledImageFetchers() const { return m_disabledImageFetchers; } - -void MetadataOptions::setDisabledImageFetchers(QStringList newDisabledImageFetchers) { - m_disabledImageFetchers = newDisabledImageFetchers; -} -QStringList MetadataOptions::imageFetcherOrder() const { return m_imageFetcherOrder; } - -void MetadataOptions::setImageFetcherOrder(QStringList newImageFetcherOrder) { - m_imageFetcherOrder = newImageFetcherOrder; -} - -} // NS DTO - -namespace Support { - -using MetadataOptions = Jellyfin::DTO::MetadataOptions; - -template <> -MetadataOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MetadataOptions::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/metadatarefreshmode.cpp b/core/src/DTO/metadatarefreshmode.cpp deleted file mode 100644 index a3ce175..0000000 --- a/core/src/DTO/metadatarefreshmode.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MetadataRefreshModeClass::MetadataRefreshModeClass() {} - - -} // NS DTO - -namespace Support { - -using MetadataRefreshMode = Jellyfin::DTO::MetadataRefreshMode; - -template <> -MetadataRefreshMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return MetadataRefreshMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("None")) { - return MetadataRefreshMode::None; - } - if (str == QStringLiteral("ValidationOnly")) { - return MetadataRefreshMode::ValidationOnly; - } - if (str == QStringLiteral("Default")) { - return MetadataRefreshMode::Default; - } - if (str == QStringLiteral("FullRefresh")) { - return MetadataRefreshMode::FullRefresh; - } - - return MetadataRefreshMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/moveplaylistitemrequestdto.cpp b/core/src/DTO/moveplaylistitemrequestdto.cpp deleted file mode 100644 index 7262a1c..0000000 --- a/core/src/DTO/moveplaylistitemrequestdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MovePlaylistItemRequestDto::MovePlaylistItemRequestDto() {} -MovePlaylistItemRequestDto::MovePlaylistItemRequestDto(const MovePlaylistItemRequestDto &other) : - m_playlistItemId(other.m_playlistItemId), - m_newIndex(other.m_newIndex){} - -MovePlaylistItemRequestDto MovePlaylistItemRequestDto::fromJson(QJsonObject source) { - MovePlaylistItemRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void MovePlaylistItemRequestDto::setFromJson(QJsonObject source) { - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - m_newIndex = Jellyfin::Support::fromJsonValue(source["NewIndex"]); - -} - -QJsonObject MovePlaylistItemRequestDto::toJson() { - QJsonObject result; - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - result["NewIndex"] = Jellyfin::Support::toJsonValue(m_newIndex); - - return result; -} - -QUuid MovePlaylistItemRequestDto::playlistItemId() const { return m_playlistItemId; } - -void MovePlaylistItemRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} -qint32 MovePlaylistItemRequestDto::newIndex() const { return m_newIndex; } - -void MovePlaylistItemRequestDto::setNewIndex(qint32 newNewIndex) { - m_newIndex = newNewIndex; -} - -} // NS DTO - -namespace Support { - -using MovePlaylistItemRequestDto = Jellyfin::DTO::MovePlaylistItemRequestDto; - -template <> -MovePlaylistItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MovePlaylistItemRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/movieinfo.cpp b/core/src/DTO/movieinfo.cpp deleted file mode 100644 index 339b116..0000000 --- a/core/src/DTO/movieinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MovieInfo::MovieInfo() {} -MovieInfo::MovieInfo(const MovieInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated){} - -MovieInfo MovieInfo::fromJson(QJsonObject source) { - MovieInfo instance; - instance.setFromJson(source); - return instance; -} - - -void MovieInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - -} - -QJsonObject MovieInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - - return result; -} - -QString MovieInfo::name() const { return m_name; } - -void MovieInfo::setName(QString newName) { - m_name = newName; -} -QString MovieInfo::path() const { return m_path; } - -void MovieInfo::setPath(QString newPath) { - m_path = newPath; -} -QString MovieInfo::metadataLanguage() const { return m_metadataLanguage; } - -void MovieInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString MovieInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void MovieInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject MovieInfo::providerIds() const { return m_providerIds; } - -void MovieInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 MovieInfo::year() const { return m_year; } - -void MovieInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 MovieInfo::indexNumber() const { return m_indexNumber; } - -void MovieInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 MovieInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void MovieInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime MovieInfo::premiereDate() const { return m_premiereDate; } - -void MovieInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool MovieInfo::isAutomated() const { return m_isAutomated; } - -void MovieInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} - -} // NS DTO - -namespace Support { - -using MovieInfo = Jellyfin::DTO::MovieInfo; - -template <> -MovieInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MovieInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/movieinforemotesearchquery.cpp b/core/src/DTO/movieinforemotesearchquery.cpp deleted file mode 100644 index f0359f8..0000000 --- a/core/src/DTO/movieinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MovieInfoRemoteSearchQuery::MovieInfoRemoteSearchQuery() {} -MovieInfoRemoteSearchQuery::MovieInfoRemoteSearchQuery(const MovieInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -MovieInfoRemoteSearchQuery MovieInfoRemoteSearchQuery::fromJson(QJsonObject source) { - MovieInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void MovieInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject MovieInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer MovieInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void MovieInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid MovieInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void MovieInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString MovieInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void MovieInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool MovieInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void MovieInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using MovieInfoRemoteSearchQuery = Jellyfin::DTO::MovieInfoRemoteSearchQuery; - -template <> -MovieInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MovieInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/musicvideoinfo.cpp b/core/src/DTO/musicvideoinfo.cpp deleted file mode 100644 index 268dc5e..0000000 --- a/core/src/DTO/musicvideoinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MusicVideoInfo::MusicVideoInfo() {} -MusicVideoInfo::MusicVideoInfo(const MusicVideoInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated), - m_artists(other.m_artists){} - -MusicVideoInfo MusicVideoInfo::fromJson(QJsonObject source) { - MusicVideoInfo instance; - instance.setFromJson(source); - return instance; -} - - -void MusicVideoInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - m_artists = Jellyfin::Support::fromJsonValue(source["Artists"]); - -} - -QJsonObject MusicVideoInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - result["Artists"] = Jellyfin::Support::toJsonValue(m_artists); - - return result; -} - -QString MusicVideoInfo::name() const { return m_name; } - -void MusicVideoInfo::setName(QString newName) { - m_name = newName; -} -QString MusicVideoInfo::path() const { return m_path; } - -void MusicVideoInfo::setPath(QString newPath) { - m_path = newPath; -} -QString MusicVideoInfo::metadataLanguage() const { return m_metadataLanguage; } - -void MusicVideoInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString MusicVideoInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void MusicVideoInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject MusicVideoInfo::providerIds() const { return m_providerIds; } - -void MusicVideoInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 MusicVideoInfo::year() const { return m_year; } - -void MusicVideoInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 MusicVideoInfo::indexNumber() const { return m_indexNumber; } - -void MusicVideoInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 MusicVideoInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void MusicVideoInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime MusicVideoInfo::premiereDate() const { return m_premiereDate; } - -void MusicVideoInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool MusicVideoInfo::isAutomated() const { return m_isAutomated; } - -void MusicVideoInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} -QStringList MusicVideoInfo::artists() const { return m_artists; } - -void MusicVideoInfo::setArtists(QStringList newArtists) { - m_artists = newArtists; -} - -} // NS DTO - -namespace Support { - -using MusicVideoInfo = Jellyfin::DTO::MusicVideoInfo; - -template <> -MusicVideoInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MusicVideoInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/musicvideoinforemotesearchquery.cpp b/core/src/DTO/musicvideoinforemotesearchquery.cpp deleted file mode 100644 index edb69c1..0000000 --- a/core/src/DTO/musicvideoinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -MusicVideoInfoRemoteSearchQuery::MusicVideoInfoRemoteSearchQuery() {} -MusicVideoInfoRemoteSearchQuery::MusicVideoInfoRemoteSearchQuery(const MusicVideoInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -MusicVideoInfoRemoteSearchQuery MusicVideoInfoRemoteSearchQuery::fromJson(QJsonObject source) { - MusicVideoInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void MusicVideoInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject MusicVideoInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer MusicVideoInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void MusicVideoInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid MusicVideoInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void MusicVideoInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString MusicVideoInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void MusicVideoInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool MusicVideoInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void MusicVideoInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using MusicVideoInfoRemoteSearchQuery = Jellyfin::DTO::MusicVideoInfoRemoteSearchQuery; - -template <> -MusicVideoInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return MusicVideoInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/nameguidpair.cpp b/core/src/DTO/nameguidpair.cpp deleted file mode 100644 index 3b0940d..0000000 --- a/core/src/DTO/nameguidpair.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NameGuidPair::NameGuidPair() {} -NameGuidPair::NameGuidPair(const NameGuidPair &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId){} - -NameGuidPair NameGuidPair::fromJson(QJsonObject source) { - NameGuidPair instance; - instance.setFromJson(source); - return instance; -} - - -void NameGuidPair::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject NameGuidPair::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QString NameGuidPair::name() const { return m_name; } - -void NameGuidPair::setName(QString newName) { - m_name = newName; -} -QUuid NameGuidPair::jellyfinId() const { return m_jellyfinId; } - -void NameGuidPair::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using NameGuidPair = Jellyfin::DTO::NameGuidPair; - -template <> -NameGuidPair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NameGuidPair::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/nameidpair.cpp b/core/src/DTO/nameidpair.cpp deleted file mode 100644 index f2bc8b8..0000000 --- a/core/src/DTO/nameidpair.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NameIdPair::NameIdPair() {} -NameIdPair::NameIdPair(const NameIdPair &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId){} - -NameIdPair NameIdPair::fromJson(QJsonObject source) { - NameIdPair instance; - instance.setFromJson(source); - return instance; -} - - -void NameIdPair::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject NameIdPair::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QString NameIdPair::name() const { return m_name; } - -void NameIdPair::setName(QString newName) { - m_name = newName; -} -QString NameIdPair::jellyfinId() const { return m_jellyfinId; } - -void NameIdPair::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using NameIdPair = Jellyfin::DTO::NameIdPair; - -template <> -NameIdPair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NameIdPair::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/namevaluepair.cpp b/core/src/DTO/namevaluepair.cpp deleted file mode 100644 index 90f5479..0000000 --- a/core/src/DTO/namevaluepair.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NameValuePair::NameValuePair() {} -NameValuePair::NameValuePair(const NameValuePair &other) : - m_name(other.m_name), - m_value(other.m_value){} - -NameValuePair NameValuePair::fromJson(QJsonObject source) { - NameValuePair instance; - instance.setFromJson(source); - return instance; -} - - -void NameValuePair::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - -} - -QJsonObject NameValuePair::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - - return result; -} - -QString NameValuePair::name() const { return m_name; } - -void NameValuePair::setName(QString newName) { - m_name = newName; -} -QString NameValuePair::value() const { return m_value; } - -void NameValuePair::setValue(QString newValue) { - m_value = newValue; -} - -} // NS DTO - -namespace Support { - -using NameValuePair = Jellyfin::DTO::NameValuePair; - -template <> -NameValuePair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NameValuePair::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/newgrouprequestdto.cpp b/core/src/DTO/newgrouprequestdto.cpp deleted file mode 100644 index 8adfad2..0000000 --- a/core/src/DTO/newgrouprequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NewGroupRequestDto::NewGroupRequestDto() {} -NewGroupRequestDto::NewGroupRequestDto(const NewGroupRequestDto &other) : - m_groupName(other.m_groupName){} - -NewGroupRequestDto NewGroupRequestDto::fromJson(QJsonObject source) { - NewGroupRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void NewGroupRequestDto::setFromJson(QJsonObject source) { - m_groupName = Jellyfin::Support::fromJsonValue(source["GroupName"]); - -} - -QJsonObject NewGroupRequestDto::toJson() { - QJsonObject result; - result["GroupName"] = Jellyfin::Support::toJsonValue(m_groupName); - - return result; -} - -QString NewGroupRequestDto::groupName() const { return m_groupName; } - -void NewGroupRequestDto::setGroupName(QString newGroupName) { - m_groupName = newGroupName; -} - -} // NS DTO - -namespace Support { - -using NewGroupRequestDto = Jellyfin::DTO::NewGroupRequestDto; - -template <> -NewGroupRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NewGroupRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/nextitemrequestdto.cpp b/core/src/DTO/nextitemrequestdto.cpp deleted file mode 100644 index 3246016..0000000 --- a/core/src/DTO/nextitemrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NextItemRequestDto::NextItemRequestDto() {} -NextItemRequestDto::NextItemRequestDto(const NextItemRequestDto &other) : - m_playlistItemId(other.m_playlistItemId){} - -NextItemRequestDto NextItemRequestDto::fromJson(QJsonObject source) { - NextItemRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void NextItemRequestDto::setFromJson(QJsonObject source) { - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject NextItemRequestDto::toJson() { - QJsonObject result; - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QUuid NextItemRequestDto::playlistItemId() const { return m_playlistItemId; } - -void NextItemRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using NextItemRequestDto = Jellyfin::DTO::NextItemRequestDto; - -template <> -NextItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NextItemRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/notificationdto.cpp b/core/src/DTO/notificationdto.cpp deleted file mode 100644 index baf4a9d..0000000 --- a/core/src/DTO/notificationdto.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NotificationDto::NotificationDto() {} -NotificationDto::NotificationDto(const NotificationDto &other) : - m_jellyfinId(other.m_jellyfinId), - m_userId(other.m_userId), - m_date(other.m_date), - m_isRead(other.m_isRead), - m_name(other.m_name), - m_description(other.m_description), - m_url(other.m_url), - m_level(other.m_level){} - -NotificationDto NotificationDto::fromJson(QJsonObject source) { - NotificationDto instance; - instance.setFromJson(source); - return instance; -} - - -void NotificationDto::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_date = Jellyfin::Support::fromJsonValue(source["Date"]); - m_isRead = Jellyfin::Support::fromJsonValue(source["IsRead"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_description = Jellyfin::Support::fromJsonValue(source["Description"]); - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - m_level = Jellyfin::Support::fromJsonValue(source["Level"]); - -} - -QJsonObject NotificationDto::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["Date"] = Jellyfin::Support::toJsonValue(m_date); - result["IsRead"] = Jellyfin::Support::toJsonValue(m_isRead); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Description"] = Jellyfin::Support::toJsonValue(m_description); - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - result["Level"] = Jellyfin::Support::toJsonValue(m_level); - - return result; -} - -QString NotificationDto::jellyfinId() const { return m_jellyfinId; } - -void NotificationDto::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString NotificationDto::userId() const { return m_userId; } - -void NotificationDto::setUserId(QString newUserId) { - m_userId = newUserId; -} -QDateTime NotificationDto::date() const { return m_date; } - -void NotificationDto::setDate(QDateTime newDate) { - m_date = newDate; -} -bool NotificationDto::isRead() const { return m_isRead; } - -void NotificationDto::setIsRead(bool newIsRead) { - m_isRead = newIsRead; -} -QString NotificationDto::name() const { return m_name; } - -void NotificationDto::setName(QString newName) { - m_name = newName; -} -QString NotificationDto::description() const { return m_description; } - -void NotificationDto::setDescription(QString newDescription) { - m_description = newDescription; -} -QString NotificationDto::url() const { return m_url; } - -void NotificationDto::setUrl(QString newUrl) { - m_url = newUrl; -} -NotificationLevel NotificationDto::level() const { return m_level; } - -void NotificationDto::setLevel(NotificationLevel newLevel) { - m_level = newLevel; -} - -} // NS DTO - -namespace Support { - -using NotificationDto = Jellyfin::DTO::NotificationDto; - -template <> -NotificationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NotificationDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/notificationlevel.cpp b/core/src/DTO/notificationlevel.cpp deleted file mode 100644 index 1294708..0000000 --- a/core/src/DTO/notificationlevel.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NotificationLevelClass::NotificationLevelClass() {} - - -} // NS DTO - -namespace Support { - -using NotificationLevel = Jellyfin::DTO::NotificationLevel; - -template <> -NotificationLevel fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return NotificationLevel::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Normal")) { - return NotificationLevel::Normal; - } - if (str == QStringLiteral("Warning")) { - return NotificationLevel::Warning; - } - if (str == QStringLiteral("Error")) { - return NotificationLevel::Error; - } - - return NotificationLevel::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/notificationresultdto.cpp b/core/src/DTO/notificationresultdto.cpp deleted file mode 100644 index 59dfd47..0000000 --- a/core/src/DTO/notificationresultdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NotificationResultDto::NotificationResultDto() {} -NotificationResultDto::NotificationResultDto(const NotificationResultDto &other) : - m_notifications(other.m_notifications), - m_totalRecordCount(other.m_totalRecordCount){} - -NotificationResultDto NotificationResultDto::fromJson(QJsonObject source) { - NotificationResultDto instance; - instance.setFromJson(source); - return instance; -} - - -void NotificationResultDto::setFromJson(QJsonObject source) { - m_notifications = Jellyfin::Support::fromJsonValue>>(source["Notifications"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - -} - -QJsonObject NotificationResultDto::toJson() { - QJsonObject result; - result["Notifications"] = Jellyfin::Support::toJsonValue>>(m_notifications); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - - return result; -} - -QList> NotificationResultDto::notifications() const { return m_notifications; } - -void NotificationResultDto::setNotifications(QList> newNotifications) { - m_notifications = newNotifications; -} -qint32 NotificationResultDto::totalRecordCount() const { return m_totalRecordCount; } - -void NotificationResultDto::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} - -} // NS DTO - -namespace Support { - -using NotificationResultDto = Jellyfin::DTO::NotificationResultDto; - -template <> -NotificationResultDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NotificationResultDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/notificationssummarydto.cpp b/core/src/DTO/notificationssummarydto.cpp deleted file mode 100644 index 9259c8e..0000000 --- a/core/src/DTO/notificationssummarydto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NotificationsSummaryDto::NotificationsSummaryDto() {} -NotificationsSummaryDto::NotificationsSummaryDto(const NotificationsSummaryDto &other) : - m_unreadCount(other.m_unreadCount), - m_maxUnreadNotificationLevel(other.m_maxUnreadNotificationLevel){} - -NotificationsSummaryDto NotificationsSummaryDto::fromJson(QJsonObject source) { - NotificationsSummaryDto instance; - instance.setFromJson(source); - return instance; -} - - -void NotificationsSummaryDto::setFromJson(QJsonObject source) { - m_unreadCount = Jellyfin::Support::fromJsonValue(source["UnreadCount"]); - m_maxUnreadNotificationLevel = Jellyfin::Support::fromJsonValue(source["MaxUnreadNotificationLevel"]); - -} - -QJsonObject NotificationsSummaryDto::toJson() { - QJsonObject result; - result["UnreadCount"] = Jellyfin::Support::toJsonValue(m_unreadCount); - result["MaxUnreadNotificationLevel"] = Jellyfin::Support::toJsonValue(m_maxUnreadNotificationLevel); - - return result; -} - -qint32 NotificationsSummaryDto::unreadCount() const { return m_unreadCount; } - -void NotificationsSummaryDto::setUnreadCount(qint32 newUnreadCount) { - m_unreadCount = newUnreadCount; -} -NotificationLevel NotificationsSummaryDto::maxUnreadNotificationLevel() const { return m_maxUnreadNotificationLevel; } - -void NotificationsSummaryDto::setMaxUnreadNotificationLevel(NotificationLevel newMaxUnreadNotificationLevel) { - m_maxUnreadNotificationLevel = newMaxUnreadNotificationLevel; -} - -} // NS DTO - -namespace Support { - -using NotificationsSummaryDto = Jellyfin::DTO::NotificationsSummaryDto; - -template <> -NotificationsSummaryDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NotificationsSummaryDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/notificationtypeinfo.cpp b/core/src/DTO/notificationtypeinfo.cpp deleted file mode 100644 index 24cfcc5..0000000 --- a/core/src/DTO/notificationtypeinfo.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -NotificationTypeInfo::NotificationTypeInfo() {} -NotificationTypeInfo::NotificationTypeInfo(const NotificationTypeInfo &other) : - m_type(other.m_type), - m_name(other.m_name), - m_enabled(other.m_enabled), - m_category(other.m_category), - m_isBasedOnUserEvent(other.m_isBasedOnUserEvent){} - -NotificationTypeInfo NotificationTypeInfo::fromJson(QJsonObject source) { - NotificationTypeInfo instance; - instance.setFromJson(source); - return instance; -} - - -void NotificationTypeInfo::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_enabled = Jellyfin::Support::fromJsonValue(source["Enabled"]); - m_category = Jellyfin::Support::fromJsonValue(source["Category"]); - m_isBasedOnUserEvent = Jellyfin::Support::fromJsonValue(source["IsBasedOnUserEvent"]); - -} - -QJsonObject NotificationTypeInfo::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Enabled"] = Jellyfin::Support::toJsonValue(m_enabled); - result["Category"] = Jellyfin::Support::toJsonValue(m_category); - result["IsBasedOnUserEvent"] = Jellyfin::Support::toJsonValue(m_isBasedOnUserEvent); - - return result; -} - -QString NotificationTypeInfo::type() const { return m_type; } - -void NotificationTypeInfo::setType(QString newType) { - m_type = newType; -} -QString NotificationTypeInfo::name() const { return m_name; } - -void NotificationTypeInfo::setName(QString newName) { - m_name = newName; -} -bool NotificationTypeInfo::enabled() const { return m_enabled; } - -void NotificationTypeInfo::setEnabled(bool newEnabled) { - m_enabled = newEnabled; -} -QString NotificationTypeInfo::category() const { return m_category; } - -void NotificationTypeInfo::setCategory(QString newCategory) { - m_category = newCategory; -} -bool NotificationTypeInfo::isBasedOnUserEvent() const { return m_isBasedOnUserEvent; } - -void NotificationTypeInfo::setIsBasedOnUserEvent(bool newIsBasedOnUserEvent) { - m_isBasedOnUserEvent = newIsBasedOnUserEvent; -} - -} // NS DTO - -namespace Support { - -using NotificationTypeInfo = Jellyfin::DTO::NotificationTypeInfo; - -template <> -NotificationTypeInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return NotificationTypeInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/objectgroupupdate.cpp b/core/src/DTO/objectgroupupdate.cpp deleted file mode 100644 index 80e6dea..0000000 --- a/core/src/DTO/objectgroupupdate.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ObjectGroupUpdate::ObjectGroupUpdate() {} -ObjectGroupUpdate::ObjectGroupUpdate(const ObjectGroupUpdate &other) : - m_groupId(other.m_groupId), - m_type(other.m_type), - m_data(other.m_data){} - -ObjectGroupUpdate ObjectGroupUpdate::fromJson(QJsonObject source) { - ObjectGroupUpdate instance; - instance.setFromJson(source); - return instance; -} - - -void ObjectGroupUpdate::setFromJson(QJsonObject source) { - m_groupId = Jellyfin::Support::fromJsonValue(source["GroupId"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_data = Jellyfin::Support::fromJsonValue(source["Data"]); - -} - -QJsonObject ObjectGroupUpdate::toJson() { - QJsonObject result; - result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["Data"] = Jellyfin::Support::toJsonValue(m_data); - - return result; -} - -QUuid ObjectGroupUpdate::groupId() const { return m_groupId; } - -void ObjectGroupUpdate::setGroupId(QUuid newGroupId) { - m_groupId = newGroupId; -} -GroupUpdateType ObjectGroupUpdate::type() const { return m_type; } - -void ObjectGroupUpdate::setType(GroupUpdateType newType) { - m_type = newType; -} -QVariant ObjectGroupUpdate::data() const { return m_data; } - -void ObjectGroupUpdate::setData(QVariant newData) { - m_data = newData; -} - -} // NS DTO - -namespace Support { - -using ObjectGroupUpdate = Jellyfin::DTO::ObjectGroupUpdate; - -template <> -ObjectGroupUpdate fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ObjectGroupUpdate::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/openlivestreamdto.cpp b/core/src/DTO/openlivestreamdto.cpp deleted file mode 100644 index 2a1520a..0000000 --- a/core/src/DTO/openlivestreamdto.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -OpenLiveStreamDto::OpenLiveStreamDto() {} -OpenLiveStreamDto::OpenLiveStreamDto(const OpenLiveStreamDto &other) : - m_openToken(other.m_openToken), - m_userId(other.m_userId), - m_playSessionId(other.m_playSessionId), - m_maxStreamingBitrate(other.m_maxStreamingBitrate), - m_startTimeTicks(other.m_startTimeTicks), - m_audioStreamIndex(other.m_audioStreamIndex), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_maxAudioChannels(other.m_maxAudioChannels), - m_itemId(other.m_itemId), - m_enableDirectPlay(other.m_enableDirectPlay), - m_enableDirectStream(other.m_enableDirectStream), - m_deviceProfile(other.m_deviceProfile), - m_directPlayProtocols(other.m_directPlayProtocols){} - -OpenLiveStreamDto OpenLiveStreamDto::fromJson(QJsonObject source) { - OpenLiveStreamDto instance; - instance.setFromJson(source); - return instance; -} - - -void OpenLiveStreamDto::setFromJson(QJsonObject source) { - m_openToken = Jellyfin::Support::fromJsonValue(source["OpenToken"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); - m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue(source["MaxStreamingBitrate"]); - m_startTimeTicks = Jellyfin::Support::fromJsonValue(source["StartTimeTicks"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_maxAudioChannels = Jellyfin::Support::fromJsonValue(source["MaxAudioChannels"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_enableDirectPlay = Jellyfin::Support::fromJsonValue(source["EnableDirectPlay"]); - m_enableDirectStream = Jellyfin::Support::fromJsonValue(source["EnableDirectStream"]); - m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); - m_directPlayProtocols = Jellyfin::Support::fromJsonValue>(source["DirectPlayProtocols"]); - -} - -QJsonObject OpenLiveStreamDto::toJson() { - QJsonObject result; - result["OpenToken"] = Jellyfin::Support::toJsonValue(m_openToken); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); - result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue(m_maxStreamingBitrate); - result["StartTimeTicks"] = Jellyfin::Support::toJsonValue(m_startTimeTicks); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["MaxAudioChannels"] = Jellyfin::Support::toJsonValue(m_maxAudioChannels); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["EnableDirectPlay"] = Jellyfin::Support::toJsonValue(m_enableDirectPlay); - result["EnableDirectStream"] = Jellyfin::Support::toJsonValue(m_enableDirectStream); - result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); - result["DirectPlayProtocols"] = Jellyfin::Support::toJsonValue>(m_directPlayProtocols); - - return result; -} - -QString OpenLiveStreamDto::openToken() const { return m_openToken; } - -void OpenLiveStreamDto::setOpenToken(QString newOpenToken) { - m_openToken = newOpenToken; -} -QUuid OpenLiveStreamDto::userId() const { return m_userId; } - -void OpenLiveStreamDto::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QString OpenLiveStreamDto::playSessionId() const { return m_playSessionId; } - -void OpenLiveStreamDto::setPlaySessionId(QString newPlaySessionId) { - m_playSessionId = newPlaySessionId; -} -qint32 OpenLiveStreamDto::maxStreamingBitrate() const { return m_maxStreamingBitrate; } - -void OpenLiveStreamDto::setMaxStreamingBitrate(qint32 newMaxStreamingBitrate) { - m_maxStreamingBitrate = newMaxStreamingBitrate; -} -qint64 OpenLiveStreamDto::startTimeTicks() const { return m_startTimeTicks; } - -void OpenLiveStreamDto::setStartTimeTicks(qint64 newStartTimeTicks) { - m_startTimeTicks = newStartTimeTicks; -} -qint32 OpenLiveStreamDto::audioStreamIndex() const { return m_audioStreamIndex; } - -void OpenLiveStreamDto::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -qint32 OpenLiveStreamDto::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void OpenLiveStreamDto::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -qint32 OpenLiveStreamDto::maxAudioChannels() const { return m_maxAudioChannels; } - -void OpenLiveStreamDto::setMaxAudioChannels(qint32 newMaxAudioChannels) { - m_maxAudioChannels = newMaxAudioChannels; -} -QUuid OpenLiveStreamDto::itemId() const { return m_itemId; } - -void OpenLiveStreamDto::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -bool OpenLiveStreamDto::enableDirectPlay() const { return m_enableDirectPlay; } - -void OpenLiveStreamDto::setEnableDirectPlay(bool newEnableDirectPlay) { - m_enableDirectPlay = newEnableDirectPlay; -} -bool OpenLiveStreamDto::enableDirectStream() const { return m_enableDirectStream; } - -void OpenLiveStreamDto::setEnableDirectStream(bool newEnableDirectStream) { - m_enableDirectStream = newEnableDirectStream; -} -QSharedPointer OpenLiveStreamDto::deviceProfile() const { return m_deviceProfile; } - -void OpenLiveStreamDto::setDeviceProfile(QSharedPointer newDeviceProfile) { - m_deviceProfile = newDeviceProfile; -} -QList OpenLiveStreamDto::directPlayProtocols() const { return m_directPlayProtocols; } - -void OpenLiveStreamDto::setDirectPlayProtocols(QList newDirectPlayProtocols) { - m_directPlayProtocols = newDirectPlayProtocols; -} - -} // NS DTO - -namespace Support { - -using OpenLiveStreamDto = Jellyfin::DTO::OpenLiveStreamDto; - -template <> -OpenLiveStreamDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return OpenLiveStreamDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/packageinfo.cpp b/core/src/DTO/packageinfo.cpp deleted file mode 100644 index 8e62fac..0000000 --- a/core/src/DTO/packageinfo.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PackageInfo::PackageInfo() {} -PackageInfo::PackageInfo(const PackageInfo &other) : - m_name(other.m_name), - m_description(other.m_description), - m_overview(other.m_overview), - m_owner(other.m_owner), - m_category(other.m_category), - m_guid(other.m_guid), - m_versions(other.m_versions), - m_imageUrl(other.m_imageUrl){} - -PackageInfo PackageInfo::fromJson(QJsonObject source) { - PackageInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PackageInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["name"]); - m_description = Jellyfin::Support::fromJsonValue(source["description"]); - m_overview = Jellyfin::Support::fromJsonValue(source["overview"]); - m_owner = Jellyfin::Support::fromJsonValue(source["owner"]); - m_category = Jellyfin::Support::fromJsonValue(source["category"]); - m_guid = Jellyfin::Support::fromJsonValue(source["guid"]); - m_versions = Jellyfin::Support::fromJsonValue>>(source["versions"]); - m_imageUrl = Jellyfin::Support::fromJsonValue(source["imageUrl"]); - -} - -QJsonObject PackageInfo::toJson() { - QJsonObject result; - result["name"] = Jellyfin::Support::toJsonValue(m_name); - result["description"] = Jellyfin::Support::toJsonValue(m_description); - result["overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["owner"] = Jellyfin::Support::toJsonValue(m_owner); - result["category"] = Jellyfin::Support::toJsonValue(m_category); - result["guid"] = Jellyfin::Support::toJsonValue(m_guid); - result["versions"] = Jellyfin::Support::toJsonValue>>(m_versions); - result["imageUrl"] = Jellyfin::Support::toJsonValue(m_imageUrl); - - return result; -} - -QString PackageInfo::name() const { return m_name; } - -void PackageInfo::setName(QString newName) { - m_name = newName; -} -QString PackageInfo::description() const { return m_description; } - -void PackageInfo::setDescription(QString newDescription) { - m_description = newDescription; -} -QString PackageInfo::overview() const { return m_overview; } - -void PackageInfo::setOverview(QString newOverview) { - m_overview = newOverview; -} -QString PackageInfo::owner() const { return m_owner; } - -void PackageInfo::setOwner(QString newOwner) { - m_owner = newOwner; -} -QString PackageInfo::category() const { return m_category; } - -void PackageInfo::setCategory(QString newCategory) { - m_category = newCategory; -} -QString PackageInfo::guid() const { return m_guid; } - -void PackageInfo::setGuid(QString newGuid) { - m_guid = newGuid; -} -QList> PackageInfo::versions() const { return m_versions; } - -void PackageInfo::setVersions(QList> newVersions) { - m_versions = newVersions; -} -QString PackageInfo::imageUrl() const { return m_imageUrl; } - -void PackageInfo::setImageUrl(QString newImageUrl) { - m_imageUrl = newImageUrl; -} - -} // NS DTO - -namespace Support { - -using PackageInfo = Jellyfin::DTO::PackageInfo; - -template <> -PackageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PackageInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/parentalrating.cpp b/core/src/DTO/parentalrating.cpp deleted file mode 100644 index 4d8d5b0..0000000 --- a/core/src/DTO/parentalrating.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ParentalRating::ParentalRating() {} -ParentalRating::ParentalRating(const ParentalRating &other) : - m_name(other.m_name), - m_value(other.m_value){} - -ParentalRating ParentalRating::fromJson(QJsonObject source) { - ParentalRating instance; - instance.setFromJson(source); - return instance; -} - - -void ParentalRating::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - -} - -QJsonObject ParentalRating::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - - return result; -} - -QString ParentalRating::name() const { return m_name; } - -void ParentalRating::setName(QString newName) { - m_name = newName; -} -qint32 ParentalRating::value() const { return m_value; } - -void ParentalRating::setValue(qint32 newValue) { - m_value = newValue; -} - -} // NS DTO - -namespace Support { - -using ParentalRating = Jellyfin::DTO::ParentalRating; - -template <> -ParentalRating fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ParentalRating::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/pathsubstitution.cpp b/core/src/DTO/pathsubstitution.cpp deleted file mode 100644 index 982e3b7..0000000 --- a/core/src/DTO/pathsubstitution.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PathSubstitution::PathSubstitution() {} -PathSubstitution::PathSubstitution(const PathSubstitution &other) : - m_from(other.m_from), - m_to(other.m_to){} - -PathSubstitution PathSubstitution::fromJson(QJsonObject source) { - PathSubstitution instance; - instance.setFromJson(source); - return instance; -} - - -void PathSubstitution::setFromJson(QJsonObject source) { - m_from = Jellyfin::Support::fromJsonValue(source["From"]); - m_to = Jellyfin::Support::fromJsonValue(source["To"]); - -} - -QJsonObject PathSubstitution::toJson() { - QJsonObject result; - result["From"] = Jellyfin::Support::toJsonValue(m_from); - result["To"] = Jellyfin::Support::toJsonValue(m_to); - - return result; -} - -QString PathSubstitution::from() const { return m_from; } - -void PathSubstitution::setFrom(QString newFrom) { - m_from = newFrom; -} -QString PathSubstitution::to() const { return m_to; } - -void PathSubstitution::setTo(QString newTo) { - m_to = newTo; -} - -} // NS DTO - -namespace Support { - -using PathSubstitution = Jellyfin::DTO::PathSubstitution; - -template <> -PathSubstitution fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PathSubstitution::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/personlookupinfo.cpp b/core/src/DTO/personlookupinfo.cpp deleted file mode 100644 index 0ab2058..0000000 --- a/core/src/DTO/personlookupinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PersonLookupInfo::PersonLookupInfo() {} -PersonLookupInfo::PersonLookupInfo(const PersonLookupInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated){} - -PersonLookupInfo PersonLookupInfo::fromJson(QJsonObject source) { - PersonLookupInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PersonLookupInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - -} - -QJsonObject PersonLookupInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - - return result; -} - -QString PersonLookupInfo::name() const { return m_name; } - -void PersonLookupInfo::setName(QString newName) { - m_name = newName; -} -QString PersonLookupInfo::path() const { return m_path; } - -void PersonLookupInfo::setPath(QString newPath) { - m_path = newPath; -} -QString PersonLookupInfo::metadataLanguage() const { return m_metadataLanguage; } - -void PersonLookupInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString PersonLookupInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void PersonLookupInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject PersonLookupInfo::providerIds() const { return m_providerIds; } - -void PersonLookupInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 PersonLookupInfo::year() const { return m_year; } - -void PersonLookupInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 PersonLookupInfo::indexNumber() const { return m_indexNumber; } - -void PersonLookupInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 PersonLookupInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void PersonLookupInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime PersonLookupInfo::premiereDate() const { return m_premiereDate; } - -void PersonLookupInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool PersonLookupInfo::isAutomated() const { return m_isAutomated; } - -void PersonLookupInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} - -} // NS DTO - -namespace Support { - -using PersonLookupInfo = Jellyfin::DTO::PersonLookupInfo; - -template <> -PersonLookupInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PersonLookupInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/personlookupinforemotesearchquery.cpp b/core/src/DTO/personlookupinforemotesearchquery.cpp deleted file mode 100644 index c26c465..0000000 --- a/core/src/DTO/personlookupinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PersonLookupInfoRemoteSearchQuery::PersonLookupInfoRemoteSearchQuery() {} -PersonLookupInfoRemoteSearchQuery::PersonLookupInfoRemoteSearchQuery(const PersonLookupInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -PersonLookupInfoRemoteSearchQuery PersonLookupInfoRemoteSearchQuery::fromJson(QJsonObject source) { - PersonLookupInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void PersonLookupInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject PersonLookupInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer PersonLookupInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void PersonLookupInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid PersonLookupInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void PersonLookupInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString PersonLookupInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void PersonLookupInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool PersonLookupInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void PersonLookupInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using PersonLookupInfoRemoteSearchQuery = Jellyfin::DTO::PersonLookupInfoRemoteSearchQuery; - -template <> -PersonLookupInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PersonLookupInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/pingrequestdto.cpp b/core/src/DTO/pingrequestdto.cpp deleted file mode 100644 index 917414f..0000000 --- a/core/src/DTO/pingrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PingRequestDto::PingRequestDto() {} -PingRequestDto::PingRequestDto(const PingRequestDto &other) : - m_ping(other.m_ping){} - -PingRequestDto PingRequestDto::fromJson(QJsonObject source) { - PingRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void PingRequestDto::setFromJson(QJsonObject source) { - m_ping = Jellyfin::Support::fromJsonValue(source["Ping"]); - -} - -QJsonObject PingRequestDto::toJson() { - QJsonObject result; - result["Ping"] = Jellyfin::Support::toJsonValue(m_ping); - - return result; -} - -qint64 PingRequestDto::ping() const { return m_ping; } - -void PingRequestDto::setPing(qint64 newPing) { - m_ping = newPing; -} - -} // NS DTO - -namespace Support { - -using PingRequestDto = Jellyfin::DTO::PingRequestDto; - -template <> -PingRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PingRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/pinredeemresult.cpp b/core/src/DTO/pinredeemresult.cpp deleted file mode 100644 index d183134..0000000 --- a/core/src/DTO/pinredeemresult.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PinRedeemResult::PinRedeemResult() {} -PinRedeemResult::PinRedeemResult(const PinRedeemResult &other) : - m_success(other.m_success), - m_usersReset(other.m_usersReset){} - -PinRedeemResult PinRedeemResult::fromJson(QJsonObject source) { - PinRedeemResult instance; - instance.setFromJson(source); - return instance; -} - - -void PinRedeemResult::setFromJson(QJsonObject source) { - m_success = Jellyfin::Support::fromJsonValue(source["Success"]); - m_usersReset = Jellyfin::Support::fromJsonValue(source["UsersReset"]); - -} - -QJsonObject PinRedeemResult::toJson() { - QJsonObject result; - result["Success"] = Jellyfin::Support::toJsonValue(m_success); - result["UsersReset"] = Jellyfin::Support::toJsonValue(m_usersReset); - - return result; -} - -bool PinRedeemResult::success() const { return m_success; } - -void PinRedeemResult::setSuccess(bool newSuccess) { - m_success = newSuccess; -} -QStringList PinRedeemResult::usersReset() const { return m_usersReset; } - -void PinRedeemResult::setUsersReset(QStringList newUsersReset) { - m_usersReset = newUsersReset; -} - -} // NS DTO - -namespace Support { - -using PinRedeemResult = Jellyfin::DTO::PinRedeemResult; - -template <> -PinRedeemResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PinRedeemResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playaccess.cpp b/core/src/DTO/playaccess.cpp deleted file mode 100644 index 46d0b43..0000000 --- a/core/src/DTO/playaccess.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayAccessClass::PlayAccessClass() {} - - -} // NS DTO - -namespace Support { - -using PlayAccess = Jellyfin::DTO::PlayAccess; - -template <> -PlayAccess fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PlayAccess::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Full")) { - return PlayAccess::Full; - } - if (str == QStringLiteral("None")) { - return PlayAccess::None; - } - - return PlayAccess::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackerrorcode.cpp b/core/src/DTO/playbackerrorcode.cpp deleted file mode 100644 index 24de5ab..0000000 --- a/core/src/DTO/playbackerrorcode.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackErrorCodeClass::PlaybackErrorCodeClass() {} - - -} // NS DTO - -namespace Support { - -using PlaybackErrorCode = Jellyfin::DTO::PlaybackErrorCode; - -template <> -PlaybackErrorCode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PlaybackErrorCode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("NotAllowed")) { - return PlaybackErrorCode::NotAllowed; - } - if (str == QStringLiteral("NoCompatibleStream")) { - return PlaybackErrorCode::NoCompatibleStream; - } - if (str == QStringLiteral("RateLimitExceeded")) { - return PlaybackErrorCode::RateLimitExceeded; - } - - return PlaybackErrorCode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackinfodto.cpp b/core/src/DTO/playbackinfodto.cpp deleted file mode 100644 index 061749b..0000000 --- a/core/src/DTO/playbackinfodto.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackInfoDto::PlaybackInfoDto() {} -PlaybackInfoDto::PlaybackInfoDto(const PlaybackInfoDto &other) : - m_userId(other.m_userId), - m_maxStreamingBitrate(other.m_maxStreamingBitrate), - m_startTimeTicks(other.m_startTimeTicks), - m_audioStreamIndex(other.m_audioStreamIndex), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_maxAudioChannels(other.m_maxAudioChannels), - m_mediaSourceId(other.m_mediaSourceId), - m_liveStreamId(other.m_liveStreamId), - m_deviceProfile(other.m_deviceProfile), - m_enableDirectPlay(other.m_enableDirectPlay), - m_enableDirectStream(other.m_enableDirectStream), - m_enableTranscoding(other.m_enableTranscoding), - m_allowVideoStreamCopy(other.m_allowVideoStreamCopy), - m_allowAudioStreamCopy(other.m_allowAudioStreamCopy), - m_autoOpenLiveStream(other.m_autoOpenLiveStream){} - -PlaybackInfoDto PlaybackInfoDto::fromJson(QJsonObject source) { - PlaybackInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void PlaybackInfoDto::setFromJson(QJsonObject source) { - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue(source["MaxStreamingBitrate"]); - m_startTimeTicks = Jellyfin::Support::fromJsonValue(source["StartTimeTicks"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_maxAudioChannels = Jellyfin::Support::fromJsonValue(source["MaxAudioChannels"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); - m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); - m_enableDirectPlay = Jellyfin::Support::fromJsonValue(source["EnableDirectPlay"]); - m_enableDirectStream = Jellyfin::Support::fromJsonValue(source["EnableDirectStream"]); - m_enableTranscoding = Jellyfin::Support::fromJsonValue(source["EnableTranscoding"]); - m_allowVideoStreamCopy = Jellyfin::Support::fromJsonValue(source["AllowVideoStreamCopy"]); - m_allowAudioStreamCopy = Jellyfin::Support::fromJsonValue(source["AllowAudioStreamCopy"]); - m_autoOpenLiveStream = Jellyfin::Support::fromJsonValue(source["AutoOpenLiveStream"]); - -} - -QJsonObject PlaybackInfoDto::toJson() { - QJsonObject result; - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue(m_maxStreamingBitrate); - result["StartTimeTicks"] = Jellyfin::Support::toJsonValue(m_startTimeTicks); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["MaxAudioChannels"] = Jellyfin::Support::toJsonValue(m_maxAudioChannels); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); - result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); - result["EnableDirectPlay"] = Jellyfin::Support::toJsonValue(m_enableDirectPlay); - result["EnableDirectStream"] = Jellyfin::Support::toJsonValue(m_enableDirectStream); - result["EnableTranscoding"] = Jellyfin::Support::toJsonValue(m_enableTranscoding); - result["AllowVideoStreamCopy"] = Jellyfin::Support::toJsonValue(m_allowVideoStreamCopy); - result["AllowAudioStreamCopy"] = Jellyfin::Support::toJsonValue(m_allowAudioStreamCopy); - result["AutoOpenLiveStream"] = Jellyfin::Support::toJsonValue(m_autoOpenLiveStream); - - return result; -} - -QUuid PlaybackInfoDto::userId() const { return m_userId; } - -void PlaybackInfoDto::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -qint32 PlaybackInfoDto::maxStreamingBitrate() const { return m_maxStreamingBitrate; } - -void PlaybackInfoDto::setMaxStreamingBitrate(qint32 newMaxStreamingBitrate) { - m_maxStreamingBitrate = newMaxStreamingBitrate; -} -qint64 PlaybackInfoDto::startTimeTicks() const { return m_startTimeTicks; } - -void PlaybackInfoDto::setStartTimeTicks(qint64 newStartTimeTicks) { - m_startTimeTicks = newStartTimeTicks; -} -qint32 PlaybackInfoDto::audioStreamIndex() const { return m_audioStreamIndex; } - -void PlaybackInfoDto::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -qint32 PlaybackInfoDto::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void PlaybackInfoDto::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -qint32 PlaybackInfoDto::maxAudioChannels() const { return m_maxAudioChannels; } - -void PlaybackInfoDto::setMaxAudioChannels(qint32 newMaxAudioChannels) { - m_maxAudioChannels = newMaxAudioChannels; -} -QString PlaybackInfoDto::mediaSourceId() const { return m_mediaSourceId; } - -void PlaybackInfoDto::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -QString PlaybackInfoDto::liveStreamId() const { return m_liveStreamId; } - -void PlaybackInfoDto::setLiveStreamId(QString newLiveStreamId) { - m_liveStreamId = newLiveStreamId; -} -QSharedPointer PlaybackInfoDto::deviceProfile() const { return m_deviceProfile; } - -void PlaybackInfoDto::setDeviceProfile(QSharedPointer newDeviceProfile) { - m_deviceProfile = newDeviceProfile; -} -bool PlaybackInfoDto::enableDirectPlay() const { return m_enableDirectPlay; } - -void PlaybackInfoDto::setEnableDirectPlay(bool newEnableDirectPlay) { - m_enableDirectPlay = newEnableDirectPlay; -} -bool PlaybackInfoDto::enableDirectStream() const { return m_enableDirectStream; } - -void PlaybackInfoDto::setEnableDirectStream(bool newEnableDirectStream) { - m_enableDirectStream = newEnableDirectStream; -} -bool PlaybackInfoDto::enableTranscoding() const { return m_enableTranscoding; } - -void PlaybackInfoDto::setEnableTranscoding(bool newEnableTranscoding) { - m_enableTranscoding = newEnableTranscoding; -} -bool PlaybackInfoDto::allowVideoStreamCopy() const { return m_allowVideoStreamCopy; } - -void PlaybackInfoDto::setAllowVideoStreamCopy(bool newAllowVideoStreamCopy) { - m_allowVideoStreamCopy = newAllowVideoStreamCopy; -} -bool PlaybackInfoDto::allowAudioStreamCopy() const { return m_allowAudioStreamCopy; } - -void PlaybackInfoDto::setAllowAudioStreamCopy(bool newAllowAudioStreamCopy) { - m_allowAudioStreamCopy = newAllowAudioStreamCopy; -} -bool PlaybackInfoDto::autoOpenLiveStream() const { return m_autoOpenLiveStream; } - -void PlaybackInfoDto::setAutoOpenLiveStream(bool newAutoOpenLiveStream) { - m_autoOpenLiveStream = newAutoOpenLiveStream; -} - -} // NS DTO - -namespace Support { - -using PlaybackInfoDto = Jellyfin::DTO::PlaybackInfoDto; - -template <> -PlaybackInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaybackInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackinforesponse.cpp b/core/src/DTO/playbackinforesponse.cpp deleted file mode 100644 index b607a4b..0000000 --- a/core/src/DTO/playbackinforesponse.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackInfoResponse::PlaybackInfoResponse() {} -PlaybackInfoResponse::PlaybackInfoResponse(const PlaybackInfoResponse &other) : - m_mediaSources(other.m_mediaSources), - m_playSessionId(other.m_playSessionId), - m_errorCode(other.m_errorCode){} - -PlaybackInfoResponse PlaybackInfoResponse::fromJson(QJsonObject source) { - PlaybackInfoResponse instance; - instance.setFromJson(source); - return instance; -} - - -void PlaybackInfoResponse::setFromJson(QJsonObject source) { - m_mediaSources = Jellyfin::Support::fromJsonValue>>(source["MediaSources"]); - m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); - m_errorCode = Jellyfin::Support::fromJsonValue(source["ErrorCode"]); - -} - -QJsonObject PlaybackInfoResponse::toJson() { - QJsonObject result; - result["MediaSources"] = Jellyfin::Support::toJsonValue>>(m_mediaSources); - result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); - result["ErrorCode"] = Jellyfin::Support::toJsonValue(m_errorCode); - - return result; -} - -QList> PlaybackInfoResponse::mediaSources() const { return m_mediaSources; } - -void PlaybackInfoResponse::setMediaSources(QList> newMediaSources) { - m_mediaSources = newMediaSources; -} -QString PlaybackInfoResponse::playSessionId() const { return m_playSessionId; } - -void PlaybackInfoResponse::setPlaySessionId(QString newPlaySessionId) { - m_playSessionId = newPlaySessionId; -} -PlaybackErrorCode PlaybackInfoResponse::errorCode() const { return m_errorCode; } - -void PlaybackInfoResponse::setErrorCode(PlaybackErrorCode newErrorCode) { - m_errorCode = newErrorCode; -} - -} // NS DTO - -namespace Support { - -using PlaybackInfoResponse = Jellyfin::DTO::PlaybackInfoResponse; - -template <> -PlaybackInfoResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaybackInfoResponse::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackprogressinfo.cpp b/core/src/DTO/playbackprogressinfo.cpp deleted file mode 100644 index 5226efe..0000000 --- a/core/src/DTO/playbackprogressinfo.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackProgressInfo::PlaybackProgressInfo() {} -PlaybackProgressInfo::PlaybackProgressInfo(const PlaybackProgressInfo &other) : - m_canSeek(other.m_canSeek), - m_item(other.m_item), - m_itemId(other.m_itemId), - m_sessionId(other.m_sessionId), - m_mediaSourceId(other.m_mediaSourceId), - m_audioStreamIndex(other.m_audioStreamIndex), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_isPaused(other.m_isPaused), - m_isMuted(other.m_isMuted), - m_positionTicks(other.m_positionTicks), - m_playbackStartTimeTicks(other.m_playbackStartTimeTicks), - m_volumeLevel(other.m_volumeLevel), - m_brightness(other.m_brightness), - m_aspectRatio(other.m_aspectRatio), - m_playMethod(other.m_playMethod), - m_liveStreamId(other.m_liveStreamId), - m_playSessionId(other.m_playSessionId), - m_repeatMode(other.m_repeatMode), - m_nowPlayingQueue(other.m_nowPlayingQueue), - m_playlistItemId(other.m_playlistItemId){} - -PlaybackProgressInfo PlaybackProgressInfo::fromJson(QJsonObject source) { - PlaybackProgressInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PlaybackProgressInfo::setFromJson(QJsonObject source) { - m_canSeek = Jellyfin::Support::fromJsonValue(source["CanSeek"]); - m_item = Jellyfin::Support::fromJsonValue>(source["Item"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_sessionId = Jellyfin::Support::fromJsonValue(source["SessionId"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_isPaused = Jellyfin::Support::fromJsonValue(source["IsPaused"]); - m_isMuted = Jellyfin::Support::fromJsonValue(source["IsMuted"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_playbackStartTimeTicks = Jellyfin::Support::fromJsonValue(source["PlaybackStartTimeTicks"]); - m_volumeLevel = Jellyfin::Support::fromJsonValue(source["VolumeLevel"]); - m_brightness = Jellyfin::Support::fromJsonValue(source["Brightness"]); - m_aspectRatio = Jellyfin::Support::fromJsonValue(source["AspectRatio"]); - m_playMethod = Jellyfin::Support::fromJsonValue(source["PlayMethod"]); - m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); - m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); - m_repeatMode = Jellyfin::Support::fromJsonValue(source["RepeatMode"]); - m_nowPlayingQueue = Jellyfin::Support::fromJsonValue>>(source["NowPlayingQueue"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject PlaybackProgressInfo::toJson() { - QJsonObject result; - result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); - result["Item"] = Jellyfin::Support::toJsonValue>(m_item); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SessionId"] = Jellyfin::Support::toJsonValue(m_sessionId); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["IsPaused"] = Jellyfin::Support::toJsonValue(m_isPaused); - result["IsMuted"] = Jellyfin::Support::toJsonValue(m_isMuted); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["PlaybackStartTimeTicks"] = Jellyfin::Support::toJsonValue(m_playbackStartTimeTicks); - result["VolumeLevel"] = Jellyfin::Support::toJsonValue(m_volumeLevel); - result["Brightness"] = Jellyfin::Support::toJsonValue(m_brightness); - result["AspectRatio"] = Jellyfin::Support::toJsonValue(m_aspectRatio); - result["PlayMethod"] = Jellyfin::Support::toJsonValue(m_playMethod); - result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); - result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); - result["RepeatMode"] = Jellyfin::Support::toJsonValue(m_repeatMode); - result["NowPlayingQueue"] = Jellyfin::Support::toJsonValue>>(m_nowPlayingQueue); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -bool PlaybackProgressInfo::canSeek() const { return m_canSeek; } - -void PlaybackProgressInfo::setCanSeek(bool newCanSeek) { - m_canSeek = newCanSeek; -} -QSharedPointer PlaybackProgressInfo::item() const { return m_item; } - -void PlaybackProgressInfo::setItem(QSharedPointer newItem) { - m_item = newItem; -} -QUuid PlaybackProgressInfo::itemId() const { return m_itemId; } - -void PlaybackProgressInfo::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString PlaybackProgressInfo::sessionId() const { return m_sessionId; } - -void PlaybackProgressInfo::setSessionId(QString newSessionId) { - m_sessionId = newSessionId; -} -QString PlaybackProgressInfo::mediaSourceId() const { return m_mediaSourceId; } - -void PlaybackProgressInfo::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -qint32 PlaybackProgressInfo::audioStreamIndex() const { return m_audioStreamIndex; } - -void PlaybackProgressInfo::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -qint32 PlaybackProgressInfo::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void PlaybackProgressInfo::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -bool PlaybackProgressInfo::isPaused() const { return m_isPaused; } - -void PlaybackProgressInfo::setIsPaused(bool newIsPaused) { - m_isPaused = newIsPaused; -} -bool PlaybackProgressInfo::isMuted() const { return m_isMuted; } - -void PlaybackProgressInfo::setIsMuted(bool newIsMuted) { - m_isMuted = newIsMuted; -} -qint64 PlaybackProgressInfo::positionTicks() const { return m_positionTicks; } - -void PlaybackProgressInfo::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -qint64 PlaybackProgressInfo::playbackStartTimeTicks() const { return m_playbackStartTimeTicks; } - -void PlaybackProgressInfo::setPlaybackStartTimeTicks(qint64 newPlaybackStartTimeTicks) { - m_playbackStartTimeTicks = newPlaybackStartTimeTicks; -} -qint32 PlaybackProgressInfo::volumeLevel() const { return m_volumeLevel; } - -void PlaybackProgressInfo::setVolumeLevel(qint32 newVolumeLevel) { - m_volumeLevel = newVolumeLevel; -} -qint32 PlaybackProgressInfo::brightness() const { return m_brightness; } - -void PlaybackProgressInfo::setBrightness(qint32 newBrightness) { - m_brightness = newBrightness; -} -QString PlaybackProgressInfo::aspectRatio() const { return m_aspectRatio; } - -void PlaybackProgressInfo::setAspectRatio(QString newAspectRatio) { - m_aspectRatio = newAspectRatio; -} -PlayMethod PlaybackProgressInfo::playMethod() const { return m_playMethod; } - -void PlaybackProgressInfo::setPlayMethod(PlayMethod newPlayMethod) { - m_playMethod = newPlayMethod; -} -QString PlaybackProgressInfo::liveStreamId() const { return m_liveStreamId; } - -void PlaybackProgressInfo::setLiveStreamId(QString newLiveStreamId) { - m_liveStreamId = newLiveStreamId; -} -QString PlaybackProgressInfo::playSessionId() const { return m_playSessionId; } - -void PlaybackProgressInfo::setPlaySessionId(QString newPlaySessionId) { - m_playSessionId = newPlaySessionId; -} -RepeatMode PlaybackProgressInfo::repeatMode() const { return m_repeatMode; } - -void PlaybackProgressInfo::setRepeatMode(RepeatMode newRepeatMode) { - m_repeatMode = newRepeatMode; -} -QList> PlaybackProgressInfo::nowPlayingQueue() const { return m_nowPlayingQueue; } - -void PlaybackProgressInfo::setNowPlayingQueue(QList> newNowPlayingQueue) { - m_nowPlayingQueue = newNowPlayingQueue; -} -QString PlaybackProgressInfo::playlistItemId() const { return m_playlistItemId; } - -void PlaybackProgressInfo::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using PlaybackProgressInfo = Jellyfin::DTO::PlaybackProgressInfo; - -template <> -PlaybackProgressInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaybackProgressInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackstartinfo.cpp b/core/src/DTO/playbackstartinfo.cpp deleted file mode 100644 index 34a9d9a..0000000 --- a/core/src/DTO/playbackstartinfo.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackStartInfo::PlaybackStartInfo() {} -PlaybackStartInfo::PlaybackStartInfo(const PlaybackStartInfo &other) : - m_canSeek(other.m_canSeek), - m_item(other.m_item), - m_itemId(other.m_itemId), - m_sessionId(other.m_sessionId), - m_mediaSourceId(other.m_mediaSourceId), - m_audioStreamIndex(other.m_audioStreamIndex), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_isPaused(other.m_isPaused), - m_isMuted(other.m_isMuted), - m_positionTicks(other.m_positionTicks), - m_playbackStartTimeTicks(other.m_playbackStartTimeTicks), - m_volumeLevel(other.m_volumeLevel), - m_brightness(other.m_brightness), - m_aspectRatio(other.m_aspectRatio), - m_playMethod(other.m_playMethod), - m_liveStreamId(other.m_liveStreamId), - m_playSessionId(other.m_playSessionId), - m_repeatMode(other.m_repeatMode), - m_nowPlayingQueue(other.m_nowPlayingQueue), - m_playlistItemId(other.m_playlistItemId){} - -PlaybackStartInfo PlaybackStartInfo::fromJson(QJsonObject source) { - PlaybackStartInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PlaybackStartInfo::setFromJson(QJsonObject source) { - m_canSeek = Jellyfin::Support::fromJsonValue(source["CanSeek"]); - m_item = Jellyfin::Support::fromJsonValue>(source["Item"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_sessionId = Jellyfin::Support::fromJsonValue(source["SessionId"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_isPaused = Jellyfin::Support::fromJsonValue(source["IsPaused"]); - m_isMuted = Jellyfin::Support::fromJsonValue(source["IsMuted"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_playbackStartTimeTicks = Jellyfin::Support::fromJsonValue(source["PlaybackStartTimeTicks"]); - m_volumeLevel = Jellyfin::Support::fromJsonValue(source["VolumeLevel"]); - m_brightness = Jellyfin::Support::fromJsonValue(source["Brightness"]); - m_aspectRatio = Jellyfin::Support::fromJsonValue(source["AspectRatio"]); - m_playMethod = Jellyfin::Support::fromJsonValue(source["PlayMethod"]); - m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); - m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); - m_repeatMode = Jellyfin::Support::fromJsonValue(source["RepeatMode"]); - m_nowPlayingQueue = Jellyfin::Support::fromJsonValue>>(source["NowPlayingQueue"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject PlaybackStartInfo::toJson() { - QJsonObject result; - result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); - result["Item"] = Jellyfin::Support::toJsonValue>(m_item); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SessionId"] = Jellyfin::Support::toJsonValue(m_sessionId); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["IsPaused"] = Jellyfin::Support::toJsonValue(m_isPaused); - result["IsMuted"] = Jellyfin::Support::toJsonValue(m_isMuted); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["PlaybackStartTimeTicks"] = Jellyfin::Support::toJsonValue(m_playbackStartTimeTicks); - result["VolumeLevel"] = Jellyfin::Support::toJsonValue(m_volumeLevel); - result["Brightness"] = Jellyfin::Support::toJsonValue(m_brightness); - result["AspectRatio"] = Jellyfin::Support::toJsonValue(m_aspectRatio); - result["PlayMethod"] = Jellyfin::Support::toJsonValue(m_playMethod); - result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); - result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); - result["RepeatMode"] = Jellyfin::Support::toJsonValue(m_repeatMode); - result["NowPlayingQueue"] = Jellyfin::Support::toJsonValue>>(m_nowPlayingQueue); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -bool PlaybackStartInfo::canSeek() const { return m_canSeek; } - -void PlaybackStartInfo::setCanSeek(bool newCanSeek) { - m_canSeek = newCanSeek; -} -QSharedPointer PlaybackStartInfo::item() const { return m_item; } - -void PlaybackStartInfo::setItem(QSharedPointer newItem) { - m_item = newItem; -} -QUuid PlaybackStartInfo::itemId() const { return m_itemId; } - -void PlaybackStartInfo::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString PlaybackStartInfo::sessionId() const { return m_sessionId; } - -void PlaybackStartInfo::setSessionId(QString newSessionId) { - m_sessionId = newSessionId; -} -QString PlaybackStartInfo::mediaSourceId() const { return m_mediaSourceId; } - -void PlaybackStartInfo::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -qint32 PlaybackStartInfo::audioStreamIndex() const { return m_audioStreamIndex; } - -void PlaybackStartInfo::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -qint32 PlaybackStartInfo::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void PlaybackStartInfo::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -bool PlaybackStartInfo::isPaused() const { return m_isPaused; } - -void PlaybackStartInfo::setIsPaused(bool newIsPaused) { - m_isPaused = newIsPaused; -} -bool PlaybackStartInfo::isMuted() const { return m_isMuted; } - -void PlaybackStartInfo::setIsMuted(bool newIsMuted) { - m_isMuted = newIsMuted; -} -qint64 PlaybackStartInfo::positionTicks() const { return m_positionTicks; } - -void PlaybackStartInfo::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -qint64 PlaybackStartInfo::playbackStartTimeTicks() const { return m_playbackStartTimeTicks; } - -void PlaybackStartInfo::setPlaybackStartTimeTicks(qint64 newPlaybackStartTimeTicks) { - m_playbackStartTimeTicks = newPlaybackStartTimeTicks; -} -qint32 PlaybackStartInfo::volumeLevel() const { return m_volumeLevel; } - -void PlaybackStartInfo::setVolumeLevel(qint32 newVolumeLevel) { - m_volumeLevel = newVolumeLevel; -} -qint32 PlaybackStartInfo::brightness() const { return m_brightness; } - -void PlaybackStartInfo::setBrightness(qint32 newBrightness) { - m_brightness = newBrightness; -} -QString PlaybackStartInfo::aspectRatio() const { return m_aspectRatio; } - -void PlaybackStartInfo::setAspectRatio(QString newAspectRatio) { - m_aspectRatio = newAspectRatio; -} -PlayMethod PlaybackStartInfo::playMethod() const { return m_playMethod; } - -void PlaybackStartInfo::setPlayMethod(PlayMethod newPlayMethod) { - m_playMethod = newPlayMethod; -} -QString PlaybackStartInfo::liveStreamId() const { return m_liveStreamId; } - -void PlaybackStartInfo::setLiveStreamId(QString newLiveStreamId) { - m_liveStreamId = newLiveStreamId; -} -QString PlaybackStartInfo::playSessionId() const { return m_playSessionId; } - -void PlaybackStartInfo::setPlaySessionId(QString newPlaySessionId) { - m_playSessionId = newPlaySessionId; -} -RepeatMode PlaybackStartInfo::repeatMode() const { return m_repeatMode; } - -void PlaybackStartInfo::setRepeatMode(RepeatMode newRepeatMode) { - m_repeatMode = newRepeatMode; -} -QList> PlaybackStartInfo::nowPlayingQueue() const { return m_nowPlayingQueue; } - -void PlaybackStartInfo::setNowPlayingQueue(QList> newNowPlayingQueue) { - m_nowPlayingQueue = newNowPlayingQueue; -} -QString PlaybackStartInfo::playlistItemId() const { return m_playlistItemId; } - -void PlaybackStartInfo::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using PlaybackStartInfo = Jellyfin::DTO::PlaybackStartInfo; - -template <> -PlaybackStartInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaybackStartInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playbackstopinfo.cpp b/core/src/DTO/playbackstopinfo.cpp deleted file mode 100644 index 87d16c5..0000000 --- a/core/src/DTO/playbackstopinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaybackStopInfo::PlaybackStopInfo() {} -PlaybackStopInfo::PlaybackStopInfo(const PlaybackStopInfo &other) : - m_item(other.m_item), - m_itemId(other.m_itemId), - m_sessionId(other.m_sessionId), - m_mediaSourceId(other.m_mediaSourceId), - m_positionTicks(other.m_positionTicks), - m_liveStreamId(other.m_liveStreamId), - m_playSessionId(other.m_playSessionId), - m_failed(other.m_failed), - m_nextMediaType(other.m_nextMediaType), - m_playlistItemId(other.m_playlistItemId), - m_nowPlayingQueue(other.m_nowPlayingQueue){} - -PlaybackStopInfo PlaybackStopInfo::fromJson(QJsonObject source) { - PlaybackStopInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PlaybackStopInfo::setFromJson(QJsonObject source) { - m_item = Jellyfin::Support::fromJsonValue>(source["Item"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_sessionId = Jellyfin::Support::fromJsonValue(source["SessionId"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); - m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); - m_failed = Jellyfin::Support::fromJsonValue(source["Failed"]); - m_nextMediaType = Jellyfin::Support::fromJsonValue(source["NextMediaType"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - m_nowPlayingQueue = Jellyfin::Support::fromJsonValue>>(source["NowPlayingQueue"]); - -} - -QJsonObject PlaybackStopInfo::toJson() { - QJsonObject result; - result["Item"] = Jellyfin::Support::toJsonValue>(m_item); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SessionId"] = Jellyfin::Support::toJsonValue(m_sessionId); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); - result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); - result["Failed"] = Jellyfin::Support::toJsonValue(m_failed); - result["NextMediaType"] = Jellyfin::Support::toJsonValue(m_nextMediaType); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - result["NowPlayingQueue"] = Jellyfin::Support::toJsonValue>>(m_nowPlayingQueue); - - return result; -} - -QSharedPointer PlaybackStopInfo::item() const { return m_item; } - -void PlaybackStopInfo::setItem(QSharedPointer newItem) { - m_item = newItem; -} -QUuid PlaybackStopInfo::itemId() const { return m_itemId; } - -void PlaybackStopInfo::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString PlaybackStopInfo::sessionId() const { return m_sessionId; } - -void PlaybackStopInfo::setSessionId(QString newSessionId) { - m_sessionId = newSessionId; -} -QString PlaybackStopInfo::mediaSourceId() const { return m_mediaSourceId; } - -void PlaybackStopInfo::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -qint64 PlaybackStopInfo::positionTicks() const { return m_positionTicks; } - -void PlaybackStopInfo::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -QString PlaybackStopInfo::liveStreamId() const { return m_liveStreamId; } - -void PlaybackStopInfo::setLiveStreamId(QString newLiveStreamId) { - m_liveStreamId = newLiveStreamId; -} -QString PlaybackStopInfo::playSessionId() const { return m_playSessionId; } - -void PlaybackStopInfo::setPlaySessionId(QString newPlaySessionId) { - m_playSessionId = newPlaySessionId; -} -bool PlaybackStopInfo::failed() const { return m_failed; } - -void PlaybackStopInfo::setFailed(bool newFailed) { - m_failed = newFailed; -} -QString PlaybackStopInfo::nextMediaType() const { return m_nextMediaType; } - -void PlaybackStopInfo::setNextMediaType(QString newNextMediaType) { - m_nextMediaType = newNextMediaType; -} -QString PlaybackStopInfo::playlistItemId() const { return m_playlistItemId; } - -void PlaybackStopInfo::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} -QList> PlaybackStopInfo::nowPlayingQueue() const { return m_nowPlayingQueue; } - -void PlaybackStopInfo::setNowPlayingQueue(QList> newNowPlayingQueue) { - m_nowPlayingQueue = newNowPlayingQueue; -} - -} // NS DTO - -namespace Support { - -using PlaybackStopInfo = Jellyfin::DTO::PlaybackStopInfo; - -template <> -PlaybackStopInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaybackStopInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playcommand.cpp b/core/src/DTO/playcommand.cpp deleted file mode 100644 index 9dce41b..0000000 --- a/core/src/DTO/playcommand.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayCommandClass::PlayCommandClass() {} - - -} // NS DTO - -namespace Support { - -using PlayCommand = Jellyfin::DTO::PlayCommand; - -template <> -PlayCommand fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PlayCommand::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("PlayNow")) { - return PlayCommand::PlayNow; - } - if (str == QStringLiteral("PlayNext")) { - return PlayCommand::PlayNext; - } - if (str == QStringLiteral("PlayLast")) { - return PlayCommand::PlayLast; - } - if (str == QStringLiteral("PlayInstantMix")) { - return PlayCommand::PlayInstantMix; - } - if (str == QStringLiteral("PlayShuffle")) { - return PlayCommand::PlayShuffle; - } - - return PlayCommand::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playerstateinfo.cpp b/core/src/DTO/playerstateinfo.cpp deleted file mode 100644 index 8fab6a5..0000000 --- a/core/src/DTO/playerstateinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayerStateInfo::PlayerStateInfo() {} -PlayerStateInfo::PlayerStateInfo(const PlayerStateInfo &other) : - m_positionTicks(other.m_positionTicks), - m_canSeek(other.m_canSeek), - m_isPaused(other.m_isPaused), - m_isMuted(other.m_isMuted), - m_volumeLevel(other.m_volumeLevel), - m_audioStreamIndex(other.m_audioStreamIndex), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_mediaSourceId(other.m_mediaSourceId), - m_playMethod(other.m_playMethod), - m_repeatMode(other.m_repeatMode){} - -PlayerStateInfo PlayerStateInfo::fromJson(QJsonObject source) { - PlayerStateInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PlayerStateInfo::setFromJson(QJsonObject source) { - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_canSeek = Jellyfin::Support::fromJsonValue(source["CanSeek"]); - m_isPaused = Jellyfin::Support::fromJsonValue(source["IsPaused"]); - m_isMuted = Jellyfin::Support::fromJsonValue(source["IsMuted"]); - m_volumeLevel = Jellyfin::Support::fromJsonValue(source["VolumeLevel"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_playMethod = Jellyfin::Support::fromJsonValue(source["PlayMethod"]); - m_repeatMode = Jellyfin::Support::fromJsonValue(source["RepeatMode"]); - -} - -QJsonObject PlayerStateInfo::toJson() { - QJsonObject result; - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); - result["IsPaused"] = Jellyfin::Support::toJsonValue(m_isPaused); - result["IsMuted"] = Jellyfin::Support::toJsonValue(m_isMuted); - result["VolumeLevel"] = Jellyfin::Support::toJsonValue(m_volumeLevel); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["PlayMethod"] = Jellyfin::Support::toJsonValue(m_playMethod); - result["RepeatMode"] = Jellyfin::Support::toJsonValue(m_repeatMode); - - return result; -} - -qint64 PlayerStateInfo::positionTicks() const { return m_positionTicks; } - -void PlayerStateInfo::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -bool PlayerStateInfo::canSeek() const { return m_canSeek; } - -void PlayerStateInfo::setCanSeek(bool newCanSeek) { - m_canSeek = newCanSeek; -} -bool PlayerStateInfo::isPaused() const { return m_isPaused; } - -void PlayerStateInfo::setIsPaused(bool newIsPaused) { - m_isPaused = newIsPaused; -} -bool PlayerStateInfo::isMuted() const { return m_isMuted; } - -void PlayerStateInfo::setIsMuted(bool newIsMuted) { - m_isMuted = newIsMuted; -} -qint32 PlayerStateInfo::volumeLevel() const { return m_volumeLevel; } - -void PlayerStateInfo::setVolumeLevel(qint32 newVolumeLevel) { - m_volumeLevel = newVolumeLevel; -} -qint32 PlayerStateInfo::audioStreamIndex() const { return m_audioStreamIndex; } - -void PlayerStateInfo::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -qint32 PlayerStateInfo::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void PlayerStateInfo::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -QString PlayerStateInfo::mediaSourceId() const { return m_mediaSourceId; } - -void PlayerStateInfo::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -PlayMethod PlayerStateInfo::playMethod() const { return m_playMethod; } - -void PlayerStateInfo::setPlayMethod(PlayMethod newPlayMethod) { - m_playMethod = newPlayMethod; -} -RepeatMode PlayerStateInfo::repeatMode() const { return m_repeatMode; } - -void PlayerStateInfo::setRepeatMode(RepeatMode newRepeatMode) { - m_repeatMode = newRepeatMode; -} - -} // NS DTO - -namespace Support { - -using PlayerStateInfo = Jellyfin::DTO::PlayerStateInfo; - -template <> -PlayerStateInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlayerStateInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playlistcreationresult.cpp b/core/src/DTO/playlistcreationresult.cpp deleted file mode 100644 index 1b0b68b..0000000 --- a/core/src/DTO/playlistcreationresult.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaylistCreationResult::PlaylistCreationResult() {} -PlaylistCreationResult::PlaylistCreationResult(const PlaylistCreationResult &other) : - m_jellyfinId(other.m_jellyfinId){} - -PlaylistCreationResult PlaylistCreationResult::fromJson(QJsonObject source) { - PlaylistCreationResult instance; - instance.setFromJson(source); - return instance; -} - - -void PlaylistCreationResult::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject PlaylistCreationResult::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QString PlaylistCreationResult::jellyfinId() const { return m_jellyfinId; } - -void PlaylistCreationResult::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using PlaylistCreationResult = Jellyfin::DTO::PlaylistCreationResult; - -template <> -PlaylistCreationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaylistCreationResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playmethod.cpp b/core/src/DTO/playmethod.cpp deleted file mode 100644 index c3333c1..0000000 --- a/core/src/DTO/playmethod.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayMethodClass::PlayMethodClass() {} - - -} // NS DTO - -namespace Support { - -using PlayMethod = Jellyfin::DTO::PlayMethod; - -template <> -PlayMethod fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PlayMethod::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Transcode")) { - return PlayMethod::Transcode; - } - if (str == QStringLiteral("DirectStream")) { - return PlayMethod::DirectStream; - } - if (str == QStringLiteral("DirectPlay")) { - return PlayMethod::DirectPlay; - } - - return PlayMethod::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playrequest.cpp b/core/src/DTO/playrequest.cpp deleted file mode 100644 index 5d40a36..0000000 --- a/core/src/DTO/playrequest.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayRequest::PlayRequest() {} -PlayRequest::PlayRequest(const PlayRequest &other) : - m_itemIds(other.m_itemIds), - m_startPositionTicks(other.m_startPositionTicks), - m_playCommand(other.m_playCommand), - m_controllingUserId(other.m_controllingUserId), - m_subtitleStreamIndex(other.m_subtitleStreamIndex), - m_audioStreamIndex(other.m_audioStreamIndex), - m_mediaSourceId(other.m_mediaSourceId), - m_startIndex(other.m_startIndex){} - -PlayRequest PlayRequest::fromJson(QJsonObject source) { - PlayRequest instance; - instance.setFromJson(source); - return instance; -} - - -void PlayRequest::setFromJson(QJsonObject source) { - m_itemIds = Jellyfin::Support::fromJsonValue>(source["ItemIds"]); - m_startPositionTicks = Jellyfin::Support::fromJsonValue(source["StartPositionTicks"]); - m_playCommand = Jellyfin::Support::fromJsonValue(source["PlayCommand"]); - m_controllingUserId = Jellyfin::Support::fromJsonValue(source["ControllingUserId"]); - m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue(source["SubtitleStreamIndex"]); - m_audioStreamIndex = Jellyfin::Support::fromJsonValue(source["AudioStreamIndex"]); - m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject PlayRequest::toJson() { - QJsonObject result; - result["ItemIds"] = Jellyfin::Support::toJsonValue>(m_itemIds); - result["StartPositionTicks"] = Jellyfin::Support::toJsonValue(m_startPositionTicks); - result["PlayCommand"] = Jellyfin::Support::toJsonValue(m_playCommand); - result["ControllingUserId"] = Jellyfin::Support::toJsonValue(m_controllingUserId); - result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue(m_subtitleStreamIndex); - result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue(m_audioStreamIndex); - result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList PlayRequest::itemIds() const { return m_itemIds; } - -void PlayRequest::setItemIds(QList newItemIds) { - m_itemIds = newItemIds; -} -qint64 PlayRequest::startPositionTicks() const { return m_startPositionTicks; } - -void PlayRequest::setStartPositionTicks(qint64 newStartPositionTicks) { - m_startPositionTicks = newStartPositionTicks; -} -PlayCommand PlayRequest::playCommand() const { return m_playCommand; } - -void PlayRequest::setPlayCommand(PlayCommand newPlayCommand) { - m_playCommand = newPlayCommand; -} -QUuid PlayRequest::controllingUserId() const { return m_controllingUserId; } - -void PlayRequest::setControllingUserId(QUuid newControllingUserId) { - m_controllingUserId = newControllingUserId; -} -qint32 PlayRequest::subtitleStreamIndex() const { return m_subtitleStreamIndex; } - -void PlayRequest::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { - m_subtitleStreamIndex = newSubtitleStreamIndex; -} -qint32 PlayRequest::audioStreamIndex() const { return m_audioStreamIndex; } - -void PlayRequest::setAudioStreamIndex(qint32 newAudioStreamIndex) { - m_audioStreamIndex = newAudioStreamIndex; -} -QString PlayRequest::mediaSourceId() const { return m_mediaSourceId; } - -void PlayRequest::setMediaSourceId(QString newMediaSourceId) { - m_mediaSourceId = newMediaSourceId; -} -qint32 PlayRequest::startIndex() const { return m_startIndex; } - -void PlayRequest::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using PlayRequest = Jellyfin::DTO::PlayRequest; - -template <> -PlayRequest fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlayRequest::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playrequestdto.cpp b/core/src/DTO/playrequestdto.cpp deleted file mode 100644 index 93c7529..0000000 --- a/core/src/DTO/playrequestdto.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlayRequestDto::PlayRequestDto() {} -PlayRequestDto::PlayRequestDto(const PlayRequestDto &other) : - m_playingQueue(other.m_playingQueue), - m_playingItemPosition(other.m_playingItemPosition), - m_startPositionTicks(other.m_startPositionTicks){} - -PlayRequestDto PlayRequestDto::fromJson(QJsonObject source) { - PlayRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void PlayRequestDto::setFromJson(QJsonObject source) { - m_playingQueue = Jellyfin::Support::fromJsonValue>(source["PlayingQueue"]); - m_playingItemPosition = Jellyfin::Support::fromJsonValue(source["PlayingItemPosition"]); - m_startPositionTicks = Jellyfin::Support::fromJsonValue(source["StartPositionTicks"]); - -} - -QJsonObject PlayRequestDto::toJson() { - QJsonObject result; - result["PlayingQueue"] = Jellyfin::Support::toJsonValue>(m_playingQueue); - result["PlayingItemPosition"] = Jellyfin::Support::toJsonValue(m_playingItemPosition); - result["StartPositionTicks"] = Jellyfin::Support::toJsonValue(m_startPositionTicks); - - return result; -} - -QList PlayRequestDto::playingQueue() const { return m_playingQueue; } - -void PlayRequestDto::setPlayingQueue(QList newPlayingQueue) { - m_playingQueue = newPlayingQueue; -} -qint32 PlayRequestDto::playingItemPosition() const { return m_playingItemPosition; } - -void PlayRequestDto::setPlayingItemPosition(qint32 newPlayingItemPosition) { - m_playingItemPosition = newPlayingItemPosition; -} -qint64 PlayRequestDto::startPositionTicks() const { return m_startPositionTicks; } - -void PlayRequestDto::setStartPositionTicks(qint64 newStartPositionTicks) { - m_startPositionTicks = newStartPositionTicks; -} - -} // NS DTO - -namespace Support { - -using PlayRequestDto = Jellyfin::DTO::PlayRequestDto; - -template <> -PlayRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlayRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playstatecommand.cpp b/core/src/DTO/playstatecommand.cpp deleted file mode 100644 index 9775aff..0000000 --- a/core/src/DTO/playstatecommand.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaystateCommandClass::PlaystateCommandClass() {} - - -} // NS DTO - -namespace Support { - -using PlaystateCommand = Jellyfin::DTO::PlaystateCommand; - -template <> -PlaystateCommand fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PlaystateCommand::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Stop")) { - return PlaystateCommand::Stop; - } - if (str == QStringLiteral("Pause")) { - return PlaystateCommand::Pause; - } - if (str == QStringLiteral("Unpause")) { - return PlaystateCommand::Unpause; - } - if (str == QStringLiteral("NextTrack")) { - return PlaystateCommand::NextTrack; - } - if (str == QStringLiteral("PreviousTrack")) { - return PlaystateCommand::PreviousTrack; - } - if (str == QStringLiteral("Seek")) { - return PlaystateCommand::Seek; - } - if (str == QStringLiteral("Rewind")) { - return PlaystateCommand::Rewind; - } - if (str == QStringLiteral("FastForward")) { - return PlaystateCommand::FastForward; - } - if (str == QStringLiteral("PlayPause")) { - return PlaystateCommand::PlayPause; - } - - return PlaystateCommand::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/playstaterequest.cpp b/core/src/DTO/playstaterequest.cpp deleted file mode 100644 index 03828a2..0000000 --- a/core/src/DTO/playstaterequest.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PlaystateRequest::PlaystateRequest() {} -PlaystateRequest::PlaystateRequest(const PlaystateRequest &other) : - m_command(other.m_command), - m_seekPositionTicks(other.m_seekPositionTicks), - m_controllingUserId(other.m_controllingUserId){} - -PlaystateRequest PlaystateRequest::fromJson(QJsonObject source) { - PlaystateRequest instance; - instance.setFromJson(source); - return instance; -} - - -void PlaystateRequest::setFromJson(QJsonObject source) { - m_command = Jellyfin::Support::fromJsonValue(source["Command"]); - m_seekPositionTicks = Jellyfin::Support::fromJsonValue(source["SeekPositionTicks"]); - m_controllingUserId = Jellyfin::Support::fromJsonValue(source["ControllingUserId"]); - -} - -QJsonObject PlaystateRequest::toJson() { - QJsonObject result; - result["Command"] = Jellyfin::Support::toJsonValue(m_command); - result["SeekPositionTicks"] = Jellyfin::Support::toJsonValue(m_seekPositionTicks); - result["ControllingUserId"] = Jellyfin::Support::toJsonValue(m_controllingUserId); - - return result; -} - -PlaystateCommand PlaystateRequest::command() const { return m_command; } - -void PlaystateRequest::setCommand(PlaystateCommand newCommand) { - m_command = newCommand; -} -qint64 PlaystateRequest::seekPositionTicks() const { return m_seekPositionTicks; } - -void PlaystateRequest::setSeekPositionTicks(qint64 newSeekPositionTicks) { - m_seekPositionTicks = newSeekPositionTicks; -} -QString PlaystateRequest::controllingUserId() const { return m_controllingUserId; } - -void PlaystateRequest::setControllingUserId(QString newControllingUserId) { - m_controllingUserId = newControllingUserId; -} - -} // NS DTO - -namespace Support { - -using PlaystateRequest = Jellyfin::DTO::PlaystateRequest; - -template <> -PlaystateRequest fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PlaystateRequest::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/plugininfo.cpp b/core/src/DTO/plugininfo.cpp deleted file mode 100644 index 05ed8e3..0000000 --- a/core/src/DTO/plugininfo.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PluginInfo::PluginInfo() {} -PluginInfo::PluginInfo(const PluginInfo &other) : - m_name(other.m_name), - m_version(other.m_version), - m_configurationFileName(other.m_configurationFileName), - m_description(other.m_description), - m_jellyfinId(other.m_jellyfinId), - m_canUninstall(other.m_canUninstall), - m_hasImage(other.m_hasImage), - m_status(other.m_status){} - -PluginInfo PluginInfo::fromJson(QJsonObject source) { - PluginInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PluginInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_version = Jellyfin::Support::fromJsonValue>(source["Version"]); - m_configurationFileName = Jellyfin::Support::fromJsonValue(source["ConfigurationFileName"]); - m_description = Jellyfin::Support::fromJsonValue(source["Description"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_canUninstall = Jellyfin::Support::fromJsonValue(source["CanUninstall"]); - m_hasImage = Jellyfin::Support::fromJsonValue(source["HasImage"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - -} - -QJsonObject PluginInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Version"] = Jellyfin::Support::toJsonValue>(m_version); - result["ConfigurationFileName"] = Jellyfin::Support::toJsonValue(m_configurationFileName); - result["Description"] = Jellyfin::Support::toJsonValue(m_description); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["CanUninstall"] = Jellyfin::Support::toJsonValue(m_canUninstall); - result["HasImage"] = Jellyfin::Support::toJsonValue(m_hasImage); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - - return result; -} - -QString PluginInfo::name() const { return m_name; } - -void PluginInfo::setName(QString newName) { - m_name = newName; -} -QSharedPointer PluginInfo::version() const { return m_version; } - -void PluginInfo::setVersion(QSharedPointer newVersion) { - m_version = newVersion; -} -QString PluginInfo::configurationFileName() const { return m_configurationFileName; } - -void PluginInfo::setConfigurationFileName(QString newConfigurationFileName) { - m_configurationFileName = newConfigurationFileName; -} -QString PluginInfo::description() const { return m_description; } - -void PluginInfo::setDescription(QString newDescription) { - m_description = newDescription; -} -QUuid PluginInfo::jellyfinId() const { return m_jellyfinId; } - -void PluginInfo::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -bool PluginInfo::canUninstall() const { return m_canUninstall; } - -void PluginInfo::setCanUninstall(bool newCanUninstall) { - m_canUninstall = newCanUninstall; -} -bool PluginInfo::hasImage() const { return m_hasImage; } - -void PluginInfo::setHasImage(bool newHasImage) { - m_hasImage = newHasImage; -} -PluginStatus PluginInfo::status() const { return m_status; } - -void PluginInfo::setStatus(PluginStatus newStatus) { - m_status = newStatus; -} - -} // NS DTO - -namespace Support { - -using PluginInfo = Jellyfin::DTO::PluginInfo; - -template <> -PluginInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PluginInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/pluginsecurityinfo.cpp b/core/src/DTO/pluginsecurityinfo.cpp deleted file mode 100644 index 31ebffa..0000000 --- a/core/src/DTO/pluginsecurityinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PluginSecurityInfo::PluginSecurityInfo() {} -PluginSecurityInfo::PluginSecurityInfo(const PluginSecurityInfo &other) : - m_supporterKey(other.m_supporterKey), - m_isMbSupporter(other.m_isMbSupporter){} - -PluginSecurityInfo PluginSecurityInfo::fromJson(QJsonObject source) { - PluginSecurityInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PluginSecurityInfo::setFromJson(QJsonObject source) { - m_supporterKey = Jellyfin::Support::fromJsonValue(source["SupporterKey"]); - m_isMbSupporter = Jellyfin::Support::fromJsonValue(source["IsMbSupporter"]); - -} - -QJsonObject PluginSecurityInfo::toJson() { - QJsonObject result; - result["SupporterKey"] = Jellyfin::Support::toJsonValue(m_supporterKey); - result["IsMbSupporter"] = Jellyfin::Support::toJsonValue(m_isMbSupporter); - - return result; -} - -QString PluginSecurityInfo::supporterKey() const { return m_supporterKey; } - -void PluginSecurityInfo::setSupporterKey(QString newSupporterKey) { - m_supporterKey = newSupporterKey; -} -bool PluginSecurityInfo::isMbSupporter() const { return m_isMbSupporter; } - -void PluginSecurityInfo::setIsMbSupporter(bool newIsMbSupporter) { - m_isMbSupporter = newIsMbSupporter; -} - -} // NS DTO - -namespace Support { - -using PluginSecurityInfo = Jellyfin::DTO::PluginSecurityInfo; - -template <> -PluginSecurityInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PluginSecurityInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/pluginstatus.cpp b/core/src/DTO/pluginstatus.cpp deleted file mode 100644 index 777c1bf..0000000 --- a/core/src/DTO/pluginstatus.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PluginStatusClass::PluginStatusClass() {} - - -} // NS DTO - -namespace Support { - -using PluginStatus = Jellyfin::DTO::PluginStatus; - -template <> -PluginStatus fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return PluginStatus::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Active")) { - return PluginStatus::Active; - } - if (str == QStringLiteral("Restart")) { - return PluginStatus::Restart; - } - if (str == QStringLiteral("Deleted")) { - return PluginStatus::Deleted; - } - if (str == QStringLiteral("Superceded")) { - return PluginStatus::Superceded; - } - if (str == QStringLiteral("Malfunctioned")) { - return PluginStatus::Malfunctioned; - } - if (str == QStringLiteral("NotSupported")) { - return PluginStatus::NotSupported; - } - if (str == QStringLiteral("Disabled")) { - return PluginStatus::Disabled; - } - - return PluginStatus::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/previousitemrequestdto.cpp b/core/src/DTO/previousitemrequestdto.cpp deleted file mode 100644 index 7ad2ef9..0000000 --- a/core/src/DTO/previousitemrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PreviousItemRequestDto::PreviousItemRequestDto() {} -PreviousItemRequestDto::PreviousItemRequestDto(const PreviousItemRequestDto &other) : - m_playlistItemId(other.m_playlistItemId){} - -PreviousItemRequestDto PreviousItemRequestDto::fromJson(QJsonObject source) { - PreviousItemRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void PreviousItemRequestDto::setFromJson(QJsonObject source) { - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject PreviousItemRequestDto::toJson() { - QJsonObject result; - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QUuid PreviousItemRequestDto::playlistItemId() const { return m_playlistItemId; } - -void PreviousItemRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using PreviousItemRequestDto = Jellyfin::DTO::PreviousItemRequestDto; - -template <> -PreviousItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PreviousItemRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/problemdetails.cpp b/core/src/DTO/problemdetails.cpp deleted file mode 100644 index 362c467..0000000 --- a/core/src/DTO/problemdetails.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ProblemDetails::ProblemDetails() {} -ProblemDetails::ProblemDetails(const ProblemDetails &other) : - m_type(other.m_type), - m_title(other.m_title), - m_status(other.m_status), - m_detail(other.m_detail), - m_instance(other.m_instance){} - -ProblemDetails ProblemDetails::fromJson(QJsonObject source) { - ProblemDetails instance; - instance.setFromJson(source); - return instance; -} - - -void ProblemDetails::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["type"]); - m_title = Jellyfin::Support::fromJsonValue(source["title"]); - m_status = Jellyfin::Support::fromJsonValue(source["status"]); - m_detail = Jellyfin::Support::fromJsonValue(source["detail"]); - m_instance = Jellyfin::Support::fromJsonValue(source["instance"]); - -} - -QJsonObject ProblemDetails::toJson() { - QJsonObject result; - result["type"] = Jellyfin::Support::toJsonValue(m_type); - result["title"] = Jellyfin::Support::toJsonValue(m_title); - result["status"] = Jellyfin::Support::toJsonValue(m_status); - result["detail"] = Jellyfin::Support::toJsonValue(m_detail); - result["instance"] = Jellyfin::Support::toJsonValue(m_instance); - - return result; -} - -QString ProblemDetails::type() const { return m_type; } - -void ProblemDetails::setType(QString newType) { - m_type = newType; -} -QString ProblemDetails::title() const { return m_title; } - -void ProblemDetails::setTitle(QString newTitle) { - m_title = newTitle; -} -qint32 ProblemDetails::status() const { return m_status; } - -void ProblemDetails::setStatus(qint32 newStatus) { - m_status = newStatus; -} -QString ProblemDetails::detail() const { return m_detail; } - -void ProblemDetails::setDetail(QString newDetail) { - m_detail = newDetail; -} -QString ProblemDetails::instance() const { return m_instance; } - -void ProblemDetails::setInstance(QString newInstance) { - m_instance = newInstance; -} - -} // NS DTO - -namespace Support { - -using ProblemDetails = Jellyfin::DTO::ProblemDetails; - -template <> -ProblemDetails fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ProblemDetails::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/profilecondition.cpp b/core/src/DTO/profilecondition.cpp deleted file mode 100644 index 223976d..0000000 --- a/core/src/DTO/profilecondition.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ProfileCondition::ProfileCondition() {} -ProfileCondition::ProfileCondition(const ProfileCondition &other) : - m_condition(other.m_condition), - m_property(other.m_property), - m_value(other.m_value), - m_isRequired(other.m_isRequired){} - -ProfileCondition ProfileCondition::fromJson(QJsonObject source) { - ProfileCondition instance; - instance.setFromJson(source); - return instance; -} - - -void ProfileCondition::setFromJson(QJsonObject source) { - m_condition = Jellyfin::Support::fromJsonValue(source["Condition"]); - m_property = Jellyfin::Support::fromJsonValue(source["Property"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - m_isRequired = Jellyfin::Support::fromJsonValue(source["IsRequired"]); - -} - -QJsonObject ProfileCondition::toJson() { - QJsonObject result; - result["Condition"] = Jellyfin::Support::toJsonValue(m_condition); - result["Property"] = Jellyfin::Support::toJsonValue(m_property); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - result["IsRequired"] = Jellyfin::Support::toJsonValue(m_isRequired); - - return result; -} - -ProfileConditionType ProfileCondition::condition() const { return m_condition; } - -void ProfileCondition::setCondition(ProfileConditionType newCondition) { - m_condition = newCondition; -} -ProfileConditionValue ProfileCondition::property() const { return m_property; } - -void ProfileCondition::setProperty(ProfileConditionValue newProperty) { - m_property = newProperty; -} -QString ProfileCondition::value() const { return m_value; } - -void ProfileCondition::setValue(QString newValue) { - m_value = newValue; -} -bool ProfileCondition::isRequired() const { return m_isRequired; } - -void ProfileCondition::setIsRequired(bool newIsRequired) { - m_isRequired = newIsRequired; -} - -} // NS DTO - -namespace Support { - -using ProfileCondition = Jellyfin::DTO::ProfileCondition; - -template <> -ProfileCondition fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ProfileCondition::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/profileconditiontype.cpp b/core/src/DTO/profileconditiontype.cpp deleted file mode 100644 index 2bc5473..0000000 --- a/core/src/DTO/profileconditiontype.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ProfileConditionTypeClass::ProfileConditionTypeClass() {} - - -} // NS DTO - -namespace Support { - -using ProfileConditionType = Jellyfin::DTO::ProfileConditionType; - -template <> -ProfileConditionType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ProfileConditionType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Equals")) { - return ProfileConditionType::Equals; - } - if (str == QStringLiteral("NotEquals")) { - return ProfileConditionType::NotEquals; - } - if (str == QStringLiteral("LessThanEqual")) { - return ProfileConditionType::LessThanEqual; - } - if (str == QStringLiteral("GreaterThanEqual")) { - return ProfileConditionType::GreaterThanEqual; - } - if (str == QStringLiteral("EqualsAny")) { - return ProfileConditionType::EqualsAny; - } - - return ProfileConditionType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/profileconditionvalue.cpp b/core/src/DTO/profileconditionvalue.cpp deleted file mode 100644 index f5acbfe..0000000 --- a/core/src/DTO/profileconditionvalue.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ProfileConditionValueClass::ProfileConditionValueClass() {} - - -} // NS DTO - -namespace Support { - -using ProfileConditionValue = Jellyfin::DTO::ProfileConditionValue; - -template <> -ProfileConditionValue fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ProfileConditionValue::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("AudioChannels")) { - return ProfileConditionValue::AudioChannels; - } - if (str == QStringLiteral("AudioBitrate")) { - return ProfileConditionValue::AudioBitrate; - } - if (str == QStringLiteral("AudioProfile")) { - return ProfileConditionValue::AudioProfile; - } - if (str == QStringLiteral("Width")) { - return ProfileConditionValue::Width; - } - if (str == QStringLiteral("Height")) { - return ProfileConditionValue::Height; - } - if (str == QStringLiteral("Has64BitOffsets")) { - return ProfileConditionValue::Has64BitOffsets; - } - if (str == QStringLiteral("PacketLength")) { - return ProfileConditionValue::PacketLength; - } - if (str == QStringLiteral("VideoBitDepth")) { - return ProfileConditionValue::VideoBitDepth; - } - if (str == QStringLiteral("VideoBitrate")) { - return ProfileConditionValue::VideoBitrate; - } - if (str == QStringLiteral("VideoFramerate")) { - return ProfileConditionValue::VideoFramerate; - } - if (str == QStringLiteral("VideoLevel")) { - return ProfileConditionValue::VideoLevel; - } - if (str == QStringLiteral("VideoProfile")) { - return ProfileConditionValue::VideoProfile; - } - if (str == QStringLiteral("VideoTimestamp")) { - return ProfileConditionValue::VideoTimestamp; - } - if (str == QStringLiteral("IsAnamorphic")) { - return ProfileConditionValue::IsAnamorphic; - } - if (str == QStringLiteral("RefFrames")) { - return ProfileConditionValue::RefFrames; - } - if (str == QStringLiteral("NumAudioStreams")) { - return ProfileConditionValue::NumAudioStreams; - } - if (str == QStringLiteral("NumVideoStreams")) { - return ProfileConditionValue::NumVideoStreams; - } - if (str == QStringLiteral("IsSecondaryAudio")) { - return ProfileConditionValue::IsSecondaryAudio; - } - if (str == QStringLiteral("VideoCodecTag")) { - return ProfileConditionValue::VideoCodecTag; - } - if (str == QStringLiteral("IsAvc")) { - return ProfileConditionValue::IsAvc; - } - if (str == QStringLiteral("IsInterlaced")) { - return ProfileConditionValue::IsInterlaced; - } - if (str == QStringLiteral("AudioSampleRate")) { - return ProfileConditionValue::AudioSampleRate; - } - if (str == QStringLiteral("AudioBitDepth")) { - return ProfileConditionValue::AudioBitDepth; - } - - return ProfileConditionValue::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/programaudio.cpp b/core/src/DTO/programaudio.cpp deleted file mode 100644 index 15506f9..0000000 --- a/core/src/DTO/programaudio.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ProgramAudioClass::ProgramAudioClass() {} - - -} // NS DTO - -namespace Support { - -using ProgramAudio = Jellyfin::DTO::ProgramAudio; - -template <> -ProgramAudio fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ProgramAudio::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Mono")) { - return ProgramAudio::Mono; - } - if (str == QStringLiteral("Stereo")) { - return ProgramAudio::Stereo; - } - if (str == QStringLiteral("Dolby")) { - return ProgramAudio::Dolby; - } - if (str == QStringLiteral("DolbyDigital")) { - return ProgramAudio::DolbyDigital; - } - if (str == QStringLiteral("Thx")) { - return ProgramAudio::Thx; - } - if (str == QStringLiteral("Atmos")) { - return ProgramAudio::Atmos; - } - - return ProgramAudio::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/publicsysteminfo.cpp b/core/src/DTO/publicsysteminfo.cpp deleted file mode 100644 index 742b831..0000000 --- a/core/src/DTO/publicsysteminfo.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -PublicSystemInfo::PublicSystemInfo() {} -PublicSystemInfo::PublicSystemInfo(const PublicSystemInfo &other) : - m_localAddress(other.m_localAddress), - m_serverName(other.m_serverName), - m_version(other.m_version), - m_productName(other.m_productName), - m_operatingSystem(other.m_operatingSystem), - m_jellyfinId(other.m_jellyfinId), - m_startupWizardCompleted(other.m_startupWizardCompleted){} - -PublicSystemInfo PublicSystemInfo::fromJson(QJsonObject source) { - PublicSystemInfo instance; - instance.setFromJson(source); - return instance; -} - - -void PublicSystemInfo::setFromJson(QJsonObject source) { - m_localAddress = Jellyfin::Support::fromJsonValue(source["LocalAddress"]); - m_serverName = Jellyfin::Support::fromJsonValue(source["ServerName"]); - m_version = Jellyfin::Support::fromJsonValue(source["Version"]); - m_productName = Jellyfin::Support::fromJsonValue(source["ProductName"]); - m_operatingSystem = Jellyfin::Support::fromJsonValue(source["OperatingSystem"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_startupWizardCompleted = Jellyfin::Support::fromJsonValue(source["StartupWizardCompleted"]); - -} - -QJsonObject PublicSystemInfo::toJson() { - QJsonObject result; - result["LocalAddress"] = Jellyfin::Support::toJsonValue(m_localAddress); - result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); - result["Version"] = Jellyfin::Support::toJsonValue(m_version); - result["ProductName"] = Jellyfin::Support::toJsonValue(m_productName); - result["OperatingSystem"] = Jellyfin::Support::toJsonValue(m_operatingSystem); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["StartupWizardCompleted"] = Jellyfin::Support::toJsonValue(m_startupWizardCompleted); - - return result; -} - -QString PublicSystemInfo::localAddress() const { return m_localAddress; } - -void PublicSystemInfo::setLocalAddress(QString newLocalAddress) { - m_localAddress = newLocalAddress; -} -QString PublicSystemInfo::serverName() const { return m_serverName; } - -void PublicSystemInfo::setServerName(QString newServerName) { - m_serverName = newServerName; -} -QString PublicSystemInfo::version() const { return m_version; } - -void PublicSystemInfo::setVersion(QString newVersion) { - m_version = newVersion; -} -QString PublicSystemInfo::productName() const { return m_productName; } - -void PublicSystemInfo::setProductName(QString newProductName) { - m_productName = newProductName; -} -QString PublicSystemInfo::operatingSystem() const { return m_operatingSystem; } - -void PublicSystemInfo::setOperatingSystem(QString newOperatingSystem) { - m_operatingSystem = newOperatingSystem; -} -QString PublicSystemInfo::jellyfinId() const { return m_jellyfinId; } - -void PublicSystemInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -bool PublicSystemInfo::startupWizardCompleted() const { return m_startupWizardCompleted; } - -void PublicSystemInfo::setStartupWizardCompleted(bool newStartupWizardCompleted) { - m_startupWizardCompleted = newStartupWizardCompleted; -} - -} // NS DTO - -namespace Support { - -using PublicSystemInfo = Jellyfin::DTO::PublicSystemInfo; - -template <> -PublicSystemInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return PublicSystemInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/queryfilters.cpp b/core/src/DTO/queryfilters.cpp deleted file mode 100644 index 54afaaa..0000000 --- a/core/src/DTO/queryfilters.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QueryFilters::QueryFilters() {} -QueryFilters::QueryFilters(const QueryFilters &other) : - m_genres(other.m_genres), - m_tags(other.m_tags){} - -QueryFilters QueryFilters::fromJson(QJsonObject source) { - QueryFilters instance; - instance.setFromJson(source); - return instance; -} - - -void QueryFilters::setFromJson(QJsonObject source) { - m_genres = Jellyfin::Support::fromJsonValue>>(source["Genres"]); - m_tags = Jellyfin::Support::fromJsonValue(source["Tags"]); - -} - -QJsonObject QueryFilters::toJson() { - QJsonObject result; - result["Genres"] = Jellyfin::Support::toJsonValue>>(m_genres); - result["Tags"] = Jellyfin::Support::toJsonValue(m_tags); - - return result; -} - -QList> QueryFilters::genres() const { return m_genres; } - -void QueryFilters::setGenres(QList> newGenres) { - m_genres = newGenres; -} -QStringList QueryFilters::tags() const { return m_tags; } - -void QueryFilters::setTags(QStringList newTags) { - m_tags = newTags; -} - -} // NS DTO - -namespace Support { - -using QueryFilters = Jellyfin::DTO::QueryFilters; - -template <> -QueryFilters fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QueryFilters::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/queryfilterslegacy.cpp b/core/src/DTO/queryfilterslegacy.cpp deleted file mode 100644 index eb20c5f..0000000 --- a/core/src/DTO/queryfilterslegacy.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QueryFiltersLegacy::QueryFiltersLegacy() {} -QueryFiltersLegacy::QueryFiltersLegacy(const QueryFiltersLegacy &other) : - m_genres(other.m_genres), - m_tags(other.m_tags), - m_officialRatings(other.m_officialRatings), - m_years(other.m_years){} - -QueryFiltersLegacy QueryFiltersLegacy::fromJson(QJsonObject source) { - QueryFiltersLegacy instance; - instance.setFromJson(source); - return instance; -} - - -void QueryFiltersLegacy::setFromJson(QJsonObject source) { - m_genres = Jellyfin::Support::fromJsonValue(source["Genres"]); - m_tags = Jellyfin::Support::fromJsonValue(source["Tags"]); - m_officialRatings = Jellyfin::Support::fromJsonValue(source["OfficialRatings"]); - m_years = Jellyfin::Support::fromJsonValue>(source["Years"]); - -} - -QJsonObject QueryFiltersLegacy::toJson() { - QJsonObject result; - result["Genres"] = Jellyfin::Support::toJsonValue(m_genres); - result["Tags"] = Jellyfin::Support::toJsonValue(m_tags); - result["OfficialRatings"] = Jellyfin::Support::toJsonValue(m_officialRatings); - result["Years"] = Jellyfin::Support::toJsonValue>(m_years); - - return result; -} - -QStringList QueryFiltersLegacy::genres() const { return m_genres; } - -void QueryFiltersLegacy::setGenres(QStringList newGenres) { - m_genres = newGenres; -} -QStringList QueryFiltersLegacy::tags() const { return m_tags; } - -void QueryFiltersLegacy::setTags(QStringList newTags) { - m_tags = newTags; -} -QStringList QueryFiltersLegacy::officialRatings() const { return m_officialRatings; } - -void QueryFiltersLegacy::setOfficialRatings(QStringList newOfficialRatings) { - m_officialRatings = newOfficialRatings; -} -QList QueryFiltersLegacy::years() const { return m_years; } - -void QueryFiltersLegacy::setYears(QList newYears) { - m_years = newYears; -} - -} // NS DTO - -namespace Support { - -using QueryFiltersLegacy = Jellyfin::DTO::QueryFiltersLegacy; - -template <> -QueryFiltersLegacy fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QueryFiltersLegacy::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/queueitem.cpp b/core/src/DTO/queueitem.cpp deleted file mode 100644 index 2b81d88..0000000 --- a/core/src/DTO/queueitem.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QueueItem::QueueItem() {} -QueueItem::QueueItem(const QueueItem &other) : - m_jellyfinId(other.m_jellyfinId), - m_playlistItemId(other.m_playlistItemId){} - -QueueItem QueueItem::fromJson(QJsonObject source) { - QueueItem instance; - instance.setFromJson(source); - return instance; -} - - -void QueueItem::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject QueueItem::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QUuid QueueItem::jellyfinId() const { return m_jellyfinId; } - -void QueueItem::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString QueueItem::playlistItemId() const { return m_playlistItemId; } - -void QueueItem::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using QueueItem = Jellyfin::DTO::QueueItem; - -template <> -QueueItem fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QueueItem::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/queuerequestdto.cpp b/core/src/DTO/queuerequestdto.cpp deleted file mode 100644 index a903a46..0000000 --- a/core/src/DTO/queuerequestdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QueueRequestDto::QueueRequestDto() {} -QueueRequestDto::QueueRequestDto(const QueueRequestDto &other) : - m_itemIds(other.m_itemIds), - m_mode(other.m_mode){} - -QueueRequestDto QueueRequestDto::fromJson(QJsonObject source) { - QueueRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void QueueRequestDto::setFromJson(QJsonObject source) { - m_itemIds = Jellyfin::Support::fromJsonValue>(source["ItemIds"]); - m_mode = Jellyfin::Support::fromJsonValue(source["Mode"]); - -} - -QJsonObject QueueRequestDto::toJson() { - QJsonObject result; - result["ItemIds"] = Jellyfin::Support::toJsonValue>(m_itemIds); - result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); - - return result; -} - -QList QueueRequestDto::itemIds() const { return m_itemIds; } - -void QueueRequestDto::setItemIds(QList newItemIds) { - m_itemIds = newItemIds; -} -GroupQueueMode QueueRequestDto::mode() const { return m_mode; } - -void QueueRequestDto::setMode(GroupQueueMode newMode) { - m_mode = newMode; -} - -} // NS DTO - -namespace Support { - -using QueueRequestDto = Jellyfin::DTO::QueueRequestDto; - -template <> -QueueRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QueueRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/quickconnectdto.cpp b/core/src/DTO/quickconnectdto.cpp deleted file mode 100644 index 01d3f42..0000000 --- a/core/src/DTO/quickconnectdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QuickConnectDto::QuickConnectDto() {} -QuickConnectDto::QuickConnectDto(const QuickConnectDto &other) : - m_token(other.m_token){} - -QuickConnectDto QuickConnectDto::fromJson(QJsonObject source) { - QuickConnectDto instance; - instance.setFromJson(source); - return instance; -} - - -void QuickConnectDto::setFromJson(QJsonObject source) { - m_token = Jellyfin::Support::fromJsonValue(source["Token"]); - -} - -QJsonObject QuickConnectDto::toJson() { - QJsonObject result; - result["Token"] = Jellyfin::Support::toJsonValue(m_token); - - return result; -} - -QString QuickConnectDto::token() const { return m_token; } - -void QuickConnectDto::setToken(QString newToken) { - m_token = newToken; -} - -} // NS DTO - -namespace Support { - -using QuickConnectDto = Jellyfin::DTO::QuickConnectDto; - -template <> -QuickConnectDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QuickConnectDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/quickconnectresult.cpp b/core/src/DTO/quickconnectresult.cpp deleted file mode 100644 index 8aa0c23..0000000 --- a/core/src/DTO/quickconnectresult.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QuickConnectResult::QuickConnectResult() {} -QuickConnectResult::QuickConnectResult(const QuickConnectResult &other) : - m_authenticated(other.m_authenticated), - m_secret(other.m_secret), - m_code(other.m_code), - m_authentication(other.m_authentication), - m_error(other.m_error), - m_dateAdded(other.m_dateAdded){} - -QuickConnectResult QuickConnectResult::fromJson(QJsonObject source) { - QuickConnectResult instance; - instance.setFromJson(source); - return instance; -} - - -void QuickConnectResult::setFromJson(QJsonObject source) { - m_authenticated = Jellyfin::Support::fromJsonValue(source["Authenticated"]); - m_secret = Jellyfin::Support::fromJsonValue(source["Secret"]); - m_code = Jellyfin::Support::fromJsonValue(source["Code"]); - m_authentication = Jellyfin::Support::fromJsonValue(source["Authentication"]); - m_error = Jellyfin::Support::fromJsonValue(source["Error"]); - m_dateAdded = Jellyfin::Support::fromJsonValue(source["DateAdded"]); - -} - -QJsonObject QuickConnectResult::toJson() { - QJsonObject result; - result["Authenticated"] = Jellyfin::Support::toJsonValue(m_authenticated); - result["Secret"] = Jellyfin::Support::toJsonValue(m_secret); - result["Code"] = Jellyfin::Support::toJsonValue(m_code); - result["Authentication"] = Jellyfin::Support::toJsonValue(m_authentication); - result["Error"] = Jellyfin::Support::toJsonValue(m_error); - result["DateAdded"] = Jellyfin::Support::toJsonValue(m_dateAdded); - - return result; -} - -bool QuickConnectResult::authenticated() const { return m_authenticated; } - -void QuickConnectResult::setAuthenticated(bool newAuthenticated) { - m_authenticated = newAuthenticated; -} -QString QuickConnectResult::secret() const { return m_secret; } - -void QuickConnectResult::setSecret(QString newSecret) { - m_secret = newSecret; -} -QString QuickConnectResult::code() const { return m_code; } - -void QuickConnectResult::setCode(QString newCode) { - m_code = newCode; -} -QString QuickConnectResult::authentication() const { return m_authentication; } - -void QuickConnectResult::setAuthentication(QString newAuthentication) { - m_authentication = newAuthentication; -} -QString QuickConnectResult::error() const { return m_error; } - -void QuickConnectResult::setError(QString newError) { - m_error = newError; -} -QDateTime QuickConnectResult::dateAdded() const { return m_dateAdded; } - -void QuickConnectResult::setDateAdded(QDateTime newDateAdded) { - m_dateAdded = newDateAdded; -} - -} // NS DTO - -namespace Support { - -using QuickConnectResult = Jellyfin::DTO::QuickConnectResult; - -template <> -QuickConnectResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return QuickConnectResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/quickconnectstate.cpp b/core/src/DTO/quickconnectstate.cpp deleted file mode 100644 index df60a6d..0000000 --- a/core/src/DTO/quickconnectstate.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -QuickConnectStateClass::QuickConnectStateClass() {} - - -} // NS DTO - -namespace Support { - -using QuickConnectState = Jellyfin::DTO::QuickConnectState; - -template <> -QuickConnectState fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return QuickConnectState::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Unavailable")) { - return QuickConnectState::Unavailable; - } - if (str == QStringLiteral("Available")) { - return QuickConnectState::Available; - } - if (str == QStringLiteral("Active")) { - return QuickConnectState::Active; - } - - return QuickConnectState::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/ratingtype.cpp b/core/src/DTO/ratingtype.cpp deleted file mode 100644 index 362baac..0000000 --- a/core/src/DTO/ratingtype.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RatingTypeClass::RatingTypeClass() {} - - -} // NS DTO - -namespace Support { - -using RatingType = Jellyfin::DTO::RatingType; - -template <> -RatingType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return RatingType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Score")) { - return RatingType::Score; - } - if (str == QStringLiteral("Likes")) { - return RatingType::Likes; - } - - return RatingType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/readyrequestdto.cpp b/core/src/DTO/readyrequestdto.cpp deleted file mode 100644 index 6655eda..0000000 --- a/core/src/DTO/readyrequestdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ReadyRequestDto::ReadyRequestDto() {} -ReadyRequestDto::ReadyRequestDto(const ReadyRequestDto &other) : - m_when(other.m_when), - m_positionTicks(other.m_positionTicks), - m_isPlaying(other.m_isPlaying), - m_playlistItemId(other.m_playlistItemId){} - -ReadyRequestDto ReadyRequestDto::fromJson(QJsonObject source) { - ReadyRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void ReadyRequestDto::setFromJson(QJsonObject source) { - m_when = Jellyfin::Support::fromJsonValue(source["When"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_isPlaying = Jellyfin::Support::fromJsonValue(source["IsPlaying"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject ReadyRequestDto::toJson() { - QJsonObject result; - result["When"] = Jellyfin::Support::toJsonValue(m_when); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["IsPlaying"] = Jellyfin::Support::toJsonValue(m_isPlaying); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QDateTime ReadyRequestDto::when() const { return m_when; } - -void ReadyRequestDto::setWhen(QDateTime newWhen) { - m_when = newWhen; -} -qint64 ReadyRequestDto::positionTicks() const { return m_positionTicks; } - -void ReadyRequestDto::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -bool ReadyRequestDto::isPlaying() const { return m_isPlaying; } - -void ReadyRequestDto::setIsPlaying(bool newIsPlaying) { - m_isPlaying = newIsPlaying; -} -QUuid ReadyRequestDto::playlistItemId() const { return m_playlistItemId; } - -void ReadyRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using ReadyRequestDto = Jellyfin::DTO::ReadyRequestDto; - -template <> -ReadyRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ReadyRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/recommendationdto.cpp b/core/src/DTO/recommendationdto.cpp deleted file mode 100644 index e30fff4..0000000 --- a/core/src/DTO/recommendationdto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RecommendationDto::RecommendationDto() {} -RecommendationDto::RecommendationDto(const RecommendationDto &other) : - m_items(other.m_items), - m_recommendationType(other.m_recommendationType), - m_baselineItemName(other.m_baselineItemName), - m_categoryId(other.m_categoryId){} - -RecommendationDto RecommendationDto::fromJson(QJsonObject source) { - RecommendationDto instance; - instance.setFromJson(source); - return instance; -} - - -void RecommendationDto::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_recommendationType = Jellyfin::Support::fromJsonValue(source["RecommendationType"]); - m_baselineItemName = Jellyfin::Support::fromJsonValue(source["BaselineItemName"]); - m_categoryId = Jellyfin::Support::fromJsonValue(source["CategoryId"]); - -} - -QJsonObject RecommendationDto::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["RecommendationType"] = Jellyfin::Support::toJsonValue(m_recommendationType); - result["BaselineItemName"] = Jellyfin::Support::toJsonValue(m_baselineItemName); - result["CategoryId"] = Jellyfin::Support::toJsonValue(m_categoryId); - - return result; -} - -QList> RecommendationDto::items() const { return m_items; } - -void RecommendationDto::setItems(QList> newItems) { - m_items = newItems; -} -RecommendationType RecommendationDto::recommendationType() const { return m_recommendationType; } - -void RecommendationDto::setRecommendationType(RecommendationType newRecommendationType) { - m_recommendationType = newRecommendationType; -} -QString RecommendationDto::baselineItemName() const { return m_baselineItemName; } - -void RecommendationDto::setBaselineItemName(QString newBaselineItemName) { - m_baselineItemName = newBaselineItemName; -} -QUuid RecommendationDto::categoryId() const { return m_categoryId; } - -void RecommendationDto::setCategoryId(QUuid newCategoryId) { - m_categoryId = newCategoryId; -} - -} // NS DTO - -namespace Support { - -using RecommendationDto = Jellyfin::DTO::RecommendationDto; - -template <> -RecommendationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RecommendationDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/recommendationtype.cpp b/core/src/DTO/recommendationtype.cpp deleted file mode 100644 index 46f855a..0000000 --- a/core/src/DTO/recommendationtype.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RecommendationTypeClass::RecommendationTypeClass() {} - - -} // NS DTO - -namespace Support { - -using RecommendationType = Jellyfin::DTO::RecommendationType; - -template <> -RecommendationType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return RecommendationType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("SimilarToRecentlyPlayed")) { - return RecommendationType::SimilarToRecentlyPlayed; - } - if (str == QStringLiteral("SimilarToLikedItem")) { - return RecommendationType::SimilarToLikedItem; - } - if (str == QStringLiteral("HasDirectorFromRecentlyPlayed")) { - return RecommendationType::HasDirectorFromRecentlyPlayed; - } - if (str == QStringLiteral("HasActorFromRecentlyPlayed")) { - return RecommendationType::HasActorFromRecentlyPlayed; - } - if (str == QStringLiteral("HasLikedDirector")) { - return RecommendationType::HasLikedDirector; - } - if (str == QStringLiteral("HasLikedActor")) { - return RecommendationType::HasLikedActor; - } - - return RecommendationType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/recordingstatus.cpp b/core/src/DTO/recordingstatus.cpp deleted file mode 100644 index a977cc5..0000000 --- a/core/src/DTO/recordingstatus.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RecordingStatusClass::RecordingStatusClass() {} - - -} // NS DTO - -namespace Support { - -using RecordingStatus = Jellyfin::DTO::RecordingStatus; - -template <> -RecordingStatus fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return RecordingStatus::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("New")) { - return RecordingStatus::New; - } - if (str == QStringLiteral("InProgress")) { - return RecordingStatus::InProgress; - } - if (str == QStringLiteral("Completed")) { - return RecordingStatus::Completed; - } - if (str == QStringLiteral("Cancelled")) { - return RecordingStatus::Cancelled; - } - if (str == QStringLiteral("ConflictedOk")) { - return RecordingStatus::ConflictedOk; - } - if (str == QStringLiteral("ConflictedNotOk")) { - return RecordingStatus::ConflictedNotOk; - } - if (str == QStringLiteral("Error")) { - return RecordingStatus::Error; - } - - return RecordingStatus::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/remoteimageinfo.cpp b/core/src/DTO/remoteimageinfo.cpp deleted file mode 100644 index 6d49717..0000000 --- a/core/src/DTO/remoteimageinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RemoteImageInfo::RemoteImageInfo() {} -RemoteImageInfo::RemoteImageInfo(const RemoteImageInfo &other) : - m_providerName(other.m_providerName), - m_url(other.m_url), - m_thumbnailUrl(other.m_thumbnailUrl), - m_height(other.m_height), - m_width(other.m_width), - m_communityRating(other.m_communityRating), - m_voteCount(other.m_voteCount), - m_language(other.m_language), - m_type(other.m_type), - m_ratingType(other.m_ratingType){} - -RemoteImageInfo RemoteImageInfo::fromJson(QJsonObject source) { - RemoteImageInfo instance; - instance.setFromJson(source); - return instance; -} - - -void RemoteImageInfo::setFromJson(QJsonObject source) { - m_providerName = Jellyfin::Support::fromJsonValue(source["ProviderName"]); - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - m_thumbnailUrl = Jellyfin::Support::fromJsonValue(source["ThumbnailUrl"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_communityRating = Jellyfin::Support::fromJsonValue(source["CommunityRating"]); - m_voteCount = Jellyfin::Support::fromJsonValue(source["VoteCount"]); - m_language = Jellyfin::Support::fromJsonValue(source["Language"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_ratingType = Jellyfin::Support::fromJsonValue(source["RatingType"]); - -} - -QJsonObject RemoteImageInfo::toJson() { - QJsonObject result; - result["ProviderName"] = Jellyfin::Support::toJsonValue(m_providerName); - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - result["ThumbnailUrl"] = Jellyfin::Support::toJsonValue(m_thumbnailUrl); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["CommunityRating"] = Jellyfin::Support::toJsonValue(m_communityRating); - result["VoteCount"] = Jellyfin::Support::toJsonValue(m_voteCount); - result["Language"] = Jellyfin::Support::toJsonValue(m_language); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["RatingType"] = Jellyfin::Support::toJsonValue(m_ratingType); - - return result; -} - -QString RemoteImageInfo::providerName() const { return m_providerName; } - -void RemoteImageInfo::setProviderName(QString newProviderName) { - m_providerName = newProviderName; -} -QString RemoteImageInfo::url() const { return m_url; } - -void RemoteImageInfo::setUrl(QString newUrl) { - m_url = newUrl; -} -QString RemoteImageInfo::thumbnailUrl() const { return m_thumbnailUrl; } - -void RemoteImageInfo::setThumbnailUrl(QString newThumbnailUrl) { - m_thumbnailUrl = newThumbnailUrl; -} -qint32 RemoteImageInfo::height() const { return m_height; } - -void RemoteImageInfo::setHeight(qint32 newHeight) { - m_height = newHeight; -} -qint32 RemoteImageInfo::width() const { return m_width; } - -void RemoteImageInfo::setWidth(qint32 newWidth) { - m_width = newWidth; -} -double RemoteImageInfo::communityRating() const { return m_communityRating; } - -void RemoteImageInfo::setCommunityRating(double newCommunityRating) { - m_communityRating = newCommunityRating; -} -qint32 RemoteImageInfo::voteCount() const { return m_voteCount; } - -void RemoteImageInfo::setVoteCount(qint32 newVoteCount) { - m_voteCount = newVoteCount; -} -QString RemoteImageInfo::language() const { return m_language; } - -void RemoteImageInfo::setLanguage(QString newLanguage) { - m_language = newLanguage; -} -ImageType RemoteImageInfo::type() const { return m_type; } - -void RemoteImageInfo::setType(ImageType newType) { - m_type = newType; -} -RatingType RemoteImageInfo::ratingType() const { return m_ratingType; } - -void RemoteImageInfo::setRatingType(RatingType newRatingType) { - m_ratingType = newRatingType; -} - -} // NS DTO - -namespace Support { - -using RemoteImageInfo = Jellyfin::DTO::RemoteImageInfo; - -template <> -RemoteImageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RemoteImageInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/remoteimageresult.cpp b/core/src/DTO/remoteimageresult.cpp deleted file mode 100644 index d5965b5..0000000 --- a/core/src/DTO/remoteimageresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RemoteImageResult::RemoteImageResult() {} -RemoteImageResult::RemoteImageResult(const RemoteImageResult &other) : - m_images(other.m_images), - m_totalRecordCount(other.m_totalRecordCount), - m_providers(other.m_providers){} - -RemoteImageResult RemoteImageResult::fromJson(QJsonObject source) { - RemoteImageResult instance; - instance.setFromJson(source); - return instance; -} - - -void RemoteImageResult::setFromJson(QJsonObject source) { - m_images = Jellyfin::Support::fromJsonValue>>(source["Images"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_providers = Jellyfin::Support::fromJsonValue(source["Providers"]); - -} - -QJsonObject RemoteImageResult::toJson() { - QJsonObject result; - result["Images"] = Jellyfin::Support::toJsonValue>>(m_images); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["Providers"] = Jellyfin::Support::toJsonValue(m_providers); - - return result; -} - -QList> RemoteImageResult::images() const { return m_images; } - -void RemoteImageResult::setImages(QList> newImages) { - m_images = newImages; -} -qint32 RemoteImageResult::totalRecordCount() const { return m_totalRecordCount; } - -void RemoteImageResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -QStringList RemoteImageResult::providers() const { return m_providers; } - -void RemoteImageResult::setProviders(QStringList newProviders) { - m_providers = newProviders; -} - -} // NS DTO - -namespace Support { - -using RemoteImageResult = Jellyfin::DTO::RemoteImageResult; - -template <> -RemoteImageResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RemoteImageResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/remotesearchresult.cpp b/core/src/DTO/remotesearchresult.cpp deleted file mode 100644 index 5285476..0000000 --- a/core/src/DTO/remotesearchresult.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RemoteSearchResult::RemoteSearchResult() {} -RemoteSearchResult::RemoteSearchResult(const RemoteSearchResult &other) : - m_name(other.m_name), - m_providerIds(other.m_providerIds), - m_productionYear(other.m_productionYear), - m_indexNumber(other.m_indexNumber), - m_indexNumberEnd(other.m_indexNumberEnd), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_imageUrl(other.m_imageUrl), - m_searchProviderName(other.m_searchProviderName), - m_overview(other.m_overview), - m_albumArtist(other.m_albumArtist), - m_artists(other.m_artists){} - -RemoteSearchResult RemoteSearchResult::fromJson(QJsonObject source) { - RemoteSearchResult instance; - instance.setFromJson(source); - return instance; -} - - -void RemoteSearchResult::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_productionYear = Jellyfin::Support::fromJsonValue(source["ProductionYear"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_indexNumberEnd = Jellyfin::Support::fromJsonValue(source["IndexNumberEnd"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_imageUrl = Jellyfin::Support::fromJsonValue(source["ImageUrl"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_overview = Jellyfin::Support::fromJsonValue(source["Overview"]); - m_albumArtist = Jellyfin::Support::fromJsonValue>(source["AlbumArtist"]); - m_artists = Jellyfin::Support::fromJsonValue>>(source["Artists"]); - -} - -QJsonObject RemoteSearchResult::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["ProductionYear"] = Jellyfin::Support::toJsonValue(m_productionYear); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue(m_indexNumberEnd); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["ImageUrl"] = Jellyfin::Support::toJsonValue(m_imageUrl); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["Overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["AlbumArtist"] = Jellyfin::Support::toJsonValue>(m_albumArtist); - result["Artists"] = Jellyfin::Support::toJsonValue>>(m_artists); - - return result; -} - -QString RemoteSearchResult::name() const { return m_name; } - -void RemoteSearchResult::setName(QString newName) { - m_name = newName; -} -QJsonObject RemoteSearchResult::providerIds() const { return m_providerIds; } - -void RemoteSearchResult::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 RemoteSearchResult::productionYear() const { return m_productionYear; } - -void RemoteSearchResult::setProductionYear(qint32 newProductionYear) { - m_productionYear = newProductionYear; -} -qint32 RemoteSearchResult::indexNumber() const { return m_indexNumber; } - -void RemoteSearchResult::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 RemoteSearchResult::indexNumberEnd() const { return m_indexNumberEnd; } - -void RemoteSearchResult::setIndexNumberEnd(qint32 newIndexNumberEnd) { - m_indexNumberEnd = newIndexNumberEnd; -} -qint32 RemoteSearchResult::parentIndexNumber() const { return m_parentIndexNumber; } - -void RemoteSearchResult::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime RemoteSearchResult::premiereDate() const { return m_premiereDate; } - -void RemoteSearchResult::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -QString RemoteSearchResult::imageUrl() const { return m_imageUrl; } - -void RemoteSearchResult::setImageUrl(QString newImageUrl) { - m_imageUrl = newImageUrl; -} -QString RemoteSearchResult::searchProviderName() const { return m_searchProviderName; } - -void RemoteSearchResult::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -QString RemoteSearchResult::overview() const { return m_overview; } - -void RemoteSearchResult::setOverview(QString newOverview) { - m_overview = newOverview; -} -QSharedPointer RemoteSearchResult::albumArtist() const { return m_albumArtist; } - -void RemoteSearchResult::setAlbumArtist(QSharedPointer newAlbumArtist) { - m_albumArtist = newAlbumArtist; -} -QList> RemoteSearchResult::artists() const { return m_artists; } - -void RemoteSearchResult::setArtists(QList> newArtists) { - m_artists = newArtists; -} - -} // NS DTO - -namespace Support { - -using RemoteSearchResult = Jellyfin::DTO::RemoteSearchResult; - -template <> -RemoteSearchResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RemoteSearchResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/remotesubtitleinfo.cpp b/core/src/DTO/remotesubtitleinfo.cpp deleted file mode 100644 index 52cf853..0000000 --- a/core/src/DTO/remotesubtitleinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RemoteSubtitleInfo::RemoteSubtitleInfo() {} -RemoteSubtitleInfo::RemoteSubtitleInfo(const RemoteSubtitleInfo &other) : - m_threeLetterISOLanguageName(other.m_threeLetterISOLanguageName), - m_jellyfinId(other.m_jellyfinId), - m_providerName(other.m_providerName), - m_name(other.m_name), - m_format(other.m_format), - m_author(other.m_author), - m_comment(other.m_comment), - m_dateCreated(other.m_dateCreated), - m_communityRating(other.m_communityRating), - m_downloadCount(other.m_downloadCount), - m_isHashMatch(other.m_isHashMatch){} - -RemoteSubtitleInfo RemoteSubtitleInfo::fromJson(QJsonObject source) { - RemoteSubtitleInfo instance; - instance.setFromJson(source); - return instance; -} - - -void RemoteSubtitleInfo::setFromJson(QJsonObject source) { - m_threeLetterISOLanguageName = Jellyfin::Support::fromJsonValue(source["ThreeLetterISOLanguageName"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_providerName = Jellyfin::Support::fromJsonValue(source["ProviderName"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_format = Jellyfin::Support::fromJsonValue(source["Format"]); - m_author = Jellyfin::Support::fromJsonValue(source["Author"]); - m_comment = Jellyfin::Support::fromJsonValue(source["Comment"]); - m_dateCreated = Jellyfin::Support::fromJsonValue(source["DateCreated"]); - m_communityRating = Jellyfin::Support::fromJsonValue(source["CommunityRating"]); - m_downloadCount = Jellyfin::Support::fromJsonValue(source["DownloadCount"]); - m_isHashMatch = Jellyfin::Support::fromJsonValue(source["IsHashMatch"]); - -} - -QJsonObject RemoteSubtitleInfo::toJson() { - QJsonObject result; - result["ThreeLetterISOLanguageName"] = Jellyfin::Support::toJsonValue(m_threeLetterISOLanguageName); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["ProviderName"] = Jellyfin::Support::toJsonValue(m_providerName); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Format"] = Jellyfin::Support::toJsonValue(m_format); - result["Author"] = Jellyfin::Support::toJsonValue(m_author); - result["Comment"] = Jellyfin::Support::toJsonValue(m_comment); - result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); - result["CommunityRating"] = Jellyfin::Support::toJsonValue(m_communityRating); - result["DownloadCount"] = Jellyfin::Support::toJsonValue(m_downloadCount); - result["IsHashMatch"] = Jellyfin::Support::toJsonValue(m_isHashMatch); - - return result; -} - -QString RemoteSubtitleInfo::threeLetterISOLanguageName() const { return m_threeLetterISOLanguageName; } - -void RemoteSubtitleInfo::setThreeLetterISOLanguageName(QString newThreeLetterISOLanguageName) { - m_threeLetterISOLanguageName = newThreeLetterISOLanguageName; -} -QString RemoteSubtitleInfo::jellyfinId() const { return m_jellyfinId; } - -void RemoteSubtitleInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString RemoteSubtitleInfo::providerName() const { return m_providerName; } - -void RemoteSubtitleInfo::setProviderName(QString newProviderName) { - m_providerName = newProviderName; -} -QString RemoteSubtitleInfo::name() const { return m_name; } - -void RemoteSubtitleInfo::setName(QString newName) { - m_name = newName; -} -QString RemoteSubtitleInfo::format() const { return m_format; } - -void RemoteSubtitleInfo::setFormat(QString newFormat) { - m_format = newFormat; -} -QString RemoteSubtitleInfo::author() const { return m_author; } - -void RemoteSubtitleInfo::setAuthor(QString newAuthor) { - m_author = newAuthor; -} -QString RemoteSubtitleInfo::comment() const { return m_comment; } - -void RemoteSubtitleInfo::setComment(QString newComment) { - m_comment = newComment; -} -QDateTime RemoteSubtitleInfo::dateCreated() const { return m_dateCreated; } - -void RemoteSubtitleInfo::setDateCreated(QDateTime newDateCreated) { - m_dateCreated = newDateCreated; -} -float RemoteSubtitleInfo::communityRating() const { return m_communityRating; } - -void RemoteSubtitleInfo::setCommunityRating(float newCommunityRating) { - m_communityRating = newCommunityRating; -} -qint32 RemoteSubtitleInfo::downloadCount() const { return m_downloadCount; } - -void RemoteSubtitleInfo::setDownloadCount(qint32 newDownloadCount) { - m_downloadCount = newDownloadCount; -} -bool RemoteSubtitleInfo::isHashMatch() const { return m_isHashMatch; } - -void RemoteSubtitleInfo::setIsHashMatch(bool newIsHashMatch) { - m_isHashMatch = newIsHashMatch; -} - -} // NS DTO - -namespace Support { - -using RemoteSubtitleInfo = Jellyfin::DTO::RemoteSubtitleInfo; - -template <> -RemoteSubtitleInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RemoteSubtitleInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/removefromplaylistrequestdto.cpp b/core/src/DTO/removefromplaylistrequestdto.cpp deleted file mode 100644 index 971106f..0000000 --- a/core/src/DTO/removefromplaylistrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RemoveFromPlaylistRequestDto::RemoveFromPlaylistRequestDto() {} -RemoveFromPlaylistRequestDto::RemoveFromPlaylistRequestDto(const RemoveFromPlaylistRequestDto &other) : - m_playlistItemIds(other.m_playlistItemIds){} - -RemoveFromPlaylistRequestDto RemoveFromPlaylistRequestDto::fromJson(QJsonObject source) { - RemoveFromPlaylistRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void RemoveFromPlaylistRequestDto::setFromJson(QJsonObject source) { - m_playlistItemIds = Jellyfin::Support::fromJsonValue>(source["PlaylistItemIds"]); - -} - -QJsonObject RemoveFromPlaylistRequestDto::toJson() { - QJsonObject result; - result["PlaylistItemIds"] = Jellyfin::Support::toJsonValue>(m_playlistItemIds); - - return result; -} - -QList RemoveFromPlaylistRequestDto::playlistItemIds() const { return m_playlistItemIds; } - -void RemoveFromPlaylistRequestDto::setPlaylistItemIds(QList newPlaylistItemIds) { - m_playlistItemIds = newPlaylistItemIds; -} - -} // NS DTO - -namespace Support { - -using RemoveFromPlaylistRequestDto = Jellyfin::DTO::RemoveFromPlaylistRequestDto; - -template <> -RemoveFromPlaylistRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RemoveFromPlaylistRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/repeatmode.cpp b/core/src/DTO/repeatmode.cpp deleted file mode 100644 index eeaaa52..0000000 --- a/core/src/DTO/repeatmode.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RepeatModeClass::RepeatModeClass() {} - - -} // NS DTO - -namespace Support { - -using RepeatMode = Jellyfin::DTO::RepeatMode; - -template <> -RepeatMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return RepeatMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("RepeatNone")) { - return RepeatMode::RepeatNone; - } - if (str == QStringLiteral("RepeatAll")) { - return RepeatMode::RepeatAll; - } - if (str == QStringLiteral("RepeatOne")) { - return RepeatMode::RepeatOne; - } - - return RepeatMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/repositoryinfo.cpp b/core/src/DTO/repositoryinfo.cpp deleted file mode 100644 index 0aec601..0000000 --- a/core/src/DTO/repositoryinfo.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -RepositoryInfo::RepositoryInfo() {} -RepositoryInfo::RepositoryInfo(const RepositoryInfo &other) : - m_name(other.m_name), - m_url(other.m_url), - m_enabled(other.m_enabled){} - -RepositoryInfo RepositoryInfo::fromJson(QJsonObject source) { - RepositoryInfo instance; - instance.setFromJson(source); - return instance; -} - - -void RepositoryInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - m_enabled = Jellyfin::Support::fromJsonValue(source["Enabled"]); - -} - -QJsonObject RepositoryInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - result["Enabled"] = Jellyfin::Support::toJsonValue(m_enabled); - - return result; -} - -QString RepositoryInfo::name() const { return m_name; } - -void RepositoryInfo::setName(QString newName) { - m_name = newName; -} -QString RepositoryInfo::url() const { return m_url; } - -void RepositoryInfo::setUrl(QString newUrl) { - m_url = newUrl; -} -bool RepositoryInfo::enabled() const { return m_enabled; } - -void RepositoryInfo::setEnabled(bool newEnabled) { - m_enabled = newEnabled; -} - -} // NS DTO - -namespace Support { - -using RepositoryInfo = Jellyfin::DTO::RepositoryInfo; - -template <> -RepositoryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return RepositoryInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/responseprofile.cpp b/core/src/DTO/responseprofile.cpp deleted file mode 100644 index 1a14e1b..0000000 --- a/core/src/DTO/responseprofile.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ResponseProfile::ResponseProfile() {} -ResponseProfile::ResponseProfile(const ResponseProfile &other) : - m_container(other.m_container), - m_audioCodec(other.m_audioCodec), - m_videoCodec(other.m_videoCodec), - m_type(other.m_type), - m_orgPn(other.m_orgPn), - m_mimeType(other.m_mimeType), - m_conditions(other.m_conditions){} - -ResponseProfile ResponseProfile::fromJson(QJsonObject source) { - ResponseProfile instance; - instance.setFromJson(source); - return instance; -} - - -void ResponseProfile::setFromJson(QJsonObject source) { - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_audioCodec = Jellyfin::Support::fromJsonValue(source["AudioCodec"]); - m_videoCodec = Jellyfin::Support::fromJsonValue(source["VideoCodec"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_orgPn = Jellyfin::Support::fromJsonValue(source["OrgPn"]); - m_mimeType = Jellyfin::Support::fromJsonValue(source["MimeType"]); - m_conditions = Jellyfin::Support::fromJsonValue>>(source["Conditions"]); - -} - -QJsonObject ResponseProfile::toJson() { - QJsonObject result; - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); - result["VideoCodec"] = Jellyfin::Support::toJsonValue(m_videoCodec); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["OrgPn"] = Jellyfin::Support::toJsonValue(m_orgPn); - result["MimeType"] = Jellyfin::Support::toJsonValue(m_mimeType); - result["Conditions"] = Jellyfin::Support::toJsonValue>>(m_conditions); - - return result; -} - -QString ResponseProfile::container() const { return m_container; } - -void ResponseProfile::setContainer(QString newContainer) { - m_container = newContainer; -} -QString ResponseProfile::audioCodec() const { return m_audioCodec; } - -void ResponseProfile::setAudioCodec(QString newAudioCodec) { - m_audioCodec = newAudioCodec; -} -QString ResponseProfile::videoCodec() const { return m_videoCodec; } - -void ResponseProfile::setVideoCodec(QString newVideoCodec) { - m_videoCodec = newVideoCodec; -} -DlnaProfileType ResponseProfile::type() const { return m_type; } - -void ResponseProfile::setType(DlnaProfileType newType) { - m_type = newType; -} -QString ResponseProfile::orgPn() const { return m_orgPn; } - -void ResponseProfile::setOrgPn(QString newOrgPn) { - m_orgPn = newOrgPn; -} -QString ResponseProfile::mimeType() const { return m_mimeType; } - -void ResponseProfile::setMimeType(QString newMimeType) { - m_mimeType = newMimeType; -} -QList> ResponseProfile::conditions() const { return m_conditions; } - -void ResponseProfile::setConditions(QList> newConditions) { - m_conditions = newConditions; -} - -} // NS DTO - -namespace Support { - -using ResponseProfile = Jellyfin::DTO::ResponseProfile; - -template <> -ResponseProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ResponseProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/scrolldirection.cpp b/core/src/DTO/scrolldirection.cpp deleted file mode 100644 index f57bd6f..0000000 --- a/core/src/DTO/scrolldirection.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ScrollDirectionClass::ScrollDirectionClass() {} - - -} // NS DTO - -namespace Support { - -using ScrollDirection = Jellyfin::DTO::ScrollDirection; - -template <> -ScrollDirection fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return ScrollDirection::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Horizontal")) { - return ScrollDirection::Horizontal; - } - if (str == QStringLiteral("Vertical")) { - return ScrollDirection::Vertical; - } - - return ScrollDirection::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/searchhint.cpp b/core/src/DTO/searchhint.cpp deleted file mode 100644 index 1334d8f..0000000 --- a/core/src/DTO/searchhint.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SearchHint::SearchHint() {} -SearchHint::SearchHint(const SearchHint &other) : - m_itemId(other.m_itemId), - m_jellyfinId(other.m_jellyfinId), - m_name(other.m_name), - m_matchedTerm(other.m_matchedTerm), - m_indexNumber(other.m_indexNumber), - m_productionYear(other.m_productionYear), - m_parentIndexNumber(other.m_parentIndexNumber), - m_primaryImageTag(other.m_primaryImageTag), - m_thumbImageTag(other.m_thumbImageTag), - m_thumbImageItemId(other.m_thumbImageItemId), - m_backdropImageTag(other.m_backdropImageTag), - m_backdropImageItemId(other.m_backdropImageItemId), - m_type(other.m_type), - m_isFolder(other.m_isFolder), - m_runTimeTicks(other.m_runTimeTicks), - m_mediaType(other.m_mediaType), - m_startDate(other.m_startDate), - m_endDate(other.m_endDate), - m_series(other.m_series), - m_status(other.m_status), - m_album(other.m_album), - m_albumId(other.m_albumId), - m_albumArtist(other.m_albumArtist), - m_artists(other.m_artists), - m_songCount(other.m_songCount), - m_episodeCount(other.m_episodeCount), - m_channelId(other.m_channelId), - m_channelName(other.m_channelName), - m_primaryImageAspectRatio(other.m_primaryImageAspectRatio){} - -SearchHint SearchHint::fromJson(QJsonObject source) { - SearchHint instance; - instance.setFromJson(source); - return instance; -} - - -void SearchHint::setFromJson(QJsonObject source) { - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_matchedTerm = Jellyfin::Support::fromJsonValue(source["MatchedTerm"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_productionYear = Jellyfin::Support::fromJsonValue(source["ProductionYear"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_primaryImageTag = Jellyfin::Support::fromJsonValue(source["PrimaryImageTag"]); - m_thumbImageTag = Jellyfin::Support::fromJsonValue(source["ThumbImageTag"]); - m_thumbImageItemId = Jellyfin::Support::fromJsonValue(source["ThumbImageItemId"]); - m_backdropImageTag = Jellyfin::Support::fromJsonValue(source["BackdropImageTag"]); - m_backdropImageItemId = Jellyfin::Support::fromJsonValue(source["BackdropImageItemId"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_isFolder = Jellyfin::Support::fromJsonValue(source["IsFolder"]); - m_runTimeTicks = Jellyfin::Support::fromJsonValue(source["RunTimeTicks"]); - m_mediaType = Jellyfin::Support::fromJsonValue(source["MediaType"]); - m_startDate = Jellyfin::Support::fromJsonValue(source["StartDate"]); - m_endDate = Jellyfin::Support::fromJsonValue(source["EndDate"]); - m_series = Jellyfin::Support::fromJsonValue(source["Series"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - m_album = Jellyfin::Support::fromJsonValue(source["Album"]); - m_albumId = Jellyfin::Support::fromJsonValue(source["AlbumId"]); - m_albumArtist = Jellyfin::Support::fromJsonValue(source["AlbumArtist"]); - m_artists = Jellyfin::Support::fromJsonValue(source["Artists"]); - m_songCount = Jellyfin::Support::fromJsonValue(source["SongCount"]); - m_episodeCount = Jellyfin::Support::fromJsonValue(source["EpisodeCount"]); - m_channelId = Jellyfin::Support::fromJsonValue(source["ChannelId"]); - m_channelName = Jellyfin::Support::fromJsonValue(source["ChannelName"]); - m_primaryImageAspectRatio = Jellyfin::Support::fromJsonValue(source["PrimaryImageAspectRatio"]); - -} - -QJsonObject SearchHint::toJson() { - QJsonObject result; - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["MatchedTerm"] = Jellyfin::Support::toJsonValue(m_matchedTerm); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ProductionYear"] = Jellyfin::Support::toJsonValue(m_productionYear); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_primaryImageTag); - result["ThumbImageTag"] = Jellyfin::Support::toJsonValue(m_thumbImageTag); - result["ThumbImageItemId"] = Jellyfin::Support::toJsonValue(m_thumbImageItemId); - result["BackdropImageTag"] = Jellyfin::Support::toJsonValue(m_backdropImageTag); - result["BackdropImageItemId"] = Jellyfin::Support::toJsonValue(m_backdropImageItemId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["IsFolder"] = Jellyfin::Support::toJsonValue(m_isFolder); - result["RunTimeTicks"] = Jellyfin::Support::toJsonValue(m_runTimeTicks); - result["MediaType"] = Jellyfin::Support::toJsonValue(m_mediaType); - result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); - result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); - result["Series"] = Jellyfin::Support::toJsonValue(m_series); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - result["Album"] = Jellyfin::Support::toJsonValue(m_album); - result["AlbumId"] = Jellyfin::Support::toJsonValue(m_albumId); - result["AlbumArtist"] = Jellyfin::Support::toJsonValue(m_albumArtist); - result["Artists"] = Jellyfin::Support::toJsonValue(m_artists); - result["SongCount"] = Jellyfin::Support::toJsonValue(m_songCount); - result["EpisodeCount"] = Jellyfin::Support::toJsonValue(m_episodeCount); - result["ChannelId"] = Jellyfin::Support::toJsonValue(m_channelId); - result["ChannelName"] = Jellyfin::Support::toJsonValue(m_channelName); - result["PrimaryImageAspectRatio"] = Jellyfin::Support::toJsonValue(m_primaryImageAspectRatio); - - return result; -} - -QUuid SearchHint::itemId() const { return m_itemId; } - -void SearchHint::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QUuid SearchHint::jellyfinId() const { return m_jellyfinId; } - -void SearchHint::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString SearchHint::name() const { return m_name; } - -void SearchHint::setName(QString newName) { - m_name = newName; -} -QString SearchHint::matchedTerm() const { return m_matchedTerm; } - -void SearchHint::setMatchedTerm(QString newMatchedTerm) { - m_matchedTerm = newMatchedTerm; -} -qint32 SearchHint::indexNumber() const { return m_indexNumber; } - -void SearchHint::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 SearchHint::productionYear() const { return m_productionYear; } - -void SearchHint::setProductionYear(qint32 newProductionYear) { - m_productionYear = newProductionYear; -} -qint32 SearchHint::parentIndexNumber() const { return m_parentIndexNumber; } - -void SearchHint::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QString SearchHint::primaryImageTag() const { return m_primaryImageTag; } - -void SearchHint::setPrimaryImageTag(QString newPrimaryImageTag) { - m_primaryImageTag = newPrimaryImageTag; -} -QString SearchHint::thumbImageTag() const { return m_thumbImageTag; } - -void SearchHint::setThumbImageTag(QString newThumbImageTag) { - m_thumbImageTag = newThumbImageTag; -} -QString SearchHint::thumbImageItemId() const { return m_thumbImageItemId; } - -void SearchHint::setThumbImageItemId(QString newThumbImageItemId) { - m_thumbImageItemId = newThumbImageItemId; -} -QString SearchHint::backdropImageTag() const { return m_backdropImageTag; } - -void SearchHint::setBackdropImageTag(QString newBackdropImageTag) { - m_backdropImageTag = newBackdropImageTag; -} -QString SearchHint::backdropImageItemId() const { return m_backdropImageItemId; } - -void SearchHint::setBackdropImageItemId(QString newBackdropImageItemId) { - m_backdropImageItemId = newBackdropImageItemId; -} -QString SearchHint::type() const { return m_type; } - -void SearchHint::setType(QString newType) { - m_type = newType; -} -bool SearchHint::isFolder() const { return m_isFolder; } - -void SearchHint::setIsFolder(bool newIsFolder) { - m_isFolder = newIsFolder; -} -qint64 SearchHint::runTimeTicks() const { return m_runTimeTicks; } - -void SearchHint::setRunTimeTicks(qint64 newRunTimeTicks) { - m_runTimeTicks = newRunTimeTicks; -} -QString SearchHint::mediaType() const { return m_mediaType; } - -void SearchHint::setMediaType(QString newMediaType) { - m_mediaType = newMediaType; -} -QDateTime SearchHint::startDate() const { return m_startDate; } - -void SearchHint::setStartDate(QDateTime newStartDate) { - m_startDate = newStartDate; -} -QDateTime SearchHint::endDate() const { return m_endDate; } - -void SearchHint::setEndDate(QDateTime newEndDate) { - m_endDate = newEndDate; -} -QString SearchHint::series() const { return m_series; } - -void SearchHint::setSeries(QString newSeries) { - m_series = newSeries; -} -QString SearchHint::status() const { return m_status; } - -void SearchHint::setStatus(QString newStatus) { - m_status = newStatus; -} -QString SearchHint::album() const { return m_album; } - -void SearchHint::setAlbum(QString newAlbum) { - m_album = newAlbum; -} -QUuid SearchHint::albumId() const { return m_albumId; } - -void SearchHint::setAlbumId(QUuid newAlbumId) { - m_albumId = newAlbumId; -} -QString SearchHint::albumArtist() const { return m_albumArtist; } - -void SearchHint::setAlbumArtist(QString newAlbumArtist) { - m_albumArtist = newAlbumArtist; -} -QStringList SearchHint::artists() const { return m_artists; } - -void SearchHint::setArtists(QStringList newArtists) { - m_artists = newArtists; -} -qint32 SearchHint::songCount() const { return m_songCount; } - -void SearchHint::setSongCount(qint32 newSongCount) { - m_songCount = newSongCount; -} -qint32 SearchHint::episodeCount() const { return m_episodeCount; } - -void SearchHint::setEpisodeCount(qint32 newEpisodeCount) { - m_episodeCount = newEpisodeCount; -} -QUuid SearchHint::channelId() const { return m_channelId; } - -void SearchHint::setChannelId(QUuid newChannelId) { - m_channelId = newChannelId; -} -QString SearchHint::channelName() const { return m_channelName; } - -void SearchHint::setChannelName(QString newChannelName) { - m_channelName = newChannelName; -} -double SearchHint::primaryImageAspectRatio() const { return m_primaryImageAspectRatio; } - -void SearchHint::setPrimaryImageAspectRatio(double newPrimaryImageAspectRatio) { - m_primaryImageAspectRatio = newPrimaryImageAspectRatio; -} - -} // NS DTO - -namespace Support { - -using SearchHint = Jellyfin::DTO::SearchHint; - -template <> -SearchHint fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SearchHint::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/searchhintresult.cpp b/core/src/DTO/searchhintresult.cpp deleted file mode 100644 index bfa351b..0000000 --- a/core/src/DTO/searchhintresult.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SearchHintResult::SearchHintResult() {} -SearchHintResult::SearchHintResult(const SearchHintResult &other) : - m_searchHints(other.m_searchHints), - m_totalRecordCount(other.m_totalRecordCount){} - -SearchHintResult SearchHintResult::fromJson(QJsonObject source) { - SearchHintResult instance; - instance.setFromJson(source); - return instance; -} - - -void SearchHintResult::setFromJson(QJsonObject source) { - m_searchHints = Jellyfin::Support::fromJsonValue>>(source["SearchHints"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - -} - -QJsonObject SearchHintResult::toJson() { - QJsonObject result; - result["SearchHints"] = Jellyfin::Support::toJsonValue>>(m_searchHints); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - - return result; -} - -QList> SearchHintResult::searchHints() const { return m_searchHints; } - -void SearchHintResult::setSearchHints(QList> newSearchHints) { - m_searchHints = newSearchHints; -} -qint32 SearchHintResult::totalRecordCount() const { return m_totalRecordCount; } - -void SearchHintResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} - -} // NS DTO - -namespace Support { - -using SearchHintResult = Jellyfin::DTO::SearchHintResult; - -template <> -SearchHintResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SearchHintResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seekrequestdto.cpp b/core/src/DTO/seekrequestdto.cpp deleted file mode 100644 index 81061c9..0000000 --- a/core/src/DTO/seekrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeekRequestDto::SeekRequestDto() {} -SeekRequestDto::SeekRequestDto(const SeekRequestDto &other) : - m_positionTicks(other.m_positionTicks){} - -SeekRequestDto SeekRequestDto::fromJson(QJsonObject source) { - SeekRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void SeekRequestDto::setFromJson(QJsonObject source) { - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - -} - -QJsonObject SeekRequestDto::toJson() { - QJsonObject result; - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - - return result; -} - -qint64 SeekRequestDto::positionTicks() const { return m_positionTicks; } - -void SeekRequestDto::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} - -} // NS DTO - -namespace Support { - -using SeekRequestDto = Jellyfin::DTO::SeekRequestDto; - -template <> -SeekRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SeekRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/sendcommand.cpp b/core/src/DTO/sendcommand.cpp deleted file mode 100644 index 485fba7..0000000 --- a/core/src/DTO/sendcommand.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SendCommand::SendCommand() {} -SendCommand::SendCommand(const SendCommand &other) : - m_groupId(other.m_groupId), - m_playlistItemId(other.m_playlistItemId), - m_when(other.m_when), - m_positionTicks(other.m_positionTicks), - m_command(other.m_command), - m_emittedAt(other.m_emittedAt){} - -SendCommand SendCommand::fromJson(QJsonObject source) { - SendCommand instance; - instance.setFromJson(source); - return instance; -} - - -void SendCommand::setFromJson(QJsonObject source) { - m_groupId = Jellyfin::Support::fromJsonValue(source["GroupId"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - m_when = Jellyfin::Support::fromJsonValue(source["When"]); - m_positionTicks = Jellyfin::Support::fromJsonValue(source["PositionTicks"]); - m_command = Jellyfin::Support::fromJsonValue(source["Command"]); - m_emittedAt = Jellyfin::Support::fromJsonValue(source["EmittedAt"]); - -} - -QJsonObject SendCommand::toJson() { - QJsonObject result; - result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - result["When"] = Jellyfin::Support::toJsonValue(m_when); - result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); - result["Command"] = Jellyfin::Support::toJsonValue(m_command); - result["EmittedAt"] = Jellyfin::Support::toJsonValue(m_emittedAt); - - return result; -} - -QUuid SendCommand::groupId() const { return m_groupId; } - -void SendCommand::setGroupId(QUuid newGroupId) { - m_groupId = newGroupId; -} -QUuid SendCommand::playlistItemId() const { return m_playlistItemId; } - -void SendCommand::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} -QDateTime SendCommand::when() const { return m_when; } - -void SendCommand::setWhen(QDateTime newWhen) { - m_when = newWhen; -} -qint64 SendCommand::positionTicks() const { return m_positionTicks; } - -void SendCommand::setPositionTicks(qint64 newPositionTicks) { - m_positionTicks = newPositionTicks; -} -SendCommandType SendCommand::command() const { return m_command; } - -void SendCommand::setCommand(SendCommandType newCommand) { - m_command = newCommand; -} -QDateTime SendCommand::emittedAt() const { return m_emittedAt; } - -void SendCommand::setEmittedAt(QDateTime newEmittedAt) { - m_emittedAt = newEmittedAt; -} - -} // NS DTO - -namespace Support { - -using SendCommand = Jellyfin::DTO::SendCommand; - -template <> -SendCommand fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SendCommand::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/sendcommandtype.cpp b/core/src/DTO/sendcommandtype.cpp deleted file mode 100644 index 655646a..0000000 --- a/core/src/DTO/sendcommandtype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SendCommandTypeClass::SendCommandTypeClass() {} - - -} // NS DTO - -namespace Support { - -using SendCommandType = Jellyfin::DTO::SendCommandType; - -template <> -SendCommandType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SendCommandType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Unpause")) { - return SendCommandType::Unpause; - } - if (str == QStringLiteral("Pause")) { - return SendCommandType::Pause; - } - if (str == QStringLiteral("Stop")) { - return SendCommandType::Stop; - } - if (str == QStringLiteral("Seek")) { - return SendCommandType::Seek; - } - - return SendCommandType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seriesinfo.cpp b/core/src/DTO/seriesinfo.cpp deleted file mode 100644 index 86fe65e..0000000 --- a/core/src/DTO/seriesinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeriesInfo::SeriesInfo() {} -SeriesInfo::SeriesInfo(const SeriesInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated){} - -SeriesInfo SeriesInfo::fromJson(QJsonObject source) { - SeriesInfo instance; - instance.setFromJson(source); - return instance; -} - - -void SeriesInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - -} - -QJsonObject SeriesInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - - return result; -} - -QString SeriesInfo::name() const { return m_name; } - -void SeriesInfo::setName(QString newName) { - m_name = newName; -} -QString SeriesInfo::path() const { return m_path; } - -void SeriesInfo::setPath(QString newPath) { - m_path = newPath; -} -QString SeriesInfo::metadataLanguage() const { return m_metadataLanguage; } - -void SeriesInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString SeriesInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void SeriesInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject SeriesInfo::providerIds() const { return m_providerIds; } - -void SeriesInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 SeriesInfo::year() const { return m_year; } - -void SeriesInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 SeriesInfo::indexNumber() const { return m_indexNumber; } - -void SeriesInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 SeriesInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void SeriesInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime SeriesInfo::premiereDate() const { return m_premiereDate; } - -void SeriesInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool SeriesInfo::isAutomated() const { return m_isAutomated; } - -void SeriesInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} - -} // NS DTO - -namespace Support { - -using SeriesInfo = Jellyfin::DTO::SeriesInfo; - -template <> -SeriesInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SeriesInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seriesinforemotesearchquery.cpp b/core/src/DTO/seriesinforemotesearchquery.cpp deleted file mode 100644 index c992e8f..0000000 --- a/core/src/DTO/seriesinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeriesInfoRemoteSearchQuery::SeriesInfoRemoteSearchQuery() {} -SeriesInfoRemoteSearchQuery::SeriesInfoRemoteSearchQuery(const SeriesInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -SeriesInfoRemoteSearchQuery SeriesInfoRemoteSearchQuery::fromJson(QJsonObject source) { - SeriesInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void SeriesInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject SeriesInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer SeriesInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void SeriesInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid SeriesInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void SeriesInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString SeriesInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void SeriesInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool SeriesInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void SeriesInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using SeriesInfoRemoteSearchQuery = Jellyfin::DTO::SeriesInfoRemoteSearchQuery; - -template <> -SeriesInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SeriesInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seriesstatus.cpp b/core/src/DTO/seriesstatus.cpp deleted file mode 100644 index 46f3751..0000000 --- a/core/src/DTO/seriesstatus.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeriesStatusClass::SeriesStatusClass() {} - - -} // NS DTO - -namespace Support { - -using SeriesStatus = Jellyfin::DTO::SeriesStatus; - -template <> -SeriesStatus fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SeriesStatus::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Continuing")) { - return SeriesStatus::Continuing; - } - if (str == QStringLiteral("Ended")) { - return SeriesStatus::Ended; - } - - return SeriesStatus::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seriestimerinfodto.cpp b/core/src/DTO/seriestimerinfodto.cpp deleted file mode 100644 index 293306f..0000000 --- a/core/src/DTO/seriestimerinfodto.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeriesTimerInfoDto::SeriesTimerInfoDto() {} -SeriesTimerInfoDto::SeriesTimerInfoDto(const SeriesTimerInfoDto &other) : - m_jellyfinId(other.m_jellyfinId), - m_type(other.m_type), - m_serverId(other.m_serverId), - m_externalId(other.m_externalId), - m_channelId(other.m_channelId), - m_externalChannelId(other.m_externalChannelId), - m_channelName(other.m_channelName), - m_channelPrimaryImageTag(other.m_channelPrimaryImageTag), - m_programId(other.m_programId), - m_externalProgramId(other.m_externalProgramId), - m_name(other.m_name), - m_overview(other.m_overview), - m_startDate(other.m_startDate), - m_endDate(other.m_endDate), - m_serviceName(other.m_serviceName), - m_priority(other.m_priority), - m_prePaddingSeconds(other.m_prePaddingSeconds), - m_postPaddingSeconds(other.m_postPaddingSeconds), - m_isPrePaddingRequired(other.m_isPrePaddingRequired), - m_parentBackdropItemId(other.m_parentBackdropItemId), - m_parentBackdropImageTags(other.m_parentBackdropImageTags), - m_isPostPaddingRequired(other.m_isPostPaddingRequired), - m_keepUntil(other.m_keepUntil), - m_recordAnyTime(other.m_recordAnyTime), - m_skipEpisodesInLibrary(other.m_skipEpisodesInLibrary), - m_recordAnyChannel(other.m_recordAnyChannel), - m_keepUpTo(other.m_keepUpTo), - m_recordNewOnly(other.m_recordNewOnly), - m_days(other.m_days), - m_dayPattern(other.m_dayPattern), - m_imageTags(other.m_imageTags), - m_parentThumbItemId(other.m_parentThumbItemId), - m_parentThumbImageTag(other.m_parentThumbImageTag), - m_parentPrimaryImageItemId(other.m_parentPrimaryImageItemId), - m_parentPrimaryImageTag(other.m_parentPrimaryImageTag){} - -SeriesTimerInfoDto SeriesTimerInfoDto::fromJson(QJsonObject source) { - SeriesTimerInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void SeriesTimerInfoDto::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - m_externalId = Jellyfin::Support::fromJsonValue(source["ExternalId"]); - m_channelId = Jellyfin::Support::fromJsonValue(source["ChannelId"]); - m_externalChannelId = Jellyfin::Support::fromJsonValue(source["ExternalChannelId"]); - m_channelName = Jellyfin::Support::fromJsonValue(source["ChannelName"]); - m_channelPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["ChannelPrimaryImageTag"]); - m_programId = Jellyfin::Support::fromJsonValue(source["ProgramId"]); - m_externalProgramId = Jellyfin::Support::fromJsonValue(source["ExternalProgramId"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_overview = Jellyfin::Support::fromJsonValue(source["Overview"]); - m_startDate = Jellyfin::Support::fromJsonValue(source["StartDate"]); - m_endDate = Jellyfin::Support::fromJsonValue(source["EndDate"]); - m_serviceName = Jellyfin::Support::fromJsonValue(source["ServiceName"]); - m_priority = Jellyfin::Support::fromJsonValue(source["Priority"]); - m_prePaddingSeconds = Jellyfin::Support::fromJsonValue(source["PrePaddingSeconds"]); - m_postPaddingSeconds = Jellyfin::Support::fromJsonValue(source["PostPaddingSeconds"]); - m_isPrePaddingRequired = Jellyfin::Support::fromJsonValue(source["IsPrePaddingRequired"]); - m_parentBackdropItemId = Jellyfin::Support::fromJsonValue(source["ParentBackdropItemId"]); - m_parentBackdropImageTags = Jellyfin::Support::fromJsonValue(source["ParentBackdropImageTags"]); - m_isPostPaddingRequired = Jellyfin::Support::fromJsonValue(source["IsPostPaddingRequired"]); - m_keepUntil = Jellyfin::Support::fromJsonValue(source["KeepUntil"]); - m_recordAnyTime = Jellyfin::Support::fromJsonValue(source["RecordAnyTime"]); - m_skipEpisodesInLibrary = Jellyfin::Support::fromJsonValue(source["SkipEpisodesInLibrary"]); - m_recordAnyChannel = Jellyfin::Support::fromJsonValue(source["RecordAnyChannel"]); - m_keepUpTo = Jellyfin::Support::fromJsonValue(source["KeepUpTo"]); - m_recordNewOnly = Jellyfin::Support::fromJsonValue(source["RecordNewOnly"]); - m_days = Jellyfin::Support::fromJsonValue>(source["Days"]); - m_dayPattern = Jellyfin::Support::fromJsonValue(source["DayPattern"]); - m_imageTags = Jellyfin::Support::fromJsonValue(source["ImageTags"]); - m_parentThumbItemId = Jellyfin::Support::fromJsonValue(source["ParentThumbItemId"]); - m_parentThumbImageTag = Jellyfin::Support::fromJsonValue(source["ParentThumbImageTag"]); - m_parentPrimaryImageItemId = Jellyfin::Support::fromJsonValue(source["ParentPrimaryImageItemId"]); - m_parentPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["ParentPrimaryImageTag"]); - -} - -QJsonObject SeriesTimerInfoDto::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - result["ExternalId"] = Jellyfin::Support::toJsonValue(m_externalId); - result["ChannelId"] = Jellyfin::Support::toJsonValue(m_channelId); - result["ExternalChannelId"] = Jellyfin::Support::toJsonValue(m_externalChannelId); - result["ChannelName"] = Jellyfin::Support::toJsonValue(m_channelName); - result["ChannelPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_channelPrimaryImageTag); - result["ProgramId"] = Jellyfin::Support::toJsonValue(m_programId); - result["ExternalProgramId"] = Jellyfin::Support::toJsonValue(m_externalProgramId); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); - result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); - result["ServiceName"] = Jellyfin::Support::toJsonValue(m_serviceName); - result["Priority"] = Jellyfin::Support::toJsonValue(m_priority); - result["PrePaddingSeconds"] = Jellyfin::Support::toJsonValue(m_prePaddingSeconds); - result["PostPaddingSeconds"] = Jellyfin::Support::toJsonValue(m_postPaddingSeconds); - result["IsPrePaddingRequired"] = Jellyfin::Support::toJsonValue(m_isPrePaddingRequired); - result["ParentBackdropItemId"] = Jellyfin::Support::toJsonValue(m_parentBackdropItemId); - result["ParentBackdropImageTags"] = Jellyfin::Support::toJsonValue(m_parentBackdropImageTags); - result["IsPostPaddingRequired"] = Jellyfin::Support::toJsonValue(m_isPostPaddingRequired); - result["KeepUntil"] = Jellyfin::Support::toJsonValue(m_keepUntil); - result["RecordAnyTime"] = Jellyfin::Support::toJsonValue(m_recordAnyTime); - result["SkipEpisodesInLibrary"] = Jellyfin::Support::toJsonValue(m_skipEpisodesInLibrary); - result["RecordAnyChannel"] = Jellyfin::Support::toJsonValue(m_recordAnyChannel); - result["KeepUpTo"] = Jellyfin::Support::toJsonValue(m_keepUpTo); - result["RecordNewOnly"] = Jellyfin::Support::toJsonValue(m_recordNewOnly); - result["Days"] = Jellyfin::Support::toJsonValue>(m_days); - result["DayPattern"] = Jellyfin::Support::toJsonValue(m_dayPattern); - result["ImageTags"] = Jellyfin::Support::toJsonValue(m_imageTags); - result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue(m_parentThumbItemId); - result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue(m_parentThumbImageTag); - result["ParentPrimaryImageItemId"] = Jellyfin::Support::toJsonValue(m_parentPrimaryImageItemId); - result["ParentPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_parentPrimaryImageTag); - - return result; -} - -QString SeriesTimerInfoDto::jellyfinId() const { return m_jellyfinId; } - -void SeriesTimerInfoDto::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString SeriesTimerInfoDto::type() const { return m_type; } - -void SeriesTimerInfoDto::setType(QString newType) { - m_type = newType; -} -QString SeriesTimerInfoDto::serverId() const { return m_serverId; } - -void SeriesTimerInfoDto::setServerId(QString newServerId) { - m_serverId = newServerId; -} -QString SeriesTimerInfoDto::externalId() const { return m_externalId; } - -void SeriesTimerInfoDto::setExternalId(QString newExternalId) { - m_externalId = newExternalId; -} -QUuid SeriesTimerInfoDto::channelId() const { return m_channelId; } - -void SeriesTimerInfoDto::setChannelId(QUuid newChannelId) { - m_channelId = newChannelId; -} -QString SeriesTimerInfoDto::externalChannelId() const { return m_externalChannelId; } - -void SeriesTimerInfoDto::setExternalChannelId(QString newExternalChannelId) { - m_externalChannelId = newExternalChannelId; -} -QString SeriesTimerInfoDto::channelName() const { return m_channelName; } - -void SeriesTimerInfoDto::setChannelName(QString newChannelName) { - m_channelName = newChannelName; -} -QString SeriesTimerInfoDto::channelPrimaryImageTag() const { return m_channelPrimaryImageTag; } - -void SeriesTimerInfoDto::setChannelPrimaryImageTag(QString newChannelPrimaryImageTag) { - m_channelPrimaryImageTag = newChannelPrimaryImageTag; -} -QString SeriesTimerInfoDto::programId() const { return m_programId; } - -void SeriesTimerInfoDto::setProgramId(QString newProgramId) { - m_programId = newProgramId; -} -QString SeriesTimerInfoDto::externalProgramId() const { return m_externalProgramId; } - -void SeriesTimerInfoDto::setExternalProgramId(QString newExternalProgramId) { - m_externalProgramId = newExternalProgramId; -} -QString SeriesTimerInfoDto::name() const { return m_name; } - -void SeriesTimerInfoDto::setName(QString newName) { - m_name = newName; -} -QString SeriesTimerInfoDto::overview() const { return m_overview; } - -void SeriesTimerInfoDto::setOverview(QString newOverview) { - m_overview = newOverview; -} -QDateTime SeriesTimerInfoDto::startDate() const { return m_startDate; } - -void SeriesTimerInfoDto::setStartDate(QDateTime newStartDate) { - m_startDate = newStartDate; -} -QDateTime SeriesTimerInfoDto::endDate() const { return m_endDate; } - -void SeriesTimerInfoDto::setEndDate(QDateTime newEndDate) { - m_endDate = newEndDate; -} -QString SeriesTimerInfoDto::serviceName() const { return m_serviceName; } - -void SeriesTimerInfoDto::setServiceName(QString newServiceName) { - m_serviceName = newServiceName; -} -qint32 SeriesTimerInfoDto::priority() const { return m_priority; } - -void SeriesTimerInfoDto::setPriority(qint32 newPriority) { - m_priority = newPriority; -} -qint32 SeriesTimerInfoDto::prePaddingSeconds() const { return m_prePaddingSeconds; } - -void SeriesTimerInfoDto::setPrePaddingSeconds(qint32 newPrePaddingSeconds) { - m_prePaddingSeconds = newPrePaddingSeconds; -} -qint32 SeriesTimerInfoDto::postPaddingSeconds() const { return m_postPaddingSeconds; } - -void SeriesTimerInfoDto::setPostPaddingSeconds(qint32 newPostPaddingSeconds) { - m_postPaddingSeconds = newPostPaddingSeconds; -} -bool SeriesTimerInfoDto::isPrePaddingRequired() const { return m_isPrePaddingRequired; } - -void SeriesTimerInfoDto::setIsPrePaddingRequired(bool newIsPrePaddingRequired) { - m_isPrePaddingRequired = newIsPrePaddingRequired; -} -QString SeriesTimerInfoDto::parentBackdropItemId() const { return m_parentBackdropItemId; } - -void SeriesTimerInfoDto::setParentBackdropItemId(QString newParentBackdropItemId) { - m_parentBackdropItemId = newParentBackdropItemId; -} -QStringList SeriesTimerInfoDto::parentBackdropImageTags() const { return m_parentBackdropImageTags; } - -void SeriesTimerInfoDto::setParentBackdropImageTags(QStringList newParentBackdropImageTags) { - m_parentBackdropImageTags = newParentBackdropImageTags; -} -bool SeriesTimerInfoDto::isPostPaddingRequired() const { return m_isPostPaddingRequired; } - -void SeriesTimerInfoDto::setIsPostPaddingRequired(bool newIsPostPaddingRequired) { - m_isPostPaddingRequired = newIsPostPaddingRequired; -} -KeepUntil SeriesTimerInfoDto::keepUntil() const { return m_keepUntil; } - -void SeriesTimerInfoDto::setKeepUntil(KeepUntil newKeepUntil) { - m_keepUntil = newKeepUntil; -} -bool SeriesTimerInfoDto::recordAnyTime() const { return m_recordAnyTime; } - -void SeriesTimerInfoDto::setRecordAnyTime(bool newRecordAnyTime) { - m_recordAnyTime = newRecordAnyTime; -} -bool SeriesTimerInfoDto::skipEpisodesInLibrary() const { return m_skipEpisodesInLibrary; } - -void SeriesTimerInfoDto::setSkipEpisodesInLibrary(bool newSkipEpisodesInLibrary) { - m_skipEpisodesInLibrary = newSkipEpisodesInLibrary; -} -bool SeriesTimerInfoDto::recordAnyChannel() const { return m_recordAnyChannel; } - -void SeriesTimerInfoDto::setRecordAnyChannel(bool newRecordAnyChannel) { - m_recordAnyChannel = newRecordAnyChannel; -} -qint32 SeriesTimerInfoDto::keepUpTo() const { return m_keepUpTo; } - -void SeriesTimerInfoDto::setKeepUpTo(qint32 newKeepUpTo) { - m_keepUpTo = newKeepUpTo; -} -bool SeriesTimerInfoDto::recordNewOnly() const { return m_recordNewOnly; } - -void SeriesTimerInfoDto::setRecordNewOnly(bool newRecordNewOnly) { - m_recordNewOnly = newRecordNewOnly; -} -QList SeriesTimerInfoDto::days() const { return m_days; } - -void SeriesTimerInfoDto::setDays(QList newDays) { - m_days = newDays; -} -DayPattern SeriesTimerInfoDto::dayPattern() const { return m_dayPattern; } - -void SeriesTimerInfoDto::setDayPattern(DayPattern newDayPattern) { - m_dayPattern = newDayPattern; -} -QJsonObject SeriesTimerInfoDto::imageTags() const { return m_imageTags; } - -void SeriesTimerInfoDto::setImageTags(QJsonObject newImageTags) { - m_imageTags = newImageTags; -} -QString SeriesTimerInfoDto::parentThumbItemId() const { return m_parentThumbItemId; } - -void SeriesTimerInfoDto::setParentThumbItemId(QString newParentThumbItemId) { - m_parentThumbItemId = newParentThumbItemId; -} -QString SeriesTimerInfoDto::parentThumbImageTag() const { return m_parentThumbImageTag; } - -void SeriesTimerInfoDto::setParentThumbImageTag(QString newParentThumbImageTag) { - m_parentThumbImageTag = newParentThumbImageTag; -} -QString SeriesTimerInfoDto::parentPrimaryImageItemId() const { return m_parentPrimaryImageItemId; } - -void SeriesTimerInfoDto::setParentPrimaryImageItemId(QString newParentPrimaryImageItemId) { - m_parentPrimaryImageItemId = newParentPrimaryImageItemId; -} -QString SeriesTimerInfoDto::parentPrimaryImageTag() const { return m_parentPrimaryImageTag; } - -void SeriesTimerInfoDto::setParentPrimaryImageTag(QString newParentPrimaryImageTag) { - m_parentPrimaryImageTag = newParentPrimaryImageTag; -} - -} // NS DTO - -namespace Support { - -using SeriesTimerInfoDto = Jellyfin::DTO::SeriesTimerInfoDto; - -template <> -SeriesTimerInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SeriesTimerInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/seriestimerinfodtoqueryresult.cpp b/core/src/DTO/seriestimerinfodtoqueryresult.cpp deleted file mode 100644 index 69cb61d..0000000 --- a/core/src/DTO/seriestimerinfodtoqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SeriesTimerInfoDtoQueryResult::SeriesTimerInfoDtoQueryResult() {} -SeriesTimerInfoDtoQueryResult::SeriesTimerInfoDtoQueryResult(const SeriesTimerInfoDtoQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -SeriesTimerInfoDtoQueryResult SeriesTimerInfoDtoQueryResult::fromJson(QJsonObject source) { - SeriesTimerInfoDtoQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void SeriesTimerInfoDtoQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject SeriesTimerInfoDtoQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> SeriesTimerInfoDtoQueryResult::items() const { return m_items; } - -void SeriesTimerInfoDtoQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 SeriesTimerInfoDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void SeriesTimerInfoDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 SeriesTimerInfoDtoQueryResult::startIndex() const { return m_startIndex; } - -void SeriesTimerInfoDtoQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using SeriesTimerInfoDtoQueryResult = Jellyfin::DTO::SeriesTimerInfoDtoQueryResult; - -template <> -SeriesTimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SeriesTimerInfoDtoQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/serverconfiguration.cpp b/core/src/DTO/serverconfiguration.cpp deleted file mode 100644 index 67e469d..0000000 --- a/core/src/DTO/serverconfiguration.cpp +++ /dev/null @@ -1,749 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ServerConfiguration::ServerConfiguration() {} -ServerConfiguration::ServerConfiguration(const ServerConfiguration &other) : - m_logFileRetentionDays(other.m_logFileRetentionDays), - m_isStartupWizardCompleted(other.m_isStartupWizardCompleted), - m_cachePath(other.m_cachePath), - m_previousVersion(other.m_previousVersion), - m_previousVersionStr(other.m_previousVersionStr), - m_enableUPnP(other.m_enableUPnP), - m_enableMetrics(other.m_enableMetrics), - m_publicPort(other.m_publicPort), - m_uPnPCreateHttpPortMap(other.m_uPnPCreateHttpPortMap), - m_uDPPortRange(other.m_uDPPortRange), - m_enableIPV6(other.m_enableIPV6), - m_enableIPV4(other.m_enableIPV4), - m_enableSSDPTracing(other.m_enableSSDPTracing), - m_sSDPTracingFilter(other.m_sSDPTracingFilter), - m_uDPSendCount(other.m_uDPSendCount), - m_uDPSendDelay(other.m_uDPSendDelay), - m_ignoreVirtualInterfaces(other.m_ignoreVirtualInterfaces), - m_virtualInterfaceNames(other.m_virtualInterfaceNames), - m_gatewayMonitorPeriod(other.m_gatewayMonitorPeriod), - m_enableMultiSocketBinding(other.m_enableMultiSocketBinding), - m_trustAllIP6Interfaces(other.m_trustAllIP6Interfaces), - m_hDHomerunPortRange(other.m_hDHomerunPortRange), - m_publishedServerUriBySubnet(other.m_publishedServerUriBySubnet), - m_autoDiscoveryTracing(other.m_autoDiscoveryTracing), - m_autoDiscovery(other.m_autoDiscovery), - m_publicHttpsPort(other.m_publicHttpsPort), - m_httpServerPortNumber(other.m_httpServerPortNumber), - m_httpsPortNumber(other.m_httpsPortNumber), - m_enableHttps(other.m_enableHttps), - m_enableNormalizedItemByNameIds(other.m_enableNormalizedItemByNameIds), - m_certificatePath(other.m_certificatePath), - m_certificatePassword(other.m_certificatePassword), - m_isPortAuthorized(other.m_isPortAuthorized), - m_quickConnectAvailable(other.m_quickConnectAvailable), - m_enableRemoteAccess(other.m_enableRemoteAccess), - m_enableCaseSensitiveItemIds(other.m_enableCaseSensitiveItemIds), - m_disableLiveTvChannelUserDataName(other.m_disableLiveTvChannelUserDataName), - m_metadataPath(other.m_metadataPath), - m_metadataNetworkPath(other.m_metadataNetworkPath), - m_preferredMetadataLanguage(other.m_preferredMetadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_sortReplaceCharacters(other.m_sortReplaceCharacters), - m_sortRemoveCharacters(other.m_sortRemoveCharacters), - m_sortRemoveWords(other.m_sortRemoveWords), - m_minResumePct(other.m_minResumePct), - m_maxResumePct(other.m_maxResumePct), - m_minResumeDurationSeconds(other.m_minResumeDurationSeconds), - m_minAudiobookResume(other.m_minAudiobookResume), - m_maxAudiobookResume(other.m_maxAudiobookResume), - m_libraryMonitorDelay(other.m_libraryMonitorDelay), - m_enableDashboardResponseCaching(other.m_enableDashboardResponseCaching), - m_imageSavingConvention(other.m_imageSavingConvention), - m_metadataOptions(other.m_metadataOptions), - m_skipDeserializationForBasicTypes(other.m_skipDeserializationForBasicTypes), - m_serverName(other.m_serverName), - m_baseUrl(other.m_baseUrl), - m_uICulture(other.m_uICulture), - m_saveMetadataHidden(other.m_saveMetadataHidden), - m_contentTypes(other.m_contentTypes), - m_remoteClientBitrateLimit(other.m_remoteClientBitrateLimit), - m_enableFolderView(other.m_enableFolderView), - m_enableGroupingIntoCollections(other.m_enableGroupingIntoCollections), - m_displaySpecialsWithinSeasons(other.m_displaySpecialsWithinSeasons), - m_localNetworkSubnets(other.m_localNetworkSubnets), - m_localNetworkAddresses(other.m_localNetworkAddresses), - m_codecsUsed(other.m_codecsUsed), - m_pluginRepositories(other.m_pluginRepositories), - m_enableExternalContentInSuggestions(other.m_enableExternalContentInSuggestions), - m_requireHttps(other.m_requireHttps), - m_enableNewOmdbSupport(other.m_enableNewOmdbSupport), - m_remoteIPFilter(other.m_remoteIPFilter), - m_isRemoteIPFilterBlacklist(other.m_isRemoteIPFilterBlacklist), - m_imageExtractionTimeoutMs(other.m_imageExtractionTimeoutMs), - m_pathSubstitutions(other.m_pathSubstitutions), - m_enableSimpleArtistDetection(other.m_enableSimpleArtistDetection), - m_uninstalledPlugins(other.m_uninstalledPlugins), - m_enableSlowResponseWarning(other.m_enableSlowResponseWarning), - m_slowResponseThresholdMs(other.m_slowResponseThresholdMs), - m_corsHosts(other.m_corsHosts), - m_knownProxies(other.m_knownProxies), - m_activityLogRetentionDays(other.m_activityLogRetentionDays), - m_libraryScanFanoutConcurrency(other.m_libraryScanFanoutConcurrency), - m_libraryMetadataRefreshConcurrency(other.m_libraryMetadataRefreshConcurrency), - m_removeOldPlugins(other.m_removeOldPlugins), - m_disablePluginImages(other.m_disablePluginImages){} - -ServerConfiguration ServerConfiguration::fromJson(QJsonObject source) { - ServerConfiguration instance; - instance.setFromJson(source); - return instance; -} - - -void ServerConfiguration::setFromJson(QJsonObject source) { - m_logFileRetentionDays = Jellyfin::Support::fromJsonValue(source["LogFileRetentionDays"]); - m_isStartupWizardCompleted = Jellyfin::Support::fromJsonValue(source["IsStartupWizardCompleted"]); - m_cachePath = Jellyfin::Support::fromJsonValue(source["CachePath"]); - m_previousVersion = Jellyfin::Support::fromJsonValue>(source["PreviousVersion"]); - m_previousVersionStr = Jellyfin::Support::fromJsonValue(source["PreviousVersionStr"]); - m_enableUPnP = Jellyfin::Support::fromJsonValue(source["EnableUPnP"]); - m_enableMetrics = Jellyfin::Support::fromJsonValue(source["EnableMetrics"]); - m_publicPort = Jellyfin::Support::fromJsonValue(source["PublicPort"]); - m_uPnPCreateHttpPortMap = Jellyfin::Support::fromJsonValue(source["UPnPCreateHttpPortMap"]); - m_uDPPortRange = Jellyfin::Support::fromJsonValue(source["UDPPortRange"]); - m_enableIPV6 = Jellyfin::Support::fromJsonValue(source["EnableIPV6"]); - m_enableIPV4 = Jellyfin::Support::fromJsonValue(source["EnableIPV4"]); - m_enableSSDPTracing = Jellyfin::Support::fromJsonValue(source["EnableSSDPTracing"]); - m_sSDPTracingFilter = Jellyfin::Support::fromJsonValue(source["SSDPTracingFilter"]); - m_uDPSendCount = Jellyfin::Support::fromJsonValue(source["UDPSendCount"]); - m_uDPSendDelay = Jellyfin::Support::fromJsonValue(source["UDPSendDelay"]); - m_ignoreVirtualInterfaces = Jellyfin::Support::fromJsonValue(source["IgnoreVirtualInterfaces"]); - m_virtualInterfaceNames = Jellyfin::Support::fromJsonValue(source["VirtualInterfaceNames"]); - m_gatewayMonitorPeriod = Jellyfin::Support::fromJsonValue(source["GatewayMonitorPeriod"]); - m_enableMultiSocketBinding = Jellyfin::Support::fromJsonValue(source["EnableMultiSocketBinding"]); - m_trustAllIP6Interfaces = Jellyfin::Support::fromJsonValue(source["TrustAllIP6Interfaces"]); - m_hDHomerunPortRange = Jellyfin::Support::fromJsonValue(source["HDHomerunPortRange"]); - m_publishedServerUriBySubnet = Jellyfin::Support::fromJsonValue(source["PublishedServerUriBySubnet"]); - m_autoDiscoveryTracing = Jellyfin::Support::fromJsonValue(source["AutoDiscoveryTracing"]); - m_autoDiscovery = Jellyfin::Support::fromJsonValue(source["AutoDiscovery"]); - m_publicHttpsPort = Jellyfin::Support::fromJsonValue(source["PublicHttpsPort"]); - m_httpServerPortNumber = Jellyfin::Support::fromJsonValue(source["HttpServerPortNumber"]); - m_httpsPortNumber = Jellyfin::Support::fromJsonValue(source["HttpsPortNumber"]); - m_enableHttps = Jellyfin::Support::fromJsonValue(source["EnableHttps"]); - m_enableNormalizedItemByNameIds = Jellyfin::Support::fromJsonValue(source["EnableNormalizedItemByNameIds"]); - m_certificatePath = Jellyfin::Support::fromJsonValue(source["CertificatePath"]); - m_certificatePassword = Jellyfin::Support::fromJsonValue(source["CertificatePassword"]); - m_isPortAuthorized = Jellyfin::Support::fromJsonValue(source["IsPortAuthorized"]); - m_quickConnectAvailable = Jellyfin::Support::fromJsonValue(source["QuickConnectAvailable"]); - m_enableRemoteAccess = Jellyfin::Support::fromJsonValue(source["EnableRemoteAccess"]); - m_enableCaseSensitiveItemIds = Jellyfin::Support::fromJsonValue(source["EnableCaseSensitiveItemIds"]); - m_disableLiveTvChannelUserDataName = Jellyfin::Support::fromJsonValue(source["DisableLiveTvChannelUserDataName"]); - m_metadataPath = Jellyfin::Support::fromJsonValue(source["MetadataPath"]); - m_metadataNetworkPath = Jellyfin::Support::fromJsonValue(source["MetadataNetworkPath"]); - m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue(source["PreferredMetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_sortReplaceCharacters = Jellyfin::Support::fromJsonValue(source["SortReplaceCharacters"]); - m_sortRemoveCharacters = Jellyfin::Support::fromJsonValue(source["SortRemoveCharacters"]); - m_sortRemoveWords = Jellyfin::Support::fromJsonValue(source["SortRemoveWords"]); - m_minResumePct = Jellyfin::Support::fromJsonValue(source["MinResumePct"]); - m_maxResumePct = Jellyfin::Support::fromJsonValue(source["MaxResumePct"]); - m_minResumeDurationSeconds = Jellyfin::Support::fromJsonValue(source["MinResumeDurationSeconds"]); - m_minAudiobookResume = Jellyfin::Support::fromJsonValue(source["MinAudiobookResume"]); - m_maxAudiobookResume = Jellyfin::Support::fromJsonValue(source["MaxAudiobookResume"]); - m_libraryMonitorDelay = Jellyfin::Support::fromJsonValue(source["LibraryMonitorDelay"]); - m_enableDashboardResponseCaching = Jellyfin::Support::fromJsonValue(source["EnableDashboardResponseCaching"]); - m_imageSavingConvention = Jellyfin::Support::fromJsonValue(source["ImageSavingConvention"]); - m_metadataOptions = Jellyfin::Support::fromJsonValue>>(source["MetadataOptions"]); - m_skipDeserializationForBasicTypes = Jellyfin::Support::fromJsonValue(source["SkipDeserializationForBasicTypes"]); - m_serverName = Jellyfin::Support::fromJsonValue(source["ServerName"]); - m_baseUrl = Jellyfin::Support::fromJsonValue(source["BaseUrl"]); - m_uICulture = Jellyfin::Support::fromJsonValue(source["UICulture"]); - m_saveMetadataHidden = Jellyfin::Support::fromJsonValue(source["SaveMetadataHidden"]); - m_contentTypes = Jellyfin::Support::fromJsonValue>>(source["ContentTypes"]); - m_remoteClientBitrateLimit = Jellyfin::Support::fromJsonValue(source["RemoteClientBitrateLimit"]); - m_enableFolderView = Jellyfin::Support::fromJsonValue(source["EnableFolderView"]); - m_enableGroupingIntoCollections = Jellyfin::Support::fromJsonValue(source["EnableGroupingIntoCollections"]); - m_displaySpecialsWithinSeasons = Jellyfin::Support::fromJsonValue(source["DisplaySpecialsWithinSeasons"]); - m_localNetworkSubnets = Jellyfin::Support::fromJsonValue(source["LocalNetworkSubnets"]); - m_localNetworkAddresses = Jellyfin::Support::fromJsonValue(source["LocalNetworkAddresses"]); - m_codecsUsed = Jellyfin::Support::fromJsonValue(source["CodecsUsed"]); - m_pluginRepositories = Jellyfin::Support::fromJsonValue>>(source["PluginRepositories"]); - m_enableExternalContentInSuggestions = Jellyfin::Support::fromJsonValue(source["EnableExternalContentInSuggestions"]); - m_requireHttps = Jellyfin::Support::fromJsonValue(source["RequireHttps"]); - m_enableNewOmdbSupport = Jellyfin::Support::fromJsonValue(source["EnableNewOmdbSupport"]); - m_remoteIPFilter = Jellyfin::Support::fromJsonValue(source["RemoteIPFilter"]); - m_isRemoteIPFilterBlacklist = Jellyfin::Support::fromJsonValue(source["IsRemoteIPFilterBlacklist"]); - m_imageExtractionTimeoutMs = Jellyfin::Support::fromJsonValue(source["ImageExtractionTimeoutMs"]); - m_pathSubstitutions = Jellyfin::Support::fromJsonValue>>(source["PathSubstitutions"]); - m_enableSimpleArtistDetection = Jellyfin::Support::fromJsonValue(source["EnableSimpleArtistDetection"]); - m_uninstalledPlugins = Jellyfin::Support::fromJsonValue(source["UninstalledPlugins"]); - m_enableSlowResponseWarning = Jellyfin::Support::fromJsonValue(source["EnableSlowResponseWarning"]); - m_slowResponseThresholdMs = Jellyfin::Support::fromJsonValue(source["SlowResponseThresholdMs"]); - m_corsHosts = Jellyfin::Support::fromJsonValue(source["CorsHosts"]); - m_knownProxies = Jellyfin::Support::fromJsonValue(source["KnownProxies"]); - m_activityLogRetentionDays = Jellyfin::Support::fromJsonValue(source["ActivityLogRetentionDays"]); - m_libraryScanFanoutConcurrency = Jellyfin::Support::fromJsonValue(source["LibraryScanFanoutConcurrency"]); - m_libraryMetadataRefreshConcurrency = Jellyfin::Support::fromJsonValue(source["LibraryMetadataRefreshConcurrency"]); - m_removeOldPlugins = Jellyfin::Support::fromJsonValue(source["RemoveOldPlugins"]); - m_disablePluginImages = Jellyfin::Support::fromJsonValue(source["DisablePluginImages"]); - -} - -QJsonObject ServerConfiguration::toJson() { - QJsonObject result; - result["LogFileRetentionDays"] = Jellyfin::Support::toJsonValue(m_logFileRetentionDays); - result["IsStartupWizardCompleted"] = Jellyfin::Support::toJsonValue(m_isStartupWizardCompleted); - result["CachePath"] = Jellyfin::Support::toJsonValue(m_cachePath); - result["PreviousVersion"] = Jellyfin::Support::toJsonValue>(m_previousVersion); - result["PreviousVersionStr"] = Jellyfin::Support::toJsonValue(m_previousVersionStr); - result["EnableUPnP"] = Jellyfin::Support::toJsonValue(m_enableUPnP); - result["EnableMetrics"] = Jellyfin::Support::toJsonValue(m_enableMetrics); - result["PublicPort"] = Jellyfin::Support::toJsonValue(m_publicPort); - result["UPnPCreateHttpPortMap"] = Jellyfin::Support::toJsonValue(m_uPnPCreateHttpPortMap); - result["UDPPortRange"] = Jellyfin::Support::toJsonValue(m_uDPPortRange); - result["EnableIPV6"] = Jellyfin::Support::toJsonValue(m_enableIPV6); - result["EnableIPV4"] = Jellyfin::Support::toJsonValue(m_enableIPV4); - result["EnableSSDPTracing"] = Jellyfin::Support::toJsonValue(m_enableSSDPTracing); - result["SSDPTracingFilter"] = Jellyfin::Support::toJsonValue(m_sSDPTracingFilter); - result["UDPSendCount"] = Jellyfin::Support::toJsonValue(m_uDPSendCount); - result["UDPSendDelay"] = Jellyfin::Support::toJsonValue(m_uDPSendDelay); - result["IgnoreVirtualInterfaces"] = Jellyfin::Support::toJsonValue(m_ignoreVirtualInterfaces); - result["VirtualInterfaceNames"] = Jellyfin::Support::toJsonValue(m_virtualInterfaceNames); - result["GatewayMonitorPeriod"] = Jellyfin::Support::toJsonValue(m_gatewayMonitorPeriod); - result["EnableMultiSocketBinding"] = Jellyfin::Support::toJsonValue(m_enableMultiSocketBinding); - result["TrustAllIP6Interfaces"] = Jellyfin::Support::toJsonValue(m_trustAllIP6Interfaces); - result["HDHomerunPortRange"] = Jellyfin::Support::toJsonValue(m_hDHomerunPortRange); - result["PublishedServerUriBySubnet"] = Jellyfin::Support::toJsonValue(m_publishedServerUriBySubnet); - result["AutoDiscoveryTracing"] = Jellyfin::Support::toJsonValue(m_autoDiscoveryTracing); - result["AutoDiscovery"] = Jellyfin::Support::toJsonValue(m_autoDiscovery); - result["PublicHttpsPort"] = Jellyfin::Support::toJsonValue(m_publicHttpsPort); - result["HttpServerPortNumber"] = Jellyfin::Support::toJsonValue(m_httpServerPortNumber); - result["HttpsPortNumber"] = Jellyfin::Support::toJsonValue(m_httpsPortNumber); - result["EnableHttps"] = Jellyfin::Support::toJsonValue(m_enableHttps); - result["EnableNormalizedItemByNameIds"] = Jellyfin::Support::toJsonValue(m_enableNormalizedItemByNameIds); - result["CertificatePath"] = Jellyfin::Support::toJsonValue(m_certificatePath); - result["CertificatePassword"] = Jellyfin::Support::toJsonValue(m_certificatePassword); - result["IsPortAuthorized"] = Jellyfin::Support::toJsonValue(m_isPortAuthorized); - result["QuickConnectAvailable"] = Jellyfin::Support::toJsonValue(m_quickConnectAvailable); - result["EnableRemoteAccess"] = Jellyfin::Support::toJsonValue(m_enableRemoteAccess); - result["EnableCaseSensitiveItemIds"] = Jellyfin::Support::toJsonValue(m_enableCaseSensitiveItemIds); - result["DisableLiveTvChannelUserDataName"] = Jellyfin::Support::toJsonValue(m_disableLiveTvChannelUserDataName); - result["MetadataPath"] = Jellyfin::Support::toJsonValue(m_metadataPath); - result["MetadataNetworkPath"] = Jellyfin::Support::toJsonValue(m_metadataNetworkPath); - result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue(m_preferredMetadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["SortReplaceCharacters"] = Jellyfin::Support::toJsonValue(m_sortReplaceCharacters); - result["SortRemoveCharacters"] = Jellyfin::Support::toJsonValue(m_sortRemoveCharacters); - result["SortRemoveWords"] = Jellyfin::Support::toJsonValue(m_sortRemoveWords); - result["MinResumePct"] = Jellyfin::Support::toJsonValue(m_minResumePct); - result["MaxResumePct"] = Jellyfin::Support::toJsonValue(m_maxResumePct); - result["MinResumeDurationSeconds"] = Jellyfin::Support::toJsonValue(m_minResumeDurationSeconds); - result["MinAudiobookResume"] = Jellyfin::Support::toJsonValue(m_minAudiobookResume); - result["MaxAudiobookResume"] = Jellyfin::Support::toJsonValue(m_maxAudiobookResume); - result["LibraryMonitorDelay"] = Jellyfin::Support::toJsonValue(m_libraryMonitorDelay); - result["EnableDashboardResponseCaching"] = Jellyfin::Support::toJsonValue(m_enableDashboardResponseCaching); - result["ImageSavingConvention"] = Jellyfin::Support::toJsonValue(m_imageSavingConvention); - result["MetadataOptions"] = Jellyfin::Support::toJsonValue>>(m_metadataOptions); - result["SkipDeserializationForBasicTypes"] = Jellyfin::Support::toJsonValue(m_skipDeserializationForBasicTypes); - result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); - result["BaseUrl"] = Jellyfin::Support::toJsonValue(m_baseUrl); - result["UICulture"] = Jellyfin::Support::toJsonValue(m_uICulture); - result["SaveMetadataHidden"] = Jellyfin::Support::toJsonValue(m_saveMetadataHidden); - result["ContentTypes"] = Jellyfin::Support::toJsonValue>>(m_contentTypes); - result["RemoteClientBitrateLimit"] = Jellyfin::Support::toJsonValue(m_remoteClientBitrateLimit); - result["EnableFolderView"] = Jellyfin::Support::toJsonValue(m_enableFolderView); - result["EnableGroupingIntoCollections"] = Jellyfin::Support::toJsonValue(m_enableGroupingIntoCollections); - result["DisplaySpecialsWithinSeasons"] = Jellyfin::Support::toJsonValue(m_displaySpecialsWithinSeasons); - result["LocalNetworkSubnets"] = Jellyfin::Support::toJsonValue(m_localNetworkSubnets); - result["LocalNetworkAddresses"] = Jellyfin::Support::toJsonValue(m_localNetworkAddresses); - result["CodecsUsed"] = Jellyfin::Support::toJsonValue(m_codecsUsed); - result["PluginRepositories"] = Jellyfin::Support::toJsonValue>>(m_pluginRepositories); - result["EnableExternalContentInSuggestions"] = Jellyfin::Support::toJsonValue(m_enableExternalContentInSuggestions); - result["RequireHttps"] = Jellyfin::Support::toJsonValue(m_requireHttps); - result["EnableNewOmdbSupport"] = Jellyfin::Support::toJsonValue(m_enableNewOmdbSupport); - result["RemoteIPFilter"] = Jellyfin::Support::toJsonValue(m_remoteIPFilter); - result["IsRemoteIPFilterBlacklist"] = Jellyfin::Support::toJsonValue(m_isRemoteIPFilterBlacklist); - result["ImageExtractionTimeoutMs"] = Jellyfin::Support::toJsonValue(m_imageExtractionTimeoutMs); - result["PathSubstitutions"] = Jellyfin::Support::toJsonValue>>(m_pathSubstitutions); - result["EnableSimpleArtistDetection"] = Jellyfin::Support::toJsonValue(m_enableSimpleArtistDetection); - result["UninstalledPlugins"] = Jellyfin::Support::toJsonValue(m_uninstalledPlugins); - result["EnableSlowResponseWarning"] = Jellyfin::Support::toJsonValue(m_enableSlowResponseWarning); - result["SlowResponseThresholdMs"] = Jellyfin::Support::toJsonValue(m_slowResponseThresholdMs); - result["CorsHosts"] = Jellyfin::Support::toJsonValue(m_corsHosts); - result["KnownProxies"] = Jellyfin::Support::toJsonValue(m_knownProxies); - result["ActivityLogRetentionDays"] = Jellyfin::Support::toJsonValue(m_activityLogRetentionDays); - result["LibraryScanFanoutConcurrency"] = Jellyfin::Support::toJsonValue(m_libraryScanFanoutConcurrency); - result["LibraryMetadataRefreshConcurrency"] = Jellyfin::Support::toJsonValue(m_libraryMetadataRefreshConcurrency); - result["RemoveOldPlugins"] = Jellyfin::Support::toJsonValue(m_removeOldPlugins); - result["DisablePluginImages"] = Jellyfin::Support::toJsonValue(m_disablePluginImages); - - return result; -} - -qint32 ServerConfiguration::logFileRetentionDays() const { return m_logFileRetentionDays; } - -void ServerConfiguration::setLogFileRetentionDays(qint32 newLogFileRetentionDays) { - m_logFileRetentionDays = newLogFileRetentionDays; -} -bool ServerConfiguration::isStartupWizardCompleted() const { return m_isStartupWizardCompleted; } - -void ServerConfiguration::setIsStartupWizardCompleted(bool newIsStartupWizardCompleted) { - m_isStartupWizardCompleted = newIsStartupWizardCompleted; -} -QString ServerConfiguration::cachePath() const { return m_cachePath; } - -void ServerConfiguration::setCachePath(QString newCachePath) { - m_cachePath = newCachePath; -} -QSharedPointer ServerConfiguration::previousVersion() const { return m_previousVersion; } - -void ServerConfiguration::setPreviousVersion(QSharedPointer newPreviousVersion) { - m_previousVersion = newPreviousVersion; -} -QString ServerConfiguration::previousVersionStr() const { return m_previousVersionStr; } - -void ServerConfiguration::setPreviousVersionStr(QString newPreviousVersionStr) { - m_previousVersionStr = newPreviousVersionStr; -} -bool ServerConfiguration::enableUPnP() const { return m_enableUPnP; } - -void ServerConfiguration::setEnableUPnP(bool newEnableUPnP) { - m_enableUPnP = newEnableUPnP; -} -bool ServerConfiguration::enableMetrics() const { return m_enableMetrics; } - -void ServerConfiguration::setEnableMetrics(bool newEnableMetrics) { - m_enableMetrics = newEnableMetrics; -} -qint32 ServerConfiguration::publicPort() const { return m_publicPort; } - -void ServerConfiguration::setPublicPort(qint32 newPublicPort) { - m_publicPort = newPublicPort; -} -bool ServerConfiguration::uPnPCreateHttpPortMap() const { return m_uPnPCreateHttpPortMap; } - -void ServerConfiguration::setUPnPCreateHttpPortMap(bool newUPnPCreateHttpPortMap) { - m_uPnPCreateHttpPortMap = newUPnPCreateHttpPortMap; -} -QString ServerConfiguration::uDPPortRange() const { return m_uDPPortRange; } - -void ServerConfiguration::setUDPPortRange(QString newUDPPortRange) { - m_uDPPortRange = newUDPPortRange; -} -bool ServerConfiguration::enableIPV6() const { return m_enableIPV6; } - -void ServerConfiguration::setEnableIPV6(bool newEnableIPV6) { - m_enableIPV6 = newEnableIPV6; -} -bool ServerConfiguration::enableIPV4() const { return m_enableIPV4; } - -void ServerConfiguration::setEnableIPV4(bool newEnableIPV4) { - m_enableIPV4 = newEnableIPV4; -} -bool ServerConfiguration::enableSSDPTracing() const { return m_enableSSDPTracing; } - -void ServerConfiguration::setEnableSSDPTracing(bool newEnableSSDPTracing) { - m_enableSSDPTracing = newEnableSSDPTracing; -} -QString ServerConfiguration::sSDPTracingFilter() const { return m_sSDPTracingFilter; } - -void ServerConfiguration::setSSDPTracingFilter(QString newSSDPTracingFilter) { - m_sSDPTracingFilter = newSSDPTracingFilter; -} -qint32 ServerConfiguration::uDPSendCount() const { return m_uDPSendCount; } - -void ServerConfiguration::setUDPSendCount(qint32 newUDPSendCount) { - m_uDPSendCount = newUDPSendCount; -} -qint32 ServerConfiguration::uDPSendDelay() const { return m_uDPSendDelay; } - -void ServerConfiguration::setUDPSendDelay(qint32 newUDPSendDelay) { - m_uDPSendDelay = newUDPSendDelay; -} -bool ServerConfiguration::ignoreVirtualInterfaces() const { return m_ignoreVirtualInterfaces; } - -void ServerConfiguration::setIgnoreVirtualInterfaces(bool newIgnoreVirtualInterfaces) { - m_ignoreVirtualInterfaces = newIgnoreVirtualInterfaces; -} -QString ServerConfiguration::virtualInterfaceNames() const { return m_virtualInterfaceNames; } - -void ServerConfiguration::setVirtualInterfaceNames(QString newVirtualInterfaceNames) { - m_virtualInterfaceNames = newVirtualInterfaceNames; -} -qint32 ServerConfiguration::gatewayMonitorPeriod() const { return m_gatewayMonitorPeriod; } - -void ServerConfiguration::setGatewayMonitorPeriod(qint32 newGatewayMonitorPeriod) { - m_gatewayMonitorPeriod = newGatewayMonitorPeriod; -} -bool ServerConfiguration::enableMultiSocketBinding() const { return m_enableMultiSocketBinding; } - -void ServerConfiguration::setEnableMultiSocketBinding(bool newEnableMultiSocketBinding) { - m_enableMultiSocketBinding = newEnableMultiSocketBinding; -} -bool ServerConfiguration::trustAllIP6Interfaces() const { return m_trustAllIP6Interfaces; } - -void ServerConfiguration::setTrustAllIP6Interfaces(bool newTrustAllIP6Interfaces) { - m_trustAllIP6Interfaces = newTrustAllIP6Interfaces; -} -QString ServerConfiguration::hDHomerunPortRange() const { return m_hDHomerunPortRange; } - -void ServerConfiguration::setHDHomerunPortRange(QString newHDHomerunPortRange) { - m_hDHomerunPortRange = newHDHomerunPortRange; -} -QStringList ServerConfiguration::publishedServerUriBySubnet() const { return m_publishedServerUriBySubnet; } - -void ServerConfiguration::setPublishedServerUriBySubnet(QStringList newPublishedServerUriBySubnet) { - m_publishedServerUriBySubnet = newPublishedServerUriBySubnet; -} -bool ServerConfiguration::autoDiscoveryTracing() const { return m_autoDiscoveryTracing; } - -void ServerConfiguration::setAutoDiscoveryTracing(bool newAutoDiscoveryTracing) { - m_autoDiscoveryTracing = newAutoDiscoveryTracing; -} -bool ServerConfiguration::autoDiscovery() const { return m_autoDiscovery; } - -void ServerConfiguration::setAutoDiscovery(bool newAutoDiscovery) { - m_autoDiscovery = newAutoDiscovery; -} -qint32 ServerConfiguration::publicHttpsPort() const { return m_publicHttpsPort; } - -void ServerConfiguration::setPublicHttpsPort(qint32 newPublicHttpsPort) { - m_publicHttpsPort = newPublicHttpsPort; -} -qint32 ServerConfiguration::httpServerPortNumber() const { return m_httpServerPortNumber; } - -void ServerConfiguration::setHttpServerPortNumber(qint32 newHttpServerPortNumber) { - m_httpServerPortNumber = newHttpServerPortNumber; -} -qint32 ServerConfiguration::httpsPortNumber() const { return m_httpsPortNumber; } - -void ServerConfiguration::setHttpsPortNumber(qint32 newHttpsPortNumber) { - m_httpsPortNumber = newHttpsPortNumber; -} -bool ServerConfiguration::enableHttps() const { return m_enableHttps; } - -void ServerConfiguration::setEnableHttps(bool newEnableHttps) { - m_enableHttps = newEnableHttps; -} -bool ServerConfiguration::enableNormalizedItemByNameIds() const { return m_enableNormalizedItemByNameIds; } - -void ServerConfiguration::setEnableNormalizedItemByNameIds(bool newEnableNormalizedItemByNameIds) { - m_enableNormalizedItemByNameIds = newEnableNormalizedItemByNameIds; -} -QString ServerConfiguration::certificatePath() const { return m_certificatePath; } - -void ServerConfiguration::setCertificatePath(QString newCertificatePath) { - m_certificatePath = newCertificatePath; -} -QString ServerConfiguration::certificatePassword() const { return m_certificatePassword; } - -void ServerConfiguration::setCertificatePassword(QString newCertificatePassword) { - m_certificatePassword = newCertificatePassword; -} -bool ServerConfiguration::isPortAuthorized() const { return m_isPortAuthorized; } - -void ServerConfiguration::setIsPortAuthorized(bool newIsPortAuthorized) { - m_isPortAuthorized = newIsPortAuthorized; -} -bool ServerConfiguration::quickConnectAvailable() const { return m_quickConnectAvailable; } - -void ServerConfiguration::setQuickConnectAvailable(bool newQuickConnectAvailable) { - m_quickConnectAvailable = newQuickConnectAvailable; -} -bool ServerConfiguration::enableRemoteAccess() const { return m_enableRemoteAccess; } - -void ServerConfiguration::setEnableRemoteAccess(bool newEnableRemoteAccess) { - m_enableRemoteAccess = newEnableRemoteAccess; -} -bool ServerConfiguration::enableCaseSensitiveItemIds() const { return m_enableCaseSensitiveItemIds; } - -void ServerConfiguration::setEnableCaseSensitiveItemIds(bool newEnableCaseSensitiveItemIds) { - m_enableCaseSensitiveItemIds = newEnableCaseSensitiveItemIds; -} -bool ServerConfiguration::disableLiveTvChannelUserDataName() const { return m_disableLiveTvChannelUserDataName; } - -void ServerConfiguration::setDisableLiveTvChannelUserDataName(bool newDisableLiveTvChannelUserDataName) { - m_disableLiveTvChannelUserDataName = newDisableLiveTvChannelUserDataName; -} -QString ServerConfiguration::metadataPath() const { return m_metadataPath; } - -void ServerConfiguration::setMetadataPath(QString newMetadataPath) { - m_metadataPath = newMetadataPath; -} -QString ServerConfiguration::metadataNetworkPath() const { return m_metadataNetworkPath; } - -void ServerConfiguration::setMetadataNetworkPath(QString newMetadataNetworkPath) { - m_metadataNetworkPath = newMetadataNetworkPath; -} -QString ServerConfiguration::preferredMetadataLanguage() const { return m_preferredMetadataLanguage; } - -void ServerConfiguration::setPreferredMetadataLanguage(QString newPreferredMetadataLanguage) { - m_preferredMetadataLanguage = newPreferredMetadataLanguage; -} -QString ServerConfiguration::metadataCountryCode() const { return m_metadataCountryCode; } - -void ServerConfiguration::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QStringList ServerConfiguration::sortReplaceCharacters() const { return m_sortReplaceCharacters; } - -void ServerConfiguration::setSortReplaceCharacters(QStringList newSortReplaceCharacters) { - m_sortReplaceCharacters = newSortReplaceCharacters; -} -QStringList ServerConfiguration::sortRemoveCharacters() const { return m_sortRemoveCharacters; } - -void ServerConfiguration::setSortRemoveCharacters(QStringList newSortRemoveCharacters) { - m_sortRemoveCharacters = newSortRemoveCharacters; -} -QStringList ServerConfiguration::sortRemoveWords() const { return m_sortRemoveWords; } - -void ServerConfiguration::setSortRemoveWords(QStringList newSortRemoveWords) { - m_sortRemoveWords = newSortRemoveWords; -} -qint32 ServerConfiguration::minResumePct() const { return m_minResumePct; } - -void ServerConfiguration::setMinResumePct(qint32 newMinResumePct) { - m_minResumePct = newMinResumePct; -} -qint32 ServerConfiguration::maxResumePct() const { return m_maxResumePct; } - -void ServerConfiguration::setMaxResumePct(qint32 newMaxResumePct) { - m_maxResumePct = newMaxResumePct; -} -qint32 ServerConfiguration::minResumeDurationSeconds() const { return m_minResumeDurationSeconds; } - -void ServerConfiguration::setMinResumeDurationSeconds(qint32 newMinResumeDurationSeconds) { - m_minResumeDurationSeconds = newMinResumeDurationSeconds; -} -qint32 ServerConfiguration::minAudiobookResume() const { return m_minAudiobookResume; } - -void ServerConfiguration::setMinAudiobookResume(qint32 newMinAudiobookResume) { - m_minAudiobookResume = newMinAudiobookResume; -} -qint32 ServerConfiguration::maxAudiobookResume() const { return m_maxAudiobookResume; } - -void ServerConfiguration::setMaxAudiobookResume(qint32 newMaxAudiobookResume) { - m_maxAudiobookResume = newMaxAudiobookResume; -} -qint32 ServerConfiguration::libraryMonitorDelay() const { return m_libraryMonitorDelay; } - -void ServerConfiguration::setLibraryMonitorDelay(qint32 newLibraryMonitorDelay) { - m_libraryMonitorDelay = newLibraryMonitorDelay; -} -bool ServerConfiguration::enableDashboardResponseCaching() const { return m_enableDashboardResponseCaching; } - -void ServerConfiguration::setEnableDashboardResponseCaching(bool newEnableDashboardResponseCaching) { - m_enableDashboardResponseCaching = newEnableDashboardResponseCaching; -} -ImageSavingConvention ServerConfiguration::imageSavingConvention() const { return m_imageSavingConvention; } - -void ServerConfiguration::setImageSavingConvention(ImageSavingConvention newImageSavingConvention) { - m_imageSavingConvention = newImageSavingConvention; -} -QList> ServerConfiguration::metadataOptions() const { return m_metadataOptions; } - -void ServerConfiguration::setMetadataOptions(QList> newMetadataOptions) { - m_metadataOptions = newMetadataOptions; -} -bool ServerConfiguration::skipDeserializationForBasicTypes() const { return m_skipDeserializationForBasicTypes; } - -void ServerConfiguration::setSkipDeserializationForBasicTypes(bool newSkipDeserializationForBasicTypes) { - m_skipDeserializationForBasicTypes = newSkipDeserializationForBasicTypes; -} -QString ServerConfiguration::serverName() const { return m_serverName; } - -void ServerConfiguration::setServerName(QString newServerName) { - m_serverName = newServerName; -} -QString ServerConfiguration::baseUrl() const { return m_baseUrl; } - -void ServerConfiguration::setBaseUrl(QString newBaseUrl) { - m_baseUrl = newBaseUrl; -} -QString ServerConfiguration::uICulture() const { return m_uICulture; } - -void ServerConfiguration::setUICulture(QString newUICulture) { - m_uICulture = newUICulture; -} -bool ServerConfiguration::saveMetadataHidden() const { return m_saveMetadataHidden; } - -void ServerConfiguration::setSaveMetadataHidden(bool newSaveMetadataHidden) { - m_saveMetadataHidden = newSaveMetadataHidden; -} -QList> ServerConfiguration::contentTypes() const { return m_contentTypes; } - -void ServerConfiguration::setContentTypes(QList> newContentTypes) { - m_contentTypes = newContentTypes; -} -qint32 ServerConfiguration::remoteClientBitrateLimit() const { return m_remoteClientBitrateLimit; } - -void ServerConfiguration::setRemoteClientBitrateLimit(qint32 newRemoteClientBitrateLimit) { - m_remoteClientBitrateLimit = newRemoteClientBitrateLimit; -} -bool ServerConfiguration::enableFolderView() const { return m_enableFolderView; } - -void ServerConfiguration::setEnableFolderView(bool newEnableFolderView) { - m_enableFolderView = newEnableFolderView; -} -bool ServerConfiguration::enableGroupingIntoCollections() const { return m_enableGroupingIntoCollections; } - -void ServerConfiguration::setEnableGroupingIntoCollections(bool newEnableGroupingIntoCollections) { - m_enableGroupingIntoCollections = newEnableGroupingIntoCollections; -} -bool ServerConfiguration::displaySpecialsWithinSeasons() const { return m_displaySpecialsWithinSeasons; } - -void ServerConfiguration::setDisplaySpecialsWithinSeasons(bool newDisplaySpecialsWithinSeasons) { - m_displaySpecialsWithinSeasons = newDisplaySpecialsWithinSeasons; -} -QStringList ServerConfiguration::localNetworkSubnets() const { return m_localNetworkSubnets; } - -void ServerConfiguration::setLocalNetworkSubnets(QStringList newLocalNetworkSubnets) { - m_localNetworkSubnets = newLocalNetworkSubnets; -} -QStringList ServerConfiguration::localNetworkAddresses() const { return m_localNetworkAddresses; } - -void ServerConfiguration::setLocalNetworkAddresses(QStringList newLocalNetworkAddresses) { - m_localNetworkAddresses = newLocalNetworkAddresses; -} -QStringList ServerConfiguration::codecsUsed() const { return m_codecsUsed; } - -void ServerConfiguration::setCodecsUsed(QStringList newCodecsUsed) { - m_codecsUsed = newCodecsUsed; -} -QList> ServerConfiguration::pluginRepositories() const { return m_pluginRepositories; } - -void ServerConfiguration::setPluginRepositories(QList> newPluginRepositories) { - m_pluginRepositories = newPluginRepositories; -} -bool ServerConfiguration::enableExternalContentInSuggestions() const { return m_enableExternalContentInSuggestions; } - -void ServerConfiguration::setEnableExternalContentInSuggestions(bool newEnableExternalContentInSuggestions) { - m_enableExternalContentInSuggestions = newEnableExternalContentInSuggestions; -} -bool ServerConfiguration::requireHttps() const { return m_requireHttps; } - -void ServerConfiguration::setRequireHttps(bool newRequireHttps) { - m_requireHttps = newRequireHttps; -} -bool ServerConfiguration::enableNewOmdbSupport() const { return m_enableNewOmdbSupport; } - -void ServerConfiguration::setEnableNewOmdbSupport(bool newEnableNewOmdbSupport) { - m_enableNewOmdbSupport = newEnableNewOmdbSupport; -} -QStringList ServerConfiguration::remoteIPFilter() const { return m_remoteIPFilter; } - -void ServerConfiguration::setRemoteIPFilter(QStringList newRemoteIPFilter) { - m_remoteIPFilter = newRemoteIPFilter; -} -bool ServerConfiguration::isRemoteIPFilterBlacklist() const { return m_isRemoteIPFilterBlacklist; } - -void ServerConfiguration::setIsRemoteIPFilterBlacklist(bool newIsRemoteIPFilterBlacklist) { - m_isRemoteIPFilterBlacklist = newIsRemoteIPFilterBlacklist; -} -qint32 ServerConfiguration::imageExtractionTimeoutMs() const { return m_imageExtractionTimeoutMs; } - -void ServerConfiguration::setImageExtractionTimeoutMs(qint32 newImageExtractionTimeoutMs) { - m_imageExtractionTimeoutMs = newImageExtractionTimeoutMs; -} -QList> ServerConfiguration::pathSubstitutions() const { return m_pathSubstitutions; } - -void ServerConfiguration::setPathSubstitutions(QList> newPathSubstitutions) { - m_pathSubstitutions = newPathSubstitutions; -} -bool ServerConfiguration::enableSimpleArtistDetection() const { return m_enableSimpleArtistDetection; } - -void ServerConfiguration::setEnableSimpleArtistDetection(bool newEnableSimpleArtistDetection) { - m_enableSimpleArtistDetection = newEnableSimpleArtistDetection; -} -QStringList ServerConfiguration::uninstalledPlugins() const { return m_uninstalledPlugins; } - -void ServerConfiguration::setUninstalledPlugins(QStringList newUninstalledPlugins) { - m_uninstalledPlugins = newUninstalledPlugins; -} -bool ServerConfiguration::enableSlowResponseWarning() const { return m_enableSlowResponseWarning; } - -void ServerConfiguration::setEnableSlowResponseWarning(bool newEnableSlowResponseWarning) { - m_enableSlowResponseWarning = newEnableSlowResponseWarning; -} -qint64 ServerConfiguration::slowResponseThresholdMs() const { return m_slowResponseThresholdMs; } - -void ServerConfiguration::setSlowResponseThresholdMs(qint64 newSlowResponseThresholdMs) { - m_slowResponseThresholdMs = newSlowResponseThresholdMs; -} -QStringList ServerConfiguration::corsHosts() const { return m_corsHosts; } - -void ServerConfiguration::setCorsHosts(QStringList newCorsHosts) { - m_corsHosts = newCorsHosts; -} -QStringList ServerConfiguration::knownProxies() const { return m_knownProxies; } - -void ServerConfiguration::setKnownProxies(QStringList newKnownProxies) { - m_knownProxies = newKnownProxies; -} -qint32 ServerConfiguration::activityLogRetentionDays() const { return m_activityLogRetentionDays; } - -void ServerConfiguration::setActivityLogRetentionDays(qint32 newActivityLogRetentionDays) { - m_activityLogRetentionDays = newActivityLogRetentionDays; -} -qint32 ServerConfiguration::libraryScanFanoutConcurrency() const { return m_libraryScanFanoutConcurrency; } - -void ServerConfiguration::setLibraryScanFanoutConcurrency(qint32 newLibraryScanFanoutConcurrency) { - m_libraryScanFanoutConcurrency = newLibraryScanFanoutConcurrency; -} -qint32 ServerConfiguration::libraryMetadataRefreshConcurrency() const { return m_libraryMetadataRefreshConcurrency; } - -void ServerConfiguration::setLibraryMetadataRefreshConcurrency(qint32 newLibraryMetadataRefreshConcurrency) { - m_libraryMetadataRefreshConcurrency = newLibraryMetadataRefreshConcurrency; -} -bool ServerConfiguration::removeOldPlugins() const { return m_removeOldPlugins; } - -void ServerConfiguration::setRemoveOldPlugins(bool newRemoveOldPlugins) { - m_removeOldPlugins = newRemoveOldPlugins; -} -bool ServerConfiguration::disablePluginImages() const { return m_disablePluginImages; } - -void ServerConfiguration::setDisablePluginImages(bool newDisablePluginImages) { - m_disablePluginImages = newDisablePluginImages; -} - -} // NS DTO - -namespace Support { - -using ServerConfiguration = Jellyfin::DTO::ServerConfiguration; - -template <> -ServerConfiguration fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ServerConfiguration::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/sessioninfo.cpp b/core/src/DTO/sessioninfo.cpp deleted file mode 100644 index e3910b3..0000000 --- a/core/src/DTO/sessioninfo.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SessionInfo::SessionInfo() {} -SessionInfo::SessionInfo(const SessionInfo &other) : - m_playState(other.m_playState), - m_additionalUsers(other.m_additionalUsers), - m_capabilities(other.m_capabilities), - m_remoteEndPoint(other.m_remoteEndPoint), - m_playableMediaTypes(other.m_playableMediaTypes), - m_jellyfinId(other.m_jellyfinId), - m_userId(other.m_userId), - m_userName(other.m_userName), - m_client(other.m_client), - m_lastActivityDate(other.m_lastActivityDate), - m_lastPlaybackCheckIn(other.m_lastPlaybackCheckIn), - m_deviceName(other.m_deviceName), - m_deviceType(other.m_deviceType), - m_nowPlayingItem(other.m_nowPlayingItem), - m_fullNowPlayingItem(other.m_fullNowPlayingItem), - m_nowViewingItem(other.m_nowViewingItem), - m_deviceId(other.m_deviceId), - m_applicationVersion(other.m_applicationVersion), - m_transcodingInfo(other.m_transcodingInfo), - m_isActive(other.m_isActive), - m_supportsMediaControl(other.m_supportsMediaControl), - m_supportsRemoteControl(other.m_supportsRemoteControl), - m_nowPlayingQueue(other.m_nowPlayingQueue), - m_hasCustomDeviceName(other.m_hasCustomDeviceName), - m_playlistItemId(other.m_playlistItemId), - m_serverId(other.m_serverId), - m_userPrimaryImageTag(other.m_userPrimaryImageTag), - m_supportedCommands(other.m_supportedCommands){} - -SessionInfo SessionInfo::fromJson(QJsonObject source) { - SessionInfo instance; - instance.setFromJson(source); - return instance; -} - - -void SessionInfo::setFromJson(QJsonObject source) { - m_playState = Jellyfin::Support::fromJsonValue>(source["PlayState"]); - m_additionalUsers = Jellyfin::Support::fromJsonValue>>(source["AdditionalUsers"]); - m_capabilities = Jellyfin::Support::fromJsonValue>(source["Capabilities"]); - m_remoteEndPoint = Jellyfin::Support::fromJsonValue(source["RemoteEndPoint"]); - m_playableMediaTypes = Jellyfin::Support::fromJsonValue(source["PlayableMediaTypes"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_userName = Jellyfin::Support::fromJsonValue(source["UserName"]); - m_client = Jellyfin::Support::fromJsonValue(source["Client"]); - m_lastActivityDate = Jellyfin::Support::fromJsonValue(source["LastActivityDate"]); - m_lastPlaybackCheckIn = Jellyfin::Support::fromJsonValue(source["LastPlaybackCheckIn"]); - m_deviceName = Jellyfin::Support::fromJsonValue(source["DeviceName"]); - m_deviceType = Jellyfin::Support::fromJsonValue(source["DeviceType"]); - m_nowPlayingItem = Jellyfin::Support::fromJsonValue>(source["NowPlayingItem"]); - m_fullNowPlayingItem = Jellyfin::Support::fromJsonValue>(source["FullNowPlayingItem"]); - m_nowViewingItem = Jellyfin::Support::fromJsonValue>(source["NowViewingItem"]); - m_deviceId = Jellyfin::Support::fromJsonValue(source["DeviceId"]); - m_applicationVersion = Jellyfin::Support::fromJsonValue(source["ApplicationVersion"]); - m_transcodingInfo = Jellyfin::Support::fromJsonValue>(source["TranscodingInfo"]); - m_isActive = Jellyfin::Support::fromJsonValue(source["IsActive"]); - m_supportsMediaControl = Jellyfin::Support::fromJsonValue(source["SupportsMediaControl"]); - m_supportsRemoteControl = Jellyfin::Support::fromJsonValue(source["SupportsRemoteControl"]); - m_nowPlayingQueue = Jellyfin::Support::fromJsonValue>>(source["NowPlayingQueue"]); - m_hasCustomDeviceName = Jellyfin::Support::fromJsonValue(source["HasCustomDeviceName"]); - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - m_userPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["UserPrimaryImageTag"]); - m_supportedCommands = Jellyfin::Support::fromJsonValue>(source["SupportedCommands"]); - -} - -QJsonObject SessionInfo::toJson() { - QJsonObject result; - result["PlayState"] = Jellyfin::Support::toJsonValue>(m_playState); - result["AdditionalUsers"] = Jellyfin::Support::toJsonValue>>(m_additionalUsers); - result["Capabilities"] = Jellyfin::Support::toJsonValue>(m_capabilities); - result["RemoteEndPoint"] = Jellyfin::Support::toJsonValue(m_remoteEndPoint); - result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["UserName"] = Jellyfin::Support::toJsonValue(m_userName); - result["Client"] = Jellyfin::Support::toJsonValue(m_client); - result["LastActivityDate"] = Jellyfin::Support::toJsonValue(m_lastActivityDate); - result["LastPlaybackCheckIn"] = Jellyfin::Support::toJsonValue(m_lastPlaybackCheckIn); - result["DeviceName"] = Jellyfin::Support::toJsonValue(m_deviceName); - result["DeviceType"] = Jellyfin::Support::toJsonValue(m_deviceType); - result["NowPlayingItem"] = Jellyfin::Support::toJsonValue>(m_nowPlayingItem); - result["FullNowPlayingItem"] = Jellyfin::Support::toJsonValue>(m_fullNowPlayingItem); - result["NowViewingItem"] = Jellyfin::Support::toJsonValue>(m_nowViewingItem); - result["DeviceId"] = Jellyfin::Support::toJsonValue(m_deviceId); - result["ApplicationVersion"] = Jellyfin::Support::toJsonValue(m_applicationVersion); - result["TranscodingInfo"] = Jellyfin::Support::toJsonValue>(m_transcodingInfo); - result["IsActive"] = Jellyfin::Support::toJsonValue(m_isActive); - result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue(m_supportsMediaControl); - result["SupportsRemoteControl"] = Jellyfin::Support::toJsonValue(m_supportsRemoteControl); - result["NowPlayingQueue"] = Jellyfin::Support::toJsonValue>>(m_nowPlayingQueue); - result["HasCustomDeviceName"] = Jellyfin::Support::toJsonValue(m_hasCustomDeviceName); - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_userPrimaryImageTag); - result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); - - return result; -} - -QSharedPointer SessionInfo::playState() const { return m_playState; } - -void SessionInfo::setPlayState(QSharedPointer newPlayState) { - m_playState = newPlayState; -} -QList> SessionInfo::additionalUsers() const { return m_additionalUsers; } - -void SessionInfo::setAdditionalUsers(QList> newAdditionalUsers) { - m_additionalUsers = newAdditionalUsers; -} -QSharedPointer SessionInfo::capabilities() const { return m_capabilities; } - -void SessionInfo::setCapabilities(QSharedPointer newCapabilities) { - m_capabilities = newCapabilities; -} -QString SessionInfo::remoteEndPoint() const { return m_remoteEndPoint; } - -void SessionInfo::setRemoteEndPoint(QString newRemoteEndPoint) { - m_remoteEndPoint = newRemoteEndPoint; -} -QStringList SessionInfo::playableMediaTypes() const { return m_playableMediaTypes; } - -void SessionInfo::setPlayableMediaTypes(QStringList newPlayableMediaTypes) { - m_playableMediaTypes = newPlayableMediaTypes; -} -QString SessionInfo::jellyfinId() const { return m_jellyfinId; } - -void SessionInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QUuid SessionInfo::userId() const { return m_userId; } - -void SessionInfo::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QString SessionInfo::userName() const { return m_userName; } - -void SessionInfo::setUserName(QString newUserName) { - m_userName = newUserName; -} -QString SessionInfo::client() const { return m_client; } - -void SessionInfo::setClient(QString newClient) { - m_client = newClient; -} -QDateTime SessionInfo::lastActivityDate() const { return m_lastActivityDate; } - -void SessionInfo::setLastActivityDate(QDateTime newLastActivityDate) { - m_lastActivityDate = newLastActivityDate; -} -QDateTime SessionInfo::lastPlaybackCheckIn() const { return m_lastPlaybackCheckIn; } - -void SessionInfo::setLastPlaybackCheckIn(QDateTime newLastPlaybackCheckIn) { - m_lastPlaybackCheckIn = newLastPlaybackCheckIn; -} -QString SessionInfo::deviceName() const { return m_deviceName; } - -void SessionInfo::setDeviceName(QString newDeviceName) { - m_deviceName = newDeviceName; -} -QString SessionInfo::deviceType() const { return m_deviceType; } - -void SessionInfo::setDeviceType(QString newDeviceType) { - m_deviceType = newDeviceType; -} -QSharedPointer SessionInfo::nowPlayingItem() const { return m_nowPlayingItem; } - -void SessionInfo::setNowPlayingItem(QSharedPointer newNowPlayingItem) { - m_nowPlayingItem = newNowPlayingItem; -} -QSharedPointer SessionInfo::fullNowPlayingItem() const { return m_fullNowPlayingItem; } - -void SessionInfo::setFullNowPlayingItem(QSharedPointer newFullNowPlayingItem) { - m_fullNowPlayingItem = newFullNowPlayingItem; -} -QSharedPointer SessionInfo::nowViewingItem() const { return m_nowViewingItem; } - -void SessionInfo::setNowViewingItem(QSharedPointer newNowViewingItem) { - m_nowViewingItem = newNowViewingItem; -} -QString SessionInfo::deviceId() const { return m_deviceId; } - -void SessionInfo::setDeviceId(QString newDeviceId) { - m_deviceId = newDeviceId; -} -QString SessionInfo::applicationVersion() const { return m_applicationVersion; } - -void SessionInfo::setApplicationVersion(QString newApplicationVersion) { - m_applicationVersion = newApplicationVersion; -} -QSharedPointer SessionInfo::transcodingInfo() const { return m_transcodingInfo; } - -void SessionInfo::setTranscodingInfo(QSharedPointer newTranscodingInfo) { - m_transcodingInfo = newTranscodingInfo; -} -bool SessionInfo::isActive() const { return m_isActive; } - -void SessionInfo::setIsActive(bool newIsActive) { - m_isActive = newIsActive; -} -bool SessionInfo::supportsMediaControl() const { return m_supportsMediaControl; } - -void SessionInfo::setSupportsMediaControl(bool newSupportsMediaControl) { - m_supportsMediaControl = newSupportsMediaControl; -} -bool SessionInfo::supportsRemoteControl() const { return m_supportsRemoteControl; } - -void SessionInfo::setSupportsRemoteControl(bool newSupportsRemoteControl) { - m_supportsRemoteControl = newSupportsRemoteControl; -} -QList> SessionInfo::nowPlayingQueue() const { return m_nowPlayingQueue; } - -void SessionInfo::setNowPlayingQueue(QList> newNowPlayingQueue) { - m_nowPlayingQueue = newNowPlayingQueue; -} -bool SessionInfo::hasCustomDeviceName() const { return m_hasCustomDeviceName; } - -void SessionInfo::setHasCustomDeviceName(bool newHasCustomDeviceName) { - m_hasCustomDeviceName = newHasCustomDeviceName; -} -QString SessionInfo::playlistItemId() const { return m_playlistItemId; } - -void SessionInfo::setPlaylistItemId(QString newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} -QString SessionInfo::serverId() const { return m_serverId; } - -void SessionInfo::setServerId(QString newServerId) { - m_serverId = newServerId; -} -QString SessionInfo::userPrimaryImageTag() const { return m_userPrimaryImageTag; } - -void SessionInfo::setUserPrimaryImageTag(QString newUserPrimaryImageTag) { - m_userPrimaryImageTag = newUserPrimaryImageTag; -} -QList SessionInfo::supportedCommands() const { return m_supportedCommands; } - -void SessionInfo::setSupportedCommands(QList newSupportedCommands) { - m_supportedCommands = newSupportedCommands; -} - -} // NS DTO - -namespace Support { - -using SessionInfo = Jellyfin::DTO::SessionInfo; - -template <> -SessionInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SessionInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/sessionuserinfo.cpp b/core/src/DTO/sessionuserinfo.cpp deleted file mode 100644 index d0e8171..0000000 --- a/core/src/DTO/sessionuserinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SessionUserInfo::SessionUserInfo() {} -SessionUserInfo::SessionUserInfo(const SessionUserInfo &other) : - m_userId(other.m_userId), - m_userName(other.m_userName){} - -SessionUserInfo SessionUserInfo::fromJson(QJsonObject source) { - SessionUserInfo instance; - instance.setFromJson(source); - return instance; -} - - -void SessionUserInfo::setFromJson(QJsonObject source) { - m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); - m_userName = Jellyfin::Support::fromJsonValue(source["UserName"]); - -} - -QJsonObject SessionUserInfo::toJson() { - QJsonObject result; - result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); - result["UserName"] = Jellyfin::Support::toJsonValue(m_userName); - - return result; -} - -QUuid SessionUserInfo::userId() const { return m_userId; } - -void SessionUserInfo::setUserId(QUuid newUserId) { - m_userId = newUserId; -} -QString SessionUserInfo::userName() const { return m_userName; } - -void SessionUserInfo::setUserName(QString newUserName) { - m_userName = newUserName; -} - -} // NS DTO - -namespace Support { - -using SessionUserInfo = Jellyfin::DTO::SessionUserInfo; - -template <> -SessionUserInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SessionUserInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/setchannelmappingdto.cpp b/core/src/DTO/setchannelmappingdto.cpp deleted file mode 100644 index 978bf89..0000000 --- a/core/src/DTO/setchannelmappingdto.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SetChannelMappingDto::SetChannelMappingDto() {} -SetChannelMappingDto::SetChannelMappingDto(const SetChannelMappingDto &other) : - m_providerId(other.m_providerId), - m_tunerChannelId(other.m_tunerChannelId), - m_providerChannelId(other.m_providerChannelId){} - -SetChannelMappingDto SetChannelMappingDto::fromJson(QJsonObject source) { - SetChannelMappingDto instance; - instance.setFromJson(source); - return instance; -} - - -void SetChannelMappingDto::setFromJson(QJsonObject source) { - m_providerId = Jellyfin::Support::fromJsonValue(source["ProviderId"]); - m_tunerChannelId = Jellyfin::Support::fromJsonValue(source["TunerChannelId"]); - m_providerChannelId = Jellyfin::Support::fromJsonValue(source["ProviderChannelId"]); - -} - -QJsonObject SetChannelMappingDto::toJson() { - QJsonObject result; - result["ProviderId"] = Jellyfin::Support::toJsonValue(m_providerId); - result["TunerChannelId"] = Jellyfin::Support::toJsonValue(m_tunerChannelId); - result["ProviderChannelId"] = Jellyfin::Support::toJsonValue(m_providerChannelId); - - return result; -} - -QString SetChannelMappingDto::providerId() const { return m_providerId; } - -void SetChannelMappingDto::setProviderId(QString newProviderId) { - m_providerId = newProviderId; -} -QString SetChannelMappingDto::tunerChannelId() const { return m_tunerChannelId; } - -void SetChannelMappingDto::setTunerChannelId(QString newTunerChannelId) { - m_tunerChannelId = newTunerChannelId; -} -QString SetChannelMappingDto::providerChannelId() const { return m_providerChannelId; } - -void SetChannelMappingDto::setProviderChannelId(QString newProviderChannelId) { - m_providerChannelId = newProviderChannelId; -} - -} // NS DTO - -namespace Support { - -using SetChannelMappingDto = Jellyfin::DTO::SetChannelMappingDto; - -template <> -SetChannelMappingDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SetChannelMappingDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/setplaylistitemrequestdto.cpp b/core/src/DTO/setplaylistitemrequestdto.cpp deleted file mode 100644 index f2fe075..0000000 --- a/core/src/DTO/setplaylistitemrequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SetPlaylistItemRequestDto::SetPlaylistItemRequestDto() {} -SetPlaylistItemRequestDto::SetPlaylistItemRequestDto(const SetPlaylistItemRequestDto &other) : - m_playlistItemId(other.m_playlistItemId){} - -SetPlaylistItemRequestDto SetPlaylistItemRequestDto::fromJson(QJsonObject source) { - SetPlaylistItemRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void SetPlaylistItemRequestDto::setFromJson(QJsonObject source) { - m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); - -} - -QJsonObject SetPlaylistItemRequestDto::toJson() { - QJsonObject result; - result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); - - return result; -} - -QUuid SetPlaylistItemRequestDto::playlistItemId() const { return m_playlistItemId; } - -void SetPlaylistItemRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) { - m_playlistItemId = newPlaylistItemId; -} - -} // NS DTO - -namespace Support { - -using SetPlaylistItemRequestDto = Jellyfin::DTO::SetPlaylistItemRequestDto; - -template <> -SetPlaylistItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SetPlaylistItemRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/setrepeatmoderequestdto.cpp b/core/src/DTO/setrepeatmoderequestdto.cpp deleted file mode 100644 index e303460..0000000 --- a/core/src/DTO/setrepeatmoderequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SetRepeatModeRequestDto::SetRepeatModeRequestDto() {} -SetRepeatModeRequestDto::SetRepeatModeRequestDto(const SetRepeatModeRequestDto &other) : - m_mode(other.m_mode){} - -SetRepeatModeRequestDto SetRepeatModeRequestDto::fromJson(QJsonObject source) { - SetRepeatModeRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void SetRepeatModeRequestDto::setFromJson(QJsonObject source) { - m_mode = Jellyfin::Support::fromJsonValue(source["Mode"]); - -} - -QJsonObject SetRepeatModeRequestDto::toJson() { - QJsonObject result; - result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); - - return result; -} - -GroupRepeatMode SetRepeatModeRequestDto::mode() const { return m_mode; } - -void SetRepeatModeRequestDto::setMode(GroupRepeatMode newMode) { - m_mode = newMode; -} - -} // NS DTO - -namespace Support { - -using SetRepeatModeRequestDto = Jellyfin::DTO::SetRepeatModeRequestDto; - -template <> -SetRepeatModeRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SetRepeatModeRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/setshufflemoderequestdto.cpp b/core/src/DTO/setshufflemoderequestdto.cpp deleted file mode 100644 index 89888c6..0000000 --- a/core/src/DTO/setshufflemoderequestdto.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SetShuffleModeRequestDto::SetShuffleModeRequestDto() {} -SetShuffleModeRequestDto::SetShuffleModeRequestDto(const SetShuffleModeRequestDto &other) : - m_mode(other.m_mode){} - -SetShuffleModeRequestDto SetShuffleModeRequestDto::fromJson(QJsonObject source) { - SetShuffleModeRequestDto instance; - instance.setFromJson(source); - return instance; -} - - -void SetShuffleModeRequestDto::setFromJson(QJsonObject source) { - m_mode = Jellyfin::Support::fromJsonValue(source["Mode"]); - -} - -QJsonObject SetShuffleModeRequestDto::toJson() { - QJsonObject result; - result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); - - return result; -} - -GroupShuffleMode SetShuffleModeRequestDto::mode() const { return m_mode; } - -void SetShuffleModeRequestDto::setMode(GroupShuffleMode newMode) { - m_mode = newMode; -} - -} // NS DTO - -namespace Support { - -using SetShuffleModeRequestDto = Jellyfin::DTO::SetShuffleModeRequestDto; - -template <> -SetShuffleModeRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SetShuffleModeRequestDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/songinfo.cpp b/core/src/DTO/songinfo.cpp deleted file mode 100644 index 83d0f67..0000000 --- a/core/src/DTO/songinfo.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SongInfo::SongInfo() {} -SongInfo::SongInfo(const SongInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated), - m_albumArtists(other.m_albumArtists), - m_album(other.m_album), - m_artists(other.m_artists){} - -SongInfo SongInfo::fromJson(QJsonObject source) { - SongInfo instance; - instance.setFromJson(source); - return instance; -} - - -void SongInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - m_albumArtists = Jellyfin::Support::fromJsonValue(source["AlbumArtists"]); - m_album = Jellyfin::Support::fromJsonValue(source["Album"]); - m_artists = Jellyfin::Support::fromJsonValue(source["Artists"]); - -} - -QJsonObject SongInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - result["AlbumArtists"] = Jellyfin::Support::toJsonValue(m_albumArtists); - result["Album"] = Jellyfin::Support::toJsonValue(m_album); - result["Artists"] = Jellyfin::Support::toJsonValue(m_artists); - - return result; -} - -QString SongInfo::name() const { return m_name; } - -void SongInfo::setName(QString newName) { - m_name = newName; -} -QString SongInfo::path() const { return m_path; } - -void SongInfo::setPath(QString newPath) { - m_path = newPath; -} -QString SongInfo::metadataLanguage() const { return m_metadataLanguage; } - -void SongInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString SongInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void SongInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject SongInfo::providerIds() const { return m_providerIds; } - -void SongInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 SongInfo::year() const { return m_year; } - -void SongInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 SongInfo::indexNumber() const { return m_indexNumber; } - -void SongInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 SongInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void SongInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime SongInfo::premiereDate() const { return m_premiereDate; } - -void SongInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool SongInfo::isAutomated() const { return m_isAutomated; } - -void SongInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} -QStringList SongInfo::albumArtists() const { return m_albumArtists; } - -void SongInfo::setAlbumArtists(QStringList newAlbumArtists) { - m_albumArtists = newAlbumArtists; -} -QString SongInfo::album() const { return m_album; } - -void SongInfo::setAlbum(QString newAlbum) { - m_album = newAlbum; -} -QStringList SongInfo::artists() const { return m_artists; } - -void SongInfo::setArtists(QStringList newArtists) { - m_artists = newArtists; -} - -} // NS DTO - -namespace Support { - -using SongInfo = Jellyfin::DTO::SongInfo; - -template <> -SongInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SongInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/sortorder.cpp b/core/src/DTO/sortorder.cpp deleted file mode 100644 index 2d7b2a2..0000000 --- a/core/src/DTO/sortorder.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SortOrderClass::SortOrderClass() {} - - -} // NS DTO - -namespace Support { - -using SortOrder = Jellyfin::DTO::SortOrder; - -template <> -SortOrder fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SortOrder::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Ascending")) { - return SortOrder::Ascending; - } - if (str == QStringLiteral("Descending")) { - return SortOrder::Descending; - } - - return SortOrder::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/specialviewoptiondto.cpp b/core/src/DTO/specialviewoptiondto.cpp deleted file mode 100644 index 7d94c40..0000000 --- a/core/src/DTO/specialviewoptiondto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SpecialViewOptionDto::SpecialViewOptionDto() {} -SpecialViewOptionDto::SpecialViewOptionDto(const SpecialViewOptionDto &other) : - m_name(other.m_name), - m_jellyfinId(other.m_jellyfinId){} - -SpecialViewOptionDto SpecialViewOptionDto::fromJson(QJsonObject source) { - SpecialViewOptionDto instance; - instance.setFromJson(source); - return instance; -} - - -void SpecialViewOptionDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject SpecialViewOptionDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QString SpecialViewOptionDto::name() const { return m_name; } - -void SpecialViewOptionDto::setName(QString newName) { - m_name = newName; -} -QString SpecialViewOptionDto::jellyfinId() const { return m_jellyfinId; } - -void SpecialViewOptionDto::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using SpecialViewOptionDto = Jellyfin::DTO::SpecialViewOptionDto; - -template <> -SpecialViewOptionDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SpecialViewOptionDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/startupconfigurationdto.cpp b/core/src/DTO/startupconfigurationdto.cpp deleted file mode 100644 index 4b3f3f0..0000000 --- a/core/src/DTO/startupconfigurationdto.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -StartupConfigurationDto::StartupConfigurationDto() {} -StartupConfigurationDto::StartupConfigurationDto(const StartupConfigurationDto &other) : - m_uICulture(other.m_uICulture), - m_metadataCountryCode(other.m_metadataCountryCode), - m_preferredMetadataLanguage(other.m_preferredMetadataLanguage){} - -StartupConfigurationDto StartupConfigurationDto::fromJson(QJsonObject source) { - StartupConfigurationDto instance; - instance.setFromJson(source); - return instance; -} - - -void StartupConfigurationDto::setFromJson(QJsonObject source) { - m_uICulture = Jellyfin::Support::fromJsonValue(source["UICulture"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue(source["PreferredMetadataLanguage"]); - -} - -QJsonObject StartupConfigurationDto::toJson() { - QJsonObject result; - result["UICulture"] = Jellyfin::Support::toJsonValue(m_uICulture); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue(m_preferredMetadataLanguage); - - return result; -} - -QString StartupConfigurationDto::uICulture() const { return m_uICulture; } - -void StartupConfigurationDto::setUICulture(QString newUICulture) { - m_uICulture = newUICulture; -} -QString StartupConfigurationDto::metadataCountryCode() const { return m_metadataCountryCode; } - -void StartupConfigurationDto::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QString StartupConfigurationDto::preferredMetadataLanguage() const { return m_preferredMetadataLanguage; } - -void StartupConfigurationDto::setPreferredMetadataLanguage(QString newPreferredMetadataLanguage) { - m_preferredMetadataLanguage = newPreferredMetadataLanguage; -} - -} // NS DTO - -namespace Support { - -using StartupConfigurationDto = Jellyfin::DTO::StartupConfigurationDto; - -template <> -StartupConfigurationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return StartupConfigurationDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/startupremoteaccessdto.cpp b/core/src/DTO/startupremoteaccessdto.cpp deleted file mode 100644 index 07f96ce..0000000 --- a/core/src/DTO/startupremoteaccessdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -StartupRemoteAccessDto::StartupRemoteAccessDto() {} -StartupRemoteAccessDto::StartupRemoteAccessDto(const StartupRemoteAccessDto &other) : - m_enableRemoteAccess(other.m_enableRemoteAccess), - m_enableAutomaticPortMapping(other.m_enableAutomaticPortMapping){} - -StartupRemoteAccessDto StartupRemoteAccessDto::fromJson(QJsonObject source) { - StartupRemoteAccessDto instance; - instance.setFromJson(source); - return instance; -} - - -void StartupRemoteAccessDto::setFromJson(QJsonObject source) { - m_enableRemoteAccess = Jellyfin::Support::fromJsonValue(source["EnableRemoteAccess"]); - m_enableAutomaticPortMapping = Jellyfin::Support::fromJsonValue(source["EnableAutomaticPortMapping"]); - -} - -QJsonObject StartupRemoteAccessDto::toJson() { - QJsonObject result; - result["EnableRemoteAccess"] = Jellyfin::Support::toJsonValue(m_enableRemoteAccess); - result["EnableAutomaticPortMapping"] = Jellyfin::Support::toJsonValue(m_enableAutomaticPortMapping); - - return result; -} - -bool StartupRemoteAccessDto::enableRemoteAccess() const { return m_enableRemoteAccess; } - -void StartupRemoteAccessDto::setEnableRemoteAccess(bool newEnableRemoteAccess) { - m_enableRemoteAccess = newEnableRemoteAccess; -} -bool StartupRemoteAccessDto::enableAutomaticPortMapping() const { return m_enableAutomaticPortMapping; } - -void StartupRemoteAccessDto::setEnableAutomaticPortMapping(bool newEnableAutomaticPortMapping) { - m_enableAutomaticPortMapping = newEnableAutomaticPortMapping; -} - -} // NS DTO - -namespace Support { - -using StartupRemoteAccessDto = Jellyfin::DTO::StartupRemoteAccessDto; - -template <> -StartupRemoteAccessDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return StartupRemoteAccessDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/startupuserdto.cpp b/core/src/DTO/startupuserdto.cpp deleted file mode 100644 index 14b967e..0000000 --- a/core/src/DTO/startupuserdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -StartupUserDto::StartupUserDto() {} -StartupUserDto::StartupUserDto(const StartupUserDto &other) : - m_name(other.m_name), - m_password(other.m_password){} - -StartupUserDto StartupUserDto::fromJson(QJsonObject source) { - StartupUserDto instance; - instance.setFromJson(source); - return instance; -} - - -void StartupUserDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_password = Jellyfin::Support::fromJsonValue(source["Password"]); - -} - -QJsonObject StartupUserDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Password"] = Jellyfin::Support::toJsonValue(m_password); - - return result; -} - -QString StartupUserDto::name() const { return m_name; } - -void StartupUserDto::setName(QString newName) { - m_name = newName; -} -QString StartupUserDto::password() const { return m_password; } - -void StartupUserDto::setPassword(QString newPassword) { - m_password = newPassword; -} - -} // NS DTO - -namespace Support { - -using StartupUserDto = Jellyfin::DTO::StartupUserDto; - -template <> -StartupUserDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return StartupUserDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/subtitledeliverymethod.cpp b/core/src/DTO/subtitledeliverymethod.cpp deleted file mode 100644 index 94f5d7a..0000000 --- a/core/src/DTO/subtitledeliverymethod.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SubtitleDeliveryMethodClass::SubtitleDeliveryMethodClass() {} - - -} // NS DTO - -namespace Support { - -using SubtitleDeliveryMethod = Jellyfin::DTO::SubtitleDeliveryMethod; - -template <> -SubtitleDeliveryMethod fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SubtitleDeliveryMethod::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Encode")) { - return SubtitleDeliveryMethod::Encode; - } - if (str == QStringLiteral("Embed")) { - return SubtitleDeliveryMethod::Embed; - } - if (str == QStringLiteral("External")) { - return SubtitleDeliveryMethod::External; - } - if (str == QStringLiteral("Hls")) { - return SubtitleDeliveryMethod::Hls; - } - - return SubtitleDeliveryMethod::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/subtitleplaybackmode.cpp b/core/src/DTO/subtitleplaybackmode.cpp deleted file mode 100644 index 3cbd26a..0000000 --- a/core/src/DTO/subtitleplaybackmode.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SubtitlePlaybackModeClass::SubtitlePlaybackModeClass() {} - - -} // NS DTO - -namespace Support { - -using SubtitlePlaybackMode = Jellyfin::DTO::SubtitlePlaybackMode; - -template <> -SubtitlePlaybackMode fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SubtitlePlaybackMode::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Default")) { - return SubtitlePlaybackMode::Default; - } - if (str == QStringLiteral("Always")) { - return SubtitlePlaybackMode::Always; - } - if (str == QStringLiteral("OnlyForced")) { - return SubtitlePlaybackMode::OnlyForced; - } - if (str == QStringLiteral("None")) { - return SubtitlePlaybackMode::None; - } - if (str == QStringLiteral("Smart")) { - return SubtitlePlaybackMode::Smart; - } - - return SubtitlePlaybackMode::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/subtitleprofile.cpp b/core/src/DTO/subtitleprofile.cpp deleted file mode 100644 index 96a9c17..0000000 --- a/core/src/DTO/subtitleprofile.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SubtitleProfile::SubtitleProfile() {} -SubtitleProfile::SubtitleProfile(const SubtitleProfile &other) : - m_format(other.m_format), - m_method(other.m_method), - m_didlMode(other.m_didlMode), - m_language(other.m_language), - m_container(other.m_container){} - -SubtitleProfile SubtitleProfile::fromJson(QJsonObject source) { - SubtitleProfile instance; - instance.setFromJson(source); - return instance; -} - - -void SubtitleProfile::setFromJson(QJsonObject source) { - m_format = Jellyfin::Support::fromJsonValue(source["Format"]); - m_method = Jellyfin::Support::fromJsonValue(source["Method"]); - m_didlMode = Jellyfin::Support::fromJsonValue(source["DidlMode"]); - m_language = Jellyfin::Support::fromJsonValue(source["Language"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - -} - -QJsonObject SubtitleProfile::toJson() { - QJsonObject result; - result["Format"] = Jellyfin::Support::toJsonValue(m_format); - result["Method"] = Jellyfin::Support::toJsonValue(m_method); - result["DidlMode"] = Jellyfin::Support::toJsonValue(m_didlMode); - result["Language"] = Jellyfin::Support::toJsonValue(m_language); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - - return result; -} - -QString SubtitleProfile::format() const { return m_format; } - -void SubtitleProfile::setFormat(QString newFormat) { - m_format = newFormat; -} -SubtitleDeliveryMethod SubtitleProfile::method() const { return m_method; } - -void SubtitleProfile::setMethod(SubtitleDeliveryMethod newMethod) { - m_method = newMethod; -} -QString SubtitleProfile::didlMode() const { return m_didlMode; } - -void SubtitleProfile::setDidlMode(QString newDidlMode) { - m_didlMode = newDidlMode; -} -QString SubtitleProfile::language() const { return m_language; } - -void SubtitleProfile::setLanguage(QString newLanguage) { - m_language = newLanguage; -} -QString SubtitleProfile::container() const { return m_container; } - -void SubtitleProfile::setContainer(QString newContainer) { - m_container = newContainer; -} - -} // NS DTO - -namespace Support { - -using SubtitleProfile = Jellyfin::DTO::SubtitleProfile; - -template <> -SubtitleProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SubtitleProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/syncplayuseraccesstype.cpp b/core/src/DTO/syncplayuseraccesstype.cpp deleted file mode 100644 index 772d2d7..0000000 --- a/core/src/DTO/syncplayuseraccesstype.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SyncPlayUserAccessTypeClass::SyncPlayUserAccessTypeClass() {} - - -} // NS DTO - -namespace Support { - -using SyncPlayUserAccessType = Jellyfin::DTO::SyncPlayUserAccessType; - -template <> -SyncPlayUserAccessType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return SyncPlayUserAccessType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("CreateAndJoinGroups")) { - return SyncPlayUserAccessType::CreateAndJoinGroups; - } - if (str == QStringLiteral("JoinGroups")) { - return SyncPlayUserAccessType::JoinGroups; - } - if (str == QStringLiteral("None")) { - return SyncPlayUserAccessType::None; - } - - return SyncPlayUserAccessType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/systeminfo.cpp b/core/src/DTO/systeminfo.cpp deleted file mode 100644 index 5ce73a8..0000000 --- a/core/src/DTO/systeminfo.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -SystemInfo::SystemInfo() {} -SystemInfo::SystemInfo(const SystemInfo &other) : - m_localAddress(other.m_localAddress), - m_serverName(other.m_serverName), - m_version(other.m_version), - m_productName(other.m_productName), - m_operatingSystem(other.m_operatingSystem), - m_jellyfinId(other.m_jellyfinId), - m_startupWizardCompleted(other.m_startupWizardCompleted), - m_operatingSystemDisplayName(other.m_operatingSystemDisplayName), - m_packageName(other.m_packageName), - m_hasPendingRestart(other.m_hasPendingRestart), - m_isShuttingDown(other.m_isShuttingDown), - m_supportsLibraryMonitor(other.m_supportsLibraryMonitor), - m_webSocketPortNumber(other.m_webSocketPortNumber), - m_completedInstallations(other.m_completedInstallations), - m_canSelfRestart(other.m_canSelfRestart), - m_canLaunchWebBrowser(other.m_canLaunchWebBrowser), - m_programDataPath(other.m_programDataPath), - m_webPath(other.m_webPath), - m_itemsByNamePath(other.m_itemsByNamePath), - m_cachePath(other.m_cachePath), - m_logPath(other.m_logPath), - m_internalMetadataPath(other.m_internalMetadataPath), - m_transcodingTempPath(other.m_transcodingTempPath), - m_hasUpdateAvailable(other.m_hasUpdateAvailable), - m_encoderLocation(other.m_encoderLocation), - m_systemArchitecture(other.m_systemArchitecture){} - -SystemInfo SystemInfo::fromJson(QJsonObject source) { - SystemInfo instance; - instance.setFromJson(source); - return instance; -} - - -void SystemInfo::setFromJson(QJsonObject source) { - m_localAddress = Jellyfin::Support::fromJsonValue(source["LocalAddress"]); - m_serverName = Jellyfin::Support::fromJsonValue(source["ServerName"]); - m_version = Jellyfin::Support::fromJsonValue(source["Version"]); - m_productName = Jellyfin::Support::fromJsonValue(source["ProductName"]); - m_operatingSystem = Jellyfin::Support::fromJsonValue(source["OperatingSystem"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_startupWizardCompleted = Jellyfin::Support::fromJsonValue(source["StartupWizardCompleted"]); - m_operatingSystemDisplayName = Jellyfin::Support::fromJsonValue(source["OperatingSystemDisplayName"]); - m_packageName = Jellyfin::Support::fromJsonValue(source["PackageName"]); - m_hasPendingRestart = Jellyfin::Support::fromJsonValue(source["HasPendingRestart"]); - m_isShuttingDown = Jellyfin::Support::fromJsonValue(source["IsShuttingDown"]); - m_supportsLibraryMonitor = Jellyfin::Support::fromJsonValue(source["SupportsLibraryMonitor"]); - m_webSocketPortNumber = Jellyfin::Support::fromJsonValue(source["WebSocketPortNumber"]); - m_completedInstallations = Jellyfin::Support::fromJsonValue>>(source["CompletedInstallations"]); - m_canSelfRestart = Jellyfin::Support::fromJsonValue(source["CanSelfRestart"]); - m_canLaunchWebBrowser = Jellyfin::Support::fromJsonValue(source["CanLaunchWebBrowser"]); - m_programDataPath = Jellyfin::Support::fromJsonValue(source["ProgramDataPath"]); - m_webPath = Jellyfin::Support::fromJsonValue(source["WebPath"]); - m_itemsByNamePath = Jellyfin::Support::fromJsonValue(source["ItemsByNamePath"]); - m_cachePath = Jellyfin::Support::fromJsonValue(source["CachePath"]); - m_logPath = Jellyfin::Support::fromJsonValue(source["LogPath"]); - m_internalMetadataPath = Jellyfin::Support::fromJsonValue(source["InternalMetadataPath"]); - m_transcodingTempPath = Jellyfin::Support::fromJsonValue(source["TranscodingTempPath"]); - m_hasUpdateAvailable = Jellyfin::Support::fromJsonValue(source["HasUpdateAvailable"]); - m_encoderLocation = Jellyfin::Support::fromJsonValue(source["EncoderLocation"]); - m_systemArchitecture = Jellyfin::Support::fromJsonValue(source["SystemArchitecture"]); - -} - -QJsonObject SystemInfo::toJson() { - QJsonObject result; - result["LocalAddress"] = Jellyfin::Support::toJsonValue(m_localAddress); - result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); - result["Version"] = Jellyfin::Support::toJsonValue(m_version); - result["ProductName"] = Jellyfin::Support::toJsonValue(m_productName); - result["OperatingSystem"] = Jellyfin::Support::toJsonValue(m_operatingSystem); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["StartupWizardCompleted"] = Jellyfin::Support::toJsonValue(m_startupWizardCompleted); - result["OperatingSystemDisplayName"] = Jellyfin::Support::toJsonValue(m_operatingSystemDisplayName); - result["PackageName"] = Jellyfin::Support::toJsonValue(m_packageName); - result["HasPendingRestart"] = Jellyfin::Support::toJsonValue(m_hasPendingRestart); - result["IsShuttingDown"] = Jellyfin::Support::toJsonValue(m_isShuttingDown); - result["SupportsLibraryMonitor"] = Jellyfin::Support::toJsonValue(m_supportsLibraryMonitor); - result["WebSocketPortNumber"] = Jellyfin::Support::toJsonValue(m_webSocketPortNumber); - result["CompletedInstallations"] = Jellyfin::Support::toJsonValue>>(m_completedInstallations); - result["CanSelfRestart"] = Jellyfin::Support::toJsonValue(m_canSelfRestart); - result["CanLaunchWebBrowser"] = Jellyfin::Support::toJsonValue(m_canLaunchWebBrowser); - result["ProgramDataPath"] = Jellyfin::Support::toJsonValue(m_programDataPath); - result["WebPath"] = Jellyfin::Support::toJsonValue(m_webPath); - result["ItemsByNamePath"] = Jellyfin::Support::toJsonValue(m_itemsByNamePath); - result["CachePath"] = Jellyfin::Support::toJsonValue(m_cachePath); - result["LogPath"] = Jellyfin::Support::toJsonValue(m_logPath); - result["InternalMetadataPath"] = Jellyfin::Support::toJsonValue(m_internalMetadataPath); - result["TranscodingTempPath"] = Jellyfin::Support::toJsonValue(m_transcodingTempPath); - result["HasUpdateAvailable"] = Jellyfin::Support::toJsonValue(m_hasUpdateAvailable); - result["EncoderLocation"] = Jellyfin::Support::toJsonValue(m_encoderLocation); - result["SystemArchitecture"] = Jellyfin::Support::toJsonValue(m_systemArchitecture); - - return result; -} - -QString SystemInfo::localAddress() const { return m_localAddress; } - -void SystemInfo::setLocalAddress(QString newLocalAddress) { - m_localAddress = newLocalAddress; -} -QString SystemInfo::serverName() const { return m_serverName; } - -void SystemInfo::setServerName(QString newServerName) { - m_serverName = newServerName; -} -QString SystemInfo::version() const { return m_version; } - -void SystemInfo::setVersion(QString newVersion) { - m_version = newVersion; -} -QString SystemInfo::productName() const { return m_productName; } - -void SystemInfo::setProductName(QString newProductName) { - m_productName = newProductName; -} -QString SystemInfo::operatingSystem() const { return m_operatingSystem; } - -void SystemInfo::setOperatingSystem(QString newOperatingSystem) { - m_operatingSystem = newOperatingSystem; -} -QString SystemInfo::jellyfinId() const { return m_jellyfinId; } - -void SystemInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -bool SystemInfo::startupWizardCompleted() const { return m_startupWizardCompleted; } - -void SystemInfo::setStartupWizardCompleted(bool newStartupWizardCompleted) { - m_startupWizardCompleted = newStartupWizardCompleted; -} -QString SystemInfo::operatingSystemDisplayName() const { return m_operatingSystemDisplayName; } - -void SystemInfo::setOperatingSystemDisplayName(QString newOperatingSystemDisplayName) { - m_operatingSystemDisplayName = newOperatingSystemDisplayName; -} -QString SystemInfo::packageName() const { return m_packageName; } - -void SystemInfo::setPackageName(QString newPackageName) { - m_packageName = newPackageName; -} -bool SystemInfo::hasPendingRestart() const { return m_hasPendingRestart; } - -void SystemInfo::setHasPendingRestart(bool newHasPendingRestart) { - m_hasPendingRestart = newHasPendingRestart; -} -bool SystemInfo::isShuttingDown() const { return m_isShuttingDown; } - -void SystemInfo::setIsShuttingDown(bool newIsShuttingDown) { - m_isShuttingDown = newIsShuttingDown; -} -bool SystemInfo::supportsLibraryMonitor() const { return m_supportsLibraryMonitor; } - -void SystemInfo::setSupportsLibraryMonitor(bool newSupportsLibraryMonitor) { - m_supportsLibraryMonitor = newSupportsLibraryMonitor; -} -qint32 SystemInfo::webSocketPortNumber() const { return m_webSocketPortNumber; } - -void SystemInfo::setWebSocketPortNumber(qint32 newWebSocketPortNumber) { - m_webSocketPortNumber = newWebSocketPortNumber; -} -QList> SystemInfo::completedInstallations() const { return m_completedInstallations; } - -void SystemInfo::setCompletedInstallations(QList> newCompletedInstallations) { - m_completedInstallations = newCompletedInstallations; -} -bool SystemInfo::canSelfRestart() const { return m_canSelfRestart; } - -void SystemInfo::setCanSelfRestart(bool newCanSelfRestart) { - m_canSelfRestart = newCanSelfRestart; -} -bool SystemInfo::canLaunchWebBrowser() const { return m_canLaunchWebBrowser; } - -void SystemInfo::setCanLaunchWebBrowser(bool newCanLaunchWebBrowser) { - m_canLaunchWebBrowser = newCanLaunchWebBrowser; -} -QString SystemInfo::programDataPath() const { return m_programDataPath; } - -void SystemInfo::setProgramDataPath(QString newProgramDataPath) { - m_programDataPath = newProgramDataPath; -} -QString SystemInfo::webPath() const { return m_webPath; } - -void SystemInfo::setWebPath(QString newWebPath) { - m_webPath = newWebPath; -} -QString SystemInfo::itemsByNamePath() const { return m_itemsByNamePath; } - -void SystemInfo::setItemsByNamePath(QString newItemsByNamePath) { - m_itemsByNamePath = newItemsByNamePath; -} -QString SystemInfo::cachePath() const { return m_cachePath; } - -void SystemInfo::setCachePath(QString newCachePath) { - m_cachePath = newCachePath; -} -QString SystemInfo::logPath() const { return m_logPath; } - -void SystemInfo::setLogPath(QString newLogPath) { - m_logPath = newLogPath; -} -QString SystemInfo::internalMetadataPath() const { return m_internalMetadataPath; } - -void SystemInfo::setInternalMetadataPath(QString newInternalMetadataPath) { - m_internalMetadataPath = newInternalMetadataPath; -} -QString SystemInfo::transcodingTempPath() const { return m_transcodingTempPath; } - -void SystemInfo::setTranscodingTempPath(QString newTranscodingTempPath) { - m_transcodingTempPath = newTranscodingTempPath; -} -bool SystemInfo::hasUpdateAvailable() const { return m_hasUpdateAvailable; } - -void SystemInfo::setHasUpdateAvailable(bool newHasUpdateAvailable) { - m_hasUpdateAvailable = newHasUpdateAvailable; -} -FFmpegLocation SystemInfo::encoderLocation() const { return m_encoderLocation; } - -void SystemInfo::setEncoderLocation(FFmpegLocation newEncoderLocation) { - m_encoderLocation = newEncoderLocation; -} -Architecture SystemInfo::systemArchitecture() const { return m_systemArchitecture; } - -void SystemInfo::setSystemArchitecture(Architecture newSystemArchitecture) { - m_systemArchitecture = newSystemArchitecture; -} - -} // NS DTO - -namespace Support { - -using SystemInfo = Jellyfin::DTO::SystemInfo; - -template <> -SystemInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return SystemInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/taskcompletionstatus.cpp b/core/src/DTO/taskcompletionstatus.cpp deleted file mode 100644 index c60c8f8..0000000 --- a/core/src/DTO/taskcompletionstatus.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TaskCompletionStatusClass::TaskCompletionStatusClass() {} - - -} // NS DTO - -namespace Support { - -using TaskCompletionStatus = Jellyfin::DTO::TaskCompletionStatus; - -template <> -TaskCompletionStatus fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return TaskCompletionStatus::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Completed")) { - return TaskCompletionStatus::Completed; - } - if (str == QStringLiteral("Failed")) { - return TaskCompletionStatus::Failed; - } - if (str == QStringLiteral("Cancelled")) { - return TaskCompletionStatus::Cancelled; - } - if (str == QStringLiteral("Aborted")) { - return TaskCompletionStatus::Aborted; - } - - return TaskCompletionStatus::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/taskinfo.cpp b/core/src/DTO/taskinfo.cpp deleted file mode 100644 index f141eb2..0000000 --- a/core/src/DTO/taskinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TaskInfo::TaskInfo() {} -TaskInfo::TaskInfo(const TaskInfo &other) : - m_name(other.m_name), - m_state(other.m_state), - m_currentProgressPercentage(other.m_currentProgressPercentage), - m_jellyfinId(other.m_jellyfinId), - m_lastExecutionResult(other.m_lastExecutionResult), - m_triggers(other.m_triggers), - m_description(other.m_description), - m_category(other.m_category), - m_isHidden(other.m_isHidden), - m_key(other.m_key){} - -TaskInfo TaskInfo::fromJson(QJsonObject source) { - TaskInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TaskInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_state = Jellyfin::Support::fromJsonValue(source["State"]); - m_currentProgressPercentage = Jellyfin::Support::fromJsonValue(source["CurrentProgressPercentage"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_lastExecutionResult = Jellyfin::Support::fromJsonValue>(source["LastExecutionResult"]); - m_triggers = Jellyfin::Support::fromJsonValue>>(source["Triggers"]); - m_description = Jellyfin::Support::fromJsonValue(source["Description"]); - m_category = Jellyfin::Support::fromJsonValue(source["Category"]); - m_isHidden = Jellyfin::Support::fromJsonValue(source["IsHidden"]); - m_key = Jellyfin::Support::fromJsonValue(source["Key"]); - -} - -QJsonObject TaskInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["State"] = Jellyfin::Support::toJsonValue(m_state); - result["CurrentProgressPercentage"] = Jellyfin::Support::toJsonValue(m_currentProgressPercentage); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["LastExecutionResult"] = Jellyfin::Support::toJsonValue>(m_lastExecutionResult); - result["Triggers"] = Jellyfin::Support::toJsonValue>>(m_triggers); - result["Description"] = Jellyfin::Support::toJsonValue(m_description); - result["Category"] = Jellyfin::Support::toJsonValue(m_category); - result["IsHidden"] = Jellyfin::Support::toJsonValue(m_isHidden); - result["Key"] = Jellyfin::Support::toJsonValue(m_key); - - return result; -} - -QString TaskInfo::name() const { return m_name; } - -void TaskInfo::setName(QString newName) { - m_name = newName; -} -TaskState TaskInfo::state() const { return m_state; } - -void TaskInfo::setState(TaskState newState) { - m_state = newState; -} -double TaskInfo::currentProgressPercentage() const { return m_currentProgressPercentage; } - -void TaskInfo::setCurrentProgressPercentage(double newCurrentProgressPercentage) { - m_currentProgressPercentage = newCurrentProgressPercentage; -} -QString TaskInfo::jellyfinId() const { return m_jellyfinId; } - -void TaskInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QSharedPointer TaskInfo::lastExecutionResult() const { return m_lastExecutionResult; } - -void TaskInfo::setLastExecutionResult(QSharedPointer newLastExecutionResult) { - m_lastExecutionResult = newLastExecutionResult; -} -QList> TaskInfo::triggers() const { return m_triggers; } - -void TaskInfo::setTriggers(QList> newTriggers) { - m_triggers = newTriggers; -} -QString TaskInfo::description() const { return m_description; } - -void TaskInfo::setDescription(QString newDescription) { - m_description = newDescription; -} -QString TaskInfo::category() const { return m_category; } - -void TaskInfo::setCategory(QString newCategory) { - m_category = newCategory; -} -bool TaskInfo::isHidden() const { return m_isHidden; } - -void TaskInfo::setIsHidden(bool newIsHidden) { - m_isHidden = newIsHidden; -} -QString TaskInfo::key() const { return m_key; } - -void TaskInfo::setKey(QString newKey) { - m_key = newKey; -} - -} // NS DTO - -namespace Support { - -using TaskInfo = Jellyfin::DTO::TaskInfo; - -template <> -TaskInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TaskInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/taskresult.cpp b/core/src/DTO/taskresult.cpp deleted file mode 100644 index 4c061f5..0000000 --- a/core/src/DTO/taskresult.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TaskResult::TaskResult() {} -TaskResult::TaskResult(const TaskResult &other) : - m_startTimeUtc(other.m_startTimeUtc), - m_endTimeUtc(other.m_endTimeUtc), - m_status(other.m_status), - m_name(other.m_name), - m_key(other.m_key), - m_jellyfinId(other.m_jellyfinId), - m_errorMessage(other.m_errorMessage), - m_longErrorMessage(other.m_longErrorMessage){} - -TaskResult TaskResult::fromJson(QJsonObject source) { - TaskResult instance; - instance.setFromJson(source); - return instance; -} - - -void TaskResult::setFromJson(QJsonObject source) { - m_startTimeUtc = Jellyfin::Support::fromJsonValue(source["StartTimeUtc"]); - m_endTimeUtc = Jellyfin::Support::fromJsonValue(source["EndTimeUtc"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_key = Jellyfin::Support::fromJsonValue(source["Key"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_errorMessage = Jellyfin::Support::fromJsonValue(source["ErrorMessage"]); - m_longErrorMessage = Jellyfin::Support::fromJsonValue(source["LongErrorMessage"]); - -} - -QJsonObject TaskResult::toJson() { - QJsonObject result; - result["StartTimeUtc"] = Jellyfin::Support::toJsonValue(m_startTimeUtc); - result["EndTimeUtc"] = Jellyfin::Support::toJsonValue(m_endTimeUtc); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Key"] = Jellyfin::Support::toJsonValue(m_key); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["ErrorMessage"] = Jellyfin::Support::toJsonValue(m_errorMessage); - result["LongErrorMessage"] = Jellyfin::Support::toJsonValue(m_longErrorMessage); - - return result; -} - -QDateTime TaskResult::startTimeUtc() const { return m_startTimeUtc; } - -void TaskResult::setStartTimeUtc(QDateTime newStartTimeUtc) { - m_startTimeUtc = newStartTimeUtc; -} -QDateTime TaskResult::endTimeUtc() const { return m_endTimeUtc; } - -void TaskResult::setEndTimeUtc(QDateTime newEndTimeUtc) { - m_endTimeUtc = newEndTimeUtc; -} -TaskCompletionStatus TaskResult::status() const { return m_status; } - -void TaskResult::setStatus(TaskCompletionStatus newStatus) { - m_status = newStatus; -} -QString TaskResult::name() const { return m_name; } - -void TaskResult::setName(QString newName) { - m_name = newName; -} -QString TaskResult::key() const { return m_key; } - -void TaskResult::setKey(QString newKey) { - m_key = newKey; -} -QString TaskResult::jellyfinId() const { return m_jellyfinId; } - -void TaskResult::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString TaskResult::errorMessage() const { return m_errorMessage; } - -void TaskResult::setErrorMessage(QString newErrorMessage) { - m_errorMessage = newErrorMessage; -} -QString TaskResult::longErrorMessage() const { return m_longErrorMessage; } - -void TaskResult::setLongErrorMessage(QString newLongErrorMessage) { - m_longErrorMessage = newLongErrorMessage; -} - -} // NS DTO - -namespace Support { - -using TaskResult = Jellyfin::DTO::TaskResult; - -template <> -TaskResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TaskResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/taskstate.cpp b/core/src/DTO/taskstate.cpp deleted file mode 100644 index 5648a38..0000000 --- a/core/src/DTO/taskstate.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TaskStateClass::TaskStateClass() {} - - -} // NS DTO - -namespace Support { - -using TaskState = Jellyfin::DTO::TaskState; - -template <> -TaskState fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return TaskState::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Idle")) { - return TaskState::Idle; - } - if (str == QStringLiteral("Cancelling")) { - return TaskState::Cancelling; - } - if (str == QStringLiteral("Running")) { - return TaskState::Running; - } - - return TaskState::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/tasktriggerinfo.cpp b/core/src/DTO/tasktriggerinfo.cpp deleted file mode 100644 index 36dd1bf..0000000 --- a/core/src/DTO/tasktriggerinfo.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TaskTriggerInfo::TaskTriggerInfo() {} -TaskTriggerInfo::TaskTriggerInfo(const TaskTriggerInfo &other) : - m_type(other.m_type), - m_timeOfDayTicks(other.m_timeOfDayTicks), - m_intervalTicks(other.m_intervalTicks), - m_dayOfWeek(other.m_dayOfWeek), - m_maxRuntimeTicks(other.m_maxRuntimeTicks){} - -TaskTriggerInfo TaskTriggerInfo::fromJson(QJsonObject source) { - TaskTriggerInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TaskTriggerInfo::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_timeOfDayTicks = Jellyfin::Support::fromJsonValue(source["TimeOfDayTicks"]); - m_intervalTicks = Jellyfin::Support::fromJsonValue(source["IntervalTicks"]); - m_dayOfWeek = Jellyfin::Support::fromJsonValue(source["DayOfWeek"]); - m_maxRuntimeTicks = Jellyfin::Support::fromJsonValue(source["MaxRuntimeTicks"]); - -} - -QJsonObject TaskTriggerInfo::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["TimeOfDayTicks"] = Jellyfin::Support::toJsonValue(m_timeOfDayTicks); - result["IntervalTicks"] = Jellyfin::Support::toJsonValue(m_intervalTicks); - result["DayOfWeek"] = Jellyfin::Support::toJsonValue(m_dayOfWeek); - result["MaxRuntimeTicks"] = Jellyfin::Support::toJsonValue(m_maxRuntimeTicks); - - return result; -} - -QString TaskTriggerInfo::type() const { return m_type; } - -void TaskTriggerInfo::setType(QString newType) { - m_type = newType; -} -qint64 TaskTriggerInfo::timeOfDayTicks() const { return m_timeOfDayTicks; } - -void TaskTriggerInfo::setTimeOfDayTicks(qint64 newTimeOfDayTicks) { - m_timeOfDayTicks = newTimeOfDayTicks; -} -qint64 TaskTriggerInfo::intervalTicks() const { return m_intervalTicks; } - -void TaskTriggerInfo::setIntervalTicks(qint64 newIntervalTicks) { - m_intervalTicks = newIntervalTicks; -} -DayOfWeek TaskTriggerInfo::dayOfWeek() const { return m_dayOfWeek; } - -void TaskTriggerInfo::setDayOfWeek(DayOfWeek newDayOfWeek) { - m_dayOfWeek = newDayOfWeek; -} -qint64 TaskTriggerInfo::maxRuntimeTicks() const { return m_maxRuntimeTicks; } - -void TaskTriggerInfo::setMaxRuntimeTicks(qint64 newMaxRuntimeTicks) { - m_maxRuntimeTicks = newMaxRuntimeTicks; -} - -} // NS DTO - -namespace Support { - -using TaskTriggerInfo = Jellyfin::DTO::TaskTriggerInfo; - -template <> -TaskTriggerInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TaskTriggerInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/thememediaresult.cpp b/core/src/DTO/thememediaresult.cpp deleted file mode 100644 index ac1163c..0000000 --- a/core/src/DTO/thememediaresult.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ThemeMediaResult::ThemeMediaResult() {} -ThemeMediaResult::ThemeMediaResult(const ThemeMediaResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex), - m_ownerId(other.m_ownerId){} - -ThemeMediaResult ThemeMediaResult::fromJson(QJsonObject source) { - ThemeMediaResult instance; - instance.setFromJson(source); - return instance; -} - - -void ThemeMediaResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - m_ownerId = Jellyfin::Support::fromJsonValue(source["OwnerId"]); - -} - -QJsonObject ThemeMediaResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - result["OwnerId"] = Jellyfin::Support::toJsonValue(m_ownerId); - - return result; -} - -QList> ThemeMediaResult::items() const { return m_items; } - -void ThemeMediaResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 ThemeMediaResult::totalRecordCount() const { return m_totalRecordCount; } - -void ThemeMediaResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 ThemeMediaResult::startIndex() const { return m_startIndex; } - -void ThemeMediaResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} -QUuid ThemeMediaResult::ownerId() const { return m_ownerId; } - -void ThemeMediaResult::setOwnerId(QUuid newOwnerId) { - m_ownerId = newOwnerId; -} - -} // NS DTO - -namespace Support { - -using ThemeMediaResult = Jellyfin::DTO::ThemeMediaResult; - -template <> -ThemeMediaResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ThemeMediaResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/timereventinfo.cpp b/core/src/DTO/timereventinfo.cpp deleted file mode 100644 index ed013fe..0000000 --- a/core/src/DTO/timereventinfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TimerEventInfo::TimerEventInfo() {} -TimerEventInfo::TimerEventInfo(const TimerEventInfo &other) : - m_jellyfinId(other.m_jellyfinId), - m_programId(other.m_programId){} - -TimerEventInfo TimerEventInfo::fromJson(QJsonObject source) { - TimerEventInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TimerEventInfo::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_programId = Jellyfin::Support::fromJsonValue(source["ProgramId"]); - -} - -QJsonObject TimerEventInfo::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["ProgramId"] = Jellyfin::Support::toJsonValue(m_programId); - - return result; -} - -QString TimerEventInfo::jellyfinId() const { return m_jellyfinId; } - -void TimerEventInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QUuid TimerEventInfo::programId() const { return m_programId; } - -void TimerEventInfo::setProgramId(QUuid newProgramId) { - m_programId = newProgramId; -} - -} // NS DTO - -namespace Support { - -using TimerEventInfo = Jellyfin::DTO::TimerEventInfo; - -template <> -TimerEventInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TimerEventInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/timerinfodto.cpp b/core/src/DTO/timerinfodto.cpp deleted file mode 100644 index 683e2b9..0000000 --- a/core/src/DTO/timerinfodto.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TimerInfoDto::TimerInfoDto() {} -TimerInfoDto::TimerInfoDto(const TimerInfoDto &other) : - m_jellyfinId(other.m_jellyfinId), - m_type(other.m_type), - m_serverId(other.m_serverId), - m_externalId(other.m_externalId), - m_channelId(other.m_channelId), - m_externalChannelId(other.m_externalChannelId), - m_channelName(other.m_channelName), - m_channelPrimaryImageTag(other.m_channelPrimaryImageTag), - m_programId(other.m_programId), - m_externalProgramId(other.m_externalProgramId), - m_name(other.m_name), - m_overview(other.m_overview), - m_startDate(other.m_startDate), - m_endDate(other.m_endDate), - m_serviceName(other.m_serviceName), - m_priority(other.m_priority), - m_prePaddingSeconds(other.m_prePaddingSeconds), - m_postPaddingSeconds(other.m_postPaddingSeconds), - m_isPrePaddingRequired(other.m_isPrePaddingRequired), - m_parentBackdropItemId(other.m_parentBackdropItemId), - m_parentBackdropImageTags(other.m_parentBackdropImageTags), - m_isPostPaddingRequired(other.m_isPostPaddingRequired), - m_keepUntil(other.m_keepUntil), - m_status(other.m_status), - m_seriesTimerId(other.m_seriesTimerId), - m_externalSeriesTimerId(other.m_externalSeriesTimerId), - m_runTimeTicks(other.m_runTimeTicks), - m_programInfo(other.m_programInfo){} - -TimerInfoDto TimerInfoDto::fromJson(QJsonObject source) { - TimerInfoDto instance; - instance.setFromJson(source); - return instance; -} - - -void TimerInfoDto::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - m_externalId = Jellyfin::Support::fromJsonValue(source["ExternalId"]); - m_channelId = Jellyfin::Support::fromJsonValue(source["ChannelId"]); - m_externalChannelId = Jellyfin::Support::fromJsonValue(source["ExternalChannelId"]); - m_channelName = Jellyfin::Support::fromJsonValue(source["ChannelName"]); - m_channelPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["ChannelPrimaryImageTag"]); - m_programId = Jellyfin::Support::fromJsonValue(source["ProgramId"]); - m_externalProgramId = Jellyfin::Support::fromJsonValue(source["ExternalProgramId"]); - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_overview = Jellyfin::Support::fromJsonValue(source["Overview"]); - m_startDate = Jellyfin::Support::fromJsonValue(source["StartDate"]); - m_endDate = Jellyfin::Support::fromJsonValue(source["EndDate"]); - m_serviceName = Jellyfin::Support::fromJsonValue(source["ServiceName"]); - m_priority = Jellyfin::Support::fromJsonValue(source["Priority"]); - m_prePaddingSeconds = Jellyfin::Support::fromJsonValue(source["PrePaddingSeconds"]); - m_postPaddingSeconds = Jellyfin::Support::fromJsonValue(source["PostPaddingSeconds"]); - m_isPrePaddingRequired = Jellyfin::Support::fromJsonValue(source["IsPrePaddingRequired"]); - m_parentBackdropItemId = Jellyfin::Support::fromJsonValue(source["ParentBackdropItemId"]); - m_parentBackdropImageTags = Jellyfin::Support::fromJsonValue(source["ParentBackdropImageTags"]); - m_isPostPaddingRequired = Jellyfin::Support::fromJsonValue(source["IsPostPaddingRequired"]); - m_keepUntil = Jellyfin::Support::fromJsonValue(source["KeepUntil"]); - m_status = Jellyfin::Support::fromJsonValue(source["Status"]); - m_seriesTimerId = Jellyfin::Support::fromJsonValue(source["SeriesTimerId"]); - m_externalSeriesTimerId = Jellyfin::Support::fromJsonValue(source["ExternalSeriesTimerId"]); - m_runTimeTicks = Jellyfin::Support::fromJsonValue(source["RunTimeTicks"]); - m_programInfo = Jellyfin::Support::fromJsonValue>(source["ProgramInfo"]); - -} - -QJsonObject TimerInfoDto::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - result["ExternalId"] = Jellyfin::Support::toJsonValue(m_externalId); - result["ChannelId"] = Jellyfin::Support::toJsonValue(m_channelId); - result["ExternalChannelId"] = Jellyfin::Support::toJsonValue(m_externalChannelId); - result["ChannelName"] = Jellyfin::Support::toJsonValue(m_channelName); - result["ChannelPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_channelPrimaryImageTag); - result["ProgramId"] = Jellyfin::Support::toJsonValue(m_programId); - result["ExternalProgramId"] = Jellyfin::Support::toJsonValue(m_externalProgramId); - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Overview"] = Jellyfin::Support::toJsonValue(m_overview); - result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); - result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); - result["ServiceName"] = Jellyfin::Support::toJsonValue(m_serviceName); - result["Priority"] = Jellyfin::Support::toJsonValue(m_priority); - result["PrePaddingSeconds"] = Jellyfin::Support::toJsonValue(m_prePaddingSeconds); - result["PostPaddingSeconds"] = Jellyfin::Support::toJsonValue(m_postPaddingSeconds); - result["IsPrePaddingRequired"] = Jellyfin::Support::toJsonValue(m_isPrePaddingRequired); - result["ParentBackdropItemId"] = Jellyfin::Support::toJsonValue(m_parentBackdropItemId); - result["ParentBackdropImageTags"] = Jellyfin::Support::toJsonValue(m_parentBackdropImageTags); - result["IsPostPaddingRequired"] = Jellyfin::Support::toJsonValue(m_isPostPaddingRequired); - result["KeepUntil"] = Jellyfin::Support::toJsonValue(m_keepUntil); - result["Status"] = Jellyfin::Support::toJsonValue(m_status); - result["SeriesTimerId"] = Jellyfin::Support::toJsonValue(m_seriesTimerId); - result["ExternalSeriesTimerId"] = Jellyfin::Support::toJsonValue(m_externalSeriesTimerId); - result["RunTimeTicks"] = Jellyfin::Support::toJsonValue(m_runTimeTicks); - result["ProgramInfo"] = Jellyfin::Support::toJsonValue>(m_programInfo); - - return result; -} - -QString TimerInfoDto::jellyfinId() const { return m_jellyfinId; } - -void TimerInfoDto::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString TimerInfoDto::type() const { return m_type; } - -void TimerInfoDto::setType(QString newType) { - m_type = newType; -} -QString TimerInfoDto::serverId() const { return m_serverId; } - -void TimerInfoDto::setServerId(QString newServerId) { - m_serverId = newServerId; -} -QString TimerInfoDto::externalId() const { return m_externalId; } - -void TimerInfoDto::setExternalId(QString newExternalId) { - m_externalId = newExternalId; -} -QUuid TimerInfoDto::channelId() const { return m_channelId; } - -void TimerInfoDto::setChannelId(QUuid newChannelId) { - m_channelId = newChannelId; -} -QString TimerInfoDto::externalChannelId() const { return m_externalChannelId; } - -void TimerInfoDto::setExternalChannelId(QString newExternalChannelId) { - m_externalChannelId = newExternalChannelId; -} -QString TimerInfoDto::channelName() const { return m_channelName; } - -void TimerInfoDto::setChannelName(QString newChannelName) { - m_channelName = newChannelName; -} -QString TimerInfoDto::channelPrimaryImageTag() const { return m_channelPrimaryImageTag; } - -void TimerInfoDto::setChannelPrimaryImageTag(QString newChannelPrimaryImageTag) { - m_channelPrimaryImageTag = newChannelPrimaryImageTag; -} -QString TimerInfoDto::programId() const { return m_programId; } - -void TimerInfoDto::setProgramId(QString newProgramId) { - m_programId = newProgramId; -} -QString TimerInfoDto::externalProgramId() const { return m_externalProgramId; } - -void TimerInfoDto::setExternalProgramId(QString newExternalProgramId) { - m_externalProgramId = newExternalProgramId; -} -QString TimerInfoDto::name() const { return m_name; } - -void TimerInfoDto::setName(QString newName) { - m_name = newName; -} -QString TimerInfoDto::overview() const { return m_overview; } - -void TimerInfoDto::setOverview(QString newOverview) { - m_overview = newOverview; -} -QDateTime TimerInfoDto::startDate() const { return m_startDate; } - -void TimerInfoDto::setStartDate(QDateTime newStartDate) { - m_startDate = newStartDate; -} -QDateTime TimerInfoDto::endDate() const { return m_endDate; } - -void TimerInfoDto::setEndDate(QDateTime newEndDate) { - m_endDate = newEndDate; -} -QString TimerInfoDto::serviceName() const { return m_serviceName; } - -void TimerInfoDto::setServiceName(QString newServiceName) { - m_serviceName = newServiceName; -} -qint32 TimerInfoDto::priority() const { return m_priority; } - -void TimerInfoDto::setPriority(qint32 newPriority) { - m_priority = newPriority; -} -qint32 TimerInfoDto::prePaddingSeconds() const { return m_prePaddingSeconds; } - -void TimerInfoDto::setPrePaddingSeconds(qint32 newPrePaddingSeconds) { - m_prePaddingSeconds = newPrePaddingSeconds; -} -qint32 TimerInfoDto::postPaddingSeconds() const { return m_postPaddingSeconds; } - -void TimerInfoDto::setPostPaddingSeconds(qint32 newPostPaddingSeconds) { - m_postPaddingSeconds = newPostPaddingSeconds; -} -bool TimerInfoDto::isPrePaddingRequired() const { return m_isPrePaddingRequired; } - -void TimerInfoDto::setIsPrePaddingRequired(bool newIsPrePaddingRequired) { - m_isPrePaddingRequired = newIsPrePaddingRequired; -} -QString TimerInfoDto::parentBackdropItemId() const { return m_parentBackdropItemId; } - -void TimerInfoDto::setParentBackdropItemId(QString newParentBackdropItemId) { - m_parentBackdropItemId = newParentBackdropItemId; -} -QStringList TimerInfoDto::parentBackdropImageTags() const { return m_parentBackdropImageTags; } - -void TimerInfoDto::setParentBackdropImageTags(QStringList newParentBackdropImageTags) { - m_parentBackdropImageTags = newParentBackdropImageTags; -} -bool TimerInfoDto::isPostPaddingRequired() const { return m_isPostPaddingRequired; } - -void TimerInfoDto::setIsPostPaddingRequired(bool newIsPostPaddingRequired) { - m_isPostPaddingRequired = newIsPostPaddingRequired; -} -KeepUntil TimerInfoDto::keepUntil() const { return m_keepUntil; } - -void TimerInfoDto::setKeepUntil(KeepUntil newKeepUntil) { - m_keepUntil = newKeepUntil; -} -RecordingStatus TimerInfoDto::status() const { return m_status; } - -void TimerInfoDto::setStatus(RecordingStatus newStatus) { - m_status = newStatus; -} -QString TimerInfoDto::seriesTimerId() const { return m_seriesTimerId; } - -void TimerInfoDto::setSeriesTimerId(QString newSeriesTimerId) { - m_seriesTimerId = newSeriesTimerId; -} -QString TimerInfoDto::externalSeriesTimerId() const { return m_externalSeriesTimerId; } - -void TimerInfoDto::setExternalSeriesTimerId(QString newExternalSeriesTimerId) { - m_externalSeriesTimerId = newExternalSeriesTimerId; -} -qint64 TimerInfoDto::runTimeTicks() const { return m_runTimeTicks; } - -void TimerInfoDto::setRunTimeTicks(qint64 newRunTimeTicks) { - m_runTimeTicks = newRunTimeTicks; -} -QSharedPointer TimerInfoDto::programInfo() const { return m_programInfo; } - -void TimerInfoDto::setProgramInfo(QSharedPointer newProgramInfo) { - m_programInfo = newProgramInfo; -} - -} // NS DTO - -namespace Support { - -using TimerInfoDto = Jellyfin::DTO::TimerInfoDto; - -template <> -TimerInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TimerInfoDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/timerinfodtoqueryresult.cpp b/core/src/DTO/timerinfodtoqueryresult.cpp deleted file mode 100644 index ac60b5f..0000000 --- a/core/src/DTO/timerinfodtoqueryresult.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TimerInfoDtoQueryResult::TimerInfoDtoQueryResult() {} -TimerInfoDtoQueryResult::TimerInfoDtoQueryResult(const TimerInfoDtoQueryResult &other) : - m_items(other.m_items), - m_totalRecordCount(other.m_totalRecordCount), - m_startIndex(other.m_startIndex){} - -TimerInfoDtoQueryResult TimerInfoDtoQueryResult::fromJson(QJsonObject source) { - TimerInfoDtoQueryResult instance; - instance.setFromJson(source); - return instance; -} - - -void TimerInfoDtoQueryResult::setFromJson(QJsonObject source) { - m_items = Jellyfin::Support::fromJsonValue>>(source["Items"]); - m_totalRecordCount = Jellyfin::Support::fromJsonValue(source["TotalRecordCount"]); - m_startIndex = Jellyfin::Support::fromJsonValue(source["StartIndex"]); - -} - -QJsonObject TimerInfoDtoQueryResult::toJson() { - QJsonObject result; - result["Items"] = Jellyfin::Support::toJsonValue>>(m_items); - result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); - result["StartIndex"] = Jellyfin::Support::toJsonValue(m_startIndex); - - return result; -} - -QList> TimerInfoDtoQueryResult::items() const { return m_items; } - -void TimerInfoDtoQueryResult::setItems(QList> newItems) { - m_items = newItems; -} -qint32 TimerInfoDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; } - -void TimerInfoDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) { - m_totalRecordCount = newTotalRecordCount; -} -qint32 TimerInfoDtoQueryResult::startIndex() const { return m_startIndex; } - -void TimerInfoDtoQueryResult::setStartIndex(qint32 newStartIndex) { - m_startIndex = newStartIndex; -} - -} // NS DTO - -namespace Support { - -using TimerInfoDtoQueryResult = Jellyfin::DTO::TimerInfoDtoQueryResult; - -template <> -TimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TimerInfoDtoQueryResult::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/trailerinfo.cpp b/core/src/DTO/trailerinfo.cpp deleted file mode 100644 index 03baed5..0000000 --- a/core/src/DTO/trailerinfo.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TrailerInfo::TrailerInfo() {} -TrailerInfo::TrailerInfo(const TrailerInfo &other) : - m_name(other.m_name), - m_path(other.m_path), - m_metadataLanguage(other.m_metadataLanguage), - m_metadataCountryCode(other.m_metadataCountryCode), - m_providerIds(other.m_providerIds), - m_year(other.m_year), - m_indexNumber(other.m_indexNumber), - m_parentIndexNumber(other.m_parentIndexNumber), - m_premiereDate(other.m_premiereDate), - m_isAutomated(other.m_isAutomated){} - -TrailerInfo TrailerInfo::fromJson(QJsonObject source) { - TrailerInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TrailerInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); - m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); - m_year = Jellyfin::Support::fromJsonValue(source["Year"]); - m_indexNumber = Jellyfin::Support::fromJsonValue(source["IndexNumber"]); - m_parentIndexNumber = Jellyfin::Support::fromJsonValue(source["ParentIndexNumber"]); - m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); - m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); - -} - -QJsonObject TrailerInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); - result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); - result["Year"] = Jellyfin::Support::toJsonValue(m_year); - result["IndexNumber"] = Jellyfin::Support::toJsonValue(m_indexNumber); - result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue(m_parentIndexNumber); - result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); - result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); - - return result; -} - -QString TrailerInfo::name() const { return m_name; } - -void TrailerInfo::setName(QString newName) { - m_name = newName; -} -QString TrailerInfo::path() const { return m_path; } - -void TrailerInfo::setPath(QString newPath) { - m_path = newPath; -} -QString TrailerInfo::metadataLanguage() const { return m_metadataLanguage; } - -void TrailerInfo::setMetadataLanguage(QString newMetadataLanguage) { - m_metadataLanguage = newMetadataLanguage; -} -QString TrailerInfo::metadataCountryCode() const { return m_metadataCountryCode; } - -void TrailerInfo::setMetadataCountryCode(QString newMetadataCountryCode) { - m_metadataCountryCode = newMetadataCountryCode; -} -QJsonObject TrailerInfo::providerIds() const { return m_providerIds; } - -void TrailerInfo::setProviderIds(QJsonObject newProviderIds) { - m_providerIds = newProviderIds; -} -qint32 TrailerInfo::year() const { return m_year; } - -void TrailerInfo::setYear(qint32 newYear) { - m_year = newYear; -} -qint32 TrailerInfo::indexNumber() const { return m_indexNumber; } - -void TrailerInfo::setIndexNumber(qint32 newIndexNumber) { - m_indexNumber = newIndexNumber; -} -qint32 TrailerInfo::parentIndexNumber() const { return m_parentIndexNumber; } - -void TrailerInfo::setParentIndexNumber(qint32 newParentIndexNumber) { - m_parentIndexNumber = newParentIndexNumber; -} -QDateTime TrailerInfo::premiereDate() const { return m_premiereDate; } - -void TrailerInfo::setPremiereDate(QDateTime newPremiereDate) { - m_premiereDate = newPremiereDate; -} -bool TrailerInfo::isAutomated() const { return m_isAutomated; } - -void TrailerInfo::setIsAutomated(bool newIsAutomated) { - m_isAutomated = newIsAutomated; -} - -} // NS DTO - -namespace Support { - -using TrailerInfo = Jellyfin::DTO::TrailerInfo; - -template <> -TrailerInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TrailerInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/trailerinforemotesearchquery.cpp b/core/src/DTO/trailerinforemotesearchquery.cpp deleted file mode 100644 index 6c54750..0000000 --- a/core/src/DTO/trailerinforemotesearchquery.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TrailerInfoRemoteSearchQuery::TrailerInfoRemoteSearchQuery() {} -TrailerInfoRemoteSearchQuery::TrailerInfoRemoteSearchQuery(const TrailerInfoRemoteSearchQuery &other) : - m_searchInfo(other.m_searchInfo), - m_itemId(other.m_itemId), - m_searchProviderName(other.m_searchProviderName), - m_includeDisabledProviders(other.m_includeDisabledProviders){} - -TrailerInfoRemoteSearchQuery TrailerInfoRemoteSearchQuery::fromJson(QJsonObject source) { - TrailerInfoRemoteSearchQuery instance; - instance.setFromJson(source); - return instance; -} - - -void TrailerInfoRemoteSearchQuery::setFromJson(QJsonObject source) { - m_searchInfo = Jellyfin::Support::fromJsonValue>(source["SearchInfo"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_searchProviderName = Jellyfin::Support::fromJsonValue(source["SearchProviderName"]); - m_includeDisabledProviders = Jellyfin::Support::fromJsonValue(source["IncludeDisabledProviders"]); - -} - -QJsonObject TrailerInfoRemoteSearchQuery::toJson() { - QJsonObject result; - result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["SearchProviderName"] = Jellyfin::Support::toJsonValue(m_searchProviderName); - result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue(m_includeDisabledProviders); - - return result; -} - -QSharedPointer TrailerInfoRemoteSearchQuery::searchInfo() const { return m_searchInfo; } - -void TrailerInfoRemoteSearchQuery::setSearchInfo(QSharedPointer newSearchInfo) { - m_searchInfo = newSearchInfo; -} -QUuid TrailerInfoRemoteSearchQuery::itemId() const { return m_itemId; } - -void TrailerInfoRemoteSearchQuery::setItemId(QUuid newItemId) { - m_itemId = newItemId; -} -QString TrailerInfoRemoteSearchQuery::searchProviderName() const { return m_searchProviderName; } - -void TrailerInfoRemoteSearchQuery::setSearchProviderName(QString newSearchProviderName) { - m_searchProviderName = newSearchProviderName; -} -bool TrailerInfoRemoteSearchQuery::includeDisabledProviders() const { return m_includeDisabledProviders; } - -void TrailerInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisabledProviders) { - m_includeDisabledProviders = newIncludeDisabledProviders; -} - -} // NS DTO - -namespace Support { - -using TrailerInfoRemoteSearchQuery = Jellyfin::DTO::TrailerInfoRemoteSearchQuery; - -template <> -TrailerInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TrailerInfoRemoteSearchQuery::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/transcodereason.cpp b/core/src/DTO/transcodereason.cpp deleted file mode 100644 index d2c5803..0000000 --- a/core/src/DTO/transcodereason.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TranscodeReasonClass::TranscodeReasonClass() {} - - -} // NS DTO - -namespace Support { - -using TranscodeReason = Jellyfin::DTO::TranscodeReason; - -template <> -TranscodeReason fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return TranscodeReason::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("ContainerNotSupported")) { - return TranscodeReason::ContainerNotSupported; - } - if (str == QStringLiteral("VideoCodecNotSupported")) { - return TranscodeReason::VideoCodecNotSupported; - } - if (str == QStringLiteral("AudioCodecNotSupported")) { - return TranscodeReason::AudioCodecNotSupported; - } - if (str == QStringLiteral("ContainerBitrateExceedsLimit")) { - return TranscodeReason::ContainerBitrateExceedsLimit; - } - if (str == QStringLiteral("AudioBitrateNotSupported")) { - return TranscodeReason::AudioBitrateNotSupported; - } - if (str == QStringLiteral("AudioChannelsNotSupported")) { - return TranscodeReason::AudioChannelsNotSupported; - } - if (str == QStringLiteral("VideoResolutionNotSupported")) { - return TranscodeReason::VideoResolutionNotSupported; - } - if (str == QStringLiteral("UnknownVideoStreamInfo")) { - return TranscodeReason::UnknownVideoStreamInfo; - } - if (str == QStringLiteral("UnknownAudioStreamInfo")) { - return TranscodeReason::UnknownAudioStreamInfo; - } - if (str == QStringLiteral("AudioProfileNotSupported")) { - return TranscodeReason::AudioProfileNotSupported; - } - if (str == QStringLiteral("AudioSampleRateNotSupported")) { - return TranscodeReason::AudioSampleRateNotSupported; - } - if (str == QStringLiteral("AnamorphicVideoNotSupported")) { - return TranscodeReason::AnamorphicVideoNotSupported; - } - if (str == QStringLiteral("InterlacedVideoNotSupported")) { - return TranscodeReason::InterlacedVideoNotSupported; - } - if (str == QStringLiteral("SecondaryAudioNotSupported")) { - return TranscodeReason::SecondaryAudioNotSupported; - } - if (str == QStringLiteral("RefFramesNotSupported")) { - return TranscodeReason::RefFramesNotSupported; - } - if (str == QStringLiteral("VideoBitDepthNotSupported")) { - return TranscodeReason::VideoBitDepthNotSupported; - } - if (str == QStringLiteral("VideoBitrateNotSupported")) { - return TranscodeReason::VideoBitrateNotSupported; - } - if (str == QStringLiteral("VideoFramerateNotSupported")) { - return TranscodeReason::VideoFramerateNotSupported; - } - if (str == QStringLiteral("VideoLevelNotSupported")) { - return TranscodeReason::VideoLevelNotSupported; - } - if (str == QStringLiteral("VideoProfileNotSupported")) { - return TranscodeReason::VideoProfileNotSupported; - } - if (str == QStringLiteral("AudioBitDepthNotSupported")) { - return TranscodeReason::AudioBitDepthNotSupported; - } - if (str == QStringLiteral("SubtitleCodecNotSupported")) { - return TranscodeReason::SubtitleCodecNotSupported; - } - if (str == QStringLiteral("DirectPlayError")) { - return TranscodeReason::DirectPlayError; - } - - return TranscodeReason::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/transcodeseekinfo.cpp b/core/src/DTO/transcodeseekinfo.cpp deleted file mode 100644 index daaf607..0000000 --- a/core/src/DTO/transcodeseekinfo.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TranscodeSeekInfoClass::TranscodeSeekInfoClass() {} - - -} // NS DTO - -namespace Support { - -using TranscodeSeekInfo = Jellyfin::DTO::TranscodeSeekInfo; - -template <> -TranscodeSeekInfo fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return TranscodeSeekInfo::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Auto")) { - return TranscodeSeekInfo::Auto; - } - if (str == QStringLiteral("Bytes")) { - return TranscodeSeekInfo::Bytes; - } - - return TranscodeSeekInfo::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/transcodinginfo.cpp b/core/src/DTO/transcodinginfo.cpp deleted file mode 100644 index b28da33..0000000 --- a/core/src/DTO/transcodinginfo.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TranscodingInfo::TranscodingInfo() {} -TranscodingInfo::TranscodingInfo(const TranscodingInfo &other) : - m_audioCodec(other.m_audioCodec), - m_videoCodec(other.m_videoCodec), - m_container(other.m_container), - m_isVideoDirect(other.m_isVideoDirect), - m_isAudioDirect(other.m_isAudioDirect), - m_bitrate(other.m_bitrate), - m_framerate(other.m_framerate), - m_completionPercentage(other.m_completionPercentage), - m_width(other.m_width), - m_height(other.m_height), - m_audioChannels(other.m_audioChannels), - m_transcodeReasons(other.m_transcodeReasons){} - -TranscodingInfo TranscodingInfo::fromJson(QJsonObject source) { - TranscodingInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TranscodingInfo::setFromJson(QJsonObject source) { - m_audioCodec = Jellyfin::Support::fromJsonValue(source["AudioCodec"]); - m_videoCodec = Jellyfin::Support::fromJsonValue(source["VideoCodec"]); - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_isVideoDirect = Jellyfin::Support::fromJsonValue(source["IsVideoDirect"]); - m_isAudioDirect = Jellyfin::Support::fromJsonValue(source["IsAudioDirect"]); - m_bitrate = Jellyfin::Support::fromJsonValue(source["Bitrate"]); - m_framerate = Jellyfin::Support::fromJsonValue(source["Framerate"]); - m_completionPercentage = Jellyfin::Support::fromJsonValue(source["CompletionPercentage"]); - m_width = Jellyfin::Support::fromJsonValue(source["Width"]); - m_height = Jellyfin::Support::fromJsonValue(source["Height"]); - m_audioChannels = Jellyfin::Support::fromJsonValue(source["AudioChannels"]); - m_transcodeReasons = Jellyfin::Support::fromJsonValue>(source["TranscodeReasons"]); - -} - -QJsonObject TranscodingInfo::toJson() { - QJsonObject result; - result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); - result["VideoCodec"] = Jellyfin::Support::toJsonValue(m_videoCodec); - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["IsVideoDirect"] = Jellyfin::Support::toJsonValue(m_isVideoDirect); - result["IsAudioDirect"] = Jellyfin::Support::toJsonValue(m_isAudioDirect); - result["Bitrate"] = Jellyfin::Support::toJsonValue(m_bitrate); - result["Framerate"] = Jellyfin::Support::toJsonValue(m_framerate); - result["CompletionPercentage"] = Jellyfin::Support::toJsonValue(m_completionPercentage); - result["Width"] = Jellyfin::Support::toJsonValue(m_width); - result["Height"] = Jellyfin::Support::toJsonValue(m_height); - result["AudioChannels"] = Jellyfin::Support::toJsonValue(m_audioChannels); - result["TranscodeReasons"] = Jellyfin::Support::toJsonValue>(m_transcodeReasons); - - return result; -} - -QString TranscodingInfo::audioCodec() const { return m_audioCodec; } - -void TranscodingInfo::setAudioCodec(QString newAudioCodec) { - m_audioCodec = newAudioCodec; -} -QString TranscodingInfo::videoCodec() const { return m_videoCodec; } - -void TranscodingInfo::setVideoCodec(QString newVideoCodec) { - m_videoCodec = newVideoCodec; -} -QString TranscodingInfo::container() const { return m_container; } - -void TranscodingInfo::setContainer(QString newContainer) { - m_container = newContainer; -} -bool TranscodingInfo::isVideoDirect() const { return m_isVideoDirect; } - -void TranscodingInfo::setIsVideoDirect(bool newIsVideoDirect) { - m_isVideoDirect = newIsVideoDirect; -} -bool TranscodingInfo::isAudioDirect() const { return m_isAudioDirect; } - -void TranscodingInfo::setIsAudioDirect(bool newIsAudioDirect) { - m_isAudioDirect = newIsAudioDirect; -} -qint32 TranscodingInfo::bitrate() const { return m_bitrate; } - -void TranscodingInfo::setBitrate(qint32 newBitrate) { - m_bitrate = newBitrate; -} -float TranscodingInfo::framerate() const { return m_framerate; } - -void TranscodingInfo::setFramerate(float newFramerate) { - m_framerate = newFramerate; -} -double TranscodingInfo::completionPercentage() const { return m_completionPercentage; } - -void TranscodingInfo::setCompletionPercentage(double newCompletionPercentage) { - m_completionPercentage = newCompletionPercentage; -} -qint32 TranscodingInfo::width() const { return m_width; } - -void TranscodingInfo::setWidth(qint32 newWidth) { - m_width = newWidth; -} -qint32 TranscodingInfo::height() const { return m_height; } - -void TranscodingInfo::setHeight(qint32 newHeight) { - m_height = newHeight; -} -qint32 TranscodingInfo::audioChannels() const { return m_audioChannels; } - -void TranscodingInfo::setAudioChannels(qint32 newAudioChannels) { - m_audioChannels = newAudioChannels; -} -QList TranscodingInfo::transcodeReasons() const { return m_transcodeReasons; } - -void TranscodingInfo::setTranscodeReasons(QList newTranscodeReasons) { - m_transcodeReasons = newTranscodeReasons; -} - -} // NS DTO - -namespace Support { - -using TranscodingInfo = Jellyfin::DTO::TranscodingInfo; - -template <> -TranscodingInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TranscodingInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/transcodingprofile.cpp b/core/src/DTO/transcodingprofile.cpp deleted file mode 100644 index 7a3c7e1..0000000 --- a/core/src/DTO/transcodingprofile.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TranscodingProfile::TranscodingProfile() {} -TranscodingProfile::TranscodingProfile(const TranscodingProfile &other) : - m_container(other.m_container), - m_type(other.m_type), - m_videoCodec(other.m_videoCodec), - m_audioCodec(other.m_audioCodec), - m_protocol(other.m_protocol), - m_estimateContentLength(other.m_estimateContentLength), - m_enableMpegtsM2TsMode(other.m_enableMpegtsM2TsMode), - m_transcodeSeekInfo(other.m_transcodeSeekInfo), - m_copyTimestamps(other.m_copyTimestamps), - m_context(other.m_context), - m_enableSubtitlesInManifest(other.m_enableSubtitlesInManifest), - m_maxAudioChannels(other.m_maxAudioChannels), - m_minSegments(other.m_minSegments), - m_segmentLength(other.m_segmentLength), - m_breakOnNonKeyFrames(other.m_breakOnNonKeyFrames){} - -TranscodingProfile TranscodingProfile::fromJson(QJsonObject source) { - TranscodingProfile instance; - instance.setFromJson(source); - return instance; -} - - -void TranscodingProfile::setFromJson(QJsonObject source) { - m_container = Jellyfin::Support::fromJsonValue(source["Container"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_videoCodec = Jellyfin::Support::fromJsonValue(source["VideoCodec"]); - m_audioCodec = Jellyfin::Support::fromJsonValue(source["AudioCodec"]); - m_protocol = Jellyfin::Support::fromJsonValue(source["Protocol"]); - m_estimateContentLength = Jellyfin::Support::fromJsonValue(source["EstimateContentLength"]); - m_enableMpegtsM2TsMode = Jellyfin::Support::fromJsonValue(source["EnableMpegtsM2TsMode"]); - m_transcodeSeekInfo = Jellyfin::Support::fromJsonValue(source["TranscodeSeekInfo"]); - m_copyTimestamps = Jellyfin::Support::fromJsonValue(source["CopyTimestamps"]); - m_context = Jellyfin::Support::fromJsonValue(source["Context"]); - m_enableSubtitlesInManifest = Jellyfin::Support::fromJsonValue(source["EnableSubtitlesInManifest"]); - m_maxAudioChannels = Jellyfin::Support::fromJsonValue(source["MaxAudioChannels"]); - m_minSegments = Jellyfin::Support::fromJsonValue(source["MinSegments"]); - m_segmentLength = Jellyfin::Support::fromJsonValue(source["SegmentLength"]); - m_breakOnNonKeyFrames = Jellyfin::Support::fromJsonValue(source["BreakOnNonKeyFrames"]); - -} - -QJsonObject TranscodingProfile::toJson() { - QJsonObject result; - result["Container"] = Jellyfin::Support::toJsonValue(m_container); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["VideoCodec"] = Jellyfin::Support::toJsonValue(m_videoCodec); - result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); - result["Protocol"] = Jellyfin::Support::toJsonValue(m_protocol); - result["EstimateContentLength"] = Jellyfin::Support::toJsonValue(m_estimateContentLength); - result["EnableMpegtsM2TsMode"] = Jellyfin::Support::toJsonValue(m_enableMpegtsM2TsMode); - result["TranscodeSeekInfo"] = Jellyfin::Support::toJsonValue(m_transcodeSeekInfo); - result["CopyTimestamps"] = Jellyfin::Support::toJsonValue(m_copyTimestamps); - result["Context"] = Jellyfin::Support::toJsonValue(m_context); - result["EnableSubtitlesInManifest"] = Jellyfin::Support::toJsonValue(m_enableSubtitlesInManifest); - result["MaxAudioChannels"] = Jellyfin::Support::toJsonValue(m_maxAudioChannels); - result["MinSegments"] = Jellyfin::Support::toJsonValue(m_minSegments); - result["SegmentLength"] = Jellyfin::Support::toJsonValue(m_segmentLength); - result["BreakOnNonKeyFrames"] = Jellyfin::Support::toJsonValue(m_breakOnNonKeyFrames); - - return result; -} - -QString TranscodingProfile::container() const { return m_container; } - -void TranscodingProfile::setContainer(QString newContainer) { - m_container = newContainer; -} -DlnaProfileType TranscodingProfile::type() const { return m_type; } - -void TranscodingProfile::setType(DlnaProfileType newType) { - m_type = newType; -} -QString TranscodingProfile::videoCodec() const { return m_videoCodec; } - -void TranscodingProfile::setVideoCodec(QString newVideoCodec) { - m_videoCodec = newVideoCodec; -} -QString TranscodingProfile::audioCodec() const { return m_audioCodec; } - -void TranscodingProfile::setAudioCodec(QString newAudioCodec) { - m_audioCodec = newAudioCodec; -} -QString TranscodingProfile::protocol() const { return m_protocol; } - -void TranscodingProfile::setProtocol(QString newProtocol) { - m_protocol = newProtocol; -} -bool TranscodingProfile::estimateContentLength() const { return m_estimateContentLength; } - -void TranscodingProfile::setEstimateContentLength(bool newEstimateContentLength) { - m_estimateContentLength = newEstimateContentLength; -} -bool TranscodingProfile::enableMpegtsM2TsMode() const { return m_enableMpegtsM2TsMode; } - -void TranscodingProfile::setEnableMpegtsM2TsMode(bool newEnableMpegtsM2TsMode) { - m_enableMpegtsM2TsMode = newEnableMpegtsM2TsMode; -} -TranscodeSeekInfo TranscodingProfile::transcodeSeekInfo() const { return m_transcodeSeekInfo; } - -void TranscodingProfile::setTranscodeSeekInfo(TranscodeSeekInfo newTranscodeSeekInfo) { - m_transcodeSeekInfo = newTranscodeSeekInfo; -} -bool TranscodingProfile::copyTimestamps() const { return m_copyTimestamps; } - -void TranscodingProfile::setCopyTimestamps(bool newCopyTimestamps) { - m_copyTimestamps = newCopyTimestamps; -} -EncodingContext TranscodingProfile::context() const { return m_context; } - -void TranscodingProfile::setContext(EncodingContext newContext) { - m_context = newContext; -} -bool TranscodingProfile::enableSubtitlesInManifest() const { return m_enableSubtitlesInManifest; } - -void TranscodingProfile::setEnableSubtitlesInManifest(bool newEnableSubtitlesInManifest) { - m_enableSubtitlesInManifest = newEnableSubtitlesInManifest; -} -QString TranscodingProfile::maxAudioChannels() const { return m_maxAudioChannels; } - -void TranscodingProfile::setMaxAudioChannels(QString newMaxAudioChannels) { - m_maxAudioChannels = newMaxAudioChannels; -} -qint32 TranscodingProfile::minSegments() const { return m_minSegments; } - -void TranscodingProfile::setMinSegments(qint32 newMinSegments) { - m_minSegments = newMinSegments; -} -qint32 TranscodingProfile::segmentLength() const { return m_segmentLength; } - -void TranscodingProfile::setSegmentLength(qint32 newSegmentLength) { - m_segmentLength = newSegmentLength; -} -bool TranscodingProfile::breakOnNonKeyFrames() const { return m_breakOnNonKeyFrames; } - -void TranscodingProfile::setBreakOnNonKeyFrames(bool newBreakOnNonKeyFrames) { - m_breakOnNonKeyFrames = newBreakOnNonKeyFrames; -} - -} // NS DTO - -namespace Support { - -using TranscodingProfile = Jellyfin::DTO::TranscodingProfile; - -template <> -TranscodingProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TranscodingProfile::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/transportstreamtimestamp.cpp b/core/src/DTO/transportstreamtimestamp.cpp deleted file mode 100644 index 33a2529..0000000 --- a/core/src/DTO/transportstreamtimestamp.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TransportStreamTimestampClass::TransportStreamTimestampClass() {} - - -} // NS DTO - -namespace Support { - -using TransportStreamTimestamp = Jellyfin::DTO::TransportStreamTimestamp; - -template <> -TransportStreamTimestamp fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return TransportStreamTimestamp::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("None")) { - return TransportStreamTimestamp::None; - } - if (str == QStringLiteral("Zero")) { - return TransportStreamTimestamp::Zero; - } - if (str == QStringLiteral("Valid")) { - return TransportStreamTimestamp::Valid; - } - - return TransportStreamTimestamp::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/tunerchannelmapping.cpp b/core/src/DTO/tunerchannelmapping.cpp deleted file mode 100644 index 5d00e3c..0000000 --- a/core/src/DTO/tunerchannelmapping.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TunerChannelMapping::TunerChannelMapping() {} -TunerChannelMapping::TunerChannelMapping(const TunerChannelMapping &other) : - m_name(other.m_name), - m_providerChannelName(other.m_providerChannelName), - m_providerChannelId(other.m_providerChannelId), - m_jellyfinId(other.m_jellyfinId){} - -TunerChannelMapping TunerChannelMapping::fromJson(QJsonObject source) { - TunerChannelMapping instance; - instance.setFromJson(source); - return instance; -} - - -void TunerChannelMapping::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_providerChannelName = Jellyfin::Support::fromJsonValue(source["ProviderChannelName"]); - m_providerChannelId = Jellyfin::Support::fromJsonValue(source["ProviderChannelId"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - -} - -QJsonObject TunerChannelMapping::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ProviderChannelName"] = Jellyfin::Support::toJsonValue(m_providerChannelName); - result["ProviderChannelId"] = Jellyfin::Support::toJsonValue(m_providerChannelId); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - - return result; -} - -QString TunerChannelMapping::name() const { return m_name; } - -void TunerChannelMapping::setName(QString newName) { - m_name = newName; -} -QString TunerChannelMapping::providerChannelName() const { return m_providerChannelName; } - -void TunerChannelMapping::setProviderChannelName(QString newProviderChannelName) { - m_providerChannelName = newProviderChannelName; -} -QString TunerChannelMapping::providerChannelId() const { return m_providerChannelId; } - -void TunerChannelMapping::setProviderChannelId(QString newProviderChannelId) { - m_providerChannelId = newProviderChannelId; -} -QString TunerChannelMapping::jellyfinId() const { return m_jellyfinId; } - -void TunerChannelMapping::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} - -} // NS DTO - -namespace Support { - -using TunerChannelMapping = Jellyfin::DTO::TunerChannelMapping; - -template <> -TunerChannelMapping fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TunerChannelMapping::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/tunerhostinfo.cpp b/core/src/DTO/tunerhostinfo.cpp deleted file mode 100644 index 982f4df..0000000 --- a/core/src/DTO/tunerhostinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TunerHostInfo::TunerHostInfo() {} -TunerHostInfo::TunerHostInfo(const TunerHostInfo &other) : - m_jellyfinId(other.m_jellyfinId), - m_url(other.m_url), - m_type(other.m_type), - m_deviceId(other.m_deviceId), - m_friendlyName(other.m_friendlyName), - m_importFavoritesOnly(other.m_importFavoritesOnly), - m_allowHWTranscoding(other.m_allowHWTranscoding), - m_enableStreamLooping(other.m_enableStreamLooping), - m_source(other.m_source), - m_tunerCount(other.m_tunerCount), - m_userAgent(other.m_userAgent){} - -TunerHostInfo TunerHostInfo::fromJson(QJsonObject source) { - TunerHostInfo instance; - instance.setFromJson(source); - return instance; -} - - -void TunerHostInfo::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_url = Jellyfin::Support::fromJsonValue(source["Url"]); - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_deviceId = Jellyfin::Support::fromJsonValue(source["DeviceId"]); - m_friendlyName = Jellyfin::Support::fromJsonValue(source["FriendlyName"]); - m_importFavoritesOnly = Jellyfin::Support::fromJsonValue(source["ImportFavoritesOnly"]); - m_allowHWTranscoding = Jellyfin::Support::fromJsonValue(source["AllowHWTranscoding"]); - m_enableStreamLooping = Jellyfin::Support::fromJsonValue(source["EnableStreamLooping"]); - m_source = Jellyfin::Support::fromJsonValue(source["Source"]); - m_tunerCount = Jellyfin::Support::fromJsonValue(source["TunerCount"]); - m_userAgent = Jellyfin::Support::fromJsonValue(source["UserAgent"]); - -} - -QJsonObject TunerHostInfo::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["Url"] = Jellyfin::Support::toJsonValue(m_url); - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["DeviceId"] = Jellyfin::Support::toJsonValue(m_deviceId); - result["FriendlyName"] = Jellyfin::Support::toJsonValue(m_friendlyName); - result["ImportFavoritesOnly"] = Jellyfin::Support::toJsonValue(m_importFavoritesOnly); - result["AllowHWTranscoding"] = Jellyfin::Support::toJsonValue(m_allowHWTranscoding); - result["EnableStreamLooping"] = Jellyfin::Support::toJsonValue(m_enableStreamLooping); - result["Source"] = Jellyfin::Support::toJsonValue(m_source); - result["TunerCount"] = Jellyfin::Support::toJsonValue(m_tunerCount); - result["UserAgent"] = Jellyfin::Support::toJsonValue(m_userAgent); - - return result; -} - -QString TunerHostInfo::jellyfinId() const { return m_jellyfinId; } - -void TunerHostInfo::setJellyfinId(QString newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString TunerHostInfo::url() const { return m_url; } - -void TunerHostInfo::setUrl(QString newUrl) { - m_url = newUrl; -} -QString TunerHostInfo::type() const { return m_type; } - -void TunerHostInfo::setType(QString newType) { - m_type = newType; -} -QString TunerHostInfo::deviceId() const { return m_deviceId; } - -void TunerHostInfo::setDeviceId(QString newDeviceId) { - m_deviceId = newDeviceId; -} -QString TunerHostInfo::friendlyName() const { return m_friendlyName; } - -void TunerHostInfo::setFriendlyName(QString newFriendlyName) { - m_friendlyName = newFriendlyName; -} -bool TunerHostInfo::importFavoritesOnly() const { return m_importFavoritesOnly; } - -void TunerHostInfo::setImportFavoritesOnly(bool newImportFavoritesOnly) { - m_importFavoritesOnly = newImportFavoritesOnly; -} -bool TunerHostInfo::allowHWTranscoding() const { return m_allowHWTranscoding; } - -void TunerHostInfo::setAllowHWTranscoding(bool newAllowHWTranscoding) { - m_allowHWTranscoding = newAllowHWTranscoding; -} -bool TunerHostInfo::enableStreamLooping() const { return m_enableStreamLooping; } - -void TunerHostInfo::setEnableStreamLooping(bool newEnableStreamLooping) { - m_enableStreamLooping = newEnableStreamLooping; -} -QString TunerHostInfo::source() const { return m_source; } - -void TunerHostInfo::setSource(QString newSource) { - m_source = newSource; -} -qint32 TunerHostInfo::tunerCount() const { return m_tunerCount; } - -void TunerHostInfo::setTunerCount(qint32 newTunerCount) { - m_tunerCount = newTunerCount; -} -QString TunerHostInfo::userAgent() const { return m_userAgent; } - -void TunerHostInfo::setUserAgent(QString newUserAgent) { - m_userAgent = newUserAgent; -} - -} // NS DTO - -namespace Support { - -using TunerHostInfo = Jellyfin::DTO::TunerHostInfo; - -template <> -TunerHostInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TunerHostInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/typeoptions.cpp b/core/src/DTO/typeoptions.cpp deleted file mode 100644 index aa3e935..0000000 --- a/core/src/DTO/typeoptions.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -TypeOptions::TypeOptions() {} -TypeOptions::TypeOptions(const TypeOptions &other) : - m_type(other.m_type), - m_metadataFetchers(other.m_metadataFetchers), - m_metadataFetcherOrder(other.m_metadataFetcherOrder), - m_imageFetchers(other.m_imageFetchers), - m_imageFetcherOrder(other.m_imageFetcherOrder), - m_imageOptions(other.m_imageOptions){} - -TypeOptions TypeOptions::fromJson(QJsonObject source) { - TypeOptions instance; - instance.setFromJson(source); - return instance; -} - - -void TypeOptions::setFromJson(QJsonObject source) { - m_type = Jellyfin::Support::fromJsonValue(source["Type"]); - m_metadataFetchers = Jellyfin::Support::fromJsonValue(source["MetadataFetchers"]); - m_metadataFetcherOrder = Jellyfin::Support::fromJsonValue(source["MetadataFetcherOrder"]); - m_imageFetchers = Jellyfin::Support::fromJsonValue(source["ImageFetchers"]); - m_imageFetcherOrder = Jellyfin::Support::fromJsonValue(source["ImageFetcherOrder"]); - m_imageOptions = Jellyfin::Support::fromJsonValue>>(source["ImageOptions"]); - -} - -QJsonObject TypeOptions::toJson() { - QJsonObject result; - result["Type"] = Jellyfin::Support::toJsonValue(m_type); - result["MetadataFetchers"] = Jellyfin::Support::toJsonValue(m_metadataFetchers); - result["MetadataFetcherOrder"] = Jellyfin::Support::toJsonValue(m_metadataFetcherOrder); - result["ImageFetchers"] = Jellyfin::Support::toJsonValue(m_imageFetchers); - result["ImageFetcherOrder"] = Jellyfin::Support::toJsonValue(m_imageFetcherOrder); - result["ImageOptions"] = Jellyfin::Support::toJsonValue>>(m_imageOptions); - - return result; -} - -QString TypeOptions::type() const { return m_type; } - -void TypeOptions::setType(QString newType) { - m_type = newType; -} -QStringList TypeOptions::metadataFetchers() const { return m_metadataFetchers; } - -void TypeOptions::setMetadataFetchers(QStringList newMetadataFetchers) { - m_metadataFetchers = newMetadataFetchers; -} -QStringList TypeOptions::metadataFetcherOrder() const { return m_metadataFetcherOrder; } - -void TypeOptions::setMetadataFetcherOrder(QStringList newMetadataFetcherOrder) { - m_metadataFetcherOrder = newMetadataFetcherOrder; -} -QStringList TypeOptions::imageFetchers() const { return m_imageFetchers; } - -void TypeOptions::setImageFetchers(QStringList newImageFetchers) { - m_imageFetchers = newImageFetchers; -} -QStringList TypeOptions::imageFetcherOrder() const { return m_imageFetcherOrder; } - -void TypeOptions::setImageFetcherOrder(QStringList newImageFetcherOrder) { - m_imageFetcherOrder = newImageFetcherOrder; -} -QList> TypeOptions::imageOptions() const { return m_imageOptions; } - -void TypeOptions::setImageOptions(QList> newImageOptions) { - m_imageOptions = newImageOptions; -} - -} // NS DTO - -namespace Support { - -using TypeOptions = Jellyfin::DTO::TypeOptions; - -template <> -TypeOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return TypeOptions::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/unrateditem.cpp b/core/src/DTO/unrateditem.cpp deleted file mode 100644 index 6ba2558..0000000 --- a/core/src/DTO/unrateditem.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UnratedItemClass::UnratedItemClass() {} - - -} // NS DTO - -namespace Support { - -using UnratedItem = Jellyfin::DTO::UnratedItem; - -template <> -UnratedItem fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return UnratedItem::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("Movie")) { - return UnratedItem::Movie; - } - if (str == QStringLiteral("Trailer")) { - return UnratedItem::Trailer; - } - if (str == QStringLiteral("Series")) { - return UnratedItem::Series; - } - if (str == QStringLiteral("Music")) { - return UnratedItem::Music; - } - if (str == QStringLiteral("Book")) { - return UnratedItem::Book; - } - if (str == QStringLiteral("LiveTvChannel")) { - return UnratedItem::LiveTvChannel; - } - if (str == QStringLiteral("LiveTvProgram")) { - return UnratedItem::LiveTvProgram; - } - if (str == QStringLiteral("ChannelContent")) { - return UnratedItem::ChannelContent; - } - if (str == QStringLiteral("Other")) { - return UnratedItem::Other; - } - - return UnratedItem::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/updatelibraryoptionsdto.cpp b/core/src/DTO/updatelibraryoptionsdto.cpp deleted file mode 100644 index 364dde3..0000000 --- a/core/src/DTO/updatelibraryoptionsdto.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UpdateLibraryOptionsDto::UpdateLibraryOptionsDto() {} -UpdateLibraryOptionsDto::UpdateLibraryOptionsDto(const UpdateLibraryOptionsDto &other) : - m_jellyfinId(other.m_jellyfinId), - m_libraryOptions(other.m_libraryOptions){} - -UpdateLibraryOptionsDto UpdateLibraryOptionsDto::fromJson(QJsonObject source) { - UpdateLibraryOptionsDto instance; - instance.setFromJson(source); - return instance; -} - - -void UpdateLibraryOptionsDto::setFromJson(QJsonObject source) { - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_libraryOptions = Jellyfin::Support::fromJsonValue>(source["LibraryOptions"]); - -} - -QJsonObject UpdateLibraryOptionsDto::toJson() { - QJsonObject result; - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["LibraryOptions"] = Jellyfin::Support::toJsonValue>(m_libraryOptions); - - return result; -} - -QUuid UpdateLibraryOptionsDto::jellyfinId() const { return m_jellyfinId; } - -void UpdateLibraryOptionsDto::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QSharedPointer UpdateLibraryOptionsDto::libraryOptions() const { return m_libraryOptions; } - -void UpdateLibraryOptionsDto::setLibraryOptions(QSharedPointer newLibraryOptions) { - m_libraryOptions = newLibraryOptions; -} - -} // NS DTO - -namespace Support { - -using UpdateLibraryOptionsDto = Jellyfin::DTO::UpdateLibraryOptionsDto; - -template <> -UpdateLibraryOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UpdateLibraryOptionsDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/updateusereasypassword.cpp b/core/src/DTO/updateusereasypassword.cpp deleted file mode 100644 index 35c1cf5..0000000 --- a/core/src/DTO/updateusereasypassword.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UpdateUserEasyPassword::UpdateUserEasyPassword() {} -UpdateUserEasyPassword::UpdateUserEasyPassword(const UpdateUserEasyPassword &other) : - m_newPassword(other.m_newPassword), - m_newPw(other.m_newPw), - m_resetPassword(other.m_resetPassword){} - -UpdateUserEasyPassword UpdateUserEasyPassword::fromJson(QJsonObject source) { - UpdateUserEasyPassword instance; - instance.setFromJson(source); - return instance; -} - - -void UpdateUserEasyPassword::setFromJson(QJsonObject source) { - m_newPassword = Jellyfin::Support::fromJsonValue(source["NewPassword"]); - m_newPw = Jellyfin::Support::fromJsonValue(source["NewPw"]); - m_resetPassword = Jellyfin::Support::fromJsonValue(source["ResetPassword"]); - -} - -QJsonObject UpdateUserEasyPassword::toJson() { - QJsonObject result; - result["NewPassword"] = Jellyfin::Support::toJsonValue(m_newPassword); - result["NewPw"] = Jellyfin::Support::toJsonValue(m_newPw); - result["ResetPassword"] = Jellyfin::Support::toJsonValue(m_resetPassword); - - return result; -} - -QString UpdateUserEasyPassword::newPassword() const { return m_newPassword; } - -void UpdateUserEasyPassword::setNewPassword(QString newNewPassword) { - m_newPassword = newNewPassword; -} -QString UpdateUserEasyPassword::newPw() const { return m_newPw; } - -void UpdateUserEasyPassword::setNewPw(QString newNewPw) { - m_newPw = newNewPw; -} -bool UpdateUserEasyPassword::resetPassword() const { return m_resetPassword; } - -void UpdateUserEasyPassword::setResetPassword(bool newResetPassword) { - m_resetPassword = newResetPassword; -} - -} // NS DTO - -namespace Support { - -using UpdateUserEasyPassword = Jellyfin::DTO::UpdateUserEasyPassword; - -template <> -UpdateUserEasyPassword fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UpdateUserEasyPassword::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/updateuserpassword.cpp b/core/src/DTO/updateuserpassword.cpp deleted file mode 100644 index 6da19fd..0000000 --- a/core/src/DTO/updateuserpassword.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UpdateUserPassword::UpdateUserPassword() {} -UpdateUserPassword::UpdateUserPassword(const UpdateUserPassword &other) : - m_currentPassword(other.m_currentPassword), - m_currentPw(other.m_currentPw), - m_newPw(other.m_newPw), - m_resetPassword(other.m_resetPassword){} - -UpdateUserPassword UpdateUserPassword::fromJson(QJsonObject source) { - UpdateUserPassword instance; - instance.setFromJson(source); - return instance; -} - - -void UpdateUserPassword::setFromJson(QJsonObject source) { - m_currentPassword = Jellyfin::Support::fromJsonValue(source["CurrentPassword"]); - m_currentPw = Jellyfin::Support::fromJsonValue(source["CurrentPw"]); - m_newPw = Jellyfin::Support::fromJsonValue(source["NewPw"]); - m_resetPassword = Jellyfin::Support::fromJsonValue(source["ResetPassword"]); - -} - -QJsonObject UpdateUserPassword::toJson() { - QJsonObject result; - result["CurrentPassword"] = Jellyfin::Support::toJsonValue(m_currentPassword); - result["CurrentPw"] = Jellyfin::Support::toJsonValue(m_currentPw); - result["NewPw"] = Jellyfin::Support::toJsonValue(m_newPw); - result["ResetPassword"] = Jellyfin::Support::toJsonValue(m_resetPassword); - - return result; -} - -QString UpdateUserPassword::currentPassword() const { return m_currentPassword; } - -void UpdateUserPassword::setCurrentPassword(QString newCurrentPassword) { - m_currentPassword = newCurrentPassword; -} -QString UpdateUserPassword::currentPw() const { return m_currentPw; } - -void UpdateUserPassword::setCurrentPw(QString newCurrentPw) { - m_currentPw = newCurrentPw; -} -QString UpdateUserPassword::newPw() const { return m_newPw; } - -void UpdateUserPassword::setNewPw(QString newNewPw) { - m_newPw = newNewPw; -} -bool UpdateUserPassword::resetPassword() const { return m_resetPassword; } - -void UpdateUserPassword::setResetPassword(bool newResetPassword) { - m_resetPassword = newResetPassword; -} - -} // NS DTO - -namespace Support { - -using UpdateUserPassword = Jellyfin::DTO::UpdateUserPassword; - -template <> -UpdateUserPassword fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UpdateUserPassword::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/uploadsubtitledto.cpp b/core/src/DTO/uploadsubtitledto.cpp deleted file mode 100644 index d89b3d5..0000000 --- a/core/src/DTO/uploadsubtitledto.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UploadSubtitleDto::UploadSubtitleDto() {} -UploadSubtitleDto::UploadSubtitleDto(const UploadSubtitleDto &other) : - m_language(other.m_language), - m_format(other.m_format), - m_isForced(other.m_isForced), - m_data(other.m_data){} - -UploadSubtitleDto UploadSubtitleDto::fromJson(QJsonObject source) { - UploadSubtitleDto instance; - instance.setFromJson(source); - return instance; -} - - -void UploadSubtitleDto::setFromJson(QJsonObject source) { - m_language = Jellyfin::Support::fromJsonValue(source["Language"]); - m_format = Jellyfin::Support::fromJsonValue(source["Format"]); - m_isForced = Jellyfin::Support::fromJsonValue(source["IsForced"]); - m_data = Jellyfin::Support::fromJsonValue(source["Data"]); - -} - -QJsonObject UploadSubtitleDto::toJson() { - QJsonObject result; - result["Language"] = Jellyfin::Support::toJsonValue(m_language); - result["Format"] = Jellyfin::Support::toJsonValue(m_format); - result["IsForced"] = Jellyfin::Support::toJsonValue(m_isForced); - result["Data"] = Jellyfin::Support::toJsonValue(m_data); - - return result; -} - -QString UploadSubtitleDto::language() const { return m_language; } - -void UploadSubtitleDto::setLanguage(QString newLanguage) { - m_language = newLanguage; -} -QString UploadSubtitleDto::format() const { return m_format; } - -void UploadSubtitleDto::setFormat(QString newFormat) { - m_format = newFormat; -} -bool UploadSubtitleDto::isForced() const { return m_isForced; } - -void UploadSubtitleDto::setIsForced(bool newIsForced) { - m_isForced = newIsForced; -} -QString UploadSubtitleDto::data() const { return m_data; } - -void UploadSubtitleDto::setData(QString newData) { - m_data = newData; -} - -} // NS DTO - -namespace Support { - -using UploadSubtitleDto = Jellyfin::DTO::UploadSubtitleDto; - -template <> -UploadSubtitleDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UploadSubtitleDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/userconfiguration.cpp b/core/src/DTO/userconfiguration.cpp deleted file mode 100644 index c09cde3..0000000 --- a/core/src/DTO/userconfiguration.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UserConfiguration::UserConfiguration() {} -UserConfiguration::UserConfiguration(const UserConfiguration &other) : - m_audioLanguagePreference(other.m_audioLanguagePreference), - m_playDefaultAudioTrack(other.m_playDefaultAudioTrack), - m_subtitleLanguagePreference(other.m_subtitleLanguagePreference), - m_displayMissingEpisodes(other.m_displayMissingEpisodes), - m_groupedFolders(other.m_groupedFolders), - m_subtitleMode(other.m_subtitleMode), - m_displayCollectionsView(other.m_displayCollectionsView), - m_enableLocalPassword(other.m_enableLocalPassword), - m_orderedViews(other.m_orderedViews), - m_latestItemsExcludes(other.m_latestItemsExcludes), - m_myMediaExcludes(other.m_myMediaExcludes), - m_hidePlayedInLatest(other.m_hidePlayedInLatest), - m_rememberAudioSelections(other.m_rememberAudioSelections), - m_rememberSubtitleSelections(other.m_rememberSubtitleSelections), - m_enableNextEpisodeAutoPlay(other.m_enableNextEpisodeAutoPlay){} - -UserConfiguration UserConfiguration::fromJson(QJsonObject source) { - UserConfiguration instance; - instance.setFromJson(source); - return instance; -} - - -void UserConfiguration::setFromJson(QJsonObject source) { - m_audioLanguagePreference = Jellyfin::Support::fromJsonValue(source["AudioLanguagePreference"]); - m_playDefaultAudioTrack = Jellyfin::Support::fromJsonValue(source["PlayDefaultAudioTrack"]); - m_subtitleLanguagePreference = Jellyfin::Support::fromJsonValue(source["SubtitleLanguagePreference"]); - m_displayMissingEpisodes = Jellyfin::Support::fromJsonValue(source["DisplayMissingEpisodes"]); - m_groupedFolders = Jellyfin::Support::fromJsonValue(source["GroupedFolders"]); - m_subtitleMode = Jellyfin::Support::fromJsonValue(source["SubtitleMode"]); - m_displayCollectionsView = Jellyfin::Support::fromJsonValue(source["DisplayCollectionsView"]); - m_enableLocalPassword = Jellyfin::Support::fromJsonValue(source["EnableLocalPassword"]); - m_orderedViews = Jellyfin::Support::fromJsonValue(source["OrderedViews"]); - m_latestItemsExcludes = Jellyfin::Support::fromJsonValue(source["LatestItemsExcludes"]); - m_myMediaExcludes = Jellyfin::Support::fromJsonValue(source["MyMediaExcludes"]); - m_hidePlayedInLatest = Jellyfin::Support::fromJsonValue(source["HidePlayedInLatest"]); - m_rememberAudioSelections = Jellyfin::Support::fromJsonValue(source["RememberAudioSelections"]); - m_rememberSubtitleSelections = Jellyfin::Support::fromJsonValue(source["RememberSubtitleSelections"]); - m_enableNextEpisodeAutoPlay = Jellyfin::Support::fromJsonValue(source["EnableNextEpisodeAutoPlay"]); - -} - -QJsonObject UserConfiguration::toJson() { - QJsonObject result; - result["AudioLanguagePreference"] = Jellyfin::Support::toJsonValue(m_audioLanguagePreference); - result["PlayDefaultAudioTrack"] = Jellyfin::Support::toJsonValue(m_playDefaultAudioTrack); - result["SubtitleLanguagePreference"] = Jellyfin::Support::toJsonValue(m_subtitleLanguagePreference); - result["DisplayMissingEpisodes"] = Jellyfin::Support::toJsonValue(m_displayMissingEpisodes); - result["GroupedFolders"] = Jellyfin::Support::toJsonValue(m_groupedFolders); - result["SubtitleMode"] = Jellyfin::Support::toJsonValue(m_subtitleMode); - result["DisplayCollectionsView"] = Jellyfin::Support::toJsonValue(m_displayCollectionsView); - result["EnableLocalPassword"] = Jellyfin::Support::toJsonValue(m_enableLocalPassword); - result["OrderedViews"] = Jellyfin::Support::toJsonValue(m_orderedViews); - result["LatestItemsExcludes"] = Jellyfin::Support::toJsonValue(m_latestItemsExcludes); - result["MyMediaExcludes"] = Jellyfin::Support::toJsonValue(m_myMediaExcludes); - result["HidePlayedInLatest"] = Jellyfin::Support::toJsonValue(m_hidePlayedInLatest); - result["RememberAudioSelections"] = Jellyfin::Support::toJsonValue(m_rememberAudioSelections); - result["RememberSubtitleSelections"] = Jellyfin::Support::toJsonValue(m_rememberSubtitleSelections); - result["EnableNextEpisodeAutoPlay"] = Jellyfin::Support::toJsonValue(m_enableNextEpisodeAutoPlay); - - return result; -} - -QString UserConfiguration::audioLanguagePreference() const { return m_audioLanguagePreference; } - -void UserConfiguration::setAudioLanguagePreference(QString newAudioLanguagePreference) { - m_audioLanguagePreference = newAudioLanguagePreference; -} -bool UserConfiguration::playDefaultAudioTrack() const { return m_playDefaultAudioTrack; } - -void UserConfiguration::setPlayDefaultAudioTrack(bool newPlayDefaultAudioTrack) { - m_playDefaultAudioTrack = newPlayDefaultAudioTrack; -} -QString UserConfiguration::subtitleLanguagePreference() const { return m_subtitleLanguagePreference; } - -void UserConfiguration::setSubtitleLanguagePreference(QString newSubtitleLanguagePreference) { - m_subtitleLanguagePreference = newSubtitleLanguagePreference; -} -bool UserConfiguration::displayMissingEpisodes() const { return m_displayMissingEpisodes; } - -void UserConfiguration::setDisplayMissingEpisodes(bool newDisplayMissingEpisodes) { - m_displayMissingEpisodes = newDisplayMissingEpisodes; -} -QStringList UserConfiguration::groupedFolders() const { return m_groupedFolders; } - -void UserConfiguration::setGroupedFolders(QStringList newGroupedFolders) { - m_groupedFolders = newGroupedFolders; -} -SubtitlePlaybackMode UserConfiguration::subtitleMode() const { return m_subtitleMode; } - -void UserConfiguration::setSubtitleMode(SubtitlePlaybackMode newSubtitleMode) { - m_subtitleMode = newSubtitleMode; -} -bool UserConfiguration::displayCollectionsView() const { return m_displayCollectionsView; } - -void UserConfiguration::setDisplayCollectionsView(bool newDisplayCollectionsView) { - m_displayCollectionsView = newDisplayCollectionsView; -} -bool UserConfiguration::enableLocalPassword() const { return m_enableLocalPassword; } - -void UserConfiguration::setEnableLocalPassword(bool newEnableLocalPassword) { - m_enableLocalPassword = newEnableLocalPassword; -} -QStringList UserConfiguration::orderedViews() const { return m_orderedViews; } - -void UserConfiguration::setOrderedViews(QStringList newOrderedViews) { - m_orderedViews = newOrderedViews; -} -QStringList UserConfiguration::latestItemsExcludes() const { return m_latestItemsExcludes; } - -void UserConfiguration::setLatestItemsExcludes(QStringList newLatestItemsExcludes) { - m_latestItemsExcludes = newLatestItemsExcludes; -} -QStringList UserConfiguration::myMediaExcludes() const { return m_myMediaExcludes; } - -void UserConfiguration::setMyMediaExcludes(QStringList newMyMediaExcludes) { - m_myMediaExcludes = newMyMediaExcludes; -} -bool UserConfiguration::hidePlayedInLatest() const { return m_hidePlayedInLatest; } - -void UserConfiguration::setHidePlayedInLatest(bool newHidePlayedInLatest) { - m_hidePlayedInLatest = newHidePlayedInLatest; -} -bool UserConfiguration::rememberAudioSelections() const { return m_rememberAudioSelections; } - -void UserConfiguration::setRememberAudioSelections(bool newRememberAudioSelections) { - m_rememberAudioSelections = newRememberAudioSelections; -} -bool UserConfiguration::rememberSubtitleSelections() const { return m_rememberSubtitleSelections; } - -void UserConfiguration::setRememberSubtitleSelections(bool newRememberSubtitleSelections) { - m_rememberSubtitleSelections = newRememberSubtitleSelections; -} -bool UserConfiguration::enableNextEpisodeAutoPlay() const { return m_enableNextEpisodeAutoPlay; } - -void UserConfiguration::setEnableNextEpisodeAutoPlay(bool newEnableNextEpisodeAutoPlay) { - m_enableNextEpisodeAutoPlay = newEnableNextEpisodeAutoPlay; -} - -} // NS DTO - -namespace Support { - -using UserConfiguration = Jellyfin::DTO::UserConfiguration; - -template <> -UserConfiguration fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UserConfiguration::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/userdto.cpp b/core/src/DTO/userdto.cpp deleted file mode 100644 index 7d38c0f..0000000 --- a/core/src/DTO/userdto.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UserDto::UserDto() {} -UserDto::UserDto(const UserDto &other) : - m_name(other.m_name), - m_serverId(other.m_serverId), - m_serverName(other.m_serverName), - m_jellyfinId(other.m_jellyfinId), - m_primaryImageTag(other.m_primaryImageTag), - m_hasPassword(other.m_hasPassword), - m_hasConfiguredPassword(other.m_hasConfiguredPassword), - m_hasConfiguredEasyPassword(other.m_hasConfiguredEasyPassword), - m_enableAutoLogin(other.m_enableAutoLogin), - m_lastLoginDate(other.m_lastLoginDate), - m_lastActivityDate(other.m_lastActivityDate), - m_configuration(other.m_configuration), - m_policy(other.m_policy), - m_primaryImageAspectRatio(other.m_primaryImageAspectRatio){} - -UserDto UserDto::fromJson(QJsonObject source) { - UserDto instance; - instance.setFromJson(source); - return instance; -} - - -void UserDto::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); - m_serverName = Jellyfin::Support::fromJsonValue(source["ServerName"]); - m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); - m_primaryImageTag = Jellyfin::Support::fromJsonValue(source["PrimaryImageTag"]); - m_hasPassword = Jellyfin::Support::fromJsonValue(source["HasPassword"]); - m_hasConfiguredPassword = Jellyfin::Support::fromJsonValue(source["HasConfiguredPassword"]); - m_hasConfiguredEasyPassword = Jellyfin::Support::fromJsonValue(source["HasConfiguredEasyPassword"]); - m_enableAutoLogin = Jellyfin::Support::fromJsonValue(source["EnableAutoLogin"]); - m_lastLoginDate = Jellyfin::Support::fromJsonValue(source["LastLoginDate"]); - m_lastActivityDate = Jellyfin::Support::fromJsonValue(source["LastActivityDate"]); - m_configuration = Jellyfin::Support::fromJsonValue>(source["Configuration"]); - m_policy = Jellyfin::Support::fromJsonValue>(source["Policy"]); - m_primaryImageAspectRatio = Jellyfin::Support::fromJsonValue(source["PrimaryImageAspectRatio"]); - -} - -QJsonObject UserDto::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); - result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); - result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); - result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_primaryImageTag); - result["HasPassword"] = Jellyfin::Support::toJsonValue(m_hasPassword); - result["HasConfiguredPassword"] = Jellyfin::Support::toJsonValue(m_hasConfiguredPassword); - result["HasConfiguredEasyPassword"] = Jellyfin::Support::toJsonValue(m_hasConfiguredEasyPassword); - result["EnableAutoLogin"] = Jellyfin::Support::toJsonValue(m_enableAutoLogin); - result["LastLoginDate"] = Jellyfin::Support::toJsonValue(m_lastLoginDate); - result["LastActivityDate"] = Jellyfin::Support::toJsonValue(m_lastActivityDate); - result["Configuration"] = Jellyfin::Support::toJsonValue>(m_configuration); - result["Policy"] = Jellyfin::Support::toJsonValue>(m_policy); - result["PrimaryImageAspectRatio"] = Jellyfin::Support::toJsonValue(m_primaryImageAspectRatio); - - return result; -} - -QString UserDto::name() const { return m_name; } - -void UserDto::setName(QString newName) { - m_name = newName; -} -QString UserDto::serverId() const { return m_serverId; } - -void UserDto::setServerId(QString newServerId) { - m_serverId = newServerId; -} -QString UserDto::serverName() const { return m_serverName; } - -void UserDto::setServerName(QString newServerName) { - m_serverName = newServerName; -} -QUuid UserDto::jellyfinId() const { return m_jellyfinId; } - -void UserDto::setJellyfinId(QUuid newJellyfinId) { - m_jellyfinId = newJellyfinId; -} -QString UserDto::primaryImageTag() const { return m_primaryImageTag; } - -void UserDto::setPrimaryImageTag(QString newPrimaryImageTag) { - m_primaryImageTag = newPrimaryImageTag; -} -bool UserDto::hasPassword() const { return m_hasPassword; } - -void UserDto::setHasPassword(bool newHasPassword) { - m_hasPassword = newHasPassword; -} -bool UserDto::hasConfiguredPassword() const { return m_hasConfiguredPassword; } - -void UserDto::setHasConfiguredPassword(bool newHasConfiguredPassword) { - m_hasConfiguredPassword = newHasConfiguredPassword; -} -bool UserDto::hasConfiguredEasyPassword() const { return m_hasConfiguredEasyPassword; } - -void UserDto::setHasConfiguredEasyPassword(bool newHasConfiguredEasyPassword) { - m_hasConfiguredEasyPassword = newHasConfiguredEasyPassword; -} -bool UserDto::enableAutoLogin() const { return m_enableAutoLogin; } - -void UserDto::setEnableAutoLogin(bool newEnableAutoLogin) { - m_enableAutoLogin = newEnableAutoLogin; -} -QDateTime UserDto::lastLoginDate() const { return m_lastLoginDate; } - -void UserDto::setLastLoginDate(QDateTime newLastLoginDate) { - m_lastLoginDate = newLastLoginDate; -} -QDateTime UserDto::lastActivityDate() const { return m_lastActivityDate; } - -void UserDto::setLastActivityDate(QDateTime newLastActivityDate) { - m_lastActivityDate = newLastActivityDate; -} -QSharedPointer UserDto::configuration() const { return m_configuration; } - -void UserDto::setConfiguration(QSharedPointer newConfiguration) { - m_configuration = newConfiguration; -} -QSharedPointer UserDto::policy() const { return m_policy; } - -void UserDto::setPolicy(QSharedPointer newPolicy) { - m_policy = newPolicy; -} -double UserDto::primaryImageAspectRatio() const { return m_primaryImageAspectRatio; } - -void UserDto::setPrimaryImageAspectRatio(double newPrimaryImageAspectRatio) { - m_primaryImageAspectRatio = newPrimaryImageAspectRatio; -} - -} // NS DTO - -namespace Support { - -using UserDto = Jellyfin::DTO::UserDto; - -template <> -UserDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UserDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/useritemdatadto.cpp b/core/src/DTO/useritemdatadto.cpp deleted file mode 100644 index 60161f1..0000000 --- a/core/src/DTO/useritemdatadto.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UserItemDataDto::UserItemDataDto() {} -UserItemDataDto::UserItemDataDto(const UserItemDataDto &other) : - m_rating(other.m_rating), - m_playedPercentage(other.m_playedPercentage), - m_unplayedItemCount(other.m_unplayedItemCount), - m_playbackPositionTicks(other.m_playbackPositionTicks), - m_playCount(other.m_playCount), - m_isFavorite(other.m_isFavorite), - m_likes(other.m_likes), - m_lastPlayedDate(other.m_lastPlayedDate), - m_played(other.m_played), - m_key(other.m_key), - m_itemId(other.m_itemId){} - -UserItemDataDto UserItemDataDto::fromJson(QJsonObject source) { - UserItemDataDto instance; - instance.setFromJson(source); - return instance; -} - - -void UserItemDataDto::setFromJson(QJsonObject source) { - m_rating = Jellyfin::Support::fromJsonValue(source["Rating"]); - m_playedPercentage = Jellyfin::Support::fromJsonValue(source["PlayedPercentage"]); - m_unplayedItemCount = Jellyfin::Support::fromJsonValue(source["UnplayedItemCount"]); - m_playbackPositionTicks = Jellyfin::Support::fromJsonValue(source["PlaybackPositionTicks"]); - m_playCount = Jellyfin::Support::fromJsonValue(source["PlayCount"]); - m_isFavorite = Jellyfin::Support::fromJsonValue(source["IsFavorite"]); - m_likes = Jellyfin::Support::fromJsonValue(source["Likes"]); - m_lastPlayedDate = Jellyfin::Support::fromJsonValue(source["LastPlayedDate"]); - m_played = Jellyfin::Support::fromJsonValue(source["Played"]); - m_key = Jellyfin::Support::fromJsonValue(source["Key"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - -} - -QJsonObject UserItemDataDto::toJson() { - QJsonObject result; - result["Rating"] = Jellyfin::Support::toJsonValue(m_rating); - result["PlayedPercentage"] = Jellyfin::Support::toJsonValue(m_playedPercentage); - result["UnplayedItemCount"] = Jellyfin::Support::toJsonValue(m_unplayedItemCount); - result["PlaybackPositionTicks"] = Jellyfin::Support::toJsonValue(m_playbackPositionTicks); - result["PlayCount"] = Jellyfin::Support::toJsonValue(m_playCount); - result["IsFavorite"] = Jellyfin::Support::toJsonValue(m_isFavorite); - result["Likes"] = Jellyfin::Support::toJsonValue(m_likes); - result["LastPlayedDate"] = Jellyfin::Support::toJsonValue(m_lastPlayedDate); - result["Played"] = Jellyfin::Support::toJsonValue(m_played); - result["Key"] = Jellyfin::Support::toJsonValue(m_key); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - - return result; -} - -double UserItemDataDto::rating() const { return m_rating; } - -void UserItemDataDto::setRating(double newRating) { - m_rating = newRating; -} -double UserItemDataDto::playedPercentage() const { return m_playedPercentage; } - -void UserItemDataDto::setPlayedPercentage(double newPlayedPercentage) { - m_playedPercentage = newPlayedPercentage; -} -qint32 UserItemDataDto::unplayedItemCount() const { return m_unplayedItemCount; } - -void UserItemDataDto::setUnplayedItemCount(qint32 newUnplayedItemCount) { - m_unplayedItemCount = newUnplayedItemCount; -} -qint64 UserItemDataDto::playbackPositionTicks() const { return m_playbackPositionTicks; } - -void UserItemDataDto::setPlaybackPositionTicks(qint64 newPlaybackPositionTicks) { - m_playbackPositionTicks = newPlaybackPositionTicks; -} -qint32 UserItemDataDto::playCount() const { return m_playCount; } - -void UserItemDataDto::setPlayCount(qint32 newPlayCount) { - m_playCount = newPlayCount; -} -bool UserItemDataDto::isFavorite() const { return m_isFavorite; } - -void UserItemDataDto::setIsFavorite(bool newIsFavorite) { - m_isFavorite = newIsFavorite; -} -bool UserItemDataDto::likes() const { return m_likes; } - -void UserItemDataDto::setLikes(bool newLikes) { - m_likes = newLikes; -} -QDateTime UserItemDataDto::lastPlayedDate() const { return m_lastPlayedDate; } - -void UserItemDataDto::setLastPlayedDate(QDateTime newLastPlayedDate) { - m_lastPlayedDate = newLastPlayedDate; -} -bool UserItemDataDto::played() const { return m_played; } - -void UserItemDataDto::setPlayed(bool newPlayed) { - m_played = newPlayed; -} -QString UserItemDataDto::key() const { return m_key; } - -void UserItemDataDto::setKey(QString newKey) { - m_key = newKey; -} -QString UserItemDataDto::itemId() const { return m_itemId; } - -void UserItemDataDto::setItemId(QString newItemId) { - m_itemId = newItemId; -} - -} // NS DTO - -namespace Support { - -using UserItemDataDto = Jellyfin::DTO::UserItemDataDto; - -template <> -UserItemDataDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UserItemDataDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/userpolicy.cpp b/core/src/DTO/userpolicy.cpp deleted file mode 100644 index 90a2dd2..0000000 --- a/core/src/DTO/userpolicy.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UserPolicy::UserPolicy() {} -UserPolicy::UserPolicy(const UserPolicy &other) : - m_isAdministrator(other.m_isAdministrator), - m_isHidden(other.m_isHidden), - m_isDisabled(other.m_isDisabled), - m_maxParentalRating(other.m_maxParentalRating), - m_blockedTags(other.m_blockedTags), - m_enableUserPreferenceAccess(other.m_enableUserPreferenceAccess), - m_accessSchedules(other.m_accessSchedules), - m_blockUnratedItems(other.m_blockUnratedItems), - m_enableRemoteControlOfOtherUsers(other.m_enableRemoteControlOfOtherUsers), - m_enableSharedDeviceControl(other.m_enableSharedDeviceControl), - m_enableRemoteAccess(other.m_enableRemoteAccess), - m_enableLiveTvManagement(other.m_enableLiveTvManagement), - m_enableLiveTvAccess(other.m_enableLiveTvAccess), - m_enableMediaPlayback(other.m_enableMediaPlayback), - m_enableAudioPlaybackTranscoding(other.m_enableAudioPlaybackTranscoding), - m_enableVideoPlaybackTranscoding(other.m_enableVideoPlaybackTranscoding), - m_enablePlaybackRemuxing(other.m_enablePlaybackRemuxing), - m_forceRemoteSourceTranscoding(other.m_forceRemoteSourceTranscoding), - m_enableContentDeletion(other.m_enableContentDeletion), - m_enableContentDeletionFromFolders(other.m_enableContentDeletionFromFolders), - m_enableContentDownloading(other.m_enableContentDownloading), - m_enableSyncTranscoding(other.m_enableSyncTranscoding), - m_enableMediaConversion(other.m_enableMediaConversion), - m_enabledDevices(other.m_enabledDevices), - m_enableAllDevices(other.m_enableAllDevices), - m_enabledChannels(other.m_enabledChannels), - m_enableAllChannels(other.m_enableAllChannels), - m_enabledFolders(other.m_enabledFolders), - m_enableAllFolders(other.m_enableAllFolders), - m_invalidLoginAttemptCount(other.m_invalidLoginAttemptCount), - m_loginAttemptsBeforeLockout(other.m_loginAttemptsBeforeLockout), - m_maxActiveSessions(other.m_maxActiveSessions), - m_enablePublicSharing(other.m_enablePublicSharing), - m_blockedMediaFolders(other.m_blockedMediaFolders), - m_blockedChannels(other.m_blockedChannels), - m_remoteClientBitrateLimit(other.m_remoteClientBitrateLimit), - m_authenticationProviderId(other.m_authenticationProviderId), - m_passwordResetProviderId(other.m_passwordResetProviderId), - m_syncPlayAccess(other.m_syncPlayAccess){} - -UserPolicy UserPolicy::fromJson(QJsonObject source) { - UserPolicy instance; - instance.setFromJson(source); - return instance; -} - - -void UserPolicy::setFromJson(QJsonObject source) { - m_isAdministrator = Jellyfin::Support::fromJsonValue(source["IsAdministrator"]); - m_isHidden = Jellyfin::Support::fromJsonValue(source["IsHidden"]); - m_isDisabled = Jellyfin::Support::fromJsonValue(source["IsDisabled"]); - m_maxParentalRating = Jellyfin::Support::fromJsonValue(source["MaxParentalRating"]); - m_blockedTags = Jellyfin::Support::fromJsonValue(source["BlockedTags"]); - m_enableUserPreferenceAccess = Jellyfin::Support::fromJsonValue(source["EnableUserPreferenceAccess"]); - m_accessSchedules = Jellyfin::Support::fromJsonValue>>(source["AccessSchedules"]); - m_blockUnratedItems = Jellyfin::Support::fromJsonValue>(source["BlockUnratedItems"]); - m_enableRemoteControlOfOtherUsers = Jellyfin::Support::fromJsonValue(source["EnableRemoteControlOfOtherUsers"]); - m_enableSharedDeviceControl = Jellyfin::Support::fromJsonValue(source["EnableSharedDeviceControl"]); - m_enableRemoteAccess = Jellyfin::Support::fromJsonValue(source["EnableRemoteAccess"]); - m_enableLiveTvManagement = Jellyfin::Support::fromJsonValue(source["EnableLiveTvManagement"]); - m_enableLiveTvAccess = Jellyfin::Support::fromJsonValue(source["EnableLiveTvAccess"]); - m_enableMediaPlayback = Jellyfin::Support::fromJsonValue(source["EnableMediaPlayback"]); - m_enableAudioPlaybackTranscoding = Jellyfin::Support::fromJsonValue(source["EnableAudioPlaybackTranscoding"]); - m_enableVideoPlaybackTranscoding = Jellyfin::Support::fromJsonValue(source["EnableVideoPlaybackTranscoding"]); - m_enablePlaybackRemuxing = Jellyfin::Support::fromJsonValue(source["EnablePlaybackRemuxing"]); - m_forceRemoteSourceTranscoding = Jellyfin::Support::fromJsonValue(source["ForceRemoteSourceTranscoding"]); - m_enableContentDeletion = Jellyfin::Support::fromJsonValue(source["EnableContentDeletion"]); - m_enableContentDeletionFromFolders = Jellyfin::Support::fromJsonValue(source["EnableContentDeletionFromFolders"]); - m_enableContentDownloading = Jellyfin::Support::fromJsonValue(source["EnableContentDownloading"]); - m_enableSyncTranscoding = Jellyfin::Support::fromJsonValue(source["EnableSyncTranscoding"]); - m_enableMediaConversion = Jellyfin::Support::fromJsonValue(source["EnableMediaConversion"]); - m_enabledDevices = Jellyfin::Support::fromJsonValue(source["EnabledDevices"]); - m_enableAllDevices = Jellyfin::Support::fromJsonValue(source["EnableAllDevices"]); - m_enabledChannels = Jellyfin::Support::fromJsonValue>(source["EnabledChannels"]); - m_enableAllChannels = Jellyfin::Support::fromJsonValue(source["EnableAllChannels"]); - m_enabledFolders = Jellyfin::Support::fromJsonValue>(source["EnabledFolders"]); - m_enableAllFolders = Jellyfin::Support::fromJsonValue(source["EnableAllFolders"]); - m_invalidLoginAttemptCount = Jellyfin::Support::fromJsonValue(source["InvalidLoginAttemptCount"]); - m_loginAttemptsBeforeLockout = Jellyfin::Support::fromJsonValue(source["LoginAttemptsBeforeLockout"]); - m_maxActiveSessions = Jellyfin::Support::fromJsonValue(source["MaxActiveSessions"]); - m_enablePublicSharing = Jellyfin::Support::fromJsonValue(source["EnablePublicSharing"]); - m_blockedMediaFolders = Jellyfin::Support::fromJsonValue>(source["BlockedMediaFolders"]); - m_blockedChannels = Jellyfin::Support::fromJsonValue>(source["BlockedChannels"]); - m_remoteClientBitrateLimit = Jellyfin::Support::fromJsonValue(source["RemoteClientBitrateLimit"]); - m_authenticationProviderId = Jellyfin::Support::fromJsonValue(source["AuthenticationProviderId"]); - m_passwordResetProviderId = Jellyfin::Support::fromJsonValue(source["PasswordResetProviderId"]); - m_syncPlayAccess = Jellyfin::Support::fromJsonValue(source["SyncPlayAccess"]); - -} - -QJsonObject UserPolicy::toJson() { - QJsonObject result; - result["IsAdministrator"] = Jellyfin::Support::toJsonValue(m_isAdministrator); - result["IsHidden"] = Jellyfin::Support::toJsonValue(m_isHidden); - result["IsDisabled"] = Jellyfin::Support::toJsonValue(m_isDisabled); - result["MaxParentalRating"] = Jellyfin::Support::toJsonValue(m_maxParentalRating); - result["BlockedTags"] = Jellyfin::Support::toJsonValue(m_blockedTags); - result["EnableUserPreferenceAccess"] = Jellyfin::Support::toJsonValue(m_enableUserPreferenceAccess); - result["AccessSchedules"] = Jellyfin::Support::toJsonValue>>(m_accessSchedules); - result["BlockUnratedItems"] = Jellyfin::Support::toJsonValue>(m_blockUnratedItems); - result["EnableRemoteControlOfOtherUsers"] = Jellyfin::Support::toJsonValue(m_enableRemoteControlOfOtherUsers); - result["EnableSharedDeviceControl"] = Jellyfin::Support::toJsonValue(m_enableSharedDeviceControl); - result["EnableRemoteAccess"] = Jellyfin::Support::toJsonValue(m_enableRemoteAccess); - result["EnableLiveTvManagement"] = Jellyfin::Support::toJsonValue(m_enableLiveTvManagement); - result["EnableLiveTvAccess"] = Jellyfin::Support::toJsonValue(m_enableLiveTvAccess); - result["EnableMediaPlayback"] = Jellyfin::Support::toJsonValue(m_enableMediaPlayback); - result["EnableAudioPlaybackTranscoding"] = Jellyfin::Support::toJsonValue(m_enableAudioPlaybackTranscoding); - result["EnableVideoPlaybackTranscoding"] = Jellyfin::Support::toJsonValue(m_enableVideoPlaybackTranscoding); - result["EnablePlaybackRemuxing"] = Jellyfin::Support::toJsonValue(m_enablePlaybackRemuxing); - result["ForceRemoteSourceTranscoding"] = Jellyfin::Support::toJsonValue(m_forceRemoteSourceTranscoding); - result["EnableContentDeletion"] = Jellyfin::Support::toJsonValue(m_enableContentDeletion); - result["EnableContentDeletionFromFolders"] = Jellyfin::Support::toJsonValue(m_enableContentDeletionFromFolders); - result["EnableContentDownloading"] = Jellyfin::Support::toJsonValue(m_enableContentDownloading); - result["EnableSyncTranscoding"] = Jellyfin::Support::toJsonValue(m_enableSyncTranscoding); - result["EnableMediaConversion"] = Jellyfin::Support::toJsonValue(m_enableMediaConversion); - result["EnabledDevices"] = Jellyfin::Support::toJsonValue(m_enabledDevices); - result["EnableAllDevices"] = Jellyfin::Support::toJsonValue(m_enableAllDevices); - result["EnabledChannels"] = Jellyfin::Support::toJsonValue>(m_enabledChannels); - result["EnableAllChannels"] = Jellyfin::Support::toJsonValue(m_enableAllChannels); - result["EnabledFolders"] = Jellyfin::Support::toJsonValue>(m_enabledFolders); - result["EnableAllFolders"] = Jellyfin::Support::toJsonValue(m_enableAllFolders); - result["InvalidLoginAttemptCount"] = Jellyfin::Support::toJsonValue(m_invalidLoginAttemptCount); - result["LoginAttemptsBeforeLockout"] = Jellyfin::Support::toJsonValue(m_loginAttemptsBeforeLockout); - result["MaxActiveSessions"] = Jellyfin::Support::toJsonValue(m_maxActiveSessions); - result["EnablePublicSharing"] = Jellyfin::Support::toJsonValue(m_enablePublicSharing); - result["BlockedMediaFolders"] = Jellyfin::Support::toJsonValue>(m_blockedMediaFolders); - result["BlockedChannels"] = Jellyfin::Support::toJsonValue>(m_blockedChannels); - result["RemoteClientBitrateLimit"] = Jellyfin::Support::toJsonValue(m_remoteClientBitrateLimit); - result["AuthenticationProviderId"] = Jellyfin::Support::toJsonValue(m_authenticationProviderId); - result["PasswordResetProviderId"] = Jellyfin::Support::toJsonValue(m_passwordResetProviderId); - result["SyncPlayAccess"] = Jellyfin::Support::toJsonValue(m_syncPlayAccess); - - return result; -} - -bool UserPolicy::isAdministrator() const { return m_isAdministrator; } - -void UserPolicy::setIsAdministrator(bool newIsAdministrator) { - m_isAdministrator = newIsAdministrator; -} -bool UserPolicy::isHidden() const { return m_isHidden; } - -void UserPolicy::setIsHidden(bool newIsHidden) { - m_isHidden = newIsHidden; -} -bool UserPolicy::isDisabled() const { return m_isDisabled; } - -void UserPolicy::setIsDisabled(bool newIsDisabled) { - m_isDisabled = newIsDisabled; -} -qint32 UserPolicy::maxParentalRating() const { return m_maxParentalRating; } - -void UserPolicy::setMaxParentalRating(qint32 newMaxParentalRating) { - m_maxParentalRating = newMaxParentalRating; -} -QStringList UserPolicy::blockedTags() const { return m_blockedTags; } - -void UserPolicy::setBlockedTags(QStringList newBlockedTags) { - m_blockedTags = newBlockedTags; -} -bool UserPolicy::enableUserPreferenceAccess() const { return m_enableUserPreferenceAccess; } - -void UserPolicy::setEnableUserPreferenceAccess(bool newEnableUserPreferenceAccess) { - m_enableUserPreferenceAccess = newEnableUserPreferenceAccess; -} -QList> UserPolicy::accessSchedules() const { return m_accessSchedules; } - -void UserPolicy::setAccessSchedules(QList> newAccessSchedules) { - m_accessSchedules = newAccessSchedules; -} -QList UserPolicy::blockUnratedItems() const { return m_blockUnratedItems; } - -void UserPolicy::setBlockUnratedItems(QList newBlockUnratedItems) { - m_blockUnratedItems = newBlockUnratedItems; -} -bool UserPolicy::enableRemoteControlOfOtherUsers() const { return m_enableRemoteControlOfOtherUsers; } - -void UserPolicy::setEnableRemoteControlOfOtherUsers(bool newEnableRemoteControlOfOtherUsers) { - m_enableRemoteControlOfOtherUsers = newEnableRemoteControlOfOtherUsers; -} -bool UserPolicy::enableSharedDeviceControl() const { return m_enableSharedDeviceControl; } - -void UserPolicy::setEnableSharedDeviceControl(bool newEnableSharedDeviceControl) { - m_enableSharedDeviceControl = newEnableSharedDeviceControl; -} -bool UserPolicy::enableRemoteAccess() const { return m_enableRemoteAccess; } - -void UserPolicy::setEnableRemoteAccess(bool newEnableRemoteAccess) { - m_enableRemoteAccess = newEnableRemoteAccess; -} -bool UserPolicy::enableLiveTvManagement() const { return m_enableLiveTvManagement; } - -void UserPolicy::setEnableLiveTvManagement(bool newEnableLiveTvManagement) { - m_enableLiveTvManagement = newEnableLiveTvManagement; -} -bool UserPolicy::enableLiveTvAccess() const { return m_enableLiveTvAccess; } - -void UserPolicy::setEnableLiveTvAccess(bool newEnableLiveTvAccess) { - m_enableLiveTvAccess = newEnableLiveTvAccess; -} -bool UserPolicy::enableMediaPlayback() const { return m_enableMediaPlayback; } - -void UserPolicy::setEnableMediaPlayback(bool newEnableMediaPlayback) { - m_enableMediaPlayback = newEnableMediaPlayback; -} -bool UserPolicy::enableAudioPlaybackTranscoding() const { return m_enableAudioPlaybackTranscoding; } - -void UserPolicy::setEnableAudioPlaybackTranscoding(bool newEnableAudioPlaybackTranscoding) { - m_enableAudioPlaybackTranscoding = newEnableAudioPlaybackTranscoding; -} -bool UserPolicy::enableVideoPlaybackTranscoding() const { return m_enableVideoPlaybackTranscoding; } - -void UserPolicy::setEnableVideoPlaybackTranscoding(bool newEnableVideoPlaybackTranscoding) { - m_enableVideoPlaybackTranscoding = newEnableVideoPlaybackTranscoding; -} -bool UserPolicy::enablePlaybackRemuxing() const { return m_enablePlaybackRemuxing; } - -void UserPolicy::setEnablePlaybackRemuxing(bool newEnablePlaybackRemuxing) { - m_enablePlaybackRemuxing = newEnablePlaybackRemuxing; -} -bool UserPolicy::forceRemoteSourceTranscoding() const { return m_forceRemoteSourceTranscoding; } - -void UserPolicy::setForceRemoteSourceTranscoding(bool newForceRemoteSourceTranscoding) { - m_forceRemoteSourceTranscoding = newForceRemoteSourceTranscoding; -} -bool UserPolicy::enableContentDeletion() const { return m_enableContentDeletion; } - -void UserPolicy::setEnableContentDeletion(bool newEnableContentDeletion) { - m_enableContentDeletion = newEnableContentDeletion; -} -QStringList UserPolicy::enableContentDeletionFromFolders() const { return m_enableContentDeletionFromFolders; } - -void UserPolicy::setEnableContentDeletionFromFolders(QStringList newEnableContentDeletionFromFolders) { - m_enableContentDeletionFromFolders = newEnableContentDeletionFromFolders; -} -bool UserPolicy::enableContentDownloading() const { return m_enableContentDownloading; } - -void UserPolicy::setEnableContentDownloading(bool newEnableContentDownloading) { - m_enableContentDownloading = newEnableContentDownloading; -} -bool UserPolicy::enableSyncTranscoding() const { return m_enableSyncTranscoding; } - -void UserPolicy::setEnableSyncTranscoding(bool newEnableSyncTranscoding) { - m_enableSyncTranscoding = newEnableSyncTranscoding; -} -bool UserPolicy::enableMediaConversion() const { return m_enableMediaConversion; } - -void UserPolicy::setEnableMediaConversion(bool newEnableMediaConversion) { - m_enableMediaConversion = newEnableMediaConversion; -} -QStringList UserPolicy::enabledDevices() const { return m_enabledDevices; } - -void UserPolicy::setEnabledDevices(QStringList newEnabledDevices) { - m_enabledDevices = newEnabledDevices; -} -bool UserPolicy::enableAllDevices() const { return m_enableAllDevices; } - -void UserPolicy::setEnableAllDevices(bool newEnableAllDevices) { - m_enableAllDevices = newEnableAllDevices; -} -QList UserPolicy::enabledChannels() const { return m_enabledChannels; } - -void UserPolicy::setEnabledChannels(QList newEnabledChannels) { - m_enabledChannels = newEnabledChannels; -} -bool UserPolicy::enableAllChannels() const { return m_enableAllChannels; } - -void UserPolicy::setEnableAllChannels(bool newEnableAllChannels) { - m_enableAllChannels = newEnableAllChannels; -} -QList UserPolicy::enabledFolders() const { return m_enabledFolders; } - -void UserPolicy::setEnabledFolders(QList newEnabledFolders) { - m_enabledFolders = newEnabledFolders; -} -bool UserPolicy::enableAllFolders() const { return m_enableAllFolders; } - -void UserPolicy::setEnableAllFolders(bool newEnableAllFolders) { - m_enableAllFolders = newEnableAllFolders; -} -qint32 UserPolicy::invalidLoginAttemptCount() const { return m_invalidLoginAttemptCount; } - -void UserPolicy::setInvalidLoginAttemptCount(qint32 newInvalidLoginAttemptCount) { - m_invalidLoginAttemptCount = newInvalidLoginAttemptCount; -} -qint32 UserPolicy::loginAttemptsBeforeLockout() const { return m_loginAttemptsBeforeLockout; } - -void UserPolicy::setLoginAttemptsBeforeLockout(qint32 newLoginAttemptsBeforeLockout) { - m_loginAttemptsBeforeLockout = newLoginAttemptsBeforeLockout; -} -qint32 UserPolicy::maxActiveSessions() const { return m_maxActiveSessions; } - -void UserPolicy::setMaxActiveSessions(qint32 newMaxActiveSessions) { - m_maxActiveSessions = newMaxActiveSessions; -} -bool UserPolicy::enablePublicSharing() const { return m_enablePublicSharing; } - -void UserPolicy::setEnablePublicSharing(bool newEnablePublicSharing) { - m_enablePublicSharing = newEnablePublicSharing; -} -QList UserPolicy::blockedMediaFolders() const { return m_blockedMediaFolders; } - -void UserPolicy::setBlockedMediaFolders(QList newBlockedMediaFolders) { - m_blockedMediaFolders = newBlockedMediaFolders; -} -QList UserPolicy::blockedChannels() const { return m_blockedChannels; } - -void UserPolicy::setBlockedChannels(QList newBlockedChannels) { - m_blockedChannels = newBlockedChannels; -} -qint32 UserPolicy::remoteClientBitrateLimit() const { return m_remoteClientBitrateLimit; } - -void UserPolicy::setRemoteClientBitrateLimit(qint32 newRemoteClientBitrateLimit) { - m_remoteClientBitrateLimit = newRemoteClientBitrateLimit; -} -QString UserPolicy::authenticationProviderId() const { return m_authenticationProviderId; } - -void UserPolicy::setAuthenticationProviderId(QString newAuthenticationProviderId) { - m_authenticationProviderId = newAuthenticationProviderId; -} -QString UserPolicy::passwordResetProviderId() const { return m_passwordResetProviderId; } - -void UserPolicy::setPasswordResetProviderId(QString newPasswordResetProviderId) { - m_passwordResetProviderId = newPasswordResetProviderId; -} -SyncPlayUserAccessType UserPolicy::syncPlayAccess() const { return m_syncPlayAccess; } - -void UserPolicy::setSyncPlayAccess(SyncPlayUserAccessType newSyncPlayAccess) { - m_syncPlayAccess = newSyncPlayAccess; -} - -} // NS DTO - -namespace Support { - -using UserPolicy = Jellyfin::DTO::UserPolicy; - -template <> -UserPolicy fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UserPolicy::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/utctimeresponse.cpp b/core/src/DTO/utctimeresponse.cpp deleted file mode 100644 index 3b6d457..0000000 --- a/core/src/DTO/utctimeresponse.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -UtcTimeResponse::UtcTimeResponse() {} -UtcTimeResponse::UtcTimeResponse(const UtcTimeResponse &other) : - m_requestReceptionTime(other.m_requestReceptionTime), - m_responseTransmissionTime(other.m_responseTransmissionTime){} - -UtcTimeResponse UtcTimeResponse::fromJson(QJsonObject source) { - UtcTimeResponse instance; - instance.setFromJson(source); - return instance; -} - - -void UtcTimeResponse::setFromJson(QJsonObject source) { - m_requestReceptionTime = Jellyfin::Support::fromJsonValue(source["RequestReceptionTime"]); - m_responseTransmissionTime = Jellyfin::Support::fromJsonValue(source["ResponseTransmissionTime"]); - -} - -QJsonObject UtcTimeResponse::toJson() { - QJsonObject result; - result["RequestReceptionTime"] = Jellyfin::Support::toJsonValue(m_requestReceptionTime); - result["ResponseTransmissionTime"] = Jellyfin::Support::toJsonValue(m_responseTransmissionTime); - - return result; -} - -QDateTime UtcTimeResponse::requestReceptionTime() const { return m_requestReceptionTime; } - -void UtcTimeResponse::setRequestReceptionTime(QDateTime newRequestReceptionTime) { - m_requestReceptionTime = newRequestReceptionTime; -} -QDateTime UtcTimeResponse::responseTransmissionTime() const { return m_responseTransmissionTime; } - -void UtcTimeResponse::setResponseTransmissionTime(QDateTime newResponseTransmissionTime) { - m_responseTransmissionTime = newResponseTransmissionTime; -} - -} // NS DTO - -namespace Support { - -using UtcTimeResponse = Jellyfin::DTO::UtcTimeResponse; - -template <> -UtcTimeResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return UtcTimeResponse::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/validatepathdto.cpp b/core/src/DTO/validatepathdto.cpp deleted file mode 100644 index 2cb49a6..0000000 --- a/core/src/DTO/validatepathdto.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -ValidatePathDto::ValidatePathDto() {} -ValidatePathDto::ValidatePathDto(const ValidatePathDto &other) : - m_validateWritable(other.m_validateWritable), - m_path(other.m_path), - m_isFile(other.m_isFile){} - -ValidatePathDto ValidatePathDto::fromJson(QJsonObject source) { - ValidatePathDto instance; - instance.setFromJson(source); - return instance; -} - - -void ValidatePathDto::setFromJson(QJsonObject source) { - m_validateWritable = Jellyfin::Support::fromJsonValue(source["ValidateWritable"]); - m_path = Jellyfin::Support::fromJsonValue(source["Path"]); - m_isFile = Jellyfin::Support::fromJsonValue(source["IsFile"]); - -} - -QJsonObject ValidatePathDto::toJson() { - QJsonObject result; - result["ValidateWritable"] = Jellyfin::Support::toJsonValue(m_validateWritable); - result["Path"] = Jellyfin::Support::toJsonValue(m_path); - result["IsFile"] = Jellyfin::Support::toJsonValue(m_isFile); - - return result; -} - -bool ValidatePathDto::validateWritable() const { return m_validateWritable; } - -void ValidatePathDto::setValidateWritable(bool newValidateWritable) { - m_validateWritable = newValidateWritable; -} -QString ValidatePathDto::path() const { return m_path; } - -void ValidatePathDto::setPath(QString newPath) { - m_path = newPath; -} -bool ValidatePathDto::isFile() const { return m_isFile; } - -void ValidatePathDto::setIsFile(bool newIsFile) { - m_isFile = newIsFile; -} - -} // NS DTO - -namespace Support { - -using ValidatePathDto = Jellyfin::DTO::ValidatePathDto; - -template <> -ValidatePathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return ValidatePathDto::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/version.cpp b/core/src/DTO/version.cpp deleted file mode 100644 index f6bce42..0000000 --- a/core/src/DTO/version.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -Version::Version() {} -Version::Version(const Version &other) : - m_major(other.m_major), - m_minor(other.m_minor), - m_build(other.m_build), - m_revision(other.m_revision), - m_majorRevision(other.m_majorRevision), - m_minorRevision(other.m_minorRevision){} - -Version Version::fromJson(QJsonObject source) { - Version instance; - instance.setFromJson(source); - return instance; -} - - -void Version::setFromJson(QJsonObject source) { - m_major = Jellyfin::Support::fromJsonValue(source["Major"]); - m_minor = Jellyfin::Support::fromJsonValue(source["Minor"]); - m_build = Jellyfin::Support::fromJsonValue(source["Build"]); - m_revision = Jellyfin::Support::fromJsonValue(source["Revision"]); - m_majorRevision = Jellyfin::Support::fromJsonValue(source["MajorRevision"]); - m_minorRevision = Jellyfin::Support::fromJsonValue(source["MinorRevision"]); - -} - -QJsonObject Version::toJson() { - QJsonObject result; - result["Major"] = Jellyfin::Support::toJsonValue(m_major); - result["Minor"] = Jellyfin::Support::toJsonValue(m_minor); - result["Build"] = Jellyfin::Support::toJsonValue(m_build); - result["Revision"] = Jellyfin::Support::toJsonValue(m_revision); - result["MajorRevision"] = Jellyfin::Support::toJsonValue(m_majorRevision); - result["MinorRevision"] = Jellyfin::Support::toJsonValue(m_minorRevision); - - return result; -} - -qint32 Version::major() const { return m_major; } - -void Version::setMajor(qint32 newMajor) { - m_major = newMajor; -} -qint32 Version::minor() const { return m_minor; } - -void Version::setMinor(qint32 newMinor) { - m_minor = newMinor; -} -qint32 Version::build() const { return m_build; } - -void Version::setBuild(qint32 newBuild) { - m_build = newBuild; -} -qint32 Version::revision() const { return m_revision; } - -void Version::setRevision(qint32 newRevision) { - m_revision = newRevision; -} -qint32 Version::majorRevision() const { return m_majorRevision; } - -void Version::setMajorRevision(qint32 newMajorRevision) { - m_majorRevision = newMajorRevision; -} -qint32 Version::minorRevision() const { return m_minorRevision; } - -void Version::setMinorRevision(qint32 newMinorRevision) { - m_minorRevision = newMinorRevision; -} - -} // NS DTO - -namespace Support { - -using Version = Jellyfin::DTO::Version; - -template <> -Version fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return Version::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/versioninfo.cpp b/core/src/DTO/versioninfo.cpp deleted file mode 100644 index 3961019..0000000 --- a/core/src/DTO/versioninfo.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -VersionInfo::VersionInfo() {} -VersionInfo::VersionInfo(const VersionInfo &other) : - m_version(other.m_version), - m_versionNumber(other.m_versionNumber), - m_changelog(other.m_changelog), - m_targetAbi(other.m_targetAbi), - m_sourceUrl(other.m_sourceUrl), - m_checksum(other.m_checksum), - m_timestamp(other.m_timestamp), - m_repositoryName(other.m_repositoryName), - m_repositoryUrl(other.m_repositoryUrl){} - -VersionInfo VersionInfo::fromJson(QJsonObject source) { - VersionInfo instance; - instance.setFromJson(source); - return instance; -} - - -void VersionInfo::setFromJson(QJsonObject source) { - m_version = Jellyfin::Support::fromJsonValue(source["version"]); - m_versionNumber = Jellyfin::Support::fromJsonValue>(source["VersionNumber"]); - m_changelog = Jellyfin::Support::fromJsonValue(source["changelog"]); - m_targetAbi = Jellyfin::Support::fromJsonValue(source["targetAbi"]); - m_sourceUrl = Jellyfin::Support::fromJsonValue(source["sourceUrl"]); - m_checksum = Jellyfin::Support::fromJsonValue(source["checksum"]); - m_timestamp = Jellyfin::Support::fromJsonValue(source["timestamp"]); - m_repositoryName = Jellyfin::Support::fromJsonValue(source["repositoryName"]); - m_repositoryUrl = Jellyfin::Support::fromJsonValue(source["repositoryUrl"]); - -} - -QJsonObject VersionInfo::toJson() { - QJsonObject result; - result["version"] = Jellyfin::Support::toJsonValue(m_version); - result["VersionNumber"] = Jellyfin::Support::toJsonValue>(m_versionNumber); - result["changelog"] = Jellyfin::Support::toJsonValue(m_changelog); - result["targetAbi"] = Jellyfin::Support::toJsonValue(m_targetAbi); - result["sourceUrl"] = Jellyfin::Support::toJsonValue(m_sourceUrl); - result["checksum"] = Jellyfin::Support::toJsonValue(m_checksum); - result["timestamp"] = Jellyfin::Support::toJsonValue(m_timestamp); - result["repositoryName"] = Jellyfin::Support::toJsonValue(m_repositoryName); - result["repositoryUrl"] = Jellyfin::Support::toJsonValue(m_repositoryUrl); - - return result; -} - -QString VersionInfo::version() const { return m_version; } - -void VersionInfo::setVersion(QString newVersion) { - m_version = newVersion; -} -QSharedPointer VersionInfo::versionNumber() const { return m_versionNumber; } - -void VersionInfo::setVersionNumber(QSharedPointer newVersionNumber) { - m_versionNumber = newVersionNumber; -} -QString VersionInfo::changelog() const { return m_changelog; } - -void VersionInfo::setChangelog(QString newChangelog) { - m_changelog = newChangelog; -} -QString VersionInfo::targetAbi() const { return m_targetAbi; } - -void VersionInfo::setTargetAbi(QString newTargetAbi) { - m_targetAbi = newTargetAbi; -} -QString VersionInfo::sourceUrl() const { return m_sourceUrl; } - -void VersionInfo::setSourceUrl(QString newSourceUrl) { - m_sourceUrl = newSourceUrl; -} -QString VersionInfo::checksum() const { return m_checksum; } - -void VersionInfo::setChecksum(QString newChecksum) { - m_checksum = newChecksum; -} -QString VersionInfo::timestamp() const { return m_timestamp; } - -void VersionInfo::setTimestamp(QString newTimestamp) { - m_timestamp = newTimestamp; -} -QString VersionInfo::repositoryName() const { return m_repositoryName; } - -void VersionInfo::setRepositoryName(QString newRepositoryName) { - m_repositoryName = newRepositoryName; -} -QString VersionInfo::repositoryUrl() const { return m_repositoryUrl; } - -void VersionInfo::setRepositoryUrl(QString newRepositoryUrl) { - m_repositoryUrl = newRepositoryUrl; -} - -} // NS DTO - -namespace Support { - -using VersionInfo = Jellyfin::DTO::VersionInfo; - -template <> -VersionInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return VersionInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/video3dformat.cpp b/core/src/DTO/video3dformat.cpp deleted file mode 100644 index aa3de2d..0000000 --- a/core/src/DTO/video3dformat.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -Video3DFormatClass::Video3DFormatClass() {} - - -} // NS DTO - -namespace Support { - -using Video3DFormat = Jellyfin::DTO::Video3DFormat; - -template <> -Video3DFormat fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return Video3DFormat::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("HalfSideBySide")) { - return Video3DFormat::HalfSideBySide; - } - if (str == QStringLiteral("FullSideBySide")) { - return Video3DFormat::FullSideBySide; - } - if (str == QStringLiteral("FullTopAndBottom")) { - return Video3DFormat::FullTopAndBottom; - } - if (str == QStringLiteral("HalfTopAndBottom")) { - return Video3DFormat::HalfTopAndBottom; - } - if (str == QStringLiteral("MVC")) { - return Video3DFormat::MVC; - } - - return Video3DFormat::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/videotype.cpp b/core/src/DTO/videotype.cpp deleted file mode 100644 index d9b78ba..0000000 --- a/core/src/DTO/videotype.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -VideoTypeClass::VideoTypeClass() {} - - -} // NS DTO - -namespace Support { - -using VideoType = Jellyfin::DTO::VideoType; - -template <> -VideoType fromJsonValue(const QJsonValue &source) { - if (!source.isString()) return VideoType::EnumNotSet; - - QString str = source.toString(); - if (str == QStringLiteral("VideoFile")) { - return VideoType::VideoFile; - } - if (str == QStringLiteral("Iso")) { - return VideoType::Iso; - } - if (str == QStringLiteral("Dvd")) { - return VideoType::Dvd; - } - if (str == QStringLiteral("BluRay")) { - return VideoType::BluRay; - } - - return VideoType::EnumNotSet; -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/virtualfolderinfo.cpp b/core/src/DTO/virtualfolderinfo.cpp deleted file mode 100644 index bd27315..0000000 --- a/core/src/DTO/virtualfolderinfo.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -VirtualFolderInfo::VirtualFolderInfo() {} -VirtualFolderInfo::VirtualFolderInfo(const VirtualFolderInfo &other) : - m_name(other.m_name), - m_locations(other.m_locations), - m_collectionType(other.m_collectionType), - m_libraryOptions(other.m_libraryOptions), - m_itemId(other.m_itemId), - m_primaryImageItemId(other.m_primaryImageItemId), - m_refreshProgress(other.m_refreshProgress), - m_refreshStatus(other.m_refreshStatus){} - -VirtualFolderInfo VirtualFolderInfo::fromJson(QJsonObject source) { - VirtualFolderInfo instance; - instance.setFromJson(source); - return instance; -} - - -void VirtualFolderInfo::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_locations = Jellyfin::Support::fromJsonValue(source["Locations"]); - m_collectionType = Jellyfin::Support::fromJsonValue(source["CollectionType"]); - m_libraryOptions = Jellyfin::Support::fromJsonValue>(source["LibraryOptions"]); - m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); - m_primaryImageItemId = Jellyfin::Support::fromJsonValue(source["PrimaryImageItemId"]); - m_refreshProgress = Jellyfin::Support::fromJsonValue(source["RefreshProgress"]); - m_refreshStatus = Jellyfin::Support::fromJsonValue(source["RefreshStatus"]); - -} - -QJsonObject VirtualFolderInfo::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Locations"] = Jellyfin::Support::toJsonValue(m_locations); - result["CollectionType"] = Jellyfin::Support::toJsonValue(m_collectionType); - result["LibraryOptions"] = Jellyfin::Support::toJsonValue>(m_libraryOptions); - result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); - result["PrimaryImageItemId"] = Jellyfin::Support::toJsonValue(m_primaryImageItemId); - result["RefreshProgress"] = Jellyfin::Support::toJsonValue(m_refreshProgress); - result["RefreshStatus"] = Jellyfin::Support::toJsonValue(m_refreshStatus); - - return result; -} - -QString VirtualFolderInfo::name() const { return m_name; } - -void VirtualFolderInfo::setName(QString newName) { - m_name = newName; -} -QStringList VirtualFolderInfo::locations() const { return m_locations; } - -void VirtualFolderInfo::setLocations(QStringList newLocations) { - m_locations = newLocations; -} -QString VirtualFolderInfo::collectionType() const { return m_collectionType; } - -void VirtualFolderInfo::setCollectionType(QString newCollectionType) { - m_collectionType = newCollectionType; -} -QSharedPointer VirtualFolderInfo::libraryOptions() const { return m_libraryOptions; } - -void VirtualFolderInfo::setLibraryOptions(QSharedPointer newLibraryOptions) { - m_libraryOptions = newLibraryOptions; -} -QString VirtualFolderInfo::itemId() const { return m_itemId; } - -void VirtualFolderInfo::setItemId(QString newItemId) { - m_itemId = newItemId; -} -QString VirtualFolderInfo::primaryImageItemId() const { return m_primaryImageItemId; } - -void VirtualFolderInfo::setPrimaryImageItemId(QString newPrimaryImageItemId) { - m_primaryImageItemId = newPrimaryImageItemId; -} -double VirtualFolderInfo::refreshProgress() const { return m_refreshProgress; } - -void VirtualFolderInfo::setRefreshProgress(double newRefreshProgress) { - m_refreshProgress = newRefreshProgress; -} -QString VirtualFolderInfo::refreshStatus() const { return m_refreshStatus; } - -void VirtualFolderInfo::setRefreshStatus(QString newRefreshStatus) { - m_refreshStatus = newRefreshStatus; -} - -} // NS DTO - -namespace Support { - -using VirtualFolderInfo = Jellyfin::DTO::VirtualFolderInfo; - -template <> -VirtualFolderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return VirtualFolderInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/wakeonlaninfo.cpp b/core/src/DTO/wakeonlaninfo.cpp deleted file mode 100644 index 54b3ef0..0000000 --- a/core/src/DTO/wakeonlaninfo.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -WakeOnLanInfo::WakeOnLanInfo() {} -WakeOnLanInfo::WakeOnLanInfo(const WakeOnLanInfo &other) : - m_macAddress(other.m_macAddress), - m_port(other.m_port){} - -WakeOnLanInfo WakeOnLanInfo::fromJson(QJsonObject source) { - WakeOnLanInfo instance; - instance.setFromJson(source); - return instance; -} - - -void WakeOnLanInfo::setFromJson(QJsonObject source) { - m_macAddress = Jellyfin::Support::fromJsonValue(source["MacAddress"]); - m_port = Jellyfin::Support::fromJsonValue(source["Port"]); - -} - -QJsonObject WakeOnLanInfo::toJson() { - QJsonObject result; - result["MacAddress"] = Jellyfin::Support::toJsonValue(m_macAddress); - result["Port"] = Jellyfin::Support::toJsonValue(m_port); - - return result; -} - -QString WakeOnLanInfo::macAddress() const { return m_macAddress; } - -void WakeOnLanInfo::setMacAddress(QString newMacAddress) { - m_macAddress = newMacAddress; -} -qint32 WakeOnLanInfo::port() const { return m_port; } - -void WakeOnLanInfo::setPort(qint32 newPort) { - m_port = newPort; -} - -} // NS DTO - -namespace Support { - -using WakeOnLanInfo = Jellyfin::DTO::WakeOnLanInfo; - -template <> -WakeOnLanInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return WakeOnLanInfo::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/DTO/xmlattribute.cpp b/core/src/DTO/xmlattribute.cpp deleted file mode 100644 index 5de925e..0000000 --- a/core/src/DTO/xmlattribute.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Sailfin: a Jellyfin client written using Qt - * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* - * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET - * OVERWRITTEN AT SOME POINT! - * - * If there is a bug in this file, please fix the code generator used to generate this file found in - * core/openapigenerator.d. - * - * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that - * file with a newer file if needed instead of manually updating the files. - */ - -#include - -namespace Jellyfin { -namespace DTO { - -XmlAttribute::XmlAttribute() {} -XmlAttribute::XmlAttribute(const XmlAttribute &other) : - m_name(other.m_name), - m_value(other.m_value){} - -XmlAttribute XmlAttribute::fromJson(QJsonObject source) { - XmlAttribute instance; - instance.setFromJson(source); - return instance; -} - - -void XmlAttribute::setFromJson(QJsonObject source) { - m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_value = Jellyfin::Support::fromJsonValue(source["Value"]); - -} - -QJsonObject XmlAttribute::toJson() { - QJsonObject result; - result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["Value"] = Jellyfin::Support::toJsonValue(m_value); - - return result; -} - -QString XmlAttribute::name() const { return m_name; } - -void XmlAttribute::setName(QString newName) { - m_name = newName; -} -QString XmlAttribute::value() const { return m_value; } - -void XmlAttribute::setValue(QString newValue) { - m_value = newValue; -} - -} // NS DTO - -namespace Support { - -using XmlAttribute = Jellyfin::DTO::XmlAttribute; - -template <> -XmlAttribute fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); - return XmlAttribute::fromJson(source.toObject()); -} - -} // NS Jellyfin -} // NS DTO diff --git a/core/src/apiclient.cpp b/core/src/apiclient.cpp index 35e1b5f..541b4db 100644 --- a/core/src/apiclient.cpp +++ b/core/src/apiclient.cpp @@ -19,6 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "JellyfinQt/apiclient.h" +#include "JellyfinQt/support/jsonconv.h" +#include "JellyfinQt/websocket.h" + + namespace Jellyfin { ApiClient::ApiClient(QObject *parent) @@ -240,7 +244,10 @@ void ApiClient::postCapabilities() { supportedCommands.append(m_supportedCommands[i].value()); } } - capabilities["SupportedCommands"] = Support::toJsonValue(supportedCommands); + QList foo = {1, 2, 3}; + qDebug() << Support::toJsonValue(3713); + qDebug() << Support::toJsonValue>(foo); + capabilities["SupportedCommands"] = Support::toJsonValue>(supportedCommands); capabilities["SupportsPersistentIdentifier"] = true; capabilities["SupportsMediaControl"] = false; capabilities["SupportsSync"] = false; @@ -257,7 +264,7 @@ QString ApiClient::downloadUrl(const QString &itemId) const { } void ApiClient::generateDeviceProfile() { - QJsonObject root = DeviceProfile::generateProfile(); + QJsonObject root = Model::DeviceProfile::generateProfile(); m_playbackDeviceProfile = QJsonObject(root); root["Name"] = m_deviceName; root["Id"] = m_deviceId; diff --git a/core/src/apimodel.cpp b/core/src/apimodel.cpp index 0584ded..82833c2 100644 --- a/core/src/apimodel.cpp +++ b/core/src/apimodel.cpp @@ -45,7 +45,7 @@ void BaseModelLoader::componentComplete() { } void BaseModelLoader::autoReloadIfNeeded() { - if (m_autoReload && m_apiClient != nullptr) { + if (m_autoReload && canReload()) { emit reloadWanted(); } } @@ -73,6 +73,10 @@ void BaseModelLoader::setAutoReload(bool newAutoReload) { } } +bool BaseModelLoader::canReload() const { + return m_apiClient != nullptr && (!m_needsAuthentication || m_apiClient->authenticated()); +} + void BaseApiModel::reload() { qWarning() << " BaseApiModel slot called instead of overloaded method"; } diff --git a/core/src/dto/accessschedule.cpp b/core/src/dto/accessschedule.cpp index 1b461ec..4b2dc16 100644 --- a/core/src/dto/accessschedule.cpp +++ b/core/src/dto/accessschedule.cpp @@ -67,7 +67,7 @@ void AccessSchedule::setFromJson(QJsonObject source) { } -QJsonObject AccessSchedule::toJson() { +QJsonObject AccessSchedule::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); @@ -116,10 +116,15 @@ namespace Support { using AccessSchedule = Jellyfin::DTO::AccessSchedule; template <> -AccessSchedule fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AccessSchedule fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AccessSchedule::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AccessSchedule &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/activitylogentry.cpp b/core/src/dto/activitylogentry.cpp index c158dea..c4a5290 100644 --- a/core/src/dto/activitylogentry.cpp +++ b/core/src/dto/activitylogentry.cpp @@ -82,7 +82,7 @@ void ActivityLogEntry::setFromJson(QJsonObject source) { } -QJsonObject ActivityLogEntry::toJson() { +QJsonObject ActivityLogEntry::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -208,10 +208,15 @@ namespace Support { using ActivityLogEntry = Jellyfin::DTO::ActivityLogEntry; template <> -ActivityLogEntry fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ActivityLogEntry fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ActivityLogEntry::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ActivityLogEntry &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/activitylogentryqueryresult.cpp b/core/src/dto/activitylogentryqueryresult.cpp index 24e1b54..7437ab6 100644 --- a/core/src/dto/activitylogentryqueryresult.cpp +++ b/core/src/dto/activitylogentryqueryresult.cpp @@ -61,7 +61,7 @@ void ActivityLogEntryQueryResult::setFromJson(QJsonObject source) { } -QJsonObject ActivityLogEntryQueryResult::toJson() { +QJsonObject ActivityLogEntryQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using ActivityLogEntryQueryResult = Jellyfin::DTO::ActivityLogEntryQueryResult; template <> -ActivityLogEntryQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ActivityLogEntryQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ActivityLogEntryQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ActivityLogEntryQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/addvirtualfolderdto.cpp b/core/src/dto/addvirtualfolderdto.cpp index f5a8c00..68c23bf 100644 --- a/core/src/dto/addvirtualfolderdto.cpp +++ b/core/src/dto/addvirtualfolderdto.cpp @@ -55,7 +55,7 @@ void AddVirtualFolderDto::setFromJson(QJsonObject source) { } -QJsonObject AddVirtualFolderDto::toJson() { +QJsonObject AddVirtualFolderDto::toJson() const { QJsonObject result; result["LibraryOptions"] = Jellyfin::Support::toJsonValue>(m_libraryOptions); @@ -76,10 +76,15 @@ namespace Support { using AddVirtualFolderDto = Jellyfin::DTO::AddVirtualFolderDto; template <> -AddVirtualFolderDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AddVirtualFolderDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AddVirtualFolderDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AddVirtualFolderDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/albuminfo.cpp b/core/src/dto/albuminfo.cpp index abd9926..a06efd1 100644 --- a/core/src/dto/albuminfo.cpp +++ b/core/src/dto/albuminfo.cpp @@ -79,32 +79,32 @@ void AlbumInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); m_premiereDate = Jellyfin::Support::fromJsonValue(source["PremiereDate"]); m_isAutomated = Jellyfin::Support::fromJsonValue(source["IsAutomated"]); m_albumArtists = Jellyfin::Support::fromJsonValue(source["AlbumArtists"]); - m_artistProviderIds = Jellyfin::Support::fromJsonValue>(source["ArtistProviderIds"]); + m_artistProviderIds = Jellyfin::Support::fromJsonValue(source["ArtistProviderIds"]); m_songInfos = Jellyfin::Support::fromJsonValue>(source["SongInfos"]); } -QJsonObject AlbumInfo::toJson() { +QJsonObject AlbumInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); result["PremiereDate"] = Jellyfin::Support::toJsonValue(m_premiereDate); result["IsAutomated"] = Jellyfin::Support::toJsonValue(m_isAutomated); result["AlbumArtists"] = Jellyfin::Support::toJsonValue(m_albumArtists); - result["ArtistProviderIds"] = Jellyfin::Support::toJsonValue>(m_artistProviderIds); + result["ArtistProviderIds"] = Jellyfin::Support::toJsonValue(m_artistProviderIds); result["SongInfos"] = Jellyfin::Support::toJsonValue>(m_songInfos); return result; @@ -162,17 +162,17 @@ void AlbumInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional AlbumInfo::providerIds() const { return m_providerIds; } +QJsonObject AlbumInfo::providerIds() const { return m_providerIds; } -void AlbumInfo::setProviderIds(std::optional newProviderIds) { +void AlbumInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool AlbumInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void AlbumInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional AlbumInfo::year() const { return m_year; } @@ -246,17 +246,17 @@ void AlbumInfo::setAlbumArtistsNull() { m_albumArtists.clear(); } -std::optional AlbumInfo::artistProviderIds() const { return m_artistProviderIds; } +QJsonObject AlbumInfo::artistProviderIds() const { return m_artistProviderIds; } -void AlbumInfo::setArtistProviderIds(std::optional newArtistProviderIds) { +void AlbumInfo::setArtistProviderIds(QJsonObject newArtistProviderIds) { m_artistProviderIds = newArtistProviderIds; } bool AlbumInfo::artistProviderIdsNull() const { - return !m_artistProviderIds.has_value(); + return m_artistProviderIds.isEmpty(); } void AlbumInfo::setArtistProviderIdsNull() { - m_artistProviderIds = std::nullopt; + m_artistProviderIds= QJsonObject(); } QList AlbumInfo::songInfos() const { return m_songInfos; } @@ -280,10 +280,15 @@ namespace Support { using AlbumInfo = Jellyfin::DTO::AlbumInfo; template <> -AlbumInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AlbumInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AlbumInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AlbumInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/albuminforemotesearchquery.cpp b/core/src/dto/albuminforemotesearchquery.cpp index c495f17..9e694bf 100644 --- a/core/src/dto/albuminforemotesearchquery.cpp +++ b/core/src/dto/albuminforemotesearchquery.cpp @@ -64,7 +64,7 @@ void AlbumInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject AlbumInfoRemoteSearchQuery::toJson() { +QJsonObject AlbumInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using AlbumInfoRemoteSearchQuery = Jellyfin::DTO::AlbumInfoRemoteSearchQuery; template <> -AlbumInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AlbumInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AlbumInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AlbumInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/allthememediaresult.cpp b/core/src/dto/allthememediaresult.cpp index 9f66e2b..d330d81 100644 --- a/core/src/dto/allthememediaresult.cpp +++ b/core/src/dto/allthememediaresult.cpp @@ -61,7 +61,7 @@ void AllThemeMediaResult::setFromJson(QJsonObject source) { } -QJsonObject AllThemeMediaResult::toJson() { +QJsonObject AllThemeMediaResult::toJson() const { QJsonObject result; result["ThemeVideosResult"] = Jellyfin::Support::toJsonValue>(m_themeVideosResult); result["ThemeSongsResult"] = Jellyfin::Support::toJsonValue>(m_themeSongsResult); @@ -96,10 +96,15 @@ namespace Support { using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult; template <> -AllThemeMediaResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AllThemeMediaResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AllThemeMediaResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AllThemeMediaResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/architecture.cpp b/core/src/dto/architecture.cpp index d36cc0b..7e9db87 100644 --- a/core/src/dto/architecture.cpp +++ b/core/src/dto/architecture.cpp @@ -34,7 +34,6 @@ namespace DTO { ArchitectureClass::ArchitectureClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using Architecture = Jellyfin::DTO::Architecture; template <> -Architecture fromJsonValue(const QJsonValue &source) { +Architecture fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return Architecture::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ Architecture fromJsonValue(const QJsonValue &source) { return Architecture::EnumNotSet; } +template <> +QJsonValue toJsonValue(const Architecture &source, convertType) { + switch(source) { + case Architecture::X86: + return QStringLiteral("X86"); + case Architecture::X64: + return QStringLiteral("X64"); + case Architecture::Arm: + return QStringLiteral("Arm"); + case Architecture::Arm64: + return QStringLiteral("Arm64"); + case Architecture::Wasm: + return QStringLiteral("Wasm"); + + case Architecture::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/artistinfo.cpp b/core/src/dto/artistinfo.cpp index 5a35745..4951768 100644 --- a/core/src/dto/artistinfo.cpp +++ b/core/src/dto/artistinfo.cpp @@ -75,7 +75,7 @@ void ArtistInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -85,13 +85,13 @@ void ArtistInfo::setFromJson(QJsonObject source) { } -QJsonObject ArtistInfo::toJson() { +QJsonObject ArtistInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -154,17 +154,17 @@ void ArtistInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional ArtistInfo::providerIds() const { return m_providerIds; } +QJsonObject ArtistInfo::providerIds() const { return m_providerIds; } -void ArtistInfo::setProviderIds(std::optional newProviderIds) { +void ArtistInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool ArtistInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void ArtistInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional ArtistInfo::year() const { return m_year; } @@ -246,10 +246,15 @@ namespace Support { using ArtistInfo = Jellyfin::DTO::ArtistInfo; template <> -ArtistInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ArtistInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ArtistInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ArtistInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/artistinforemotesearchquery.cpp b/core/src/dto/artistinforemotesearchquery.cpp index 34e008b..983dbf4 100644 --- a/core/src/dto/artistinforemotesearchquery.cpp +++ b/core/src/dto/artistinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void ArtistInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject ArtistInfoRemoteSearchQuery::toJson() { +QJsonObject ArtistInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using ArtistInfoRemoteSearchQuery = Jellyfin::DTO::ArtistInfoRemoteSearchQuery; template <> -ArtistInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ArtistInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ArtistInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ArtistInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/authenticateuserbyname.cpp b/core/src/dto/authenticateuserbyname.cpp index b1a1e70..4e82272 100644 --- a/core/src/dto/authenticateuserbyname.cpp +++ b/core/src/dto/authenticateuserbyname.cpp @@ -61,7 +61,7 @@ void AuthenticateUserByName::setFromJson(QJsonObject source) { } -QJsonObject AuthenticateUserByName::toJson() { +QJsonObject AuthenticateUserByName::toJson() const { QJsonObject result; result["Username"] = Jellyfin::Support::toJsonValue(m_username); result["Pw"] = Jellyfin::Support::toJsonValue(m_pw); @@ -117,10 +117,15 @@ namespace Support { using AuthenticateUserByName = Jellyfin::DTO::AuthenticateUserByName; template <> -AuthenticateUserByName fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AuthenticateUserByName fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AuthenticateUserByName::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AuthenticateUserByName &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/authenticationinfo.cpp b/core/src/dto/authenticationinfo.cpp index d36ec0b..94e7857 100644 --- a/core/src/dto/authenticationinfo.cpp +++ b/core/src/dto/authenticationinfo.cpp @@ -88,7 +88,7 @@ void AuthenticationInfo::setFromJson(QJsonObject source) { } -QJsonObject AuthenticationInfo::toJson() { +QJsonObject AuthenticationInfo::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["AccessToken"] = Jellyfin::Support::toJsonValue(m_accessToken); @@ -235,10 +235,15 @@ namespace Support { using AuthenticationInfo = Jellyfin::DTO::AuthenticationInfo; template <> -AuthenticationInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AuthenticationInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AuthenticationInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AuthenticationInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/authenticationinfoqueryresult.cpp b/core/src/dto/authenticationinfoqueryresult.cpp index abce850..b566397 100644 --- a/core/src/dto/authenticationinfoqueryresult.cpp +++ b/core/src/dto/authenticationinfoqueryresult.cpp @@ -61,7 +61,7 @@ void AuthenticationInfoQueryResult::setFromJson(QJsonObject source) { } -QJsonObject AuthenticationInfoQueryResult::toJson() { +QJsonObject AuthenticationInfoQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using AuthenticationInfoQueryResult = Jellyfin::DTO::AuthenticationInfoQueryResult; template <> -AuthenticationInfoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AuthenticationInfoQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AuthenticationInfoQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AuthenticationInfoQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/authenticationresult.cpp b/core/src/dto/authenticationresult.cpp index 07767cf..e75b842 100644 --- a/core/src/dto/authenticationresult.cpp +++ b/core/src/dto/authenticationresult.cpp @@ -64,7 +64,7 @@ void AuthenticationResult::setFromJson(QJsonObject source) { } -QJsonObject AuthenticationResult::toJson() { +QJsonObject AuthenticationResult::toJson() const { QJsonObject result; result["User"] = Jellyfin::Support::toJsonValue>(m_user); result["SessionInfo"] = Jellyfin::Support::toJsonValue>(m_sessionInfo); @@ -120,10 +120,15 @@ namespace Support { using AuthenticationResult = Jellyfin::DTO::AuthenticationResult; template <> -AuthenticationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +AuthenticationResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return AuthenticationResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const AuthenticationResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/baseitem.cpp b/core/src/dto/baseitem.cpp index 7d8b7f8..8b5f155 100644 --- a/core/src/dto/baseitem.cpp +++ b/core/src/dto/baseitem.cpp @@ -85,7 +85,7 @@ void BaseItem::setFromJson(QJsonObject source) { } -QJsonObject BaseItem::toJson() { +QJsonObject BaseItem::toJson() const { QJsonObject result; result["Size"] = Jellyfin::Support::toJsonValue>(m_size); result["Container"] = Jellyfin::Support::toJsonValue(m_container); @@ -211,10 +211,15 @@ namespace Support { using BaseItem = Jellyfin::DTO::BaseItem; template <> -BaseItem fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BaseItem fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BaseItem::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BaseItem &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/baseitemdto.cpp b/core/src/dto/baseitemdto.cpp index 65f3a05..8128f12 100644 --- a/core/src/dto/baseitemdto.cpp +++ b/core/src/dto/baseitemdto.cpp @@ -401,7 +401,7 @@ void BaseItemDto::setFromJson(QJsonObject source) { m_indexNumberEnd = Jellyfin::Support::fromJsonValue>(source["IndexNumberEnd"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); m_remoteTrailers = Jellyfin::Support::fromJsonValue>(source["RemoteTrailers"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_isHD = Jellyfin::Support::fromJsonValue>(source["IsHD"]); m_isFolder = Jellyfin::Support::fromJsonValue>(source["IsFolder"]); m_parentId = Jellyfin::Support::fromJsonValue(source["ParentId"]); @@ -441,14 +441,14 @@ void BaseItemDto::setFromJson(QJsonObject source) { m_videoType = Jellyfin::Support::fromJsonValue(source["VideoType"]); m_partCount = Jellyfin::Support::fromJsonValue>(source["PartCount"]); m_mediaSourceCount = Jellyfin::Support::fromJsonValue>(source["MediaSourceCount"]); - m_imageTags = Jellyfin::Support::fromJsonValue>(source["ImageTags"]); + m_imageTags = Jellyfin::Support::fromJsonValue(source["ImageTags"]); m_backdropImageTags = Jellyfin::Support::fromJsonValue(source["BackdropImageTags"]); m_screenshotImageTags = Jellyfin::Support::fromJsonValue(source["ScreenshotImageTags"]); m_parentLogoImageTag = Jellyfin::Support::fromJsonValue(source["ParentLogoImageTag"]); m_parentArtItemId = Jellyfin::Support::fromJsonValue(source["ParentArtItemId"]); m_parentArtImageTag = Jellyfin::Support::fromJsonValue(source["ParentArtImageTag"]); m_seriesThumbImageTag = Jellyfin::Support::fromJsonValue(source["SeriesThumbImageTag"]); - m_imageBlurHashes = Jellyfin::Support::fromJsonValue>(source["ImageBlurHashes"]); + m_imageBlurHashes = Jellyfin::Support::fromJsonValue(source["ImageBlurHashes"]); m_seriesStudio = Jellyfin::Support::fromJsonValue(source["SeriesStudio"]); m_parentThumbItemId = Jellyfin::Support::fromJsonValue(source["ParentThumbItemId"]); m_parentThumbImageTag = Jellyfin::Support::fromJsonValue(source["ParentThumbImageTag"]); @@ -505,7 +505,7 @@ void BaseItemDto::setFromJson(QJsonObject source) { } -QJsonObject BaseItemDto::toJson() { +QJsonObject BaseItemDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["OriginalTitle"] = Jellyfin::Support::toJsonValue(m_originalTitle); @@ -557,7 +557,7 @@ QJsonObject BaseItemDto::toJson() { result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue>(m_indexNumberEnd); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); result["RemoteTrailers"] = Jellyfin::Support::toJsonValue>(m_remoteTrailers); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["IsHD"] = Jellyfin::Support::toJsonValue>(m_isHD); result["IsFolder"] = Jellyfin::Support::toJsonValue>(m_isFolder); result["ParentId"] = Jellyfin::Support::toJsonValue(m_parentId); @@ -597,14 +597,14 @@ QJsonObject BaseItemDto::toJson() { result["VideoType"] = Jellyfin::Support::toJsonValue(m_videoType); result["PartCount"] = Jellyfin::Support::toJsonValue>(m_partCount); result["MediaSourceCount"] = Jellyfin::Support::toJsonValue>(m_mediaSourceCount); - result["ImageTags"] = Jellyfin::Support::toJsonValue>(m_imageTags); + result["ImageTags"] = Jellyfin::Support::toJsonValue(m_imageTags); result["BackdropImageTags"] = Jellyfin::Support::toJsonValue(m_backdropImageTags); result["ScreenshotImageTags"] = Jellyfin::Support::toJsonValue(m_screenshotImageTags); result["ParentLogoImageTag"] = Jellyfin::Support::toJsonValue(m_parentLogoImageTag); result["ParentArtItemId"] = Jellyfin::Support::toJsonValue(m_parentArtItemId); result["ParentArtImageTag"] = Jellyfin::Support::toJsonValue(m_parentArtImageTag); result["SeriesThumbImageTag"] = Jellyfin::Support::toJsonValue(m_seriesThumbImageTag); - result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue>(m_imageBlurHashes); + result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue(m_imageBlurHashes); result["SeriesStudio"] = Jellyfin::Support::toJsonValue(m_seriesStudio); result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue(m_parentThumbItemId); result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue(m_parentThumbImageTag); @@ -1291,17 +1291,17 @@ void BaseItemDto::setRemoteTrailersNull() { m_remoteTrailers.clear(); } -std::optional BaseItemDto::providerIds() const { return m_providerIds; } +QJsonObject BaseItemDto::providerIds() const { return m_providerIds; } -void BaseItemDto::setProviderIds(std::optional newProviderIds) { +void BaseItemDto::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool BaseItemDto::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void BaseItemDto::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional BaseItemDto::isHD() const { return m_isHD; } @@ -1797,17 +1797,17 @@ void BaseItemDto::setMediaSourceCountNull() { m_mediaSourceCount = std::nullopt; } -std::optional BaseItemDto::imageTags() const { return m_imageTags; } +QJsonObject BaseItemDto::imageTags() const { return m_imageTags; } -void BaseItemDto::setImageTags(std::optional newImageTags) { +void BaseItemDto::setImageTags(QJsonObject newImageTags) { m_imageTags = newImageTags; } bool BaseItemDto::imageTagsNull() const { - return !m_imageTags.has_value(); + return m_imageTags.isEmpty(); } void BaseItemDto::setImageTagsNull() { - m_imageTags = std::nullopt; + m_imageTags= QJsonObject(); } QStringList BaseItemDto::backdropImageTags() const { return m_backdropImageTags; } @@ -1888,17 +1888,17 @@ void BaseItemDto::setSeriesThumbImageTagNull() { m_seriesThumbImageTag.clear(); } -std::optional BaseItemDto::imageBlurHashes() const { return m_imageBlurHashes; } +QJsonObject BaseItemDto::imageBlurHashes() const { return m_imageBlurHashes; } -void BaseItemDto::setImageBlurHashes(std::optional newImageBlurHashes) { +void BaseItemDto::setImageBlurHashes(QJsonObject newImageBlurHashes) { m_imageBlurHashes = newImageBlurHashes; } bool BaseItemDto::imageBlurHashesNull() const { - return !m_imageBlurHashes.has_value(); + return m_imageBlurHashes.isEmpty(); } void BaseItemDto::setImageBlurHashesNull() { - m_imageBlurHashes = std::nullopt; + m_imageBlurHashes= QJsonObject(); } QString BaseItemDto::seriesStudio() const { return m_seriesStudio; } @@ -2556,10 +2556,15 @@ namespace Support { using BaseItemDto = Jellyfin::DTO::BaseItemDto; template <> -BaseItemDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BaseItemDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BaseItemDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BaseItemDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/baseitemdtoqueryresult.cpp b/core/src/dto/baseitemdtoqueryresult.cpp index 2ba00f7..480d155 100644 --- a/core/src/dto/baseitemdtoqueryresult.cpp +++ b/core/src/dto/baseitemdtoqueryresult.cpp @@ -61,7 +61,7 @@ void BaseItemDtoQueryResult::setFromJson(QJsonObject source) { } -QJsonObject BaseItemDtoQueryResult::toJson() { +QJsonObject BaseItemDtoQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using BaseItemDtoQueryResult = Jellyfin::DTO::BaseItemDtoQueryResult; template <> -BaseItemDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BaseItemDtoQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BaseItemDtoQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BaseItemDtoQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/baseitemperson.cpp b/core/src/dto/baseitemperson.cpp index 7b5b2d3..a4b294c 100644 --- a/core/src/dto/baseitemperson.cpp +++ b/core/src/dto/baseitemperson.cpp @@ -66,18 +66,18 @@ void BaseItemPerson::setFromJson(QJsonObject source) { m_role = Jellyfin::Support::fromJsonValue(source["Role"]); m_type = Jellyfin::Support::fromJsonValue(source["Type"]); m_primaryImageTag = Jellyfin::Support::fromJsonValue(source["PrimaryImageTag"]); - m_imageBlurHashes = Jellyfin::Support::fromJsonValue>(source["ImageBlurHashes"]); + m_imageBlurHashes = Jellyfin::Support::fromJsonValue(source["ImageBlurHashes"]); } -QJsonObject BaseItemPerson::toJson() { +QJsonObject BaseItemPerson::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Role"] = Jellyfin::Support::toJsonValue(m_role); result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_primaryImageTag); - result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue>(m_imageBlurHashes); + result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue(m_imageBlurHashes); return result; } @@ -147,17 +147,17 @@ void BaseItemPerson::setPrimaryImageTagNull() { m_primaryImageTag.clear(); } -std::optional BaseItemPerson::imageBlurHashes() const { return m_imageBlurHashes; } +QJsonObject BaseItemPerson::imageBlurHashes() const { return m_imageBlurHashes; } -void BaseItemPerson::setImageBlurHashes(std::optional newImageBlurHashes) { +void BaseItemPerson::setImageBlurHashes(QJsonObject newImageBlurHashes) { m_imageBlurHashes = newImageBlurHashes; } bool BaseItemPerson::imageBlurHashesNull() const { - return !m_imageBlurHashes.has_value(); + return m_imageBlurHashes.isEmpty(); } void BaseItemPerson::setImageBlurHashesNull() { - m_imageBlurHashes = std::nullopt; + m_imageBlurHashes= QJsonObject(); } @@ -168,10 +168,15 @@ namespace Support { using BaseItemPerson = Jellyfin::DTO::BaseItemPerson; template <> -BaseItemPerson fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BaseItemPerson fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BaseItemPerson::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BaseItemPerson &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/bookinfo.cpp b/core/src/dto/bookinfo.cpp index 9c48a0f..d3aba66 100644 --- a/core/src/dto/bookinfo.cpp +++ b/core/src/dto/bookinfo.cpp @@ -75,7 +75,7 @@ void BookInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -85,13 +85,13 @@ void BookInfo::setFromJson(QJsonObject source) { } -QJsonObject BookInfo::toJson() { +QJsonObject BookInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -154,17 +154,17 @@ void BookInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional BookInfo::providerIds() const { return m_providerIds; } +QJsonObject BookInfo::providerIds() const { return m_providerIds; } -void BookInfo::setProviderIds(std::optional newProviderIds) { +void BookInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool BookInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void BookInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional BookInfo::year() const { return m_year; } @@ -246,10 +246,15 @@ namespace Support { using BookInfo = Jellyfin::DTO::BookInfo; template <> -BookInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BookInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BookInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BookInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/bookinforemotesearchquery.cpp b/core/src/dto/bookinforemotesearchquery.cpp index b08f9ff..aae807a 100644 --- a/core/src/dto/bookinforemotesearchquery.cpp +++ b/core/src/dto/bookinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void BookInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject BookInfoRemoteSearchQuery::toJson() { +QJsonObject BookInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using BookInfoRemoteSearchQuery = Jellyfin::DTO::BookInfoRemoteSearchQuery; template <> -BookInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BookInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BookInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BookInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/boxsetinfo.cpp b/core/src/dto/boxsetinfo.cpp index 3b1467a..985e0d2 100644 --- a/core/src/dto/boxsetinfo.cpp +++ b/core/src/dto/boxsetinfo.cpp @@ -73,7 +73,7 @@ void BoxSetInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -82,13 +82,13 @@ void BoxSetInfo::setFromJson(QJsonObject source) { } -QJsonObject BoxSetInfo::toJson() { +QJsonObject BoxSetInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -150,17 +150,17 @@ void BoxSetInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional BoxSetInfo::providerIds() const { return m_providerIds; } +QJsonObject BoxSetInfo::providerIds() const { return m_providerIds; } -void BoxSetInfo::setProviderIds(std::optional newProviderIds) { +void BoxSetInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool BoxSetInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void BoxSetInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional BoxSetInfo::year() const { return m_year; } @@ -229,10 +229,15 @@ namespace Support { using BoxSetInfo = Jellyfin::DTO::BoxSetInfo; template <> -BoxSetInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BoxSetInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BoxSetInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BoxSetInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/boxsetinforemotesearchquery.cpp b/core/src/dto/boxsetinforemotesearchquery.cpp index bab364f..b988710 100644 --- a/core/src/dto/boxsetinforemotesearchquery.cpp +++ b/core/src/dto/boxsetinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void BoxSetInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject BoxSetInfoRemoteSearchQuery::toJson() { +QJsonObject BoxSetInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using BoxSetInfoRemoteSearchQuery = Jellyfin::DTO::BoxSetInfoRemoteSearchQuery; template <> -BoxSetInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BoxSetInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BoxSetInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BoxSetInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/brandingoptions.cpp b/core/src/dto/brandingoptions.cpp index 3f90f19..7af9c7d 100644 --- a/core/src/dto/brandingoptions.cpp +++ b/core/src/dto/brandingoptions.cpp @@ -58,7 +58,7 @@ void BrandingOptions::setFromJson(QJsonObject source) { } -QJsonObject BrandingOptions::toJson() { +QJsonObject BrandingOptions::toJson() const { QJsonObject result; result["LoginDisclaimer"] = Jellyfin::Support::toJsonValue(m_loginDisclaimer); result["CustomCss"] = Jellyfin::Support::toJsonValue(m_customCss); @@ -100,10 +100,15 @@ namespace Support { using BrandingOptions = Jellyfin::DTO::BrandingOptions; template <> -BrandingOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BrandingOptions fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BrandingOptions::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BrandingOptions &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/bufferrequestdto.cpp b/core/src/dto/bufferrequestdto.cpp index 95d7ced..6ec3237 100644 --- a/core/src/dto/bufferrequestdto.cpp +++ b/core/src/dto/bufferrequestdto.cpp @@ -64,7 +64,7 @@ void BufferRequestDto::setFromJson(QJsonObject source) { } -QJsonObject BufferRequestDto::toJson() { +QJsonObject BufferRequestDto::toJson() const { QJsonObject result; result["When"] = Jellyfin::Support::toJsonValue(m_when); result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); @@ -106,10 +106,15 @@ namespace Support { using BufferRequestDto = Jellyfin::DTO::BufferRequestDto; template <> -BufferRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +BufferRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return BufferRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const BufferRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channelfeatures.cpp b/core/src/dto/channelfeatures.cpp index be03338..a9ad1f5 100644 --- a/core/src/dto/channelfeatures.cpp +++ b/core/src/dto/channelfeatures.cpp @@ -88,7 +88,7 @@ void ChannelFeatures::setFromJson(QJsonObject source) { } -QJsonObject ChannelFeatures::toJson() { +QJsonObject ChannelFeatures::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -235,10 +235,15 @@ namespace Support { using ChannelFeatures = Jellyfin::DTO::ChannelFeatures; template <> -ChannelFeatures fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ChannelFeatures fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ChannelFeatures::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ChannelFeatures &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channelitemsortfield.cpp b/core/src/dto/channelitemsortfield.cpp index 616349c..c884a25 100644 --- a/core/src/dto/channelitemsortfield.cpp +++ b/core/src/dto/channelitemsortfield.cpp @@ -34,7 +34,6 @@ namespace DTO { ChannelItemSortFieldClass::ChannelItemSortFieldClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ChannelItemSortField = Jellyfin::DTO::ChannelItemSortField; template <> -ChannelItemSortField fromJsonValue(const QJsonValue &source) { +ChannelItemSortField fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ChannelItemSortField::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ ChannelItemSortField fromJsonValue(const QJsonValue &sourc return ChannelItemSortField::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ChannelItemSortField &source, convertType) { + switch(source) { + case ChannelItemSortField::Name: + return QStringLiteral("Name"); + case ChannelItemSortField::CommunityRating: + return QStringLiteral("CommunityRating"); + case ChannelItemSortField::PremiereDate: + return QStringLiteral("PremiereDate"); + case ChannelItemSortField::DateCreated: + return QStringLiteral("DateCreated"); + case ChannelItemSortField::Runtime: + return QStringLiteral("Runtime"); + case ChannelItemSortField::PlayCount: + return QStringLiteral("PlayCount"); + case ChannelItemSortField::CommunityPlayCount: + return QStringLiteral("CommunityPlayCount"); + + case ChannelItemSortField::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channelmappingoptionsdto.cpp b/core/src/dto/channelmappingoptionsdto.cpp index 6510982..badf3d4 100644 --- a/core/src/dto/channelmappingoptionsdto.cpp +++ b/core/src/dto/channelmappingoptionsdto.cpp @@ -64,7 +64,7 @@ void ChannelMappingOptionsDto::setFromJson(QJsonObject source) { } -QJsonObject ChannelMappingOptionsDto::toJson() { +QJsonObject ChannelMappingOptionsDto::toJson() const { QJsonObject result; result["TunerChannels"] = Jellyfin::Support::toJsonValue>(m_tunerChannels); result["ProviderChannels"] = Jellyfin::Support::toJsonValue>(m_providerChannels); @@ -134,10 +134,15 @@ namespace Support { using ChannelMappingOptionsDto = Jellyfin::DTO::ChannelMappingOptionsDto; template <> -ChannelMappingOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ChannelMappingOptionsDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ChannelMappingOptionsDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ChannelMappingOptionsDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channelmediacontenttype.cpp b/core/src/dto/channelmediacontenttype.cpp index fb977d6..a5f69d9 100644 --- a/core/src/dto/channelmediacontenttype.cpp +++ b/core/src/dto/channelmediacontenttype.cpp @@ -34,7 +34,6 @@ namespace DTO { ChannelMediaContentTypeClass::ChannelMediaContentTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ChannelMediaContentType = Jellyfin::DTO::ChannelMediaContentType; template <> -ChannelMediaContentType fromJsonValue(const QJsonValue &source) { +ChannelMediaContentType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ChannelMediaContentType::EnumNotSet; QString str = source.toString(); @@ -74,5 +73,31 @@ ChannelMediaContentType fromJsonValue(const QJsonValue return ChannelMediaContentType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ChannelMediaContentType &source, convertType) { + switch(source) { + case ChannelMediaContentType::Clip: + return QStringLiteral("Clip"); + case ChannelMediaContentType::Podcast: + return QStringLiteral("Podcast"); + case ChannelMediaContentType::Trailer: + return QStringLiteral("Trailer"); + case ChannelMediaContentType::Movie: + return QStringLiteral("Movie"); + case ChannelMediaContentType::Episode: + return QStringLiteral("Episode"); + case ChannelMediaContentType::Song: + return QStringLiteral("Song"); + case ChannelMediaContentType::MovieExtra: + return QStringLiteral("MovieExtra"); + case ChannelMediaContentType::TvExtra: + return QStringLiteral("TvExtra"); + + case ChannelMediaContentType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channelmediatype.cpp b/core/src/dto/channelmediatype.cpp index ae71526..985b2f5 100644 --- a/core/src/dto/channelmediatype.cpp +++ b/core/src/dto/channelmediatype.cpp @@ -34,7 +34,6 @@ namespace DTO { ChannelMediaTypeClass::ChannelMediaTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ChannelMediaType = Jellyfin::DTO::ChannelMediaType; template <> -ChannelMediaType fromJsonValue(const QJsonValue &source) { +ChannelMediaType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ChannelMediaType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ ChannelMediaType fromJsonValue(const QJsonValue &source) { return ChannelMediaType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ChannelMediaType &source, convertType) { + switch(source) { + case ChannelMediaType::Audio: + return QStringLiteral("Audio"); + case ChannelMediaType::Video: + return QStringLiteral("Video"); + case ChannelMediaType::Photo: + return QStringLiteral("Photo"); + + case ChannelMediaType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/channeltype.cpp b/core/src/dto/channeltype.cpp index 4969e85..6858cdd 100644 --- a/core/src/dto/channeltype.cpp +++ b/core/src/dto/channeltype.cpp @@ -34,7 +34,6 @@ namespace DTO { ChannelTypeClass::ChannelTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ChannelType = Jellyfin::DTO::ChannelType; template <> -ChannelType fromJsonValue(const QJsonValue &source) { +ChannelType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ChannelType::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ ChannelType fromJsonValue(const QJsonValue &source) { return ChannelType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ChannelType &source, convertType) { + switch(source) { + case ChannelType::TV: + return QStringLiteral("TV"); + case ChannelType::Radio: + return QStringLiteral("Radio"); + + case ChannelType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/chapterinfo.cpp b/core/src/dto/chapterinfo.cpp index ebbeeeb..da84f4e 100644 --- a/core/src/dto/chapterinfo.cpp +++ b/core/src/dto/chapterinfo.cpp @@ -67,7 +67,7 @@ void ChapterInfo::setFromJson(QJsonObject source) { } -QJsonObject ChapterInfo::toJson() { +QJsonObject ChapterInfo::toJson() const { QJsonObject result; result["StartPositionTicks"] = Jellyfin::Support::toJsonValue(m_startPositionTicks); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -137,10 +137,15 @@ namespace Support { using ChapterInfo = Jellyfin::DTO::ChapterInfo; template <> -ChapterInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ChapterInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ChapterInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ChapterInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/clientcapabilities.cpp b/core/src/dto/clientcapabilities.cpp index 6da42e8..57ed707 100644 --- a/core/src/dto/clientcapabilities.cpp +++ b/core/src/dto/clientcapabilities.cpp @@ -82,7 +82,7 @@ void ClientCapabilities::setFromJson(QJsonObject source) { } -QJsonObject ClientCapabilities::toJson() { +QJsonObject ClientCapabilities::toJson() const { QJsonObject result; result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); @@ -201,10 +201,15 @@ namespace Support { using ClientCapabilities = Jellyfin::DTO::ClientCapabilities; template <> -ClientCapabilities fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ClientCapabilities fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ClientCapabilities::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ClientCapabilities &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/clientcapabilitiesdto.cpp b/core/src/dto/clientcapabilitiesdto.cpp index 58f288e..9d860ef 100644 --- a/core/src/dto/clientcapabilitiesdto.cpp +++ b/core/src/dto/clientcapabilitiesdto.cpp @@ -82,7 +82,7 @@ void ClientCapabilitiesDto::setFromJson(QJsonObject source) { } -QJsonObject ClientCapabilitiesDto::toJson() { +QJsonObject ClientCapabilitiesDto::toJson() const { QJsonObject result; result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); @@ -201,10 +201,15 @@ namespace Support { using ClientCapabilitiesDto = Jellyfin::DTO::ClientCapabilitiesDto; template <> -ClientCapabilitiesDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ClientCapabilitiesDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ClientCapabilitiesDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ClientCapabilitiesDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/codecprofile.cpp b/core/src/dto/codecprofile.cpp index f17c0ba..530fc6e 100644 --- a/core/src/dto/codecprofile.cpp +++ b/core/src/dto/codecprofile.cpp @@ -67,7 +67,7 @@ void CodecProfile::setFromJson(QJsonObject source) { } -QJsonObject CodecProfile::toJson() { +QJsonObject CodecProfile::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["Conditions"] = Jellyfin::Support::toJsonValue>(m_conditions); @@ -144,10 +144,15 @@ namespace Support { using CodecProfile = Jellyfin::DTO::CodecProfile; template <> -CodecProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CodecProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CodecProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CodecProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/codectype.cpp b/core/src/dto/codectype.cpp index 332cb49..3465756 100644 --- a/core/src/dto/codectype.cpp +++ b/core/src/dto/codectype.cpp @@ -34,7 +34,6 @@ namespace DTO { CodecTypeClass::CodecTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using CodecType = Jellyfin::DTO::CodecType; template <> -CodecType fromJsonValue(const QJsonValue &source) { +CodecType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return CodecType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ CodecType fromJsonValue(const QJsonValue &source) { return CodecType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const CodecType &source, convertType) { + switch(source) { + case CodecType::Video: + return QStringLiteral("Video"); + case CodecType::VideoAudio: + return QStringLiteral("VideoAudio"); + case CodecType::Audio: + return QStringLiteral("Audio"); + + case CodecType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/collectioncreationresult.cpp b/core/src/dto/collectioncreationresult.cpp index f10a52a..6169e3b 100644 --- a/core/src/dto/collectioncreationresult.cpp +++ b/core/src/dto/collectioncreationresult.cpp @@ -55,7 +55,7 @@ void CollectionCreationResult::setFromJson(QJsonObject source) { } -QJsonObject CollectionCreationResult::toJson() { +QJsonObject CollectionCreationResult::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -76,10 +76,15 @@ namespace Support { using CollectionCreationResult = Jellyfin::DTO::CollectionCreationResult; template <> -CollectionCreationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CollectionCreationResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CollectionCreationResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CollectionCreationResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/configurationpageinfo.cpp b/core/src/dto/configurationpageinfo.cpp index 333513e..2f105ab 100644 --- a/core/src/dto/configurationpageinfo.cpp +++ b/core/src/dto/configurationpageinfo.cpp @@ -73,7 +73,7 @@ void ConfigurationPageInfo::setFromJson(QJsonObject source) { } -QJsonObject ConfigurationPageInfo::toJson() { +QJsonObject ConfigurationPageInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["EnableInMainMenu"] = Jellyfin::Support::toJsonValue(m_enableInMainMenu); @@ -171,10 +171,15 @@ namespace Support { using ConfigurationPageInfo = Jellyfin::DTO::ConfigurationPageInfo; template <> -ConfigurationPageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ConfigurationPageInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ConfigurationPageInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ConfigurationPageInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/configurationpagetype.cpp b/core/src/dto/configurationpagetype.cpp index 6049722..df299c0 100644 --- a/core/src/dto/configurationpagetype.cpp +++ b/core/src/dto/configurationpagetype.cpp @@ -34,7 +34,6 @@ namespace DTO { ConfigurationPageTypeClass::ConfigurationPageTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType; template <> -ConfigurationPageType fromJsonValue(const QJsonValue &source) { +ConfigurationPageType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ConfigurationPageType::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ ConfigurationPageType fromJsonValue(const QJsonValue &sou return ConfigurationPageType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ConfigurationPageType &source, convertType) { + switch(source) { + case ConfigurationPageType::PluginConfiguration: + return QStringLiteral("PluginConfiguration"); + case ConfigurationPageType::None: + return QStringLiteral("None"); + + case ConfigurationPageType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/containerprofile.cpp b/core/src/dto/containerprofile.cpp index f82aa1c..7b0de6a 100644 --- a/core/src/dto/containerprofile.cpp +++ b/core/src/dto/containerprofile.cpp @@ -61,7 +61,7 @@ void ContainerProfile::setFromJson(QJsonObject source) { } -QJsonObject ContainerProfile::toJson() { +QJsonObject ContainerProfile::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["Conditions"] = Jellyfin::Support::toJsonValue>(m_conditions); @@ -110,10 +110,15 @@ namespace Support { using ContainerProfile = Jellyfin::DTO::ContainerProfile; template <> -ContainerProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ContainerProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ContainerProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ContainerProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/controlresponse.cpp b/core/src/dto/controlresponse.cpp index 6c8a9f1..6f91ed0 100644 --- a/core/src/dto/controlresponse.cpp +++ b/core/src/dto/controlresponse.cpp @@ -55,32 +55,32 @@ ControlResponse ControlResponse::fromJson(QJsonObject source) { void ControlResponse::setFromJson(QJsonObject source) { - m_headers = Jellyfin::Support::fromJsonValue>(source["Headers"]); + m_headers = Jellyfin::Support::fromJsonValue(source["Headers"]); m_xml = Jellyfin::Support::fromJsonValue(source["Xml"]); m_isSuccessful = Jellyfin::Support::fromJsonValue(source["IsSuccessful"]); } -QJsonObject ControlResponse::toJson() { +QJsonObject ControlResponse::toJson() const { QJsonObject result; - result["Headers"] = Jellyfin::Support::toJsonValue>(m_headers); + result["Headers"] = Jellyfin::Support::toJsonValue(m_headers); result["Xml"] = Jellyfin::Support::toJsonValue(m_xml); result["IsSuccessful"] = Jellyfin::Support::toJsonValue(m_isSuccessful); return result; } -std::optional ControlResponse::headers() const { return m_headers; } +QJsonObject ControlResponse::headers() const { return m_headers; } -void ControlResponse::setHeaders(std::optional newHeaders) { +void ControlResponse::setHeaders(QJsonObject newHeaders) { m_headers = newHeaders; } bool ControlResponse::headersNull() const { - return !m_headers.has_value(); + return m_headers.isEmpty(); } void ControlResponse::setHeadersNull() { - m_headers = std::nullopt; + m_headers= QJsonObject(); } QString ControlResponse::xml() const { return m_xml; } @@ -110,10 +110,15 @@ namespace Support { using ControlResponse = Jellyfin::DTO::ControlResponse; template <> -ControlResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ControlResponse fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ControlResponse::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ControlResponse &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/countryinfo.cpp b/core/src/dto/countryinfo.cpp index 8540fd9..c3f349a 100644 --- a/core/src/dto/countryinfo.cpp +++ b/core/src/dto/countryinfo.cpp @@ -64,7 +64,7 @@ void CountryInfo::setFromJson(QJsonObject source) { } -QJsonObject CountryInfo::toJson() { +QJsonObject CountryInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["DisplayName"] = Jellyfin::Support::toJsonValue(m_displayName); @@ -134,10 +134,15 @@ namespace Support { using CountryInfo = Jellyfin::DTO::CountryInfo; template <> -CountryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CountryInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CountryInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CountryInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/createplaylistdto.cpp b/core/src/dto/createplaylistdto.cpp index 3914912..0cf76a0 100644 --- a/core/src/dto/createplaylistdto.cpp +++ b/core/src/dto/createplaylistdto.cpp @@ -64,7 +64,7 @@ void CreatePlaylistDto::setFromJson(QJsonObject source) { } -QJsonObject CreatePlaylistDto::toJson() { +QJsonObject CreatePlaylistDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Ids"] = Jellyfin::Support::toJsonValue(m_ids); @@ -134,10 +134,15 @@ namespace Support { using CreatePlaylistDto = Jellyfin::DTO::CreatePlaylistDto; template <> -CreatePlaylistDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CreatePlaylistDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CreatePlaylistDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CreatePlaylistDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/createuserbyname.cpp b/core/src/dto/createuserbyname.cpp index 0f1fc7a..e3d3b0c 100644 --- a/core/src/dto/createuserbyname.cpp +++ b/core/src/dto/createuserbyname.cpp @@ -58,7 +58,7 @@ void CreateUserByName::setFromJson(QJsonObject source) { } -QJsonObject CreateUserByName::toJson() { +QJsonObject CreateUserByName::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Password"] = Jellyfin::Support::toJsonValue(m_password); @@ -100,10 +100,15 @@ namespace Support { using CreateUserByName = Jellyfin::DTO::CreateUserByName; template <> -CreateUserByName fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CreateUserByName fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CreateUserByName::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CreateUserByName &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/culturedto.cpp b/core/src/dto/culturedto.cpp index 2479928..530556d 100644 --- a/core/src/dto/culturedto.cpp +++ b/core/src/dto/culturedto.cpp @@ -67,7 +67,7 @@ void CultureDto::setFromJson(QJsonObject source) { } -QJsonObject CultureDto::toJson() { +QJsonObject CultureDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["DisplayName"] = Jellyfin::Support::toJsonValue(m_displayName); @@ -151,10 +151,15 @@ namespace Support { using CultureDto = Jellyfin::DTO::CultureDto; template <> -CultureDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +CultureDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return CultureDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const CultureDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/dayofweek.cpp b/core/src/dto/dayofweek.cpp index b5b3f1c..68f854d 100644 --- a/core/src/dto/dayofweek.cpp +++ b/core/src/dto/dayofweek.cpp @@ -34,7 +34,6 @@ namespace DTO { DayOfWeekClass::DayOfWeekClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using DayOfWeek = Jellyfin::DTO::DayOfWeek; template <> -DayOfWeek fromJsonValue(const QJsonValue &source) { +DayOfWeek fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return DayOfWeek::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ DayOfWeek fromJsonValue(const QJsonValue &source) { return DayOfWeek::EnumNotSet; } +template <> +QJsonValue toJsonValue(const DayOfWeek &source, convertType) { + switch(source) { + case DayOfWeek::Sunday: + return QStringLiteral("Sunday"); + case DayOfWeek::Monday: + return QStringLiteral("Monday"); + case DayOfWeek::Tuesday: + return QStringLiteral("Tuesday"); + case DayOfWeek::Wednesday: + return QStringLiteral("Wednesday"); + case DayOfWeek::Thursday: + return QStringLiteral("Thursday"); + case DayOfWeek::Friday: + return QStringLiteral("Friday"); + case DayOfWeek::Saturday: + return QStringLiteral("Saturday"); + + case DayOfWeek::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/daypattern.cpp b/core/src/dto/daypattern.cpp index a1d0265..da3ee41 100644 --- a/core/src/dto/daypattern.cpp +++ b/core/src/dto/daypattern.cpp @@ -34,7 +34,6 @@ namespace DTO { DayPatternClass::DayPatternClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using DayPattern = Jellyfin::DTO::DayPattern; template <> -DayPattern fromJsonValue(const QJsonValue &source) { +DayPattern fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return DayPattern::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ DayPattern fromJsonValue(const QJsonValue &source) { return DayPattern::EnumNotSet; } +template <> +QJsonValue toJsonValue(const DayPattern &source, convertType) { + switch(source) { + case DayPattern::Daily: + return QStringLiteral("Daily"); + case DayPattern::Weekdays: + return QStringLiteral("Weekdays"); + case DayPattern::Weekends: + return QStringLiteral("Weekends"); + + case DayPattern::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/defaultdirectorybrowserinfodto.cpp b/core/src/dto/defaultdirectorybrowserinfodto.cpp index 259f2af..4c32b2f 100644 --- a/core/src/dto/defaultdirectorybrowserinfodto.cpp +++ b/core/src/dto/defaultdirectorybrowserinfodto.cpp @@ -55,7 +55,7 @@ void DefaultDirectoryBrowserInfoDto::setFromJson(QJsonObject source) { } -QJsonObject DefaultDirectoryBrowserInfoDto::toJson() { +QJsonObject DefaultDirectoryBrowserInfoDto::toJson() const { QJsonObject result; result["Path"] = Jellyfin::Support::toJsonValue(m_path); @@ -83,10 +83,15 @@ namespace Support { using DefaultDirectoryBrowserInfoDto = Jellyfin::DTO::DefaultDirectoryBrowserInfoDto; template <> -DefaultDirectoryBrowserInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DefaultDirectoryBrowserInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DefaultDirectoryBrowserInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DefaultDirectoryBrowserInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceidentification.cpp b/core/src/dto/deviceidentification.cpp index 2873b70..5b20d2e 100644 --- a/core/src/dto/deviceidentification.cpp +++ b/core/src/dto/deviceidentification.cpp @@ -79,7 +79,7 @@ void DeviceIdentification::setFromJson(QJsonObject source) { } -QJsonObject DeviceIdentification::toJson() { +QJsonObject DeviceIdentification::toJson() const { QJsonObject result; result["FriendlyName"] = Jellyfin::Support::toJsonValue(m_friendlyName); result["ModelNumber"] = Jellyfin::Support::toJsonValue(m_modelNumber); @@ -219,10 +219,15 @@ namespace Support { using DeviceIdentification = Jellyfin::DTO::DeviceIdentification; template <> -DeviceIdentification fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceIdentification fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceIdentification::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceIdentification &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceinfo.cpp b/core/src/dto/deviceinfo.cpp index 83644ce..34a6c09 100644 --- a/core/src/dto/deviceinfo.cpp +++ b/core/src/dto/deviceinfo.cpp @@ -79,7 +79,7 @@ void DeviceInfo::setFromJson(QJsonObject source) { } -QJsonObject DeviceInfo::toJson() { +QJsonObject DeviceInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -198,10 +198,15 @@ namespace Support { using DeviceInfo = Jellyfin::DTO::DeviceInfo; template <> -DeviceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceinfoqueryresult.cpp b/core/src/dto/deviceinfoqueryresult.cpp index 9d0df8e..5c23812 100644 --- a/core/src/dto/deviceinfoqueryresult.cpp +++ b/core/src/dto/deviceinfoqueryresult.cpp @@ -61,7 +61,7 @@ void DeviceInfoQueryResult::setFromJson(QJsonObject source) { } -QJsonObject DeviceInfoQueryResult::toJson() { +QJsonObject DeviceInfoQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult; template <> -DeviceInfoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceInfoQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceInfoQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceInfoQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceoptions.cpp b/core/src/dto/deviceoptions.cpp index 02b60dc..ef94c04 100644 --- a/core/src/dto/deviceoptions.cpp +++ b/core/src/dto/deviceoptions.cpp @@ -55,7 +55,7 @@ void DeviceOptions::setFromJson(QJsonObject source) { } -QJsonObject DeviceOptions::toJson() { +QJsonObject DeviceOptions::toJson() const { QJsonObject result; result["CustomName"] = Jellyfin::Support::toJsonValue(m_customName); @@ -83,10 +83,15 @@ namespace Support { using DeviceOptions = Jellyfin::DTO::DeviceOptions; template <> -DeviceOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceOptions fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceOptions::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceOptions &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceprofile.cpp b/core/src/dto/deviceprofile.cpp index 4c52d6f..a456ac8 100644 --- a/core/src/dto/deviceprofile.cpp +++ b/core/src/dto/deviceprofile.cpp @@ -169,7 +169,7 @@ void DeviceProfile::setFromJson(QJsonObject source) { } -QJsonObject DeviceProfile::toJson() { +QJsonObject DeviceProfile::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -652,10 +652,15 @@ namespace Support { using DeviceProfile = Jellyfin::DTO::DeviceProfile; template <> -DeviceProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceprofileinfo.cpp b/core/src/dto/deviceprofileinfo.cpp index c5a88d9..6587e42 100644 --- a/core/src/dto/deviceprofileinfo.cpp +++ b/core/src/dto/deviceprofileinfo.cpp @@ -61,7 +61,7 @@ void DeviceProfileInfo::setFromJson(QJsonObject source) { } -QJsonObject DeviceProfileInfo::toJson() { +QJsonObject DeviceProfileInfo::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -110,10 +110,15 @@ namespace Support { using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo; template <> -DeviceProfileInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DeviceProfileInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DeviceProfileInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DeviceProfileInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/deviceprofiletype.cpp b/core/src/dto/deviceprofiletype.cpp index cc4152f..b64d7fa 100644 --- a/core/src/dto/deviceprofiletype.cpp +++ b/core/src/dto/deviceprofiletype.cpp @@ -34,7 +34,6 @@ namespace DTO { DeviceProfileTypeClass::DeviceProfileTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using DeviceProfileType = Jellyfin::DTO::DeviceProfileType; template <> -DeviceProfileType fromJsonValue(const QJsonValue &source) { +DeviceProfileType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return DeviceProfileType::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ DeviceProfileType fromJsonValue(const QJsonValue &source) { return DeviceProfileType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const DeviceProfileType &source, convertType) { + switch(source) { + case DeviceProfileType::System: + return QStringLiteral("System"); + case DeviceProfileType::User: + return QStringLiteral("User"); + + case DeviceProfileType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/directplayprofile.cpp b/core/src/dto/directplayprofile.cpp index 5d2838a..472e2eb 100644 --- a/core/src/dto/directplayprofile.cpp +++ b/core/src/dto/directplayprofile.cpp @@ -64,7 +64,7 @@ void DirectPlayProfile::setFromJson(QJsonObject source) { } -QJsonObject DirectPlayProfile::toJson() { +QJsonObject DirectPlayProfile::toJson() const { QJsonObject result; result["Container"] = Jellyfin::Support::toJsonValue(m_container); result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); @@ -127,10 +127,15 @@ namespace Support { using DirectPlayProfile = Jellyfin::DTO::DirectPlayProfile; template <> -DirectPlayProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DirectPlayProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DirectPlayProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DirectPlayProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/displaypreferencesdto.cpp b/core/src/dto/displaypreferencesdto.cpp index dd6ee97..82afdc3 100644 --- a/core/src/dto/displaypreferencesdto.cpp +++ b/core/src/dto/displaypreferencesdto.cpp @@ -84,7 +84,7 @@ void DisplayPreferencesDto::setFromJson(QJsonObject source) { m_rememberIndexing = Jellyfin::Support::fromJsonValue(source["RememberIndexing"]); m_primaryImageHeight = Jellyfin::Support::fromJsonValue(source["PrimaryImageHeight"]); m_primaryImageWidth = Jellyfin::Support::fromJsonValue(source["PrimaryImageWidth"]); - m_customPrefs = Jellyfin::Support::fromJsonValue>(source["CustomPrefs"]); + m_customPrefs = Jellyfin::Support::fromJsonValue(source["CustomPrefs"]); m_scrollDirection = Jellyfin::Support::fromJsonValue(source["ScrollDirection"]); m_showBackdrop = Jellyfin::Support::fromJsonValue(source["ShowBackdrop"]); m_rememberSorting = Jellyfin::Support::fromJsonValue(source["RememberSorting"]); @@ -94,7 +94,7 @@ void DisplayPreferencesDto::setFromJson(QJsonObject source) { } -QJsonObject DisplayPreferencesDto::toJson() { +QJsonObject DisplayPreferencesDto::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["ViewType"] = Jellyfin::Support::toJsonValue(m_viewType); @@ -103,7 +103,7 @@ QJsonObject DisplayPreferencesDto::toJson() { result["RememberIndexing"] = Jellyfin::Support::toJsonValue(m_rememberIndexing); result["PrimaryImageHeight"] = Jellyfin::Support::toJsonValue(m_primaryImageHeight); result["PrimaryImageWidth"] = Jellyfin::Support::toJsonValue(m_primaryImageWidth); - result["CustomPrefs"] = Jellyfin::Support::toJsonValue>(m_customPrefs); + result["CustomPrefs"] = Jellyfin::Support::toJsonValue(m_customPrefs); result["ScrollDirection"] = Jellyfin::Support::toJsonValue(m_scrollDirection); result["ShowBackdrop"] = Jellyfin::Support::toJsonValue(m_showBackdrop); result["RememberSorting"] = Jellyfin::Support::toJsonValue(m_rememberSorting); @@ -184,17 +184,17 @@ void DisplayPreferencesDto::setPrimaryImageWidth(qint32 newPrimaryImageWidth) { m_primaryImageWidth = newPrimaryImageWidth; } -std::optional DisplayPreferencesDto::customPrefs() const { return m_customPrefs; } +QJsonObject DisplayPreferencesDto::customPrefs() const { return m_customPrefs; } -void DisplayPreferencesDto::setCustomPrefs(std::optional newCustomPrefs) { +void DisplayPreferencesDto::setCustomPrefs(QJsonObject newCustomPrefs) { m_customPrefs = newCustomPrefs; } bool DisplayPreferencesDto::customPrefsNull() const { - return !m_customPrefs.has_value(); + return m_customPrefs.isEmpty(); } void DisplayPreferencesDto::setCustomPrefsNull() { - m_customPrefs = std::nullopt; + m_customPrefs= QJsonObject(); } ScrollDirection DisplayPreferencesDto::scrollDirection() const { return m_scrollDirection; } @@ -248,10 +248,15 @@ namespace Support { using DisplayPreferencesDto = Jellyfin::DTO::DisplayPreferencesDto; template <> -DisplayPreferencesDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +DisplayPreferencesDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return DisplayPreferencesDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const DisplayPreferencesDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/dlnaprofiletype.cpp b/core/src/dto/dlnaprofiletype.cpp index 419dd72..611edb9 100644 --- a/core/src/dto/dlnaprofiletype.cpp +++ b/core/src/dto/dlnaprofiletype.cpp @@ -34,7 +34,6 @@ namespace DTO { DlnaProfileTypeClass::DlnaProfileTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using DlnaProfileType = Jellyfin::DTO::DlnaProfileType; template <> -DlnaProfileType fromJsonValue(const QJsonValue &source) { +DlnaProfileType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return DlnaProfileType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ DlnaProfileType fromJsonValue(const QJsonValue &source) { return DlnaProfileType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const DlnaProfileType &source, convertType) { + switch(source) { + case DlnaProfileType::Audio: + return QStringLiteral("Audio"); + case DlnaProfileType::Video: + return QStringLiteral("Video"); + case DlnaProfileType::Photo: + return QStringLiteral("Photo"); + + case DlnaProfileType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/dynamicdayofweek.cpp b/core/src/dto/dynamicdayofweek.cpp index bdada4c..6671c03 100644 --- a/core/src/dto/dynamicdayofweek.cpp +++ b/core/src/dto/dynamicdayofweek.cpp @@ -34,7 +34,6 @@ namespace DTO { DynamicDayOfWeekClass::DynamicDayOfWeekClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using DynamicDayOfWeek = Jellyfin::DTO::DynamicDayOfWeek; template <> -DynamicDayOfWeek fromJsonValue(const QJsonValue &source) { +DynamicDayOfWeek fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return DynamicDayOfWeek::EnumNotSet; QString str = source.toString(); @@ -80,5 +79,35 @@ DynamicDayOfWeek fromJsonValue(const QJsonValue &source) { return DynamicDayOfWeek::EnumNotSet; } +template <> +QJsonValue toJsonValue(const DynamicDayOfWeek &source, convertType) { + switch(source) { + case DynamicDayOfWeek::Sunday: + return QStringLiteral("Sunday"); + case DynamicDayOfWeek::Monday: + return QStringLiteral("Monday"); + case DynamicDayOfWeek::Tuesday: + return QStringLiteral("Tuesday"); + case DynamicDayOfWeek::Wednesday: + return QStringLiteral("Wednesday"); + case DynamicDayOfWeek::Thursday: + return QStringLiteral("Thursday"); + case DynamicDayOfWeek::Friday: + return QStringLiteral("Friday"); + case DynamicDayOfWeek::Saturday: + return QStringLiteral("Saturday"); + case DynamicDayOfWeek::Everyday: + return QStringLiteral("Everyday"); + case DynamicDayOfWeek::Weekday: + return QStringLiteral("Weekday"); + case DynamicDayOfWeek::Weekend: + return QStringLiteral("Weekend"); + + case DynamicDayOfWeek::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/encodingcontext.cpp b/core/src/dto/encodingcontext.cpp index acf1f4b..098a9e9 100644 --- a/core/src/dto/encodingcontext.cpp +++ b/core/src/dto/encodingcontext.cpp @@ -34,7 +34,6 @@ namespace DTO { EncodingContextClass::EncodingContextClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using EncodingContext = Jellyfin::DTO::EncodingContext; template <> -EncodingContext fromJsonValue(const QJsonValue &source) { +EncodingContext fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return EncodingContext::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ EncodingContext fromJsonValue(const QJsonValue &source) { return EncodingContext::EnumNotSet; } +template <> +QJsonValue toJsonValue(const EncodingContext &source, convertType) { + switch(source) { + case EncodingContext::Streaming: + return QStringLiteral("Streaming"); + case EncodingContext::Static: + return QStringLiteral("Static"); + + case EncodingContext::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/endpointinfo.cpp b/core/src/dto/endpointinfo.cpp index 81e6f7e..8c392bb 100644 --- a/core/src/dto/endpointinfo.cpp +++ b/core/src/dto/endpointinfo.cpp @@ -58,7 +58,7 @@ void EndPointInfo::setFromJson(QJsonObject source) { } -QJsonObject EndPointInfo::toJson() { +QJsonObject EndPointInfo::toJson() const { QJsonObject result; result["IsLocal"] = Jellyfin::Support::toJsonValue(m_isLocal); result["IsInNetwork"] = Jellyfin::Support::toJsonValue(m_isInNetwork); @@ -86,10 +86,15 @@ namespace Support { using EndPointInfo = Jellyfin::DTO::EndPointInfo; template <> -EndPointInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +EndPointInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return EndPointInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const EndPointInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/externalidinfo.cpp b/core/src/dto/externalidinfo.cpp index f379782..1f3b8fb 100644 --- a/core/src/dto/externalidinfo.cpp +++ b/core/src/dto/externalidinfo.cpp @@ -64,7 +64,7 @@ void ExternalIdInfo::setFromJson(QJsonObject source) { } -QJsonObject ExternalIdInfo::toJson() { +QJsonObject ExternalIdInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Key"] = Jellyfin::Support::toJsonValue(m_key); @@ -127,10 +127,15 @@ namespace Support { using ExternalIdInfo = Jellyfin::DTO::ExternalIdInfo; template <> -ExternalIdInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ExternalIdInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ExternalIdInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ExternalIdInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/externalidmediatype.cpp b/core/src/dto/externalidmediatype.cpp index bc4e234..7e42dd4 100644 --- a/core/src/dto/externalidmediatype.cpp +++ b/core/src/dto/externalidmediatype.cpp @@ -34,7 +34,6 @@ namespace DTO { ExternalIdMediaTypeClass::ExternalIdMediaTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ExternalIdMediaType = Jellyfin::DTO::ExternalIdMediaType; template <> -ExternalIdMediaType fromJsonValue(const QJsonValue &source) { +ExternalIdMediaType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ExternalIdMediaType::EnumNotSet; QString str = source.toString(); @@ -86,5 +85,39 @@ ExternalIdMediaType fromJsonValue(const QJsonValue &source) return ExternalIdMediaType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ExternalIdMediaType &source, convertType) { + switch(source) { + case ExternalIdMediaType::Album: + return QStringLiteral("Album"); + case ExternalIdMediaType::AlbumArtist: + return QStringLiteral("AlbumArtist"); + case ExternalIdMediaType::Artist: + return QStringLiteral("Artist"); + case ExternalIdMediaType::BoxSet: + return QStringLiteral("BoxSet"); + case ExternalIdMediaType::Episode: + return QStringLiteral("Episode"); + case ExternalIdMediaType::Movie: + return QStringLiteral("Movie"); + case ExternalIdMediaType::OtherArtist: + return QStringLiteral("OtherArtist"); + case ExternalIdMediaType::Person: + return QStringLiteral("Person"); + case ExternalIdMediaType::ReleaseGroup: + return QStringLiteral("ReleaseGroup"); + case ExternalIdMediaType::Season: + return QStringLiteral("Season"); + case ExternalIdMediaType::Series: + return QStringLiteral("Series"); + case ExternalIdMediaType::Track: + return QStringLiteral("Track"); + + case ExternalIdMediaType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/externalurl.cpp b/core/src/dto/externalurl.cpp index 530104c..7840d2b 100644 --- a/core/src/dto/externalurl.cpp +++ b/core/src/dto/externalurl.cpp @@ -58,7 +58,7 @@ void ExternalUrl::setFromJson(QJsonObject source) { } -QJsonObject ExternalUrl::toJson() { +QJsonObject ExternalUrl::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Url"] = Jellyfin::Support::toJsonValue(m_url); @@ -100,10 +100,15 @@ namespace Support { using ExternalUrl = Jellyfin::DTO::ExternalUrl; template <> -ExternalUrl fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ExternalUrl fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ExternalUrl::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ExternalUrl &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/ffmpeglocation.cpp b/core/src/dto/ffmpeglocation.cpp index a0a1ad7..8df09f6 100644 --- a/core/src/dto/ffmpeglocation.cpp +++ b/core/src/dto/ffmpeglocation.cpp @@ -34,7 +34,6 @@ namespace DTO { FFmpegLocationClass::FFmpegLocationClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using FFmpegLocation = Jellyfin::DTO::FFmpegLocation; template <> -FFmpegLocation fromJsonValue(const QJsonValue &source) { +FFmpegLocation fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return FFmpegLocation::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ FFmpegLocation fromJsonValue(const QJsonValue &source) { return FFmpegLocation::EnumNotSet; } +template <> +QJsonValue toJsonValue(const FFmpegLocation &source, convertType) { + switch(source) { + case FFmpegLocation::NotFound: + return QStringLiteral("NotFound"); + case FFmpegLocation::SetByArgument: + return QStringLiteral("SetByArgument"); + case FFmpegLocation::Custom: + return QStringLiteral("Custom"); + case FFmpegLocation::System: + return QStringLiteral("System"); + + case FFmpegLocation::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/filesystementryinfo.cpp b/core/src/dto/filesystementryinfo.cpp index 3cc5f00..a904612 100644 --- a/core/src/dto/filesystementryinfo.cpp +++ b/core/src/dto/filesystementryinfo.cpp @@ -61,7 +61,7 @@ void FileSystemEntryInfo::setFromJson(QJsonObject source) { } -QJsonObject FileSystemEntryInfo::toJson() { +QJsonObject FileSystemEntryInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); @@ -110,10 +110,15 @@ namespace Support { using FileSystemEntryInfo = Jellyfin::DTO::FileSystemEntryInfo; template <> -FileSystemEntryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +FileSystemEntryInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return FileSystemEntryInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const FileSystemEntryInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/filesystementrytype.cpp b/core/src/dto/filesystementrytype.cpp index dd95b9a..1bd4875 100644 --- a/core/src/dto/filesystementrytype.cpp +++ b/core/src/dto/filesystementrytype.cpp @@ -34,7 +34,6 @@ namespace DTO { FileSystemEntryTypeClass::FileSystemEntryTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using FileSystemEntryType = Jellyfin::DTO::FileSystemEntryType; template <> -FileSystemEntryType fromJsonValue(const QJsonValue &source) { +FileSystemEntryType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return FileSystemEntryType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ FileSystemEntryType fromJsonValue(const QJsonValue &source) return FileSystemEntryType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const FileSystemEntryType &source, convertType) { + switch(source) { + case FileSystemEntryType::File: + return QStringLiteral("File"); + case FileSystemEntryType::Directory: + return QStringLiteral("Directory"); + case FileSystemEntryType::NetworkComputer: + return QStringLiteral("NetworkComputer"); + case FileSystemEntryType::NetworkShare: + return QStringLiteral("NetworkShare"); + + case FileSystemEntryType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/fontfile.cpp b/core/src/dto/fontfile.cpp index 249ec43..8811d70 100644 --- a/core/src/dto/fontfile.cpp +++ b/core/src/dto/fontfile.cpp @@ -64,7 +64,7 @@ void FontFile::setFromJson(QJsonObject source) { } -QJsonObject FontFile::toJson() { +QJsonObject FontFile::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Size"] = Jellyfin::Support::toJsonValue(m_size); @@ -113,10 +113,15 @@ namespace Support { using FontFile = Jellyfin::DTO::FontFile; template <> -FontFile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +FontFile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return FontFile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const FontFile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/forgotpasswordaction.cpp b/core/src/dto/forgotpasswordaction.cpp index 0b96a3f..6e23f37 100644 --- a/core/src/dto/forgotpasswordaction.cpp +++ b/core/src/dto/forgotpasswordaction.cpp @@ -34,7 +34,6 @@ namespace DTO { ForgotPasswordActionClass::ForgotPasswordActionClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ForgotPasswordAction = Jellyfin::DTO::ForgotPasswordAction; template <> -ForgotPasswordAction fromJsonValue(const QJsonValue &source) { +ForgotPasswordAction fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ForgotPasswordAction::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ ForgotPasswordAction fromJsonValue(const QJsonValue &sourc return ForgotPasswordAction::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ForgotPasswordAction &source, convertType) { + switch(source) { + case ForgotPasswordAction::ContactAdmin: + return QStringLiteral("ContactAdmin"); + case ForgotPasswordAction::PinCode: + return QStringLiteral("PinCode"); + case ForgotPasswordAction::InNetworkRequired: + return QStringLiteral("InNetworkRequired"); + + case ForgotPasswordAction::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/forgotpassworddto.cpp b/core/src/dto/forgotpassworddto.cpp index a8860f4..4fb7cbc 100644 --- a/core/src/dto/forgotpassworddto.cpp +++ b/core/src/dto/forgotpassworddto.cpp @@ -55,7 +55,7 @@ void ForgotPasswordDto::setFromJson(QJsonObject source) { } -QJsonObject ForgotPasswordDto::toJson() { +QJsonObject ForgotPasswordDto::toJson() const { QJsonObject result; result["EnteredUsername"] = Jellyfin::Support::toJsonValue(m_enteredUsername); @@ -76,10 +76,15 @@ namespace Support { using ForgotPasswordDto = Jellyfin::DTO::ForgotPasswordDto; template <> -ForgotPasswordDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ForgotPasswordDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ForgotPasswordDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ForgotPasswordDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/forgotpasswordresult.cpp b/core/src/dto/forgotpasswordresult.cpp index 15c2a00..32737a1 100644 --- a/core/src/dto/forgotpasswordresult.cpp +++ b/core/src/dto/forgotpasswordresult.cpp @@ -61,7 +61,7 @@ void ForgotPasswordResult::setFromJson(QJsonObject source) { } -QJsonObject ForgotPasswordResult::toJson() { +QJsonObject ForgotPasswordResult::toJson() const { QJsonObject result; result["Action"] = Jellyfin::Support::toJsonValue(m_action); result["PinFile"] = Jellyfin::Support::toJsonValue(m_pinFile); @@ -110,10 +110,15 @@ namespace Support { using ForgotPasswordResult = Jellyfin::DTO::ForgotPasswordResult; template <> -ForgotPasswordResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ForgotPasswordResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ForgotPasswordResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ForgotPasswordResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/generalcommand.cpp b/core/src/dto/generalcommand.cpp index 8fb1b2c..05dfada 100644 --- a/core/src/dto/generalcommand.cpp +++ b/core/src/dto/generalcommand.cpp @@ -57,15 +57,15 @@ GeneralCommand GeneralCommand::fromJson(QJsonObject source) { void GeneralCommand::setFromJson(QJsonObject source) { m_name = Jellyfin::Support::fromJsonValue(source["Name"]); m_controllingUserId = Jellyfin::Support::fromJsonValue(source["ControllingUserId"]); - m_arguments = Jellyfin::Support::fromJsonValue>(source["Arguments"]); + m_arguments = Jellyfin::Support::fromJsonValue(source["Arguments"]); } -QJsonObject GeneralCommand::toJson() { +QJsonObject GeneralCommand::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["ControllingUserId"] = Jellyfin::Support::toJsonValue(m_controllingUserId); - result["Arguments"] = Jellyfin::Support::toJsonValue>(m_arguments); + result["Arguments"] = Jellyfin::Support::toJsonValue(m_arguments); return result; } @@ -82,17 +82,17 @@ void GeneralCommand::setControllingUserId(QString newControllingUserId) { m_controllingUserId = newControllingUserId; } -std::optional GeneralCommand::arguments() const { return m_arguments; } +QJsonObject GeneralCommand::arguments() const { return m_arguments; } -void GeneralCommand::setArguments(std::optional newArguments) { +void GeneralCommand::setArguments(QJsonObject newArguments) { m_arguments = newArguments; } bool GeneralCommand::argumentsNull() const { - return !m_arguments.has_value(); + return m_arguments.isEmpty(); } void GeneralCommand::setArgumentsNull() { - m_arguments = std::nullopt; + m_arguments= QJsonObject(); } @@ -103,10 +103,15 @@ namespace Support { using GeneralCommand = Jellyfin::DTO::GeneralCommand; template <> -GeneralCommand fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +GeneralCommand fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return GeneralCommand::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const GeneralCommand &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/generalcommandtype.cpp b/core/src/dto/generalcommandtype.cpp index 7bdad50..eb8de73 100644 --- a/core/src/dto/generalcommandtype.cpp +++ b/core/src/dto/generalcommandtype.cpp @@ -34,7 +34,6 @@ namespace DTO { GeneralCommandTypeClass::GeneralCommandTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GeneralCommandType = Jellyfin::DTO::GeneralCommandType; template <> -GeneralCommandType fromJsonValue(const QJsonValue &source) { +GeneralCommandType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GeneralCommandType::EnumNotSet; QString str = source.toString(); @@ -173,5 +172,97 @@ GeneralCommandType fromJsonValue(const QJsonValue &source) { return GeneralCommandType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GeneralCommandType &source, convertType) { + switch(source) { + case GeneralCommandType::MoveUp: + return QStringLiteral("MoveUp"); + case GeneralCommandType::MoveDown: + return QStringLiteral("MoveDown"); + case GeneralCommandType::MoveLeft: + return QStringLiteral("MoveLeft"); + case GeneralCommandType::MoveRight: + return QStringLiteral("MoveRight"); + case GeneralCommandType::PageUp: + return QStringLiteral("PageUp"); + case GeneralCommandType::PageDown: + return QStringLiteral("PageDown"); + case GeneralCommandType::PreviousLetter: + return QStringLiteral("PreviousLetter"); + case GeneralCommandType::NextLetter: + return QStringLiteral("NextLetter"); + case GeneralCommandType::ToggleOsd: + return QStringLiteral("ToggleOsd"); + case GeneralCommandType::ToggleContextMenu: + return QStringLiteral("ToggleContextMenu"); + case GeneralCommandType::Select: + return QStringLiteral("Select"); + case GeneralCommandType::Back: + return QStringLiteral("Back"); + case GeneralCommandType::TakeScreenshot: + return QStringLiteral("TakeScreenshot"); + case GeneralCommandType::SendKey: + return QStringLiteral("SendKey"); + case GeneralCommandType::SendString: + return QStringLiteral("SendString"); + case GeneralCommandType::GoHome: + return QStringLiteral("GoHome"); + case GeneralCommandType::GoToSettings: + return QStringLiteral("GoToSettings"); + case GeneralCommandType::VolumeUp: + return QStringLiteral("VolumeUp"); + case GeneralCommandType::VolumeDown: + return QStringLiteral("VolumeDown"); + case GeneralCommandType::Mute: + return QStringLiteral("Mute"); + case GeneralCommandType::Unmute: + return QStringLiteral("Unmute"); + case GeneralCommandType::ToggleMute: + return QStringLiteral("ToggleMute"); + case GeneralCommandType::SetVolume: + return QStringLiteral("SetVolume"); + case GeneralCommandType::SetAudioStreamIndex: + return QStringLiteral("SetAudioStreamIndex"); + case GeneralCommandType::SetSubtitleStreamIndex: + return QStringLiteral("SetSubtitleStreamIndex"); + case GeneralCommandType::ToggleFullscreen: + return QStringLiteral("ToggleFullscreen"); + case GeneralCommandType::DisplayContent: + return QStringLiteral("DisplayContent"); + case GeneralCommandType::GoToSearch: + return QStringLiteral("GoToSearch"); + case GeneralCommandType::DisplayMessage: + return QStringLiteral("DisplayMessage"); + case GeneralCommandType::SetRepeatMode: + return QStringLiteral("SetRepeatMode"); + case GeneralCommandType::ChannelUp: + return QStringLiteral("ChannelUp"); + case GeneralCommandType::ChannelDown: + return QStringLiteral("ChannelDown"); + case GeneralCommandType::Guide: + return QStringLiteral("Guide"); + case GeneralCommandType::ToggleStats: + return QStringLiteral("ToggleStats"); + case GeneralCommandType::PlayMediaSource: + return QStringLiteral("PlayMediaSource"); + case GeneralCommandType::PlayTrailers: + return QStringLiteral("PlayTrailers"); + case GeneralCommandType::SetShuffleQueue: + return QStringLiteral("SetShuffleQueue"); + case GeneralCommandType::PlayState: + return QStringLiteral("PlayState"); + case GeneralCommandType::PlayNext: + return QStringLiteral("PlayNext"); + case GeneralCommandType::ToggleOsdMenu: + return QStringLiteral("ToggleOsdMenu"); + case GeneralCommandType::Play: + return QStringLiteral("Play"); + + case GeneralCommandType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/getprogramsdto.cpp b/core/src/dto/getprogramsdto.cpp index 7e82087..b72ab61 100644 --- a/core/src/dto/getprogramsdto.cpp +++ b/core/src/dto/getprogramsdto.cpp @@ -133,7 +133,7 @@ void GetProgramsDto::setFromJson(QJsonObject source) { } -QJsonObject GetProgramsDto::toJson() { +QJsonObject GetProgramsDto::toJson() const { QJsonObject result; result["ChannelIds"] = Jellyfin::Support::toJsonValue(m_channelIds); result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); @@ -504,10 +504,15 @@ namespace Support { using GetProgramsDto = Jellyfin::DTO::GetProgramsDto; template <> -GetProgramsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +GetProgramsDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return GetProgramsDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const GetProgramsDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/groupinfodto.cpp b/core/src/dto/groupinfodto.cpp index 798b443..1be160f 100644 --- a/core/src/dto/groupinfodto.cpp +++ b/core/src/dto/groupinfodto.cpp @@ -67,7 +67,7 @@ void GroupInfoDto::setFromJson(QJsonObject source) { } -QJsonObject GroupInfoDto::toJson() { +QJsonObject GroupInfoDto::toJson() const { QJsonObject result; result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); result["GroupName"] = Jellyfin::Support::toJsonValue(m_groupName); @@ -130,10 +130,15 @@ namespace Support { using GroupInfoDto = Jellyfin::DTO::GroupInfoDto; template <> -GroupInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +GroupInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return GroupInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const GroupInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/groupqueuemode.cpp b/core/src/dto/groupqueuemode.cpp index 8b07529..06ae908 100644 --- a/core/src/dto/groupqueuemode.cpp +++ b/core/src/dto/groupqueuemode.cpp @@ -34,7 +34,6 @@ namespace DTO { GroupQueueModeClass::GroupQueueModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GroupQueueMode = Jellyfin::DTO::GroupQueueMode; template <> -GroupQueueMode fromJsonValue(const QJsonValue &source) { +GroupQueueMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GroupQueueMode::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ GroupQueueMode fromJsonValue(const QJsonValue &source) { return GroupQueueMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GroupQueueMode &source, convertType) { + switch(source) { + case GroupQueueMode::Queue: + return QStringLiteral("Queue"); + case GroupQueueMode::QueueNext: + return QStringLiteral("QueueNext"); + + case GroupQueueMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/grouprepeatmode.cpp b/core/src/dto/grouprepeatmode.cpp index b776ce7..5804db1 100644 --- a/core/src/dto/grouprepeatmode.cpp +++ b/core/src/dto/grouprepeatmode.cpp @@ -34,7 +34,6 @@ namespace DTO { GroupRepeatModeClass::GroupRepeatModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GroupRepeatMode = Jellyfin::DTO::GroupRepeatMode; template <> -GroupRepeatMode fromJsonValue(const QJsonValue &source) { +GroupRepeatMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GroupRepeatMode::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ GroupRepeatMode fromJsonValue(const QJsonValue &source) { return GroupRepeatMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GroupRepeatMode &source, convertType) { + switch(source) { + case GroupRepeatMode::RepeatOne: + return QStringLiteral("RepeatOne"); + case GroupRepeatMode::RepeatAll: + return QStringLiteral("RepeatAll"); + case GroupRepeatMode::RepeatNone: + return QStringLiteral("RepeatNone"); + + case GroupRepeatMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/groupshufflemode.cpp b/core/src/dto/groupshufflemode.cpp index 6902905..6508638 100644 --- a/core/src/dto/groupshufflemode.cpp +++ b/core/src/dto/groupshufflemode.cpp @@ -34,7 +34,6 @@ namespace DTO { GroupShuffleModeClass::GroupShuffleModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GroupShuffleMode = Jellyfin::DTO::GroupShuffleMode; template <> -GroupShuffleMode fromJsonValue(const QJsonValue &source) { +GroupShuffleMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GroupShuffleMode::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ GroupShuffleMode fromJsonValue(const QJsonValue &source) { return GroupShuffleMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GroupShuffleMode &source, convertType) { + switch(source) { + case GroupShuffleMode::Sorted: + return QStringLiteral("Sorted"); + case GroupShuffleMode::Shuffle: + return QStringLiteral("Shuffle"); + + case GroupShuffleMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/groupstatetype.cpp b/core/src/dto/groupstatetype.cpp index c22bf78..edfcc96 100644 --- a/core/src/dto/groupstatetype.cpp +++ b/core/src/dto/groupstatetype.cpp @@ -34,7 +34,6 @@ namespace DTO { GroupStateTypeClass::GroupStateTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GroupStateType = Jellyfin::DTO::GroupStateType; template <> -GroupStateType fromJsonValue(const QJsonValue &source) { +GroupStateType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GroupStateType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ GroupStateType fromJsonValue(const QJsonValue &source) { return GroupStateType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GroupStateType &source, convertType) { + switch(source) { + case GroupStateType::Idle: + return QStringLiteral("Idle"); + case GroupStateType::Waiting: + return QStringLiteral("Waiting"); + case GroupStateType::Paused: + return QStringLiteral("Paused"); + case GroupStateType::Playing: + return QStringLiteral("Playing"); + + case GroupStateType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/groupupdatetype.cpp b/core/src/dto/groupupdatetype.cpp index 76bb6de..218353b 100644 --- a/core/src/dto/groupupdatetype.cpp +++ b/core/src/dto/groupupdatetype.cpp @@ -34,7 +34,6 @@ namespace DTO { GroupUpdateTypeClass::GroupUpdateTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using GroupUpdateType = Jellyfin::DTO::GroupUpdateType; template <> -GroupUpdateType fromJsonValue(const QJsonValue &source) { +GroupUpdateType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return GroupUpdateType::EnumNotSet; QString str = source.toString(); @@ -83,5 +82,37 @@ GroupUpdateType fromJsonValue(const QJsonValue &source) { return GroupUpdateType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const GroupUpdateType &source, convertType) { + switch(source) { + case GroupUpdateType::UserJoined: + return QStringLiteral("UserJoined"); + case GroupUpdateType::UserLeft: + return QStringLiteral("UserLeft"); + case GroupUpdateType::GroupJoined: + return QStringLiteral("GroupJoined"); + case GroupUpdateType::GroupLeft: + return QStringLiteral("GroupLeft"); + case GroupUpdateType::StateUpdate: + return QStringLiteral("StateUpdate"); + case GroupUpdateType::PlayQueue: + return QStringLiteral("PlayQueue"); + case GroupUpdateType::NotInGroup: + return QStringLiteral("NotInGroup"); + case GroupUpdateType::GroupDoesNotExist: + return QStringLiteral("GroupDoesNotExist"); + case GroupUpdateType::CreateGroupDenied: + return QStringLiteral("CreateGroupDenied"); + case GroupUpdateType::JoinGroupDenied: + return QStringLiteral("JoinGroupDenied"); + case GroupUpdateType::LibraryAccessDenied: + return QStringLiteral("LibraryAccessDenied"); + + case GroupUpdateType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/guideinfo.cpp b/core/src/dto/guideinfo.cpp index 5cf60e7..a2636cd 100644 --- a/core/src/dto/guideinfo.cpp +++ b/core/src/dto/guideinfo.cpp @@ -58,7 +58,7 @@ void GuideInfo::setFromJson(QJsonObject source) { } -QJsonObject GuideInfo::toJson() { +QJsonObject GuideInfo::toJson() const { QJsonObject result; result["StartDate"] = Jellyfin::Support::toJsonValue(m_startDate); result["EndDate"] = Jellyfin::Support::toJsonValue(m_endDate); @@ -86,10 +86,15 @@ namespace Support { using GuideInfo = Jellyfin::DTO::GuideInfo; template <> -GuideInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +GuideInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return GuideInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const GuideInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/headermatchtype.cpp b/core/src/dto/headermatchtype.cpp index 4ddc25c..9cd299b 100644 --- a/core/src/dto/headermatchtype.cpp +++ b/core/src/dto/headermatchtype.cpp @@ -34,7 +34,6 @@ namespace DTO { HeaderMatchTypeClass::HeaderMatchTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using HeaderMatchType = Jellyfin::DTO::HeaderMatchType; template <> -HeaderMatchType fromJsonValue(const QJsonValue &source) { +HeaderMatchType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return HeaderMatchType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ HeaderMatchType fromJsonValue(const QJsonValue &source) { return HeaderMatchType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const HeaderMatchType &source, convertType) { + switch(source) { + case HeaderMatchType::Equals: + return QStringLiteral("Equals"); + case HeaderMatchType::Regex: + return QStringLiteral("Regex"); + case HeaderMatchType::Substring: + return QStringLiteral("Substring"); + + case HeaderMatchType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/httpheaderinfo.cpp b/core/src/dto/httpheaderinfo.cpp index 42c24ca..b04fc59 100644 --- a/core/src/dto/httpheaderinfo.cpp +++ b/core/src/dto/httpheaderinfo.cpp @@ -61,7 +61,7 @@ void HttpHeaderInfo::setFromJson(QJsonObject source) { } -QJsonObject HttpHeaderInfo::toJson() { +QJsonObject HttpHeaderInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Value"] = Jellyfin::Support::toJsonValue(m_value); @@ -110,10 +110,15 @@ namespace Support { using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo; template <> -HttpHeaderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +HttpHeaderInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return HttpHeaderInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const HttpHeaderInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/ignorewaitrequestdto.cpp b/core/src/dto/ignorewaitrequestdto.cpp index 95f4949..f49efe2 100644 --- a/core/src/dto/ignorewaitrequestdto.cpp +++ b/core/src/dto/ignorewaitrequestdto.cpp @@ -55,7 +55,7 @@ void IgnoreWaitRequestDto::setFromJson(QJsonObject source) { } -QJsonObject IgnoreWaitRequestDto::toJson() { +QJsonObject IgnoreWaitRequestDto::toJson() const { QJsonObject result; result["IgnoreWait"] = Jellyfin::Support::toJsonValue(m_ignoreWait); @@ -76,10 +76,15 @@ namespace Support { using IgnoreWaitRequestDto = Jellyfin::DTO::IgnoreWaitRequestDto; template <> -IgnoreWaitRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +IgnoreWaitRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return IgnoreWaitRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const IgnoreWaitRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imagebynameinfo.cpp b/core/src/dto/imagebynameinfo.cpp index 922598d..1f976c8 100644 --- a/core/src/dto/imagebynameinfo.cpp +++ b/core/src/dto/imagebynameinfo.cpp @@ -67,7 +67,7 @@ void ImageByNameInfo::setFromJson(QJsonObject source) { } -QJsonObject ImageByNameInfo::toJson() { +QJsonObject ImageByNameInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Theme"] = Jellyfin::Support::toJsonValue(m_theme); @@ -144,10 +144,15 @@ namespace Support { using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo; template <> -ImageByNameInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ImageByNameInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ImageByNameInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ImageByNameInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imageformat.cpp b/core/src/dto/imageformat.cpp index b4f4708..d081d58 100644 --- a/core/src/dto/imageformat.cpp +++ b/core/src/dto/imageformat.cpp @@ -34,7 +34,6 @@ namespace DTO { ImageFormatClass::ImageFormatClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ImageFormat = Jellyfin::DTO::ImageFormat; template <> -ImageFormat fromJsonValue(const QJsonValue &source) { +ImageFormat fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ImageFormat::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ ImageFormat fromJsonValue(const QJsonValue &source) { return ImageFormat::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ImageFormat &source, convertType) { + switch(source) { + case ImageFormat::Bmp: + return QStringLiteral("Bmp"); + case ImageFormat::Gif: + return QStringLiteral("Gif"); + case ImageFormat::Jpg: + return QStringLiteral("Jpg"); + case ImageFormat::Png: + return QStringLiteral("Png"); + case ImageFormat::Webp: + return QStringLiteral("Webp"); + + case ImageFormat::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imageinfo.cpp b/core/src/dto/imageinfo.cpp index badd82b..da03c0f 100644 --- a/core/src/dto/imageinfo.cpp +++ b/core/src/dto/imageinfo.cpp @@ -76,7 +76,7 @@ void ImageInfo::setFromJson(QJsonObject source) { } -QJsonObject ImageInfo::toJson() { +QJsonObject ImageInfo::toJson() const { QJsonObject result; result["ImageType"] = Jellyfin::Support::toJsonValue(m_imageType); result["ImageIndex"] = Jellyfin::Support::toJsonValue>(m_imageIndex); @@ -188,10 +188,15 @@ namespace Support { using ImageInfo = Jellyfin::DTO::ImageInfo; template <> -ImageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ImageInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ImageInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ImageInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imageoption.cpp b/core/src/dto/imageoption.cpp index 38f30da..f643bbf 100644 --- a/core/src/dto/imageoption.cpp +++ b/core/src/dto/imageoption.cpp @@ -61,7 +61,7 @@ void ImageOption::setFromJson(QJsonObject source) { } -QJsonObject ImageOption::toJson() { +QJsonObject ImageOption::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["Limit"] = Jellyfin::Support::toJsonValue(m_limit); @@ -96,10 +96,15 @@ namespace Support { using ImageOption = Jellyfin::DTO::ImageOption; template <> -ImageOption fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ImageOption fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ImageOption::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ImageOption &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imageorientation.cpp b/core/src/dto/imageorientation.cpp index a2c1b17..f5e9f8a 100644 --- a/core/src/dto/imageorientation.cpp +++ b/core/src/dto/imageorientation.cpp @@ -34,7 +34,6 @@ namespace DTO { ImageOrientationClass::ImageOrientationClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ImageOrientation = Jellyfin::DTO::ImageOrientation; template <> -ImageOrientation fromJsonValue(const QJsonValue &source) { +ImageOrientation fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ImageOrientation::EnumNotSet; QString str = source.toString(); @@ -74,5 +73,31 @@ ImageOrientation fromJsonValue(const QJsonValue &source) { return ImageOrientation::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ImageOrientation &source, convertType) { + switch(source) { + case ImageOrientation::TopLeft: + return QStringLiteral("TopLeft"); + case ImageOrientation::TopRight: + return QStringLiteral("TopRight"); + case ImageOrientation::BottomRight: + return QStringLiteral("BottomRight"); + case ImageOrientation::BottomLeft: + return QStringLiteral("BottomLeft"); + case ImageOrientation::LeftTop: + return QStringLiteral("LeftTop"); + case ImageOrientation::RightTop: + return QStringLiteral("RightTop"); + case ImageOrientation::RightBottom: + return QStringLiteral("RightBottom"); + case ImageOrientation::LeftBottom: + return QStringLiteral("LeftBottom"); + + case ImageOrientation::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imageproviderinfo.cpp b/core/src/dto/imageproviderinfo.cpp index 4ee0726..30b9955 100644 --- a/core/src/dto/imageproviderinfo.cpp +++ b/core/src/dto/imageproviderinfo.cpp @@ -58,7 +58,7 @@ void ImageProviderInfo::setFromJson(QJsonObject source) { } -QJsonObject ImageProviderInfo::toJson() { +QJsonObject ImageProviderInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["SupportedImages"] = Jellyfin::Support::toJsonValue>(m_supportedImages); @@ -100,10 +100,15 @@ namespace Support { using ImageProviderInfo = Jellyfin::DTO::ImageProviderInfo; template <> -ImageProviderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ImageProviderInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ImageProviderInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ImageProviderInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imagesavingconvention.cpp b/core/src/dto/imagesavingconvention.cpp index f3f08be..deb8f23 100644 --- a/core/src/dto/imagesavingconvention.cpp +++ b/core/src/dto/imagesavingconvention.cpp @@ -34,7 +34,6 @@ namespace DTO { ImageSavingConventionClass::ImageSavingConventionClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ImageSavingConvention = Jellyfin::DTO::ImageSavingConvention; template <> -ImageSavingConvention fromJsonValue(const QJsonValue &source) { +ImageSavingConvention fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ImageSavingConvention::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ ImageSavingConvention fromJsonValue(const QJsonValue &sou return ImageSavingConvention::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ImageSavingConvention &source, convertType) { + switch(source) { + case ImageSavingConvention::Legacy: + return QStringLiteral("Legacy"); + case ImageSavingConvention::Compatible: + return QStringLiteral("Compatible"); + + case ImageSavingConvention::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/imagetype.cpp b/core/src/dto/imagetype.cpp index d826b3d..5b95c9b 100644 --- a/core/src/dto/imagetype.cpp +++ b/core/src/dto/imagetype.cpp @@ -34,7 +34,6 @@ namespace DTO { ImageTypeClass::ImageTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ImageType = Jellyfin::DTO::ImageType; template <> -ImageType fromJsonValue(const QJsonValue &source) { +ImageType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ImageType::EnumNotSet; QString str = source.toString(); @@ -89,5 +88,41 @@ ImageType fromJsonValue(const QJsonValue &source) { return ImageType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ImageType &source, convertType) { + switch(source) { + case ImageType::Primary: + return QStringLiteral("Primary"); + case ImageType::Art: + return QStringLiteral("Art"); + case ImageType::Backdrop: + return QStringLiteral("Backdrop"); + case ImageType::Banner: + return QStringLiteral("Banner"); + case ImageType::Logo: + return QStringLiteral("Logo"); + case ImageType::Thumb: + return QStringLiteral("Thumb"); + case ImageType::Disc: + return QStringLiteral("Disc"); + case ImageType::Box: + return QStringLiteral("Box"); + case ImageType::Screenshot: + return QStringLiteral("Screenshot"); + case ImageType::Menu: + return QStringLiteral("Menu"); + case ImageType::Chapter: + return QStringLiteral("Chapter"); + case ImageType::BoxRear: + return QStringLiteral("BoxRear"); + case ImageType::Profile: + return QStringLiteral("Profile"); + + case ImageType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/installationinfo.cpp b/core/src/dto/installationinfo.cpp index 0c39770..b74c90a 100644 --- a/core/src/dto/installationinfo.cpp +++ b/core/src/dto/installationinfo.cpp @@ -70,7 +70,7 @@ void InstallationInfo::setFromJson(QJsonObject source) { } -QJsonObject InstallationInfo::toJson() { +QJsonObject InstallationInfo::toJson() const { QJsonObject result; result["Guid"] = Jellyfin::Support::toJsonValue(m_guid); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -154,10 +154,15 @@ namespace Support { using InstallationInfo = Jellyfin::DTO::InstallationInfo; template <> -InstallationInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +InstallationInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return InstallationInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const InstallationInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/iplugin.cpp b/core/src/dto/iplugin.cpp index 265d6e0..8275799 100644 --- a/core/src/dto/iplugin.cpp +++ b/core/src/dto/iplugin.cpp @@ -73,7 +73,7 @@ void IPlugin::setFromJson(QJsonObject source) { } -QJsonObject IPlugin::toJson() { +QJsonObject IPlugin::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Description"] = Jellyfin::Support::toJsonValue(m_description); @@ -164,10 +164,15 @@ namespace Support { using IPlugin = Jellyfin::DTO::IPlugin; template <> -IPlugin fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +IPlugin fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return IPlugin::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const IPlugin &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/isotype.cpp b/core/src/dto/isotype.cpp index 2dc858e..751b96f 100644 --- a/core/src/dto/isotype.cpp +++ b/core/src/dto/isotype.cpp @@ -34,7 +34,6 @@ namespace DTO { IsoTypeClass::IsoTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using IsoType = Jellyfin::DTO::IsoType; template <> -IsoType fromJsonValue(const QJsonValue &source) { +IsoType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return IsoType::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ IsoType fromJsonValue(const QJsonValue &source) { return IsoType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const IsoType &source, convertType) { + switch(source) { + case IsoType::Dvd: + return QStringLiteral("Dvd"); + case IsoType::BluRay: + return QStringLiteral("BluRay"); + + case IsoType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/itemcounts.cpp b/core/src/dto/itemcounts.cpp index 4e905a8..88f1f53 100644 --- a/core/src/dto/itemcounts.cpp +++ b/core/src/dto/itemcounts.cpp @@ -88,7 +88,7 @@ void ItemCounts::setFromJson(QJsonObject source) { } -QJsonObject ItemCounts::toJson() { +QJsonObject ItemCounts::toJson() const { QJsonObject result; result["MovieCount"] = Jellyfin::Support::toJsonValue(m_movieCount); result["SeriesCount"] = Jellyfin::Support::toJsonValue(m_seriesCount); @@ -186,10 +186,15 @@ namespace Support { using ItemCounts = Jellyfin::DTO::ItemCounts; template <> -ItemCounts fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ItemCounts fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ItemCounts::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ItemCounts &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/itemfields.cpp b/core/src/dto/itemfields.cpp index eee745a..b832e31 100644 --- a/core/src/dto/itemfields.cpp +++ b/core/src/dto/itemfields.cpp @@ -34,7 +34,6 @@ namespace DTO { ItemFieldsClass::ItemFieldsClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ItemFields = Jellyfin::DTO::ItemFields; template <> -ItemFields fromJsonValue(const QJsonValue &source) { +ItemFields fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ItemFields::EnumNotSet; QString str = source.toString(); @@ -233,5 +232,137 @@ ItemFields fromJsonValue(const QJsonValue &source) { return ItemFields::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ItemFields &source, convertType) { + switch(source) { + case ItemFields::AirTime: + return QStringLiteral("AirTime"); + case ItemFields::CanDelete: + return QStringLiteral("CanDelete"); + case ItemFields::CanDownload: + return QStringLiteral("CanDownload"); + case ItemFields::ChannelInfo: + return QStringLiteral("ChannelInfo"); + case ItemFields::Chapters: + return QStringLiteral("Chapters"); + case ItemFields::ChildCount: + return QStringLiteral("ChildCount"); + case ItemFields::CumulativeRunTimeTicks: + return QStringLiteral("CumulativeRunTimeTicks"); + case ItemFields::CustomRating: + return QStringLiteral("CustomRating"); + case ItemFields::DateCreated: + return QStringLiteral("DateCreated"); + case ItemFields::DateLastMediaAdded: + return QStringLiteral("DateLastMediaAdded"); + case ItemFields::DisplayPreferencesId: + return QStringLiteral("DisplayPreferencesId"); + case ItemFields::Etag: + return QStringLiteral("Etag"); + case ItemFields::ExternalUrls: + return QStringLiteral("ExternalUrls"); + case ItemFields::Genres: + return QStringLiteral("Genres"); + case ItemFields::HomePageUrl: + return QStringLiteral("HomePageUrl"); + case ItemFields::ItemCounts: + return QStringLiteral("ItemCounts"); + case ItemFields::MediaSourceCount: + return QStringLiteral("MediaSourceCount"); + case ItemFields::MediaSources: + return QStringLiteral("MediaSources"); + case ItemFields::OriginalTitle: + return QStringLiteral("OriginalTitle"); + case ItemFields::Overview: + return QStringLiteral("Overview"); + case ItemFields::ParentId: + return QStringLiteral("ParentId"); + case ItemFields::Path: + return QStringLiteral("Path"); + case ItemFields::People: + return QStringLiteral("People"); + case ItemFields::PlayAccess: + return QStringLiteral("PlayAccess"); + case ItemFields::ProductionLocations: + return QStringLiteral("ProductionLocations"); + case ItemFields::ProviderIds: + return QStringLiteral("ProviderIds"); + case ItemFields::PrimaryImageAspectRatio: + return QStringLiteral("PrimaryImageAspectRatio"); + case ItemFields::RecursiveItemCount: + return QStringLiteral("RecursiveItemCount"); + case ItemFields::Settings: + return QStringLiteral("Settings"); + case ItemFields::ScreenshotImageTags: + return QStringLiteral("ScreenshotImageTags"); + case ItemFields::SeriesPrimaryImage: + return QStringLiteral("SeriesPrimaryImage"); + case ItemFields::SeriesStudio: + return QStringLiteral("SeriesStudio"); + case ItemFields::SortName: + return QStringLiteral("SortName"); + case ItemFields::SpecialEpisodeNumbers: + return QStringLiteral("SpecialEpisodeNumbers"); + case ItemFields::Studios: + return QStringLiteral("Studios"); + case ItemFields::BasicSyncInfo: + return QStringLiteral("BasicSyncInfo"); + case ItemFields::SyncInfo: + return QStringLiteral("SyncInfo"); + case ItemFields::Taglines: + return QStringLiteral("Taglines"); + case ItemFields::Tags: + return QStringLiteral("Tags"); + case ItemFields::RemoteTrailers: + return QStringLiteral("RemoteTrailers"); + case ItemFields::MediaStreams: + return QStringLiteral("MediaStreams"); + case ItemFields::SeasonUserData: + return QStringLiteral("SeasonUserData"); + case ItemFields::ServiceName: + return QStringLiteral("ServiceName"); + case ItemFields::ThemeSongIds: + return QStringLiteral("ThemeSongIds"); + case ItemFields::ThemeVideoIds: + return QStringLiteral("ThemeVideoIds"); + case ItemFields::ExternalEtag: + return QStringLiteral("ExternalEtag"); + case ItemFields::PresentationUniqueKey: + return QStringLiteral("PresentationUniqueKey"); + case ItemFields::InheritedParentalRatingValue: + return QStringLiteral("InheritedParentalRatingValue"); + case ItemFields::ExternalSeriesId: + return QStringLiteral("ExternalSeriesId"); + case ItemFields::SeriesPresentationUniqueKey: + return QStringLiteral("SeriesPresentationUniqueKey"); + case ItemFields::DateLastRefreshed: + return QStringLiteral("DateLastRefreshed"); + case ItemFields::DateLastSaved: + return QStringLiteral("DateLastSaved"); + case ItemFields::RefreshState: + return QStringLiteral("RefreshState"); + case ItemFields::ChannelImage: + return QStringLiteral("ChannelImage"); + case ItemFields::EnableMediaSourceDisplay: + return QStringLiteral("EnableMediaSourceDisplay"); + case ItemFields::Width: + return QStringLiteral("Width"); + case ItemFields::Height: + return QStringLiteral("Height"); + case ItemFields::ExtraIds: + return QStringLiteral("ExtraIds"); + case ItemFields::LocalTrailerCount: + return QStringLiteral("LocalTrailerCount"); + case ItemFields::IsHD: + return QStringLiteral("IsHD"); + case ItemFields::SpecialFeatureCount: + return QStringLiteral("SpecialFeatureCount"); + + case ItemFields::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/itemfilter.cpp b/core/src/dto/itemfilter.cpp index 67ec33e..1261e10 100644 --- a/core/src/dto/itemfilter.cpp +++ b/core/src/dto/itemfilter.cpp @@ -34,7 +34,6 @@ namespace DTO { ItemFilterClass::ItemFilterClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ItemFilter = Jellyfin::DTO::ItemFilter; template <> -ItemFilter fromJsonValue(const QJsonValue &source) { +ItemFilter fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ItemFilter::EnumNotSet; QString str = source.toString(); @@ -77,5 +76,33 @@ ItemFilter fromJsonValue(const QJsonValue &source) { return ItemFilter::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ItemFilter &source, convertType) { + switch(source) { + case ItemFilter::IsFolder: + return QStringLiteral("IsFolder"); + case ItemFilter::IsNotFolder: + return QStringLiteral("IsNotFolder"); + case ItemFilter::IsUnplayed: + return QStringLiteral("IsUnplayed"); + case ItemFilter::IsPlayed: + return QStringLiteral("IsPlayed"); + case ItemFilter::IsFavorite: + return QStringLiteral("IsFavorite"); + case ItemFilter::IsResumable: + return QStringLiteral("IsResumable"); + case ItemFilter::Likes: + return QStringLiteral("Likes"); + case ItemFilter::Dislikes: + return QStringLiteral("Dislikes"); + case ItemFilter::IsFavoriteOrLikes: + return QStringLiteral("IsFavoriteOrLikes"); + + case ItemFilter::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/joingrouprequestdto.cpp b/core/src/dto/joingrouprequestdto.cpp index 49c84e2..ed38b28 100644 --- a/core/src/dto/joingrouprequestdto.cpp +++ b/core/src/dto/joingrouprequestdto.cpp @@ -55,7 +55,7 @@ void JoinGroupRequestDto::setFromJson(QJsonObject source) { } -QJsonObject JoinGroupRequestDto::toJson() { +QJsonObject JoinGroupRequestDto::toJson() const { QJsonObject result; result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); @@ -76,10 +76,15 @@ namespace Support { using JoinGroupRequestDto = Jellyfin::DTO::JoinGroupRequestDto; template <> -JoinGroupRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +JoinGroupRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return JoinGroupRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const JoinGroupRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/keepuntil.cpp b/core/src/dto/keepuntil.cpp index 61765bf..e33b29b 100644 --- a/core/src/dto/keepuntil.cpp +++ b/core/src/dto/keepuntil.cpp @@ -34,7 +34,6 @@ namespace DTO { KeepUntilClass::KeepUntilClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using KeepUntil = Jellyfin::DTO::KeepUntil; template <> -KeepUntil fromJsonValue(const QJsonValue &source) { +KeepUntil fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return KeepUntil::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ KeepUntil fromJsonValue(const QJsonValue &source) { return KeepUntil::EnumNotSet; } +template <> +QJsonValue toJsonValue(const KeepUntil &source, convertType) { + switch(source) { + case KeepUntil::UntilDeleted: + return QStringLiteral("UntilDeleted"); + case KeepUntil::UntilSpaceNeeded: + return QStringLiteral("UntilSpaceNeeded"); + case KeepUntil::UntilWatched: + return QStringLiteral("UntilWatched"); + case KeepUntil::UntilDate: + return QStringLiteral("UntilDate"); + + case KeepUntil::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/libraryoptioninfodto.cpp b/core/src/dto/libraryoptioninfodto.cpp index 5d90810..28e9beb 100644 --- a/core/src/dto/libraryoptioninfodto.cpp +++ b/core/src/dto/libraryoptioninfodto.cpp @@ -58,7 +58,7 @@ void LibraryOptionInfoDto::setFromJson(QJsonObject source) { } -QJsonObject LibraryOptionInfoDto::toJson() { +QJsonObject LibraryOptionInfoDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["DefaultEnabled"] = Jellyfin::Support::toJsonValue(m_defaultEnabled); @@ -93,10 +93,15 @@ namespace Support { using LibraryOptionInfoDto = Jellyfin::DTO::LibraryOptionInfoDto; template <> -LibraryOptionInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LibraryOptionInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LibraryOptionInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LibraryOptionInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/libraryoptions.cpp b/core/src/dto/libraryoptions.cpp index c4690f8..688f1d5 100644 --- a/core/src/dto/libraryoptions.cpp +++ b/core/src/dto/libraryoptions.cpp @@ -127,7 +127,7 @@ void LibraryOptions::setFromJson(QJsonObject source) { } -QJsonObject LibraryOptions::toJson() { +QJsonObject LibraryOptions::toJson() const { QJsonObject result; result["EnablePhotos"] = Jellyfin::Support::toJsonValue(m_enablePhotos); result["EnableRealtimeMonitor"] = Jellyfin::Support::toJsonValue(m_enableRealtimeMonitor); @@ -393,10 +393,15 @@ namespace Support { using LibraryOptions = Jellyfin::DTO::LibraryOptions; template <> -LibraryOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LibraryOptions fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LibraryOptions::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LibraryOptions &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/libraryoptionsresultdto.cpp b/core/src/dto/libraryoptionsresultdto.cpp index 7e32433..2c8ac3a 100644 --- a/core/src/dto/libraryoptionsresultdto.cpp +++ b/core/src/dto/libraryoptionsresultdto.cpp @@ -64,7 +64,7 @@ void LibraryOptionsResultDto::setFromJson(QJsonObject source) { } -QJsonObject LibraryOptionsResultDto::toJson() { +QJsonObject LibraryOptionsResultDto::toJson() const { QJsonObject result; result["MetadataSavers"] = Jellyfin::Support::toJsonValue>(m_metadataSavers); result["MetadataReaders"] = Jellyfin::Support::toJsonValue>(m_metadataReaders); @@ -134,10 +134,15 @@ namespace Support { using LibraryOptionsResultDto = Jellyfin::DTO::LibraryOptionsResultDto; template <> -LibraryOptionsResultDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LibraryOptionsResultDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LibraryOptionsResultDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LibraryOptionsResultDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/librarytypeoptionsdto.cpp b/core/src/dto/librarytypeoptionsdto.cpp index 7e50112..e09d7dc 100644 --- a/core/src/dto/librarytypeoptionsdto.cpp +++ b/core/src/dto/librarytypeoptionsdto.cpp @@ -67,7 +67,7 @@ void LibraryTypeOptionsDto::setFromJson(QJsonObject source) { } -QJsonObject LibraryTypeOptionsDto::toJson() { +QJsonObject LibraryTypeOptionsDto::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["MetadataFetchers"] = Jellyfin::Support::toJsonValue>(m_metadataFetchers); @@ -151,10 +151,15 @@ namespace Support { using LibraryTypeOptionsDto = Jellyfin::DTO::LibraryTypeOptionsDto; template <> -LibraryTypeOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LibraryTypeOptionsDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LibraryTypeOptionsDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LibraryTypeOptionsDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/libraryupdateinfo.cpp b/core/src/dto/libraryupdateinfo.cpp index 04440bd..2e3d74d 100644 --- a/core/src/dto/libraryupdateinfo.cpp +++ b/core/src/dto/libraryupdateinfo.cpp @@ -73,7 +73,7 @@ void LibraryUpdateInfo::setFromJson(QJsonObject source) { } -QJsonObject LibraryUpdateInfo::toJson() { +QJsonObject LibraryUpdateInfo::toJson() const { QJsonObject result; result["FoldersAddedTo"] = Jellyfin::Support::toJsonValue(m_foldersAddedTo); result["FoldersRemovedFrom"] = Jellyfin::Support::toJsonValue(m_foldersRemovedFrom); @@ -178,10 +178,15 @@ namespace Support { using LibraryUpdateInfo = Jellyfin::DTO::LibraryUpdateInfo; template <> -LibraryUpdateInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LibraryUpdateInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LibraryUpdateInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LibraryUpdateInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/listingsproviderinfo.cpp b/core/src/dto/listingsproviderinfo.cpp index de6dc30..5451190 100644 --- a/core/src/dto/listingsproviderinfo.cpp +++ b/core/src/dto/listingsproviderinfo.cpp @@ -106,7 +106,7 @@ void ListingsProviderInfo::setFromJson(QJsonObject source) { } -QJsonObject ListingsProviderInfo::toJson() { +QJsonObject ListingsProviderInfo::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Type"] = Jellyfin::Support::toJsonValue(m_type); @@ -365,10 +365,15 @@ namespace Support { using ListingsProviderInfo = Jellyfin::DTO::ListingsProviderInfo; template <> -ListingsProviderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ListingsProviderInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ListingsProviderInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ListingsProviderInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/livestreamresponse.cpp b/core/src/dto/livestreamresponse.cpp index a04c179..9bb8eb3 100644 --- a/core/src/dto/livestreamresponse.cpp +++ b/core/src/dto/livestreamresponse.cpp @@ -55,7 +55,7 @@ void LiveStreamResponse::setFromJson(QJsonObject source) { } -QJsonObject LiveStreamResponse::toJson() { +QJsonObject LiveStreamResponse::toJson() const { QJsonObject result; result["MediaSource"] = Jellyfin::Support::toJsonValue>(m_mediaSource); @@ -76,10 +76,15 @@ namespace Support { using LiveStreamResponse = Jellyfin::DTO::LiveStreamResponse; template <> -LiveStreamResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LiveStreamResponse fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LiveStreamResponse::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LiveStreamResponse &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/livetvinfo.cpp b/core/src/dto/livetvinfo.cpp index 19611c1..49bb5bb 100644 --- a/core/src/dto/livetvinfo.cpp +++ b/core/src/dto/livetvinfo.cpp @@ -61,7 +61,7 @@ void LiveTvInfo::setFromJson(QJsonObject source) { } -QJsonObject LiveTvInfo::toJson() { +QJsonObject LiveTvInfo::toJson() const { QJsonObject result; result["Services"] = Jellyfin::Support::toJsonValue>(m_services); result["IsEnabled"] = Jellyfin::Support::toJsonValue(m_isEnabled); @@ -110,10 +110,15 @@ namespace Support { using LiveTvInfo = Jellyfin::DTO::LiveTvInfo; template <> -LiveTvInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LiveTvInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LiveTvInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LiveTvInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/livetvserviceinfo.cpp b/core/src/dto/livetvserviceinfo.cpp index b305c9d..93ce481 100644 --- a/core/src/dto/livetvserviceinfo.cpp +++ b/core/src/dto/livetvserviceinfo.cpp @@ -76,7 +76,7 @@ void LiveTvServiceInfo::setFromJson(QJsonObject source) { } -QJsonObject LiveTvServiceInfo::toJson() { +QJsonObject LiveTvServiceInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["HomePageUrl"] = Jellyfin::Support::toJsonValue(m_homePageUrl); @@ -181,10 +181,15 @@ namespace Support { using LiveTvServiceInfo = Jellyfin::DTO::LiveTvServiceInfo; template <> -LiveTvServiceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LiveTvServiceInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LiveTvServiceInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LiveTvServiceInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/livetvservicestatus.cpp b/core/src/dto/livetvservicestatus.cpp index cfce462..c780482 100644 --- a/core/src/dto/livetvservicestatus.cpp +++ b/core/src/dto/livetvservicestatus.cpp @@ -34,7 +34,6 @@ namespace DTO { LiveTvServiceStatusClass::LiveTvServiceStatusClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using LiveTvServiceStatus = Jellyfin::DTO::LiveTvServiceStatus; template <> -LiveTvServiceStatus fromJsonValue(const QJsonValue &source) { +LiveTvServiceStatus fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return LiveTvServiceStatus::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ LiveTvServiceStatus fromJsonValue(const QJsonValue &source) return LiveTvServiceStatus::EnumNotSet; } +template <> +QJsonValue toJsonValue(const LiveTvServiceStatus &source, convertType) { + switch(source) { + case LiveTvServiceStatus::Ok: + return QStringLiteral("Ok"); + case LiveTvServiceStatus::Unavailable: + return QStringLiteral("Unavailable"); + + case LiveTvServiceStatus::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/localizationoption.cpp b/core/src/dto/localizationoption.cpp index ad18008..f12bb54 100644 --- a/core/src/dto/localizationoption.cpp +++ b/core/src/dto/localizationoption.cpp @@ -58,7 +58,7 @@ void LocalizationOption::setFromJson(QJsonObject source) { } -QJsonObject LocalizationOption::toJson() { +QJsonObject LocalizationOption::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Value"] = Jellyfin::Support::toJsonValue(m_value); @@ -100,10 +100,15 @@ namespace Support { using LocalizationOption = Jellyfin::DTO::LocalizationOption; template <> -LocalizationOption fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LocalizationOption fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LocalizationOption::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LocalizationOption &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/locationtype.cpp b/core/src/dto/locationtype.cpp index abab8f1..2ae6a12 100644 --- a/core/src/dto/locationtype.cpp +++ b/core/src/dto/locationtype.cpp @@ -34,7 +34,6 @@ namespace DTO { LocationTypeClass::LocationTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using LocationType = Jellyfin::DTO::LocationType; template <> -LocationType fromJsonValue(const QJsonValue &source) { +LocationType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return LocationType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ LocationType fromJsonValue(const QJsonValue &source) { return LocationType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const LocationType &source, convertType) { + switch(source) { + case LocationType::FileSystem: + return QStringLiteral("FileSystem"); + case LocationType::Remote: + return QStringLiteral("Remote"); + case LocationType::Virtual: + return QStringLiteral("Virtual"); + case LocationType::Offline: + return QStringLiteral("Offline"); + + case LocationType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/logfile.cpp b/core/src/dto/logfile.cpp index 66bb00c..92c721c 100644 --- a/core/src/dto/logfile.cpp +++ b/core/src/dto/logfile.cpp @@ -64,7 +64,7 @@ void LogFile::setFromJson(QJsonObject source) { } -QJsonObject LogFile::toJson() { +QJsonObject LogFile::toJson() const { QJsonObject result; result["DateCreated"] = Jellyfin::Support::toJsonValue(m_dateCreated); result["DateModified"] = Jellyfin::Support::toJsonValue(m_dateModified); @@ -113,10 +113,15 @@ namespace Support { using LogFile = Jellyfin::DTO::LogFile; template <> -LogFile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +LogFile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return LogFile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const LogFile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/loglevel.cpp b/core/src/dto/loglevel.cpp index c1bcdb9..66968bf 100644 --- a/core/src/dto/loglevel.cpp +++ b/core/src/dto/loglevel.cpp @@ -34,7 +34,6 @@ namespace DTO { LogLevelClass::LogLevelClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using LogLevel = Jellyfin::DTO::LogLevel; template <> -LogLevel fromJsonValue(const QJsonValue &source) { +LogLevel fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return LogLevel::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ LogLevel fromJsonValue(const QJsonValue &source) { return LogLevel::EnumNotSet; } +template <> +QJsonValue toJsonValue(const LogLevel &source, convertType) { + switch(source) { + case LogLevel::Trace: + return QStringLiteral("Trace"); + case LogLevel::Debug: + return QStringLiteral("Debug"); + case LogLevel::Information: + return QStringLiteral("Information"); + case LogLevel::Warning: + return QStringLiteral("Warning"); + case LogLevel::Error: + return QStringLiteral("Error"); + case LogLevel::Critical: + return QStringLiteral("Critical"); + case LogLevel::None: + return QStringLiteral("None"); + + case LogLevel::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediaattachment.cpp b/core/src/dto/mediaattachment.cpp index 89854c6..f9c5281 100644 --- a/core/src/dto/mediaattachment.cpp +++ b/core/src/dto/mediaattachment.cpp @@ -73,7 +73,7 @@ void MediaAttachment::setFromJson(QJsonObject source) { } -QJsonObject MediaAttachment::toJson() { +QJsonObject MediaAttachment::toJson() const { QJsonObject result; result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); result["CodecTag"] = Jellyfin::Support::toJsonValue(m_codecTag); @@ -178,10 +178,15 @@ namespace Support { using MediaAttachment = Jellyfin::DTO::MediaAttachment; template <> -MediaAttachment fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaAttachment fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaAttachment::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaAttachment &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediaencoderpathdto.cpp b/core/src/dto/mediaencoderpathdto.cpp index fcc2ae1..7e21988 100644 --- a/core/src/dto/mediaencoderpathdto.cpp +++ b/core/src/dto/mediaencoderpathdto.cpp @@ -58,7 +58,7 @@ void MediaEncoderPathDto::setFromJson(QJsonObject source) { } -QJsonObject MediaEncoderPathDto::toJson() { +QJsonObject MediaEncoderPathDto::toJson() const { QJsonObject result; result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["PathType"] = Jellyfin::Support::toJsonValue(m_pathType); @@ -100,10 +100,15 @@ namespace Support { using MediaEncoderPathDto = Jellyfin::DTO::MediaEncoderPathDto; template <> -MediaEncoderPathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaEncoderPathDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaEncoderPathDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaEncoderPathDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediapathdto.cpp b/core/src/dto/mediapathdto.cpp index 85e5c41..332c945 100644 --- a/core/src/dto/mediapathdto.cpp +++ b/core/src/dto/mediapathdto.cpp @@ -61,7 +61,7 @@ void MediaPathDto::setFromJson(QJsonObject source) { } -QJsonObject MediaPathDto::toJson() { +QJsonObject MediaPathDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); @@ -103,10 +103,15 @@ namespace Support { using MediaPathDto = Jellyfin::DTO::MediaPathDto; template <> -MediaPathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaPathDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaPathDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaPathDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediapathinfo.cpp b/core/src/dto/mediapathinfo.cpp index 3e1cb9c..e9573b7 100644 --- a/core/src/dto/mediapathinfo.cpp +++ b/core/src/dto/mediapathinfo.cpp @@ -58,7 +58,7 @@ void MediaPathInfo::setFromJson(QJsonObject source) { } -QJsonObject MediaPathInfo::toJson() { +QJsonObject MediaPathInfo::toJson() const { QJsonObject result; result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["NetworkPath"] = Jellyfin::Support::toJsonValue(m_networkPath); @@ -100,10 +100,15 @@ namespace Support { using MediaPathInfo = Jellyfin::DTO::MediaPathInfo; template <> -MediaPathInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaPathInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaPathInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaPathInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediaprotocol.cpp b/core/src/dto/mediaprotocol.cpp index 8ca141d..f932a85 100644 --- a/core/src/dto/mediaprotocol.cpp +++ b/core/src/dto/mediaprotocol.cpp @@ -34,7 +34,6 @@ namespace DTO { MediaProtocolClass::MediaProtocolClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using MediaProtocol = Jellyfin::DTO::MediaProtocol; template <> -MediaProtocol fromJsonValue(const QJsonValue &source) { +MediaProtocol fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return MediaProtocol::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ MediaProtocol fromJsonValue(const QJsonValue &source) { return MediaProtocol::EnumNotSet; } +template <> +QJsonValue toJsonValue(const MediaProtocol &source, convertType) { + switch(source) { + case MediaProtocol::File: + return QStringLiteral("File"); + case MediaProtocol::Http: + return QStringLiteral("Http"); + case MediaProtocol::Rtmp: + return QStringLiteral("Rtmp"); + case MediaProtocol::Rtsp: + return QStringLiteral("Rtsp"); + case MediaProtocol::Udp: + return QStringLiteral("Udp"); + case MediaProtocol::Rtp: + return QStringLiteral("Rtp"); + case MediaProtocol::Ftp: + return QStringLiteral("Ftp"); + + case MediaProtocol::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediasourceinfo.cpp b/core/src/dto/mediasourceinfo.cpp index 68791c0..46c54aa 100644 --- a/core/src/dto/mediasourceinfo.cpp +++ b/core/src/dto/mediasourceinfo.cpp @@ -168,7 +168,7 @@ void MediaSourceInfo::setFromJson(QJsonObject source) { m_formats = Jellyfin::Support::fromJsonValue(source["Formats"]); m_bitrate = Jellyfin::Support::fromJsonValue>(source["Bitrate"]); m_timestamp = Jellyfin::Support::fromJsonValue(source["Timestamp"]); - m_requiredHttpHeaders = Jellyfin::Support::fromJsonValue>(source["RequiredHttpHeaders"]); + m_requiredHttpHeaders = Jellyfin::Support::fromJsonValue(source["RequiredHttpHeaders"]); m_transcodingUrl = Jellyfin::Support::fromJsonValue(source["TranscodingUrl"]); m_transcodingSubProtocol = Jellyfin::Support::fromJsonValue(source["TranscodingSubProtocol"]); m_transcodingContainer = Jellyfin::Support::fromJsonValue(source["TranscodingContainer"]); @@ -178,7 +178,7 @@ void MediaSourceInfo::setFromJson(QJsonObject source) { } -QJsonObject MediaSourceInfo::toJson() { +QJsonObject MediaSourceInfo::toJson() const { QJsonObject result; result["Protocol"] = Jellyfin::Support::toJsonValue(m_protocol); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -215,7 +215,7 @@ QJsonObject MediaSourceInfo::toJson() { result["Formats"] = Jellyfin::Support::toJsonValue(m_formats); result["Bitrate"] = Jellyfin::Support::toJsonValue>(m_bitrate); result["Timestamp"] = Jellyfin::Support::toJsonValue(m_timestamp); - result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue>(m_requiredHttpHeaders); + result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue(m_requiredHttpHeaders); result["TranscodingUrl"] = Jellyfin::Support::toJsonValue(m_transcodingUrl); result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue(m_transcodingSubProtocol); result["TranscodingContainer"] = Jellyfin::Support::toJsonValue(m_transcodingContainer); @@ -541,17 +541,17 @@ void MediaSourceInfo::setTimestamp(TransportStreamTimestamp newTimestamp) { m_timestamp = newTimestamp; } -std::optional MediaSourceInfo::requiredHttpHeaders() const { return m_requiredHttpHeaders; } +QJsonObject MediaSourceInfo::requiredHttpHeaders() const { return m_requiredHttpHeaders; } -void MediaSourceInfo::setRequiredHttpHeaders(std::optional newRequiredHttpHeaders) { +void MediaSourceInfo::setRequiredHttpHeaders(QJsonObject newRequiredHttpHeaders) { m_requiredHttpHeaders = newRequiredHttpHeaders; } bool MediaSourceInfo::requiredHttpHeadersNull() const { - return !m_requiredHttpHeaders.has_value(); + return m_requiredHttpHeaders.isEmpty(); } void MediaSourceInfo::setRequiredHttpHeadersNull() { - m_requiredHttpHeaders = std::nullopt; + m_requiredHttpHeaders= QJsonObject(); } QString MediaSourceInfo::transcodingUrl() const { return m_transcodingUrl; } @@ -640,10 +640,15 @@ namespace Support { using MediaSourceInfo = Jellyfin::DTO::MediaSourceInfo; template <> -MediaSourceInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaSourceInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaSourceInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaSourceInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediasourcetype.cpp b/core/src/dto/mediasourcetype.cpp index c164cc3..ffb449a 100644 --- a/core/src/dto/mediasourcetype.cpp +++ b/core/src/dto/mediasourcetype.cpp @@ -34,7 +34,6 @@ namespace DTO { MediaSourceTypeClass::MediaSourceTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using MediaSourceType = Jellyfin::DTO::MediaSourceType; template <> -MediaSourceType fromJsonValue(const QJsonValue &source) { +MediaSourceType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return MediaSourceType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ MediaSourceType fromJsonValue(const QJsonValue &source) { return MediaSourceType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const MediaSourceType &source, convertType) { + switch(source) { + case MediaSourceType::Default: + return QStringLiteral("Default"); + case MediaSourceType::Grouping: + return QStringLiteral("Grouping"); + case MediaSourceType::Placeholder: + return QStringLiteral("Placeholder"); + + case MediaSourceType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediastream.cpp b/core/src/dto/mediastream.cpp index 25db4ef..b4839c9 100644 --- a/core/src/dto/mediastream.cpp +++ b/core/src/dto/mediastream.cpp @@ -193,7 +193,7 @@ void MediaStream::setFromJson(QJsonObject source) { } -QJsonObject MediaStream::toJson() { +QJsonObject MediaStream::toJson() const { QJsonObject result; result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); result["CodecTag"] = Jellyfin::Support::toJsonValue(m_codecTag); @@ -802,10 +802,15 @@ namespace Support { using MediaStream = Jellyfin::DTO::MediaStream; template <> -MediaStream fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaStream fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaStream::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaStream &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediastreamtype.cpp b/core/src/dto/mediastreamtype.cpp index 686fe90..a196d01 100644 --- a/core/src/dto/mediastreamtype.cpp +++ b/core/src/dto/mediastreamtype.cpp @@ -34,7 +34,6 @@ namespace DTO { MediaStreamTypeClass::MediaStreamTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using MediaStreamType = Jellyfin::DTO::MediaStreamType; template <> -MediaStreamType fromJsonValue(const QJsonValue &source) { +MediaStreamType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return MediaStreamType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ MediaStreamType fromJsonValue(const QJsonValue &source) { return MediaStreamType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const MediaStreamType &source, convertType) { + switch(source) { + case MediaStreamType::Audio: + return QStringLiteral("Audio"); + case MediaStreamType::Video: + return QStringLiteral("Video"); + case MediaStreamType::Subtitle: + return QStringLiteral("Subtitle"); + case MediaStreamType::EmbeddedImage: + return QStringLiteral("EmbeddedImage"); + + case MediaStreamType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediaupdateinfodto.cpp b/core/src/dto/mediaupdateinfodto.cpp index 6446097..24ba17c 100644 --- a/core/src/dto/mediaupdateinfodto.cpp +++ b/core/src/dto/mediaupdateinfodto.cpp @@ -58,7 +58,7 @@ void MediaUpdateInfoDto::setFromJson(QJsonObject source) { } -QJsonObject MediaUpdateInfoDto::toJson() { +QJsonObject MediaUpdateInfoDto::toJson() const { QJsonObject result; result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["UpdateType"] = Jellyfin::Support::toJsonValue(m_updateType); @@ -100,10 +100,15 @@ namespace Support { using MediaUpdateInfoDto = Jellyfin::DTO::MediaUpdateInfoDto; template <> -MediaUpdateInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaUpdateInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaUpdateInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaUpdateInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/mediaurl.cpp b/core/src/dto/mediaurl.cpp index 678b133..6f8ed34 100644 --- a/core/src/dto/mediaurl.cpp +++ b/core/src/dto/mediaurl.cpp @@ -58,7 +58,7 @@ void MediaUrl::setFromJson(QJsonObject source) { } -QJsonObject MediaUrl::toJson() { +QJsonObject MediaUrl::toJson() const { QJsonObject result; result["Url"] = Jellyfin::Support::toJsonValue(m_url); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -100,10 +100,15 @@ namespace Support { using MediaUrl = Jellyfin::DTO::MediaUrl; template <> -MediaUrl fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MediaUrl fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaUrl::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MediaUrl &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/metadataeditorinfo.cpp b/core/src/dto/metadataeditorinfo.cpp index c734b37..f63408d 100644 --- a/core/src/dto/metadataeditorinfo.cpp +++ b/core/src/dto/metadataeditorinfo.cpp @@ -70,7 +70,7 @@ void MetadataEditorInfo::setFromJson(QJsonObject source) { } -QJsonObject MetadataEditorInfo::toJson() { +QJsonObject MetadataEditorInfo::toJson() const { QJsonObject result; result["ParentalRatingOptions"] = Jellyfin::Support::toJsonValue>(m_parentalRatingOptions); result["Countries"] = Jellyfin::Support::toJsonValue>(m_countries); @@ -168,10 +168,15 @@ namespace Support { using MetadataEditorInfo = Jellyfin::DTO::MetadataEditorInfo; template <> -MetadataEditorInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MetadataEditorInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MetadataEditorInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MetadataEditorInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/metadatafield.cpp b/core/src/dto/metadatafield.cpp index 1aaf6fa..a39e7aa 100644 --- a/core/src/dto/metadatafield.cpp +++ b/core/src/dto/metadatafield.cpp @@ -34,7 +34,6 @@ namespace DTO { MetadataFieldClass::MetadataFieldClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using MetadataField = Jellyfin::DTO::MetadataField; template <> -MetadataField fromJsonValue(const QJsonValue &source) { +MetadataField fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return MetadataField::EnumNotSet; QString str = source.toString(); @@ -77,5 +76,33 @@ MetadataField fromJsonValue(const QJsonValue &source) { return MetadataField::EnumNotSet; } +template <> +QJsonValue toJsonValue(const MetadataField &source, convertType) { + switch(source) { + case MetadataField::Cast: + return QStringLiteral("Cast"); + case MetadataField::Genres: + return QStringLiteral("Genres"); + case MetadataField::ProductionLocations: + return QStringLiteral("ProductionLocations"); + case MetadataField::Studios: + return QStringLiteral("Studios"); + case MetadataField::Tags: + return QStringLiteral("Tags"); + case MetadataField::Name: + return QStringLiteral("Name"); + case MetadataField::Overview: + return QStringLiteral("Overview"); + case MetadataField::Runtime: + return QStringLiteral("Runtime"); + case MetadataField::OfficialRating: + return QStringLiteral("OfficialRating"); + + case MetadataField::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/metadataoptions.cpp b/core/src/dto/metadataoptions.cpp index cc5e8a7..05c3206 100644 --- a/core/src/dto/metadataoptions.cpp +++ b/core/src/dto/metadataoptions.cpp @@ -73,7 +73,7 @@ void MetadataOptions::setFromJson(QJsonObject source) { } -QJsonObject MetadataOptions::toJson() { +QJsonObject MetadataOptions::toJson() const { QJsonObject result; result["ItemType"] = Jellyfin::Support::toJsonValue(m_itemType); result["DisabledMetadataSavers"] = Jellyfin::Support::toJsonValue(m_disabledMetadataSavers); @@ -185,10 +185,15 @@ namespace Support { using MetadataOptions = Jellyfin::DTO::MetadataOptions; template <> -MetadataOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MetadataOptions fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MetadataOptions::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MetadataOptions &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/metadatarefreshmode.cpp b/core/src/dto/metadatarefreshmode.cpp index 9d961d2..dd07791 100644 --- a/core/src/dto/metadatarefreshmode.cpp +++ b/core/src/dto/metadatarefreshmode.cpp @@ -34,7 +34,6 @@ namespace DTO { MetadataRefreshModeClass::MetadataRefreshModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using MetadataRefreshMode = Jellyfin::DTO::MetadataRefreshMode; template <> -MetadataRefreshMode fromJsonValue(const QJsonValue &source) { +MetadataRefreshMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return MetadataRefreshMode::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ MetadataRefreshMode fromJsonValue(const QJsonValue &source) return MetadataRefreshMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const MetadataRefreshMode &source, convertType) { + switch(source) { + case MetadataRefreshMode::None: + return QStringLiteral("None"); + case MetadataRefreshMode::ValidationOnly: + return QStringLiteral("ValidationOnly"); + case MetadataRefreshMode::Default: + return QStringLiteral("Default"); + case MetadataRefreshMode::FullRefresh: + return QStringLiteral("FullRefresh"); + + case MetadataRefreshMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/moveplaylistitemrequestdto.cpp b/core/src/dto/moveplaylistitemrequestdto.cpp index 42778ad..8c246ef 100644 --- a/core/src/dto/moveplaylistitemrequestdto.cpp +++ b/core/src/dto/moveplaylistitemrequestdto.cpp @@ -58,7 +58,7 @@ void MovePlaylistItemRequestDto::setFromJson(QJsonObject source) { } -QJsonObject MovePlaylistItemRequestDto::toJson() { +QJsonObject MovePlaylistItemRequestDto::toJson() const { QJsonObject result; result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); result["NewIndex"] = Jellyfin::Support::toJsonValue(m_newIndex); @@ -86,10 +86,15 @@ namespace Support { using MovePlaylistItemRequestDto = Jellyfin::DTO::MovePlaylistItemRequestDto; template <> -MovePlaylistItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MovePlaylistItemRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MovePlaylistItemRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MovePlaylistItemRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/movieinfo.cpp b/core/src/dto/movieinfo.cpp index c68a11f..9237c36 100644 --- a/core/src/dto/movieinfo.cpp +++ b/core/src/dto/movieinfo.cpp @@ -73,7 +73,7 @@ void MovieInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -82,13 +82,13 @@ void MovieInfo::setFromJson(QJsonObject source) { } -QJsonObject MovieInfo::toJson() { +QJsonObject MovieInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -150,17 +150,17 @@ void MovieInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional MovieInfo::providerIds() const { return m_providerIds; } +QJsonObject MovieInfo::providerIds() const { return m_providerIds; } -void MovieInfo::setProviderIds(std::optional newProviderIds) { +void MovieInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool MovieInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void MovieInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional MovieInfo::year() const { return m_year; } @@ -229,10 +229,15 @@ namespace Support { using MovieInfo = Jellyfin::DTO::MovieInfo; template <> -MovieInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MovieInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MovieInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MovieInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/movieinforemotesearchquery.cpp b/core/src/dto/movieinforemotesearchquery.cpp index 7370cad..21a3b2f 100644 --- a/core/src/dto/movieinforemotesearchquery.cpp +++ b/core/src/dto/movieinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void MovieInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject MovieInfoRemoteSearchQuery::toJson() { +QJsonObject MovieInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using MovieInfoRemoteSearchQuery = Jellyfin::DTO::MovieInfoRemoteSearchQuery; template <> -MovieInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MovieInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MovieInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MovieInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/musicvideoinfo.cpp b/core/src/dto/musicvideoinfo.cpp index 8759ec7..2848129 100644 --- a/core/src/dto/musicvideoinfo.cpp +++ b/core/src/dto/musicvideoinfo.cpp @@ -75,7 +75,7 @@ void MusicVideoInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -85,13 +85,13 @@ void MusicVideoInfo::setFromJson(QJsonObject source) { } -QJsonObject MusicVideoInfo::toJson() { +QJsonObject MusicVideoInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -154,17 +154,17 @@ void MusicVideoInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional MusicVideoInfo::providerIds() const { return m_providerIds; } +QJsonObject MusicVideoInfo::providerIds() const { return m_providerIds; } -void MusicVideoInfo::setProviderIds(std::optional newProviderIds) { +void MusicVideoInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool MusicVideoInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void MusicVideoInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional MusicVideoInfo::year() const { return m_year; } @@ -246,10 +246,15 @@ namespace Support { using MusicVideoInfo = Jellyfin::DTO::MusicVideoInfo; template <> -MusicVideoInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MusicVideoInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MusicVideoInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MusicVideoInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/musicvideoinforemotesearchquery.cpp b/core/src/dto/musicvideoinforemotesearchquery.cpp index 7688ce0..139cd90 100644 --- a/core/src/dto/musicvideoinforemotesearchquery.cpp +++ b/core/src/dto/musicvideoinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void MusicVideoInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject MusicVideoInfoRemoteSearchQuery::toJson() { +QJsonObject MusicVideoInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using MusicVideoInfoRemoteSearchQuery = Jellyfin::DTO::MusicVideoInfoRemoteSearchQuery; template <> -MusicVideoInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +MusicVideoInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return MusicVideoInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const MusicVideoInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/nameguidpair.cpp b/core/src/dto/nameguidpair.cpp index 9569902..4c8f05e 100644 --- a/core/src/dto/nameguidpair.cpp +++ b/core/src/dto/nameguidpair.cpp @@ -58,7 +58,7 @@ void NameGuidPair::setFromJson(QJsonObject source) { } -QJsonObject NameGuidPair::toJson() { +QJsonObject NameGuidPair::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -93,10 +93,15 @@ namespace Support { using NameGuidPair = Jellyfin::DTO::NameGuidPair; template <> -NameGuidPair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NameGuidPair fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NameGuidPair::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NameGuidPair &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/nameidpair.cpp b/core/src/dto/nameidpair.cpp index 91f21f9..918cb77 100644 --- a/core/src/dto/nameidpair.cpp +++ b/core/src/dto/nameidpair.cpp @@ -58,7 +58,7 @@ void NameIdPair::setFromJson(QJsonObject source) { } -QJsonObject NameIdPair::toJson() { +QJsonObject NameIdPair::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -100,10 +100,15 @@ namespace Support { using NameIdPair = Jellyfin::DTO::NameIdPair; template <> -NameIdPair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NameIdPair fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NameIdPair::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NameIdPair &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/namevaluepair.cpp b/core/src/dto/namevaluepair.cpp index 8db0df2..93d5eac 100644 --- a/core/src/dto/namevaluepair.cpp +++ b/core/src/dto/namevaluepair.cpp @@ -58,7 +58,7 @@ void NameValuePair::setFromJson(QJsonObject source) { } -QJsonObject NameValuePair::toJson() { +QJsonObject NameValuePair::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Value"] = Jellyfin::Support::toJsonValue(m_value); @@ -100,10 +100,15 @@ namespace Support { using NameValuePair = Jellyfin::DTO::NameValuePair; template <> -NameValuePair fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NameValuePair fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NameValuePair::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NameValuePair &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/newgrouprequestdto.cpp b/core/src/dto/newgrouprequestdto.cpp index 79b501d..3c75c3e 100644 --- a/core/src/dto/newgrouprequestdto.cpp +++ b/core/src/dto/newgrouprequestdto.cpp @@ -55,7 +55,7 @@ void NewGroupRequestDto::setFromJson(QJsonObject source) { } -QJsonObject NewGroupRequestDto::toJson() { +QJsonObject NewGroupRequestDto::toJson() const { QJsonObject result; result["GroupName"] = Jellyfin::Support::toJsonValue(m_groupName); @@ -83,10 +83,15 @@ namespace Support { using NewGroupRequestDto = Jellyfin::DTO::NewGroupRequestDto; template <> -NewGroupRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NewGroupRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NewGroupRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NewGroupRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/nextitemrequestdto.cpp b/core/src/dto/nextitemrequestdto.cpp index 3bbd2a8..0ac4662 100644 --- a/core/src/dto/nextitemrequestdto.cpp +++ b/core/src/dto/nextitemrequestdto.cpp @@ -55,7 +55,7 @@ void NextItemRequestDto::setFromJson(QJsonObject source) { } -QJsonObject NextItemRequestDto::toJson() { +QJsonObject NextItemRequestDto::toJson() const { QJsonObject result; result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); @@ -76,10 +76,15 @@ namespace Support { using NextItemRequestDto = Jellyfin::DTO::NextItemRequestDto; template <> -NextItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NextItemRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NextItemRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NextItemRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/notificationdto.cpp b/core/src/dto/notificationdto.cpp index 28d24a6..eddee22 100644 --- a/core/src/dto/notificationdto.cpp +++ b/core/src/dto/notificationdto.cpp @@ -76,7 +76,7 @@ void NotificationDto::setFromJson(QJsonObject source) { } -QJsonObject NotificationDto::toJson() { +QJsonObject NotificationDto::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); @@ -181,10 +181,15 @@ namespace Support { using NotificationDto = Jellyfin::DTO::NotificationDto; template <> -NotificationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NotificationDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NotificationDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NotificationDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/notificationlevel.cpp b/core/src/dto/notificationlevel.cpp index fa13a40..a53c67d 100644 --- a/core/src/dto/notificationlevel.cpp +++ b/core/src/dto/notificationlevel.cpp @@ -34,7 +34,6 @@ namespace DTO { NotificationLevelClass::NotificationLevelClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using NotificationLevel = Jellyfin::DTO::NotificationLevel; template <> -NotificationLevel fromJsonValue(const QJsonValue &source) { +NotificationLevel fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return NotificationLevel::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ NotificationLevel fromJsonValue(const QJsonValue &source) { return NotificationLevel::EnumNotSet; } +template <> +QJsonValue toJsonValue(const NotificationLevel &source, convertType) { + switch(source) { + case NotificationLevel::Normal: + return QStringLiteral("Normal"); + case NotificationLevel::Warning: + return QStringLiteral("Warning"); + case NotificationLevel::Error: + return QStringLiteral("Error"); + + case NotificationLevel::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/notificationresultdto.cpp b/core/src/dto/notificationresultdto.cpp index 39b53f4..138f5c9 100644 --- a/core/src/dto/notificationresultdto.cpp +++ b/core/src/dto/notificationresultdto.cpp @@ -58,7 +58,7 @@ void NotificationResultDto::setFromJson(QJsonObject source) { } -QJsonObject NotificationResultDto::toJson() { +QJsonObject NotificationResultDto::toJson() const { QJsonObject result; result["Notifications"] = Jellyfin::Support::toJsonValue>(m_notifications); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -93,10 +93,15 @@ namespace Support { using NotificationResultDto = Jellyfin::DTO::NotificationResultDto; template <> -NotificationResultDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NotificationResultDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NotificationResultDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NotificationResultDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/notificationssummarydto.cpp b/core/src/dto/notificationssummarydto.cpp index 41de821..4ef4fde 100644 --- a/core/src/dto/notificationssummarydto.cpp +++ b/core/src/dto/notificationssummarydto.cpp @@ -58,7 +58,7 @@ void NotificationsSummaryDto::setFromJson(QJsonObject source) { } -QJsonObject NotificationsSummaryDto::toJson() { +QJsonObject NotificationsSummaryDto::toJson() const { QJsonObject result; result["UnreadCount"] = Jellyfin::Support::toJsonValue(m_unreadCount); result["MaxUnreadNotificationLevel"] = Jellyfin::Support::toJsonValue(m_maxUnreadNotificationLevel); @@ -86,10 +86,15 @@ namespace Support { using NotificationsSummaryDto = Jellyfin::DTO::NotificationsSummaryDto; template <> -NotificationsSummaryDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NotificationsSummaryDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NotificationsSummaryDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NotificationsSummaryDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/notificationtypeinfo.cpp b/core/src/dto/notificationtypeinfo.cpp index af395bf..72cbce0 100644 --- a/core/src/dto/notificationtypeinfo.cpp +++ b/core/src/dto/notificationtypeinfo.cpp @@ -67,7 +67,7 @@ void NotificationTypeInfo::setFromJson(QJsonObject source) { } -QJsonObject NotificationTypeInfo::toJson() { +QJsonObject NotificationTypeInfo::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["Name"] = Jellyfin::Support::toJsonValue(m_name); @@ -137,10 +137,15 @@ namespace Support { using NotificationTypeInfo = Jellyfin::DTO::NotificationTypeInfo; template <> -NotificationTypeInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +NotificationTypeInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return NotificationTypeInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const NotificationTypeInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/objectgroupupdate.cpp b/core/src/dto/objectgroupupdate.cpp index 26a3a02..bed40ba 100644 --- a/core/src/dto/objectgroupupdate.cpp +++ b/core/src/dto/objectgroupupdate.cpp @@ -61,7 +61,7 @@ void ObjectGroupUpdate::setFromJson(QJsonObject source) { } -QJsonObject ObjectGroupUpdate::toJson() { +QJsonObject ObjectGroupUpdate::toJson() const { QJsonObject result; result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); result["Type"] = Jellyfin::Support::toJsonValue(m_type); @@ -96,10 +96,15 @@ namespace Support { using ObjectGroupUpdate = Jellyfin::DTO::ObjectGroupUpdate; template <> -ObjectGroupUpdate fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ObjectGroupUpdate fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ObjectGroupUpdate::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ObjectGroupUpdate &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/openlivestreamdto.cpp b/core/src/dto/openlivestreamdto.cpp index 22726e6..9ce6ded 100644 --- a/core/src/dto/openlivestreamdto.cpp +++ b/core/src/dto/openlivestreamdto.cpp @@ -91,7 +91,7 @@ void OpenLiveStreamDto::setFromJson(QJsonObject source) { } -QJsonObject OpenLiveStreamDto::toJson() { +QJsonObject OpenLiveStreamDto::toJson() const { QJsonObject result; result["OpenToken"] = Jellyfin::Support::toJsonValue(m_openToken); result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); @@ -280,10 +280,15 @@ namespace Support { using OpenLiveStreamDto = Jellyfin::DTO::OpenLiveStreamDto; template <> -OpenLiveStreamDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +OpenLiveStreamDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return OpenLiveStreamDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const OpenLiveStreamDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/packageinfo.cpp b/core/src/dto/packageinfo.cpp index cd16b77..1ce8d81 100644 --- a/core/src/dto/packageinfo.cpp +++ b/core/src/dto/packageinfo.cpp @@ -76,7 +76,7 @@ void PackageInfo::setFromJson(QJsonObject source) { } -QJsonObject PackageInfo::toJson() { +QJsonObject PackageInfo::toJson() const { QJsonObject result; result["name"] = Jellyfin::Support::toJsonValue(m_name); result["description"] = Jellyfin::Support::toJsonValue(m_description); @@ -202,10 +202,15 @@ namespace Support { using PackageInfo = Jellyfin::DTO::PackageInfo; template <> -PackageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PackageInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PackageInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PackageInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/parentalrating.cpp b/core/src/dto/parentalrating.cpp index ee7dabb..5875ae5 100644 --- a/core/src/dto/parentalrating.cpp +++ b/core/src/dto/parentalrating.cpp @@ -58,7 +58,7 @@ void ParentalRating::setFromJson(QJsonObject source) { } -QJsonObject ParentalRating::toJson() { +QJsonObject ParentalRating::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Value"] = Jellyfin::Support::toJsonValue(m_value); @@ -93,10 +93,15 @@ namespace Support { using ParentalRating = Jellyfin::DTO::ParentalRating; template <> -ParentalRating fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ParentalRating fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ParentalRating::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ParentalRating &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/pathsubstitution.cpp b/core/src/dto/pathsubstitution.cpp index 14058c1..140a48e 100644 --- a/core/src/dto/pathsubstitution.cpp +++ b/core/src/dto/pathsubstitution.cpp @@ -58,7 +58,7 @@ void PathSubstitution::setFromJson(QJsonObject source) { } -QJsonObject PathSubstitution::toJson() { +QJsonObject PathSubstitution::toJson() const { QJsonObject result; result["From"] = Jellyfin::Support::toJsonValue(m_from); result["To"] = Jellyfin::Support::toJsonValue(m_to); @@ -100,10 +100,15 @@ namespace Support { using PathSubstitution = Jellyfin::DTO::PathSubstitution; template <> -PathSubstitution fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PathSubstitution fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PathSubstitution::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PathSubstitution &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/personlookupinfo.cpp b/core/src/dto/personlookupinfo.cpp index a4e71fa..b07e67d 100644 --- a/core/src/dto/personlookupinfo.cpp +++ b/core/src/dto/personlookupinfo.cpp @@ -73,7 +73,7 @@ void PersonLookupInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -82,13 +82,13 @@ void PersonLookupInfo::setFromJson(QJsonObject source) { } -QJsonObject PersonLookupInfo::toJson() { +QJsonObject PersonLookupInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -150,17 +150,17 @@ void PersonLookupInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional PersonLookupInfo::providerIds() const { return m_providerIds; } +QJsonObject PersonLookupInfo::providerIds() const { return m_providerIds; } -void PersonLookupInfo::setProviderIds(std::optional newProviderIds) { +void PersonLookupInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool PersonLookupInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void PersonLookupInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional PersonLookupInfo::year() const { return m_year; } @@ -229,10 +229,15 @@ namespace Support { using PersonLookupInfo = Jellyfin::DTO::PersonLookupInfo; template <> -PersonLookupInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PersonLookupInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PersonLookupInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PersonLookupInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/personlookupinforemotesearchquery.cpp b/core/src/dto/personlookupinforemotesearchquery.cpp index 4d481cc..3fbf2d7 100644 --- a/core/src/dto/personlookupinforemotesearchquery.cpp +++ b/core/src/dto/personlookupinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void PersonLookupInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject PersonLookupInfoRemoteSearchQuery::toJson() { +QJsonObject PersonLookupInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using PersonLookupInfoRemoteSearchQuery = Jellyfin::DTO::PersonLookupInfoRemoteSearchQuery; template <> -PersonLookupInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PersonLookupInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PersonLookupInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PersonLookupInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/pingrequestdto.cpp b/core/src/dto/pingrequestdto.cpp index 1aa5341..fd95280 100644 --- a/core/src/dto/pingrequestdto.cpp +++ b/core/src/dto/pingrequestdto.cpp @@ -55,7 +55,7 @@ void PingRequestDto::setFromJson(QJsonObject source) { } -QJsonObject PingRequestDto::toJson() { +QJsonObject PingRequestDto::toJson() const { QJsonObject result; result["Ping"] = Jellyfin::Support::toJsonValue(m_ping); @@ -76,10 +76,15 @@ namespace Support { using PingRequestDto = Jellyfin::DTO::PingRequestDto; template <> -PingRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PingRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PingRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PingRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/pinredeemresult.cpp b/core/src/dto/pinredeemresult.cpp index 31be1de..dd2bbd2 100644 --- a/core/src/dto/pinredeemresult.cpp +++ b/core/src/dto/pinredeemresult.cpp @@ -58,7 +58,7 @@ void PinRedeemResult::setFromJson(QJsonObject source) { } -QJsonObject PinRedeemResult::toJson() { +QJsonObject PinRedeemResult::toJson() const { QJsonObject result; result["Success"] = Jellyfin::Support::toJsonValue(m_success); result["UsersReset"] = Jellyfin::Support::toJsonValue(m_usersReset); @@ -93,10 +93,15 @@ namespace Support { using PinRedeemResult = Jellyfin::DTO::PinRedeemResult; template <> -PinRedeemResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PinRedeemResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PinRedeemResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PinRedeemResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playaccess.cpp b/core/src/dto/playaccess.cpp index 9c1951e..8084a3e 100644 --- a/core/src/dto/playaccess.cpp +++ b/core/src/dto/playaccess.cpp @@ -34,7 +34,6 @@ namespace DTO { PlayAccessClass::PlayAccessClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PlayAccess = Jellyfin::DTO::PlayAccess; template <> -PlayAccess fromJsonValue(const QJsonValue &source) { +PlayAccess fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PlayAccess::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ PlayAccess fromJsonValue(const QJsonValue &source) { return PlayAccess::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PlayAccess &source, convertType) { + switch(source) { + case PlayAccess::Full: + return QStringLiteral("Full"); + case PlayAccess::None: + return QStringLiteral("None"); + + case PlayAccess::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackerrorcode.cpp b/core/src/dto/playbackerrorcode.cpp index e4e41ef..10b1be7 100644 --- a/core/src/dto/playbackerrorcode.cpp +++ b/core/src/dto/playbackerrorcode.cpp @@ -34,7 +34,6 @@ namespace DTO { PlaybackErrorCodeClass::PlaybackErrorCodeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PlaybackErrorCode = Jellyfin::DTO::PlaybackErrorCode; template <> -PlaybackErrorCode fromJsonValue(const QJsonValue &source) { +PlaybackErrorCode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PlaybackErrorCode::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ PlaybackErrorCode fromJsonValue(const QJsonValue &source) { return PlaybackErrorCode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PlaybackErrorCode &source, convertType) { + switch(source) { + case PlaybackErrorCode::NotAllowed: + return QStringLiteral("NotAllowed"); + case PlaybackErrorCode::NoCompatibleStream: + return QStringLiteral("NoCompatibleStream"); + case PlaybackErrorCode::RateLimitExceeded: + return QStringLiteral("RateLimitExceeded"); + + case PlaybackErrorCode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackinfodto.cpp b/core/src/dto/playbackinfodto.cpp index f365689..a7e27af 100644 --- a/core/src/dto/playbackinfodto.cpp +++ b/core/src/dto/playbackinfodto.cpp @@ -97,7 +97,7 @@ void PlaybackInfoDto::setFromJson(QJsonObject source) { } -QJsonObject PlaybackInfoDto::toJson() { +QJsonObject PlaybackInfoDto::toJson() const { QJsonObject result; result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue>(m_maxStreamingBitrate); @@ -314,10 +314,15 @@ namespace Support { using PlaybackInfoDto = Jellyfin::DTO::PlaybackInfoDto; template <> -PlaybackInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaybackInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaybackInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackinforesponse.cpp b/core/src/dto/playbackinforesponse.cpp index 0a57b78..adc1e62 100644 --- a/core/src/dto/playbackinforesponse.cpp +++ b/core/src/dto/playbackinforesponse.cpp @@ -61,7 +61,7 @@ void PlaybackInfoResponse::setFromJson(QJsonObject source) { } -QJsonObject PlaybackInfoResponse::toJson() { +QJsonObject PlaybackInfoResponse::toJson() const { QJsonObject result; result["MediaSources"] = Jellyfin::Support::toJsonValue>(m_mediaSources); result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); @@ -110,10 +110,15 @@ namespace Support { using PlaybackInfoResponse = Jellyfin::DTO::PlaybackInfoResponse; template <> -PlaybackInfoResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaybackInfoResponse fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackInfoResponse::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaybackInfoResponse &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackprogressinfo.cpp b/core/src/dto/playbackprogressinfo.cpp index 0f9548e..48f36c6 100644 --- a/core/src/dto/playbackprogressinfo.cpp +++ b/core/src/dto/playbackprogressinfo.cpp @@ -112,7 +112,7 @@ void PlaybackProgressInfo::setFromJson(QJsonObject source) { } -QJsonObject PlaybackProgressInfo::toJson() { +QJsonObject PlaybackProgressInfo::toJson() const { QJsonObject result; result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); result["Item"] = Jellyfin::Support::toJsonValue>(m_item); @@ -357,10 +357,15 @@ namespace Support { using PlaybackProgressInfo = Jellyfin::DTO::PlaybackProgressInfo; template <> -PlaybackProgressInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaybackProgressInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackProgressInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaybackProgressInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackstartinfo.cpp b/core/src/dto/playbackstartinfo.cpp index d56525d..04abfb9 100644 --- a/core/src/dto/playbackstartinfo.cpp +++ b/core/src/dto/playbackstartinfo.cpp @@ -112,7 +112,7 @@ void PlaybackStartInfo::setFromJson(QJsonObject source) { } -QJsonObject PlaybackStartInfo::toJson() { +QJsonObject PlaybackStartInfo::toJson() const { QJsonObject result; result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); result["Item"] = Jellyfin::Support::toJsonValue>(m_item); @@ -357,10 +357,15 @@ namespace Support { using PlaybackStartInfo = Jellyfin::DTO::PlaybackStartInfo; template <> -PlaybackStartInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaybackStartInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackStartInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaybackStartInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playbackstopinfo.cpp b/core/src/dto/playbackstopinfo.cpp index c403900..1231bad 100644 --- a/core/src/dto/playbackstopinfo.cpp +++ b/core/src/dto/playbackstopinfo.cpp @@ -85,7 +85,7 @@ void PlaybackStopInfo::setFromJson(QJsonObject source) { } -QJsonObject PlaybackStopInfo::toJson() { +QJsonObject PlaybackStopInfo::toJson() const { QJsonObject result; result["Item"] = Jellyfin::Support::toJsonValue>(m_item); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -232,10 +232,15 @@ namespace Support { using PlaybackStopInfo = Jellyfin::DTO::PlaybackStopInfo; template <> -PlaybackStopInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaybackStopInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackStopInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaybackStopInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playcommand.cpp b/core/src/dto/playcommand.cpp index 9459567..7412063 100644 --- a/core/src/dto/playcommand.cpp +++ b/core/src/dto/playcommand.cpp @@ -34,7 +34,6 @@ namespace DTO { PlayCommandClass::PlayCommandClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PlayCommand = Jellyfin::DTO::PlayCommand; template <> -PlayCommand fromJsonValue(const QJsonValue &source) { +PlayCommand fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PlayCommand::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ PlayCommand fromJsonValue(const QJsonValue &source) { return PlayCommand::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PlayCommand &source, convertType) { + switch(source) { + case PlayCommand::PlayNow: + return QStringLiteral("PlayNow"); + case PlayCommand::PlayNext: + return QStringLiteral("PlayNext"); + case PlayCommand::PlayLast: + return QStringLiteral("PlayLast"); + case PlayCommand::PlayInstantMix: + return QStringLiteral("PlayInstantMix"); + case PlayCommand::PlayShuffle: + return QStringLiteral("PlayShuffle"); + + case PlayCommand::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playerstateinfo.cpp b/core/src/dto/playerstateinfo.cpp index 4e383bb..2b89550 100644 --- a/core/src/dto/playerstateinfo.cpp +++ b/core/src/dto/playerstateinfo.cpp @@ -82,7 +82,7 @@ void PlayerStateInfo::setFromJson(QJsonObject source) { } -QJsonObject PlayerStateInfo::toJson() { +QJsonObject PlayerStateInfo::toJson() const { QJsonObject result; result["PositionTicks"] = Jellyfin::Support::toJsonValue>(m_positionTicks); result["CanSeek"] = Jellyfin::Support::toJsonValue(m_canSeek); @@ -201,10 +201,15 @@ namespace Support { using PlayerStateInfo = Jellyfin::DTO::PlayerStateInfo; template <> -PlayerStateInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlayerStateInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlayerStateInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlayerStateInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playlistcreationresult.cpp b/core/src/dto/playlistcreationresult.cpp index b815459..1ae5cb9 100644 --- a/core/src/dto/playlistcreationresult.cpp +++ b/core/src/dto/playlistcreationresult.cpp @@ -55,7 +55,7 @@ void PlaylistCreationResult::setFromJson(QJsonObject source) { } -QJsonObject PlaylistCreationResult::toJson() { +QJsonObject PlaylistCreationResult::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -83,10 +83,15 @@ namespace Support { using PlaylistCreationResult = Jellyfin::DTO::PlaylistCreationResult; template <> -PlaylistCreationResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaylistCreationResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaylistCreationResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaylistCreationResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playmethod.cpp b/core/src/dto/playmethod.cpp index 2ef7299..98496d7 100644 --- a/core/src/dto/playmethod.cpp +++ b/core/src/dto/playmethod.cpp @@ -34,7 +34,6 @@ namespace DTO { PlayMethodClass::PlayMethodClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PlayMethod = Jellyfin::DTO::PlayMethod; template <> -PlayMethod fromJsonValue(const QJsonValue &source) { +PlayMethod fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PlayMethod::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ PlayMethod fromJsonValue(const QJsonValue &source) { return PlayMethod::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PlayMethod &source, convertType) { + switch(source) { + case PlayMethod::Transcode: + return QStringLiteral("Transcode"); + case PlayMethod::DirectStream: + return QStringLiteral("DirectStream"); + case PlayMethod::DirectPlay: + return QStringLiteral("DirectPlay"); + + case PlayMethod::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playrequest.cpp b/core/src/dto/playrequest.cpp index 17e0016..7597f8c 100644 --- a/core/src/dto/playrequest.cpp +++ b/core/src/dto/playrequest.cpp @@ -76,7 +76,7 @@ void PlayRequest::setFromJson(QJsonObject source) { } -QJsonObject PlayRequest::toJson() { +QJsonObject PlayRequest::toJson() const { QJsonObject result; result["ItemIds"] = Jellyfin::Support::toJsonValue(m_itemIds); result["StartPositionTicks"] = Jellyfin::Support::toJsonValue>(m_startPositionTicks); @@ -188,10 +188,15 @@ namespace Support { using PlayRequest = Jellyfin::DTO::PlayRequest; template <> -PlayRequest fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlayRequest fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlayRequest::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlayRequest &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playrequestdto.cpp b/core/src/dto/playrequestdto.cpp index 5f07685..a72020f 100644 --- a/core/src/dto/playrequestdto.cpp +++ b/core/src/dto/playrequestdto.cpp @@ -61,7 +61,7 @@ void PlayRequestDto::setFromJson(QJsonObject source) { } -QJsonObject PlayRequestDto::toJson() { +QJsonObject PlayRequestDto::toJson() const { QJsonObject result; result["PlayingQueue"] = Jellyfin::Support::toJsonValue(m_playingQueue); result["PlayingItemPosition"] = Jellyfin::Support::toJsonValue(m_playingItemPosition); @@ -103,10 +103,15 @@ namespace Support { using PlayRequestDto = Jellyfin::DTO::PlayRequestDto; template <> -PlayRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlayRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlayRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlayRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playstatecommand.cpp b/core/src/dto/playstatecommand.cpp index aaf64eb..eaf32db 100644 --- a/core/src/dto/playstatecommand.cpp +++ b/core/src/dto/playstatecommand.cpp @@ -34,7 +34,6 @@ namespace DTO { PlaystateCommandClass::PlaystateCommandClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PlaystateCommand = Jellyfin::DTO::PlaystateCommand; template <> -PlaystateCommand fromJsonValue(const QJsonValue &source) { +PlaystateCommand fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PlaystateCommand::EnumNotSet; QString str = source.toString(); @@ -77,5 +76,33 @@ PlaystateCommand fromJsonValue(const QJsonValue &source) { return PlaystateCommand::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PlaystateCommand &source, convertType) { + switch(source) { + case PlaystateCommand::Stop: + return QStringLiteral("Stop"); + case PlaystateCommand::Pause: + return QStringLiteral("Pause"); + case PlaystateCommand::Unpause: + return QStringLiteral("Unpause"); + case PlaystateCommand::NextTrack: + return QStringLiteral("NextTrack"); + case PlaystateCommand::PreviousTrack: + return QStringLiteral("PreviousTrack"); + case PlaystateCommand::Seek: + return QStringLiteral("Seek"); + case PlaystateCommand::Rewind: + return QStringLiteral("Rewind"); + case PlaystateCommand::FastForward: + return QStringLiteral("FastForward"); + case PlaystateCommand::PlayPause: + return QStringLiteral("PlayPause"); + + case PlaystateCommand::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/playstaterequest.cpp b/core/src/dto/playstaterequest.cpp index 3554607..30c2e0b 100644 --- a/core/src/dto/playstaterequest.cpp +++ b/core/src/dto/playstaterequest.cpp @@ -61,7 +61,7 @@ void PlaystateRequest::setFromJson(QJsonObject source) { } -QJsonObject PlaystateRequest::toJson() { +QJsonObject PlaystateRequest::toJson() const { QJsonObject result; result["Command"] = Jellyfin::Support::toJsonValue(m_command); result["SeekPositionTicks"] = Jellyfin::Support::toJsonValue>(m_seekPositionTicks); @@ -110,10 +110,15 @@ namespace Support { using PlaystateRequest = Jellyfin::DTO::PlaystateRequest; template <> -PlaystateRequest fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PlaystateRequest fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaystateRequest::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PlaystateRequest &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/plugininfo.cpp b/core/src/dto/plugininfo.cpp index f31e88a..11290a5 100644 --- a/core/src/dto/plugininfo.cpp +++ b/core/src/dto/plugininfo.cpp @@ -76,7 +76,7 @@ void PluginInfo::setFromJson(QJsonObject source) { } -QJsonObject PluginInfo::toJson() { +QJsonObject PluginInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Version"] = Jellyfin::Support::toJsonValue>(m_version); @@ -167,10 +167,15 @@ namespace Support { using PluginInfo = Jellyfin::DTO::PluginInfo; template <> -PluginInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PluginInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PluginInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PluginInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/pluginsecurityinfo.cpp b/core/src/dto/pluginsecurityinfo.cpp index 8d209e2..988ab1f 100644 --- a/core/src/dto/pluginsecurityinfo.cpp +++ b/core/src/dto/pluginsecurityinfo.cpp @@ -58,7 +58,7 @@ void PluginSecurityInfo::setFromJson(QJsonObject source) { } -QJsonObject PluginSecurityInfo::toJson() { +QJsonObject PluginSecurityInfo::toJson() const { QJsonObject result; result["SupporterKey"] = Jellyfin::Support::toJsonValue(m_supporterKey); result["IsMbSupporter"] = Jellyfin::Support::toJsonValue(m_isMbSupporter); @@ -93,10 +93,15 @@ namespace Support { using PluginSecurityInfo = Jellyfin::DTO::PluginSecurityInfo; template <> -PluginSecurityInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PluginSecurityInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PluginSecurityInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PluginSecurityInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/pluginstatus.cpp b/core/src/dto/pluginstatus.cpp index ae303f4..3d2ac81 100644 --- a/core/src/dto/pluginstatus.cpp +++ b/core/src/dto/pluginstatus.cpp @@ -34,7 +34,6 @@ namespace DTO { PluginStatusClass::PluginStatusClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using PluginStatus = Jellyfin::DTO::PluginStatus; template <> -PluginStatus fromJsonValue(const QJsonValue &source) { +PluginStatus fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return PluginStatus::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ PluginStatus fromJsonValue(const QJsonValue &source) { return PluginStatus::EnumNotSet; } +template <> +QJsonValue toJsonValue(const PluginStatus &source, convertType) { + switch(source) { + case PluginStatus::Active: + return QStringLiteral("Active"); + case PluginStatus::Restart: + return QStringLiteral("Restart"); + case PluginStatus::Deleted: + return QStringLiteral("Deleted"); + case PluginStatus::Superceded: + return QStringLiteral("Superceded"); + case PluginStatus::Malfunctioned: + return QStringLiteral("Malfunctioned"); + case PluginStatus::NotSupported: + return QStringLiteral("NotSupported"); + case PluginStatus::Disabled: + return QStringLiteral("Disabled"); + + case PluginStatus::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/previousitemrequestdto.cpp b/core/src/dto/previousitemrequestdto.cpp index 027802d..52846c9 100644 --- a/core/src/dto/previousitemrequestdto.cpp +++ b/core/src/dto/previousitemrequestdto.cpp @@ -55,7 +55,7 @@ void PreviousItemRequestDto::setFromJson(QJsonObject source) { } -QJsonObject PreviousItemRequestDto::toJson() { +QJsonObject PreviousItemRequestDto::toJson() const { QJsonObject result; result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); @@ -76,10 +76,15 @@ namespace Support { using PreviousItemRequestDto = Jellyfin::DTO::PreviousItemRequestDto; template <> -PreviousItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PreviousItemRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PreviousItemRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PreviousItemRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/problemdetails.cpp b/core/src/dto/problemdetails.cpp index ba209f3..44f6130 100644 --- a/core/src/dto/problemdetails.cpp +++ b/core/src/dto/problemdetails.cpp @@ -67,7 +67,7 @@ void ProblemDetails::setFromJson(QJsonObject source) { } -QJsonObject ProblemDetails::toJson() { +QJsonObject ProblemDetails::toJson() const { QJsonObject result; result["type"] = Jellyfin::Support::toJsonValue(m_type); result["title"] = Jellyfin::Support::toJsonValue(m_title); @@ -151,10 +151,15 @@ namespace Support { using ProblemDetails = Jellyfin::DTO::ProblemDetails; template <> -ProblemDetails fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ProblemDetails fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ProblemDetails::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ProblemDetails &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/profilecondition.cpp b/core/src/dto/profilecondition.cpp index 7e32e60..fd223fb 100644 --- a/core/src/dto/profilecondition.cpp +++ b/core/src/dto/profilecondition.cpp @@ -64,7 +64,7 @@ void ProfileCondition::setFromJson(QJsonObject source) { } -QJsonObject ProfileCondition::toJson() { +QJsonObject ProfileCondition::toJson() const { QJsonObject result; result["Condition"] = Jellyfin::Support::toJsonValue(m_condition); result["Property"] = Jellyfin::Support::toJsonValue(m_property); @@ -113,10 +113,15 @@ namespace Support { using ProfileCondition = Jellyfin::DTO::ProfileCondition; template <> -ProfileCondition fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ProfileCondition fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ProfileCondition::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ProfileCondition &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/profileconditiontype.cpp b/core/src/dto/profileconditiontype.cpp index 3a2f5da..573b46e 100644 --- a/core/src/dto/profileconditiontype.cpp +++ b/core/src/dto/profileconditiontype.cpp @@ -34,7 +34,6 @@ namespace DTO { ProfileConditionTypeClass::ProfileConditionTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ProfileConditionType = Jellyfin::DTO::ProfileConditionType; template <> -ProfileConditionType fromJsonValue(const QJsonValue &source) { +ProfileConditionType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ProfileConditionType::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ ProfileConditionType fromJsonValue(const QJsonValue &sourc return ProfileConditionType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ProfileConditionType &source, convertType) { + switch(source) { + case ProfileConditionType::Equals: + return QStringLiteral("Equals"); + case ProfileConditionType::NotEquals: + return QStringLiteral("NotEquals"); + case ProfileConditionType::LessThanEqual: + return QStringLiteral("LessThanEqual"); + case ProfileConditionType::GreaterThanEqual: + return QStringLiteral("GreaterThanEqual"); + case ProfileConditionType::EqualsAny: + return QStringLiteral("EqualsAny"); + + case ProfileConditionType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/profileconditionvalue.cpp b/core/src/dto/profileconditionvalue.cpp index d924606..d0366ec 100644 --- a/core/src/dto/profileconditionvalue.cpp +++ b/core/src/dto/profileconditionvalue.cpp @@ -34,7 +34,6 @@ namespace DTO { ProfileConditionValueClass::ProfileConditionValueClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ProfileConditionValue = Jellyfin::DTO::ProfileConditionValue; template <> -ProfileConditionValue fromJsonValue(const QJsonValue &source) { +ProfileConditionValue fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ProfileConditionValue::EnumNotSet; QString str = source.toString(); @@ -119,5 +118,61 @@ ProfileConditionValue fromJsonValue(const QJsonValue &sou return ProfileConditionValue::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ProfileConditionValue &source, convertType) { + switch(source) { + case ProfileConditionValue::AudioChannels: + return QStringLiteral("AudioChannels"); + case ProfileConditionValue::AudioBitrate: + return QStringLiteral("AudioBitrate"); + case ProfileConditionValue::AudioProfile: + return QStringLiteral("AudioProfile"); + case ProfileConditionValue::Width: + return QStringLiteral("Width"); + case ProfileConditionValue::Height: + return QStringLiteral("Height"); + case ProfileConditionValue::Has64BitOffsets: + return QStringLiteral("Has64BitOffsets"); + case ProfileConditionValue::PacketLength: + return QStringLiteral("PacketLength"); + case ProfileConditionValue::VideoBitDepth: + return QStringLiteral("VideoBitDepth"); + case ProfileConditionValue::VideoBitrate: + return QStringLiteral("VideoBitrate"); + case ProfileConditionValue::VideoFramerate: + return QStringLiteral("VideoFramerate"); + case ProfileConditionValue::VideoLevel: + return QStringLiteral("VideoLevel"); + case ProfileConditionValue::VideoProfile: + return QStringLiteral("VideoProfile"); + case ProfileConditionValue::VideoTimestamp: + return QStringLiteral("VideoTimestamp"); + case ProfileConditionValue::IsAnamorphic: + return QStringLiteral("IsAnamorphic"); + case ProfileConditionValue::RefFrames: + return QStringLiteral("RefFrames"); + case ProfileConditionValue::NumAudioStreams: + return QStringLiteral("NumAudioStreams"); + case ProfileConditionValue::NumVideoStreams: + return QStringLiteral("NumVideoStreams"); + case ProfileConditionValue::IsSecondaryAudio: + return QStringLiteral("IsSecondaryAudio"); + case ProfileConditionValue::VideoCodecTag: + return QStringLiteral("VideoCodecTag"); + case ProfileConditionValue::IsAvc: + return QStringLiteral("IsAvc"); + case ProfileConditionValue::IsInterlaced: + return QStringLiteral("IsInterlaced"); + case ProfileConditionValue::AudioSampleRate: + return QStringLiteral("AudioSampleRate"); + case ProfileConditionValue::AudioBitDepth: + return QStringLiteral("AudioBitDepth"); + + case ProfileConditionValue::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/programaudio.cpp b/core/src/dto/programaudio.cpp index 3f5ffac..6335e4b 100644 --- a/core/src/dto/programaudio.cpp +++ b/core/src/dto/programaudio.cpp @@ -34,7 +34,6 @@ namespace DTO { ProgramAudioClass::ProgramAudioClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ProgramAudio = Jellyfin::DTO::ProgramAudio; template <> -ProgramAudio fromJsonValue(const QJsonValue &source) { +ProgramAudio fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ProgramAudio::EnumNotSet; QString str = source.toString(); @@ -68,5 +67,27 @@ ProgramAudio fromJsonValue(const QJsonValue &source) { return ProgramAudio::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ProgramAudio &source, convertType) { + switch(source) { + case ProgramAudio::Mono: + return QStringLiteral("Mono"); + case ProgramAudio::Stereo: + return QStringLiteral("Stereo"); + case ProgramAudio::Dolby: + return QStringLiteral("Dolby"); + case ProgramAudio::DolbyDigital: + return QStringLiteral("DolbyDigital"); + case ProgramAudio::Thx: + return QStringLiteral("Thx"); + case ProgramAudio::Atmos: + return QStringLiteral("Atmos"); + + case ProgramAudio::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/publicsysteminfo.cpp b/core/src/dto/publicsysteminfo.cpp index d4686fa..45abf75 100644 --- a/core/src/dto/publicsysteminfo.cpp +++ b/core/src/dto/publicsysteminfo.cpp @@ -73,7 +73,7 @@ void PublicSystemInfo::setFromJson(QJsonObject source) { } -QJsonObject PublicSystemInfo::toJson() { +QJsonObject PublicSystemInfo::toJson() const { QJsonObject result; result["LocalAddress"] = Jellyfin::Support::toJsonValue(m_localAddress); result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); @@ -185,10 +185,15 @@ namespace Support { using PublicSystemInfo = Jellyfin::DTO::PublicSystemInfo; template <> -PublicSystemInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +PublicSystemInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return PublicSystemInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const PublicSystemInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/queryfilters.cpp b/core/src/dto/queryfilters.cpp index 1739903..3b6ef6e 100644 --- a/core/src/dto/queryfilters.cpp +++ b/core/src/dto/queryfilters.cpp @@ -58,7 +58,7 @@ void QueryFilters::setFromJson(QJsonObject source) { } -QJsonObject QueryFilters::toJson() { +QJsonObject QueryFilters::toJson() const { QJsonObject result; result["Genres"] = Jellyfin::Support::toJsonValue>(m_genres); result["Tags"] = Jellyfin::Support::toJsonValue(m_tags); @@ -100,10 +100,15 @@ namespace Support { using QueryFilters = Jellyfin::DTO::QueryFilters; template <> -QueryFilters fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QueryFilters fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QueryFilters::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QueryFilters &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/queryfilterslegacy.cpp b/core/src/dto/queryfilterslegacy.cpp index 6f78f4c..e94fe8a 100644 --- a/core/src/dto/queryfilterslegacy.cpp +++ b/core/src/dto/queryfilterslegacy.cpp @@ -64,7 +64,7 @@ void QueryFiltersLegacy::setFromJson(QJsonObject source) { } -QJsonObject QueryFiltersLegacy::toJson() { +QJsonObject QueryFiltersLegacy::toJson() const { QJsonObject result; result["Genres"] = Jellyfin::Support::toJsonValue(m_genres); result["Tags"] = Jellyfin::Support::toJsonValue(m_tags); @@ -134,10 +134,15 @@ namespace Support { using QueryFiltersLegacy = Jellyfin::DTO::QueryFiltersLegacy; template <> -QueryFiltersLegacy fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QueryFiltersLegacy fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QueryFiltersLegacy::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QueryFiltersLegacy &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/queueitem.cpp b/core/src/dto/queueitem.cpp index fd4fd0a..6894d4f 100644 --- a/core/src/dto/queueitem.cpp +++ b/core/src/dto/queueitem.cpp @@ -58,7 +58,7 @@ void QueueItem::setFromJson(QJsonObject source) { } -QJsonObject QueueItem::toJson() { +QJsonObject QueueItem::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); @@ -93,10 +93,15 @@ namespace Support { using QueueItem = Jellyfin::DTO::QueueItem; template <> -QueueItem fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QueueItem fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QueueItem::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QueueItem &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/queuerequestdto.cpp b/core/src/dto/queuerequestdto.cpp index 8992ee6..33d25a2 100644 --- a/core/src/dto/queuerequestdto.cpp +++ b/core/src/dto/queuerequestdto.cpp @@ -58,7 +58,7 @@ void QueueRequestDto::setFromJson(QJsonObject source) { } -QJsonObject QueueRequestDto::toJson() { +QJsonObject QueueRequestDto::toJson() const { QJsonObject result; result["ItemIds"] = Jellyfin::Support::toJsonValue(m_itemIds); result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); @@ -93,10 +93,15 @@ namespace Support { using QueueRequestDto = Jellyfin::DTO::QueueRequestDto; template <> -QueueRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QueueRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QueueRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QueueRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/quickconnectdto.cpp b/core/src/dto/quickconnectdto.cpp index ddedfaa..f3736a1 100644 --- a/core/src/dto/quickconnectdto.cpp +++ b/core/src/dto/quickconnectdto.cpp @@ -55,7 +55,7 @@ void QuickConnectDto::setFromJson(QJsonObject source) { } -QJsonObject QuickConnectDto::toJson() { +QJsonObject QuickConnectDto::toJson() const { QJsonObject result; result["Token"] = Jellyfin::Support::toJsonValue(m_token); @@ -76,10 +76,15 @@ namespace Support { using QuickConnectDto = Jellyfin::DTO::QuickConnectDto; template <> -QuickConnectDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QuickConnectDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QuickConnectDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QuickConnectDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/quickconnectresult.cpp b/core/src/dto/quickconnectresult.cpp index dd9cdfc..056ec1c 100644 --- a/core/src/dto/quickconnectresult.cpp +++ b/core/src/dto/quickconnectresult.cpp @@ -70,7 +70,7 @@ void QuickConnectResult::setFromJson(QJsonObject source) { } -QJsonObject QuickConnectResult::toJson() { +QJsonObject QuickConnectResult::toJson() const { QJsonObject result; result["Authenticated"] = Jellyfin::Support::toJsonValue(m_authenticated); result["Secret"] = Jellyfin::Support::toJsonValue(m_secret); @@ -161,10 +161,15 @@ namespace Support { using QuickConnectResult = Jellyfin::DTO::QuickConnectResult; template <> -QuickConnectResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +QuickConnectResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return QuickConnectResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const QuickConnectResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/quickconnectstate.cpp b/core/src/dto/quickconnectstate.cpp index 82d82fd..119a0d7 100644 --- a/core/src/dto/quickconnectstate.cpp +++ b/core/src/dto/quickconnectstate.cpp @@ -34,7 +34,6 @@ namespace DTO { QuickConnectStateClass::QuickConnectStateClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using QuickConnectState = Jellyfin::DTO::QuickConnectState; template <> -QuickConnectState fromJsonValue(const QJsonValue &source) { +QuickConnectState fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return QuickConnectState::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ QuickConnectState fromJsonValue(const QJsonValue &source) { return QuickConnectState::EnumNotSet; } +template <> +QJsonValue toJsonValue(const QuickConnectState &source, convertType) { + switch(source) { + case QuickConnectState::Unavailable: + return QStringLiteral("Unavailable"); + case QuickConnectState::Available: + return QStringLiteral("Available"); + case QuickConnectState::Active: + return QStringLiteral("Active"); + + case QuickConnectState::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/ratingtype.cpp b/core/src/dto/ratingtype.cpp index 8140a73..f8f0fe2 100644 --- a/core/src/dto/ratingtype.cpp +++ b/core/src/dto/ratingtype.cpp @@ -34,7 +34,6 @@ namespace DTO { RatingTypeClass::RatingTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using RatingType = Jellyfin::DTO::RatingType; template <> -RatingType fromJsonValue(const QJsonValue &source) { +RatingType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return RatingType::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ RatingType fromJsonValue(const QJsonValue &source) { return RatingType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const RatingType &source, convertType) { + switch(source) { + case RatingType::Score: + return QStringLiteral("Score"); + case RatingType::Likes: + return QStringLiteral("Likes"); + + case RatingType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/readyrequestdto.cpp b/core/src/dto/readyrequestdto.cpp index 5bffcd9..fc608eb 100644 --- a/core/src/dto/readyrequestdto.cpp +++ b/core/src/dto/readyrequestdto.cpp @@ -64,7 +64,7 @@ void ReadyRequestDto::setFromJson(QJsonObject source) { } -QJsonObject ReadyRequestDto::toJson() { +QJsonObject ReadyRequestDto::toJson() const { QJsonObject result; result["When"] = Jellyfin::Support::toJsonValue(m_when); result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); @@ -106,10 +106,15 @@ namespace Support { using ReadyRequestDto = Jellyfin::DTO::ReadyRequestDto; template <> -ReadyRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ReadyRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ReadyRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ReadyRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/recommendationdto.cpp b/core/src/dto/recommendationdto.cpp index 6ff5c2f..5c2ef24 100644 --- a/core/src/dto/recommendationdto.cpp +++ b/core/src/dto/recommendationdto.cpp @@ -64,7 +64,7 @@ void RecommendationDto::setFromJson(QJsonObject source) { } -QJsonObject RecommendationDto::toJson() { +QJsonObject RecommendationDto::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["RecommendationType"] = Jellyfin::Support::toJsonValue(m_recommendationType); @@ -120,10 +120,15 @@ namespace Support { using RecommendationDto = Jellyfin::DTO::RecommendationDto; template <> -RecommendationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RecommendationDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RecommendationDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RecommendationDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/recommendationtype.cpp b/core/src/dto/recommendationtype.cpp index e2dc962..e25b7d5 100644 --- a/core/src/dto/recommendationtype.cpp +++ b/core/src/dto/recommendationtype.cpp @@ -34,7 +34,6 @@ namespace DTO { RecommendationTypeClass::RecommendationTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using RecommendationType = Jellyfin::DTO::RecommendationType; template <> -RecommendationType fromJsonValue(const QJsonValue &source) { +RecommendationType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return RecommendationType::EnumNotSet; QString str = source.toString(); @@ -68,5 +67,27 @@ RecommendationType fromJsonValue(const QJsonValue &source) { return RecommendationType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const RecommendationType &source, convertType) { + switch(source) { + case RecommendationType::SimilarToRecentlyPlayed: + return QStringLiteral("SimilarToRecentlyPlayed"); + case RecommendationType::SimilarToLikedItem: + return QStringLiteral("SimilarToLikedItem"); + case RecommendationType::HasDirectorFromRecentlyPlayed: + return QStringLiteral("HasDirectorFromRecentlyPlayed"); + case RecommendationType::HasActorFromRecentlyPlayed: + return QStringLiteral("HasActorFromRecentlyPlayed"); + case RecommendationType::HasLikedDirector: + return QStringLiteral("HasLikedDirector"); + case RecommendationType::HasLikedActor: + return QStringLiteral("HasLikedActor"); + + case RecommendationType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/recordingstatus.cpp b/core/src/dto/recordingstatus.cpp index 2b114a0..4797d6e 100644 --- a/core/src/dto/recordingstatus.cpp +++ b/core/src/dto/recordingstatus.cpp @@ -34,7 +34,6 @@ namespace DTO { RecordingStatusClass::RecordingStatusClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using RecordingStatus = Jellyfin::DTO::RecordingStatus; template <> -RecordingStatus fromJsonValue(const QJsonValue &source) { +RecordingStatus fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return RecordingStatus::EnumNotSet; QString str = source.toString(); @@ -71,5 +70,29 @@ RecordingStatus fromJsonValue(const QJsonValue &source) { return RecordingStatus::EnumNotSet; } +template <> +QJsonValue toJsonValue(const RecordingStatus &source, convertType) { + switch(source) { + case RecordingStatus::New: + return QStringLiteral("New"); + case RecordingStatus::InProgress: + return QStringLiteral("InProgress"); + case RecordingStatus::Completed: + return QStringLiteral("Completed"); + case RecordingStatus::Cancelled: + return QStringLiteral("Cancelled"); + case RecordingStatus::ConflictedOk: + return QStringLiteral("ConflictedOk"); + case RecordingStatus::ConflictedNotOk: + return QStringLiteral("ConflictedNotOk"); + case RecordingStatus::Error: + return QStringLiteral("Error"); + + case RecordingStatus::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/remoteimageinfo.cpp b/core/src/dto/remoteimageinfo.cpp index 9b43c77..5393a4b 100644 --- a/core/src/dto/remoteimageinfo.cpp +++ b/core/src/dto/remoteimageinfo.cpp @@ -82,7 +82,7 @@ void RemoteImageInfo::setFromJson(QJsonObject source) { } -QJsonObject RemoteImageInfo::toJson() { +QJsonObject RemoteImageInfo::toJson() const { QJsonObject result; result["ProviderName"] = Jellyfin::Support::toJsonValue(m_providerName); result["Url"] = Jellyfin::Support::toJsonValue(m_url); @@ -222,10 +222,15 @@ namespace Support { using RemoteImageInfo = Jellyfin::DTO::RemoteImageInfo; template <> -RemoteImageInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RemoteImageInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RemoteImageInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RemoteImageInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/remoteimageresult.cpp b/core/src/dto/remoteimageresult.cpp index 2fe5d5b..40fba2f 100644 --- a/core/src/dto/remoteimageresult.cpp +++ b/core/src/dto/remoteimageresult.cpp @@ -61,7 +61,7 @@ void RemoteImageResult::setFromJson(QJsonObject source) { } -QJsonObject RemoteImageResult::toJson() { +QJsonObject RemoteImageResult::toJson() const { QJsonObject result; result["Images"] = Jellyfin::Support::toJsonValue>(m_images); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -110,10 +110,15 @@ namespace Support { using RemoteImageResult = Jellyfin::DTO::RemoteImageResult; template <> -RemoteImageResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RemoteImageResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RemoteImageResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RemoteImageResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/remotesearchresult.cpp b/core/src/dto/remotesearchresult.cpp index a5b6059..76e1a48 100644 --- a/core/src/dto/remotesearchresult.cpp +++ b/core/src/dto/remotesearchresult.cpp @@ -74,7 +74,7 @@ RemoteSearchResult RemoteSearchResult::fromJson(QJsonObject source) { void RemoteSearchResult::setFromJson(QJsonObject source) { m_name = Jellyfin::Support::fromJsonValue(source["Name"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_productionYear = Jellyfin::Support::fromJsonValue>(source["ProductionYear"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_indexNumberEnd = Jellyfin::Support::fromJsonValue>(source["IndexNumberEnd"]); @@ -88,10 +88,10 @@ void RemoteSearchResult::setFromJson(QJsonObject source) { } -QJsonObject RemoteSearchResult::toJson() { +QJsonObject RemoteSearchResult::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["ProductionYear"] = Jellyfin::Support::toJsonValue>(m_productionYear); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue>(m_indexNumberEnd); @@ -119,17 +119,17 @@ void RemoteSearchResult::setNameNull() { m_name.clear(); } -std::optional RemoteSearchResult::providerIds() const { return m_providerIds; } +QJsonObject RemoteSearchResult::providerIds() const { return m_providerIds; } -void RemoteSearchResult::setProviderIds(std::optional newProviderIds) { +void RemoteSearchResult::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool RemoteSearchResult::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void RemoteSearchResult::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional RemoteSearchResult::productionYear() const { return m_productionYear; } @@ -263,10 +263,15 @@ namespace Support { using RemoteSearchResult = Jellyfin::DTO::RemoteSearchResult; template <> -RemoteSearchResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RemoteSearchResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RemoteSearchResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RemoteSearchResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/remotesubtitleinfo.cpp b/core/src/dto/remotesubtitleinfo.cpp index e2a7632..721a7ce 100644 --- a/core/src/dto/remotesubtitleinfo.cpp +++ b/core/src/dto/remotesubtitleinfo.cpp @@ -85,7 +85,7 @@ void RemoteSubtitleInfo::setFromJson(QJsonObject source) { } -QJsonObject RemoteSubtitleInfo::toJson() { +QJsonObject RemoteSubtitleInfo::toJson() const { QJsonObject result; result["ThreeLetterISOLanguageName"] = Jellyfin::Support::toJsonValue(m_threeLetterISOLanguageName); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -253,10 +253,15 @@ namespace Support { using RemoteSubtitleInfo = Jellyfin::DTO::RemoteSubtitleInfo; template <> -RemoteSubtitleInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RemoteSubtitleInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RemoteSubtitleInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RemoteSubtitleInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/removefromplaylistrequestdto.cpp b/core/src/dto/removefromplaylistrequestdto.cpp index 5c292bb..20219b2 100644 --- a/core/src/dto/removefromplaylistrequestdto.cpp +++ b/core/src/dto/removefromplaylistrequestdto.cpp @@ -55,7 +55,7 @@ void RemoveFromPlaylistRequestDto::setFromJson(QJsonObject source) { } -QJsonObject RemoveFromPlaylistRequestDto::toJson() { +QJsonObject RemoveFromPlaylistRequestDto::toJson() const { QJsonObject result; result["PlaylistItemIds"] = Jellyfin::Support::toJsonValue(m_playlistItemIds); @@ -83,10 +83,15 @@ namespace Support { using RemoveFromPlaylistRequestDto = Jellyfin::DTO::RemoveFromPlaylistRequestDto; template <> -RemoveFromPlaylistRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RemoveFromPlaylistRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RemoveFromPlaylistRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RemoveFromPlaylistRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/repeatmode.cpp b/core/src/dto/repeatmode.cpp index b8e7f99..d6430bd 100644 --- a/core/src/dto/repeatmode.cpp +++ b/core/src/dto/repeatmode.cpp @@ -34,7 +34,6 @@ namespace DTO { RepeatModeClass::RepeatModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using RepeatMode = Jellyfin::DTO::RepeatMode; template <> -RepeatMode fromJsonValue(const QJsonValue &source) { +RepeatMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return RepeatMode::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ RepeatMode fromJsonValue(const QJsonValue &source) { return RepeatMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const RepeatMode &source, convertType) { + switch(source) { + case RepeatMode::RepeatNone: + return QStringLiteral("RepeatNone"); + case RepeatMode::RepeatAll: + return QStringLiteral("RepeatAll"); + case RepeatMode::RepeatOne: + return QStringLiteral("RepeatOne"); + + case RepeatMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/repositoryinfo.cpp b/core/src/dto/repositoryinfo.cpp index 65332fa..3fd54b8 100644 --- a/core/src/dto/repositoryinfo.cpp +++ b/core/src/dto/repositoryinfo.cpp @@ -61,7 +61,7 @@ void RepositoryInfo::setFromJson(QJsonObject source) { } -QJsonObject RepositoryInfo::toJson() { +QJsonObject RepositoryInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Url"] = Jellyfin::Support::toJsonValue(m_url); @@ -110,10 +110,15 @@ namespace Support { using RepositoryInfo = Jellyfin::DTO::RepositoryInfo; template <> -RepositoryInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +RepositoryInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return RepositoryInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const RepositoryInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/responseprofile.cpp b/core/src/dto/responseprofile.cpp index 339b12b..9327d0e 100644 --- a/core/src/dto/responseprofile.cpp +++ b/core/src/dto/responseprofile.cpp @@ -73,7 +73,7 @@ void ResponseProfile::setFromJson(QJsonObject source) { } -QJsonObject ResponseProfile::toJson() { +QJsonObject ResponseProfile::toJson() const { QJsonObject result; result["Container"] = Jellyfin::Support::toJsonValue(m_container); result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); @@ -178,10 +178,15 @@ namespace Support { using ResponseProfile = Jellyfin::DTO::ResponseProfile; template <> -ResponseProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ResponseProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ResponseProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ResponseProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/scrolldirection.cpp b/core/src/dto/scrolldirection.cpp index 68d242b..c933347 100644 --- a/core/src/dto/scrolldirection.cpp +++ b/core/src/dto/scrolldirection.cpp @@ -34,7 +34,6 @@ namespace DTO { ScrollDirectionClass::ScrollDirectionClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using ScrollDirection = Jellyfin::DTO::ScrollDirection; template <> -ScrollDirection fromJsonValue(const QJsonValue &source) { +ScrollDirection fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return ScrollDirection::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ ScrollDirection fromJsonValue(const QJsonValue &source) { return ScrollDirection::EnumNotSet; } +template <> +QJsonValue toJsonValue(const ScrollDirection &source, convertType) { + switch(source) { + case ScrollDirection::Horizontal: + return QStringLiteral("Horizontal"); + case ScrollDirection::Vertical: + return QStringLiteral("Vertical"); + + case ScrollDirection::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/searchhint.cpp b/core/src/dto/searchhint.cpp index c66a335..1dfc088 100644 --- a/core/src/dto/searchhint.cpp +++ b/core/src/dto/searchhint.cpp @@ -139,7 +139,7 @@ void SearchHint::setFromJson(QJsonObject source) { } -QJsonObject SearchHint::toJson() { +QJsonObject SearchHint::toJson() const { QJsonObject result; result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -531,10 +531,15 @@ namespace Support { using SearchHint = Jellyfin::DTO::SearchHint; template <> -SearchHint fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SearchHint fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SearchHint::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SearchHint &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/searchhintresult.cpp b/core/src/dto/searchhintresult.cpp index 13b8de3..9e00a46 100644 --- a/core/src/dto/searchhintresult.cpp +++ b/core/src/dto/searchhintresult.cpp @@ -58,7 +58,7 @@ void SearchHintResult::setFromJson(QJsonObject source) { } -QJsonObject SearchHintResult::toJson() { +QJsonObject SearchHintResult::toJson() const { QJsonObject result; result["SearchHints"] = Jellyfin::Support::toJsonValue>(m_searchHints); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -93,10 +93,15 @@ namespace Support { using SearchHintResult = Jellyfin::DTO::SearchHintResult; template <> -SearchHintResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SearchHintResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SearchHintResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SearchHintResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seekrequestdto.cpp b/core/src/dto/seekrequestdto.cpp index 1febd97..57edc8a 100644 --- a/core/src/dto/seekrequestdto.cpp +++ b/core/src/dto/seekrequestdto.cpp @@ -55,7 +55,7 @@ void SeekRequestDto::setFromJson(QJsonObject source) { } -QJsonObject SeekRequestDto::toJson() { +QJsonObject SeekRequestDto::toJson() const { QJsonObject result; result["PositionTicks"] = Jellyfin::Support::toJsonValue(m_positionTicks); @@ -76,10 +76,15 @@ namespace Support { using SeekRequestDto = Jellyfin::DTO::SeekRequestDto; template <> -SeekRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SeekRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SeekRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SeekRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/sendcommand.cpp b/core/src/dto/sendcommand.cpp index 380a530..230e82e 100644 --- a/core/src/dto/sendcommand.cpp +++ b/core/src/dto/sendcommand.cpp @@ -70,7 +70,7 @@ void SendCommand::setFromJson(QJsonObject source) { } -QJsonObject SendCommand::toJson() { +QJsonObject SendCommand::toJson() const { QJsonObject result; result["GroupId"] = Jellyfin::Support::toJsonValue(m_groupId); result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); @@ -133,10 +133,15 @@ namespace Support { using SendCommand = Jellyfin::DTO::SendCommand; template <> -SendCommand fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SendCommand fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SendCommand::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SendCommand &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/sendcommandtype.cpp b/core/src/dto/sendcommandtype.cpp index 5e8f8a9..48f4706 100644 --- a/core/src/dto/sendcommandtype.cpp +++ b/core/src/dto/sendcommandtype.cpp @@ -34,7 +34,6 @@ namespace DTO { SendCommandTypeClass::SendCommandTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SendCommandType = Jellyfin::DTO::SendCommandType; template <> -SendCommandType fromJsonValue(const QJsonValue &source) { +SendCommandType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SendCommandType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ SendCommandType fromJsonValue(const QJsonValue &source) { return SendCommandType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SendCommandType &source, convertType) { + switch(source) { + case SendCommandType::Unpause: + return QStringLiteral("Unpause"); + case SendCommandType::Pause: + return QStringLiteral("Pause"); + case SendCommandType::Stop: + return QStringLiteral("Stop"); + case SendCommandType::Seek: + return QStringLiteral("Seek"); + + case SendCommandType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seriesinfo.cpp b/core/src/dto/seriesinfo.cpp index 2384204..fff0594 100644 --- a/core/src/dto/seriesinfo.cpp +++ b/core/src/dto/seriesinfo.cpp @@ -73,7 +73,7 @@ void SeriesInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -82,13 +82,13 @@ void SeriesInfo::setFromJson(QJsonObject source) { } -QJsonObject SeriesInfo::toJson() { +QJsonObject SeriesInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -150,17 +150,17 @@ void SeriesInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional SeriesInfo::providerIds() const { return m_providerIds; } +QJsonObject SeriesInfo::providerIds() const { return m_providerIds; } -void SeriesInfo::setProviderIds(std::optional newProviderIds) { +void SeriesInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool SeriesInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void SeriesInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional SeriesInfo::year() const { return m_year; } @@ -229,10 +229,15 @@ namespace Support { using SeriesInfo = Jellyfin::DTO::SeriesInfo; template <> -SeriesInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SeriesInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SeriesInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SeriesInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seriesinforemotesearchquery.cpp b/core/src/dto/seriesinforemotesearchquery.cpp index 8a71b24..b05c66e 100644 --- a/core/src/dto/seriesinforemotesearchquery.cpp +++ b/core/src/dto/seriesinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void SeriesInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject SeriesInfoRemoteSearchQuery::toJson() { +QJsonObject SeriesInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using SeriesInfoRemoteSearchQuery = Jellyfin::DTO::SeriesInfoRemoteSearchQuery; template <> -SeriesInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SeriesInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SeriesInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SeriesInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seriesstatus.cpp b/core/src/dto/seriesstatus.cpp index 9823902..69e7e9a 100644 --- a/core/src/dto/seriesstatus.cpp +++ b/core/src/dto/seriesstatus.cpp @@ -34,7 +34,6 @@ namespace DTO { SeriesStatusClass::SeriesStatusClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SeriesStatus = Jellyfin::DTO::SeriesStatus; template <> -SeriesStatus fromJsonValue(const QJsonValue &source) { +SeriesStatus fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SeriesStatus::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ SeriesStatus fromJsonValue(const QJsonValue &source) { return SeriesStatus::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SeriesStatus &source, convertType) { + switch(source) { + case SeriesStatus::Continuing: + return QStringLiteral("Continuing"); + case SeriesStatus::Ended: + return QStringLiteral("Ended"); + + case SeriesStatus::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seriestimerinfodto.cpp b/core/src/dto/seriestimerinfodto.cpp index 5d50d99..04da1d7 100644 --- a/core/src/dto/seriestimerinfodto.cpp +++ b/core/src/dto/seriestimerinfodto.cpp @@ -149,7 +149,7 @@ void SeriesTimerInfoDto::setFromJson(QJsonObject source) { m_recordNewOnly = Jellyfin::Support::fromJsonValue(source["RecordNewOnly"]); m_days = Jellyfin::Support::fromJsonValue>(source["Days"]); m_dayPattern = Jellyfin::Support::fromJsonValue(source["DayPattern"]); - m_imageTags = Jellyfin::Support::fromJsonValue>(source["ImageTags"]); + m_imageTags = Jellyfin::Support::fromJsonValue(source["ImageTags"]); m_parentThumbItemId = Jellyfin::Support::fromJsonValue(source["ParentThumbItemId"]); m_parentThumbImageTag = Jellyfin::Support::fromJsonValue(source["ParentThumbImageTag"]); m_parentPrimaryImageItemId = Jellyfin::Support::fromJsonValue(source["ParentPrimaryImageItemId"]); @@ -157,7 +157,7 @@ void SeriesTimerInfoDto::setFromJson(QJsonObject source) { } -QJsonObject SeriesTimerInfoDto::toJson() { +QJsonObject SeriesTimerInfoDto::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Type"] = Jellyfin::Support::toJsonValue(m_type); @@ -189,7 +189,7 @@ QJsonObject SeriesTimerInfoDto::toJson() { result["RecordNewOnly"] = Jellyfin::Support::toJsonValue(m_recordNewOnly); result["Days"] = Jellyfin::Support::toJsonValue>(m_days); result["DayPattern"] = Jellyfin::Support::toJsonValue(m_dayPattern); - result["ImageTags"] = Jellyfin::Support::toJsonValue>(m_imageTags); + result["ImageTags"] = Jellyfin::Support::toJsonValue(m_imageTags); result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue(m_parentThumbItemId); result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue(m_parentThumbImageTag); result["ParentPrimaryImageItemId"] = Jellyfin::Support::toJsonValue(m_parentPrimaryImageItemId); @@ -483,17 +483,17 @@ void SeriesTimerInfoDto::setDayPattern(DayPattern newDayPattern) { m_dayPattern = newDayPattern; } -std::optional SeriesTimerInfoDto::imageTags() const { return m_imageTags; } +QJsonObject SeriesTimerInfoDto::imageTags() const { return m_imageTags; } -void SeriesTimerInfoDto::setImageTags(std::optional newImageTags) { +void SeriesTimerInfoDto::setImageTags(QJsonObject newImageTags) { m_imageTags = newImageTags; } bool SeriesTimerInfoDto::imageTagsNull() const { - return !m_imageTags.has_value(); + return m_imageTags.isEmpty(); } void SeriesTimerInfoDto::setImageTagsNull() { - m_imageTags = std::nullopt; + m_imageTags= QJsonObject(); } QString SeriesTimerInfoDto::parentThumbItemId() const { return m_parentThumbItemId; } @@ -556,10 +556,15 @@ namespace Support { using SeriesTimerInfoDto = Jellyfin::DTO::SeriesTimerInfoDto; template <> -SeriesTimerInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SeriesTimerInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SeriesTimerInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SeriesTimerInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/seriestimerinfodtoqueryresult.cpp b/core/src/dto/seriestimerinfodtoqueryresult.cpp index 7d78453..8ed7193 100644 --- a/core/src/dto/seriestimerinfodtoqueryresult.cpp +++ b/core/src/dto/seriestimerinfodtoqueryresult.cpp @@ -61,7 +61,7 @@ void SeriesTimerInfoDtoQueryResult::setFromJson(QJsonObject source) { } -QJsonObject SeriesTimerInfoDtoQueryResult::toJson() { +QJsonObject SeriesTimerInfoDtoQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using SeriesTimerInfoDtoQueryResult = Jellyfin::DTO::SeriesTimerInfoDtoQueryResult; template <> -SeriesTimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SeriesTimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SeriesTimerInfoDtoQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SeriesTimerInfoDtoQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/serverconfiguration.cpp b/core/src/dto/serverconfiguration.cpp index 6a25443..4a6b5bc 100644 --- a/core/src/dto/serverconfiguration.cpp +++ b/core/src/dto/serverconfiguration.cpp @@ -307,7 +307,7 @@ void ServerConfiguration::setFromJson(QJsonObject source) { } -QJsonObject ServerConfiguration::toJson() { +QJsonObject ServerConfiguration::toJson() const { QJsonObject result; result["LogFileRetentionDays"] = Jellyfin::Support::toJsonValue(m_logFileRetentionDays); result["IsStartupWizardCompleted"] = Jellyfin::Support::toJsonValue(m_isStartupWizardCompleted); @@ -1133,10 +1133,15 @@ namespace Support { using ServerConfiguration = Jellyfin::DTO::ServerConfiguration; template <> -ServerConfiguration fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ServerConfiguration fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ServerConfiguration::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ServerConfiguration &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/sessioninfo.cpp b/core/src/dto/sessioninfo.cpp index 03bfc03..c3d2bf9 100644 --- a/core/src/dto/sessioninfo.cpp +++ b/core/src/dto/sessioninfo.cpp @@ -136,7 +136,7 @@ void SessionInfo::setFromJson(QJsonObject source) { } -QJsonObject SessionInfo::toJson() { +QJsonObject SessionInfo::toJson() const { QJsonObject result; result["PlayState"] = Jellyfin::Support::toJsonValue>(m_playState); result["AdditionalUsers"] = Jellyfin::Support::toJsonValue>(m_additionalUsers); @@ -451,10 +451,15 @@ namespace Support { using SessionInfo = Jellyfin::DTO::SessionInfo; template <> -SessionInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SessionInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SessionInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SessionInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/sessionuserinfo.cpp b/core/src/dto/sessionuserinfo.cpp index 4b5c772..12c98c5 100644 --- a/core/src/dto/sessionuserinfo.cpp +++ b/core/src/dto/sessionuserinfo.cpp @@ -58,7 +58,7 @@ void SessionUserInfo::setFromJson(QJsonObject source) { } -QJsonObject SessionUserInfo::toJson() { +QJsonObject SessionUserInfo::toJson() const { QJsonObject result; result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); result["UserName"] = Jellyfin::Support::toJsonValue(m_userName); @@ -93,10 +93,15 @@ namespace Support { using SessionUserInfo = Jellyfin::DTO::SessionUserInfo; template <> -SessionUserInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SessionUserInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SessionUserInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SessionUserInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/setchannelmappingdto.cpp b/core/src/dto/setchannelmappingdto.cpp index b179801..5ca369c 100644 --- a/core/src/dto/setchannelmappingdto.cpp +++ b/core/src/dto/setchannelmappingdto.cpp @@ -61,7 +61,7 @@ void SetChannelMappingDto::setFromJson(QJsonObject source) { } -QJsonObject SetChannelMappingDto::toJson() { +QJsonObject SetChannelMappingDto::toJson() const { QJsonObject result; result["ProviderId"] = Jellyfin::Support::toJsonValue(m_providerId); result["TunerChannelId"] = Jellyfin::Support::toJsonValue(m_tunerChannelId); @@ -96,10 +96,15 @@ namespace Support { using SetChannelMappingDto = Jellyfin::DTO::SetChannelMappingDto; template <> -SetChannelMappingDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SetChannelMappingDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SetChannelMappingDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SetChannelMappingDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/setplaylistitemrequestdto.cpp b/core/src/dto/setplaylistitemrequestdto.cpp index 8ba1831..485860c 100644 --- a/core/src/dto/setplaylistitemrequestdto.cpp +++ b/core/src/dto/setplaylistitemrequestdto.cpp @@ -55,7 +55,7 @@ void SetPlaylistItemRequestDto::setFromJson(QJsonObject source) { } -QJsonObject SetPlaylistItemRequestDto::toJson() { +QJsonObject SetPlaylistItemRequestDto::toJson() const { QJsonObject result; result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); @@ -76,10 +76,15 @@ namespace Support { using SetPlaylistItemRequestDto = Jellyfin::DTO::SetPlaylistItemRequestDto; template <> -SetPlaylistItemRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SetPlaylistItemRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SetPlaylistItemRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SetPlaylistItemRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/setrepeatmoderequestdto.cpp b/core/src/dto/setrepeatmoderequestdto.cpp index 9f6268c..4a948b2 100644 --- a/core/src/dto/setrepeatmoderequestdto.cpp +++ b/core/src/dto/setrepeatmoderequestdto.cpp @@ -55,7 +55,7 @@ void SetRepeatModeRequestDto::setFromJson(QJsonObject source) { } -QJsonObject SetRepeatModeRequestDto::toJson() { +QJsonObject SetRepeatModeRequestDto::toJson() const { QJsonObject result; result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); @@ -76,10 +76,15 @@ namespace Support { using SetRepeatModeRequestDto = Jellyfin::DTO::SetRepeatModeRequestDto; template <> -SetRepeatModeRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SetRepeatModeRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SetRepeatModeRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SetRepeatModeRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/setshufflemoderequestdto.cpp b/core/src/dto/setshufflemoderequestdto.cpp index 6db9004..735c6ae 100644 --- a/core/src/dto/setshufflemoderequestdto.cpp +++ b/core/src/dto/setshufflemoderequestdto.cpp @@ -55,7 +55,7 @@ void SetShuffleModeRequestDto::setFromJson(QJsonObject source) { } -QJsonObject SetShuffleModeRequestDto::toJson() { +QJsonObject SetShuffleModeRequestDto::toJson() const { QJsonObject result; result["Mode"] = Jellyfin::Support::toJsonValue(m_mode); @@ -76,10 +76,15 @@ namespace Support { using SetShuffleModeRequestDto = Jellyfin::DTO::SetShuffleModeRequestDto; template <> -SetShuffleModeRequestDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SetShuffleModeRequestDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SetShuffleModeRequestDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SetShuffleModeRequestDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/songinfo.cpp b/core/src/dto/songinfo.cpp index 228204b..05658b8 100644 --- a/core/src/dto/songinfo.cpp +++ b/core/src/dto/songinfo.cpp @@ -79,7 +79,7 @@ void SongInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -91,13 +91,13 @@ void SongInfo::setFromJson(QJsonObject source) { } -QJsonObject SongInfo::toJson() { +QJsonObject SongInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -162,17 +162,17 @@ void SongInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional SongInfo::providerIds() const { return m_providerIds; } +QJsonObject SongInfo::providerIds() const { return m_providerIds; } -void SongInfo::setProviderIds(std::optional newProviderIds) { +void SongInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool SongInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void SongInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional SongInfo::year() const { return m_year; } @@ -280,10 +280,15 @@ namespace Support { using SongInfo = Jellyfin::DTO::SongInfo; template <> -SongInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SongInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SongInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SongInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/sortorder.cpp b/core/src/dto/sortorder.cpp index 5bd8e13..17e1645 100644 --- a/core/src/dto/sortorder.cpp +++ b/core/src/dto/sortorder.cpp @@ -34,7 +34,6 @@ namespace DTO { SortOrderClass::SortOrderClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SortOrder = Jellyfin::DTO::SortOrder; template <> -SortOrder fromJsonValue(const QJsonValue &source) { +SortOrder fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SortOrder::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ SortOrder fromJsonValue(const QJsonValue &source) { return SortOrder::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SortOrder &source, convertType) { + switch(source) { + case SortOrder::Ascending: + return QStringLiteral("Ascending"); + case SortOrder::Descending: + return QStringLiteral("Descending"); + + case SortOrder::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/specialviewoptiondto.cpp b/core/src/dto/specialviewoptiondto.cpp index 504cd43..d3d61b6 100644 --- a/core/src/dto/specialviewoptiondto.cpp +++ b/core/src/dto/specialviewoptiondto.cpp @@ -58,7 +58,7 @@ void SpecialViewOptionDto::setFromJson(QJsonObject source) { } -QJsonObject SpecialViewOptionDto::toJson() { +QJsonObject SpecialViewOptionDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); @@ -100,10 +100,15 @@ namespace Support { using SpecialViewOptionDto = Jellyfin::DTO::SpecialViewOptionDto; template <> -SpecialViewOptionDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SpecialViewOptionDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SpecialViewOptionDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SpecialViewOptionDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/startupconfigurationdto.cpp b/core/src/dto/startupconfigurationdto.cpp index 16d2518..806d88e 100644 --- a/core/src/dto/startupconfigurationdto.cpp +++ b/core/src/dto/startupconfigurationdto.cpp @@ -61,7 +61,7 @@ void StartupConfigurationDto::setFromJson(QJsonObject source) { } -QJsonObject StartupConfigurationDto::toJson() { +QJsonObject StartupConfigurationDto::toJson() const { QJsonObject result; result["UICulture"] = Jellyfin::Support::toJsonValue(m_uICulture); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); @@ -117,10 +117,15 @@ namespace Support { using StartupConfigurationDto = Jellyfin::DTO::StartupConfigurationDto; template <> -StartupConfigurationDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +StartupConfigurationDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return StartupConfigurationDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const StartupConfigurationDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/startupremoteaccessdto.cpp b/core/src/dto/startupremoteaccessdto.cpp index ebdda48..1da3bd9 100644 --- a/core/src/dto/startupremoteaccessdto.cpp +++ b/core/src/dto/startupremoteaccessdto.cpp @@ -58,7 +58,7 @@ void StartupRemoteAccessDto::setFromJson(QJsonObject source) { } -QJsonObject StartupRemoteAccessDto::toJson() { +QJsonObject StartupRemoteAccessDto::toJson() const { QJsonObject result; result["EnableRemoteAccess"] = Jellyfin::Support::toJsonValue(m_enableRemoteAccess); result["EnableAutomaticPortMapping"] = Jellyfin::Support::toJsonValue(m_enableAutomaticPortMapping); @@ -86,10 +86,15 @@ namespace Support { using StartupRemoteAccessDto = Jellyfin::DTO::StartupRemoteAccessDto; template <> -StartupRemoteAccessDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +StartupRemoteAccessDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return StartupRemoteAccessDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const StartupRemoteAccessDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/startupuserdto.cpp b/core/src/dto/startupuserdto.cpp index d7d5b33..5ca8b29 100644 --- a/core/src/dto/startupuserdto.cpp +++ b/core/src/dto/startupuserdto.cpp @@ -58,7 +58,7 @@ void StartupUserDto::setFromJson(QJsonObject source) { } -QJsonObject StartupUserDto::toJson() { +QJsonObject StartupUserDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Password"] = Jellyfin::Support::toJsonValue(m_password); @@ -100,10 +100,15 @@ namespace Support { using StartupUserDto = Jellyfin::DTO::StartupUserDto; template <> -StartupUserDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +StartupUserDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return StartupUserDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const StartupUserDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/subtitledeliverymethod.cpp b/core/src/dto/subtitledeliverymethod.cpp index bb61ecd..b30f845 100644 --- a/core/src/dto/subtitledeliverymethod.cpp +++ b/core/src/dto/subtitledeliverymethod.cpp @@ -34,7 +34,6 @@ namespace DTO { SubtitleDeliveryMethodClass::SubtitleDeliveryMethodClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SubtitleDeliveryMethod = Jellyfin::DTO::SubtitleDeliveryMethod; template <> -SubtitleDeliveryMethod fromJsonValue(const QJsonValue &source) { +SubtitleDeliveryMethod fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SubtitleDeliveryMethod::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ SubtitleDeliveryMethod fromJsonValue(const QJsonValue &s return SubtitleDeliveryMethod::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SubtitleDeliveryMethod &source, convertType) { + switch(source) { + case SubtitleDeliveryMethod::Encode: + return QStringLiteral("Encode"); + case SubtitleDeliveryMethod::Embed: + return QStringLiteral("Embed"); + case SubtitleDeliveryMethod::External: + return QStringLiteral("External"); + case SubtitleDeliveryMethod::Hls: + return QStringLiteral("Hls"); + + case SubtitleDeliveryMethod::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/subtitleplaybackmode.cpp b/core/src/dto/subtitleplaybackmode.cpp index f8aa8bb..01ca341 100644 --- a/core/src/dto/subtitleplaybackmode.cpp +++ b/core/src/dto/subtitleplaybackmode.cpp @@ -34,7 +34,6 @@ namespace DTO { SubtitlePlaybackModeClass::SubtitlePlaybackModeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SubtitlePlaybackMode = Jellyfin::DTO::SubtitlePlaybackMode; template <> -SubtitlePlaybackMode fromJsonValue(const QJsonValue &source) { +SubtitlePlaybackMode fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SubtitlePlaybackMode::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ SubtitlePlaybackMode fromJsonValue(const QJsonValue &sourc return SubtitlePlaybackMode::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SubtitlePlaybackMode &source, convertType) { + switch(source) { + case SubtitlePlaybackMode::Default: + return QStringLiteral("Default"); + case SubtitlePlaybackMode::Always: + return QStringLiteral("Always"); + case SubtitlePlaybackMode::OnlyForced: + return QStringLiteral("OnlyForced"); + case SubtitlePlaybackMode::None: + return QStringLiteral("None"); + case SubtitlePlaybackMode::Smart: + return QStringLiteral("Smart"); + + case SubtitlePlaybackMode::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/subtitleprofile.cpp b/core/src/dto/subtitleprofile.cpp index 8188620..40b5de5 100644 --- a/core/src/dto/subtitleprofile.cpp +++ b/core/src/dto/subtitleprofile.cpp @@ -67,7 +67,7 @@ void SubtitleProfile::setFromJson(QJsonObject source) { } -QJsonObject SubtitleProfile::toJson() { +QJsonObject SubtitleProfile::toJson() const { QJsonObject result; result["Format"] = Jellyfin::Support::toJsonValue(m_format); result["Method"] = Jellyfin::Support::toJsonValue(m_method); @@ -144,10 +144,15 @@ namespace Support { using SubtitleProfile = Jellyfin::DTO::SubtitleProfile; template <> -SubtitleProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SubtitleProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SubtitleProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SubtitleProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/syncplayuseraccesstype.cpp b/core/src/dto/syncplayuseraccesstype.cpp index 6239b63..c463142 100644 --- a/core/src/dto/syncplayuseraccesstype.cpp +++ b/core/src/dto/syncplayuseraccesstype.cpp @@ -34,7 +34,6 @@ namespace DTO { SyncPlayUserAccessTypeClass::SyncPlayUserAccessTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using SyncPlayUserAccessType = Jellyfin::DTO::SyncPlayUserAccessType; template <> -SyncPlayUserAccessType fromJsonValue(const QJsonValue &source) { +SyncPlayUserAccessType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return SyncPlayUserAccessType::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ SyncPlayUserAccessType fromJsonValue(const QJsonValue &s return SyncPlayUserAccessType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const SyncPlayUserAccessType &source, convertType) { + switch(source) { + case SyncPlayUserAccessType::CreateAndJoinGroups: + return QStringLiteral("CreateAndJoinGroups"); + case SyncPlayUserAccessType::JoinGroups: + return QStringLiteral("JoinGroups"); + case SyncPlayUserAccessType::None: + return QStringLiteral("None"); + + case SyncPlayUserAccessType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/systeminfo.cpp b/core/src/dto/systeminfo.cpp index 1c660ed..da2bbff 100644 --- a/core/src/dto/systeminfo.cpp +++ b/core/src/dto/systeminfo.cpp @@ -130,7 +130,7 @@ void SystemInfo::setFromJson(QJsonObject source) { } -QJsonObject SystemInfo::toJson() { +QJsonObject SystemInfo::toJson() const { QJsonObject result; result["LocalAddress"] = Jellyfin::Support::toJsonValue(m_localAddress); result["ServerName"] = Jellyfin::Support::toJsonValue(m_serverName); @@ -445,10 +445,15 @@ namespace Support { using SystemInfo = Jellyfin::DTO::SystemInfo; template <> -SystemInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +SystemInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return SystemInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const SystemInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/taskcompletionstatus.cpp b/core/src/dto/taskcompletionstatus.cpp index 17236aa..669da4d 100644 --- a/core/src/dto/taskcompletionstatus.cpp +++ b/core/src/dto/taskcompletionstatus.cpp @@ -34,7 +34,6 @@ namespace DTO { TaskCompletionStatusClass::TaskCompletionStatusClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using TaskCompletionStatus = Jellyfin::DTO::TaskCompletionStatus; template <> -TaskCompletionStatus fromJsonValue(const QJsonValue &source) { +TaskCompletionStatus fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return TaskCompletionStatus::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ TaskCompletionStatus fromJsonValue(const QJsonValue &sourc return TaskCompletionStatus::EnumNotSet; } +template <> +QJsonValue toJsonValue(const TaskCompletionStatus &source, convertType) { + switch(source) { + case TaskCompletionStatus::Completed: + return QStringLiteral("Completed"); + case TaskCompletionStatus::Failed: + return QStringLiteral("Failed"); + case TaskCompletionStatus::Cancelled: + return QStringLiteral("Cancelled"); + case TaskCompletionStatus::Aborted: + return QStringLiteral("Aborted"); + + case TaskCompletionStatus::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/taskinfo.cpp b/core/src/dto/taskinfo.cpp index 24fd6ac..0cc41ed 100644 --- a/core/src/dto/taskinfo.cpp +++ b/core/src/dto/taskinfo.cpp @@ -82,7 +82,7 @@ void TaskInfo::setFromJson(QJsonObject source) { } -QJsonObject TaskInfo::toJson() { +QJsonObject TaskInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["State"] = Jellyfin::Support::toJsonValue(m_state); @@ -215,10 +215,15 @@ namespace Support { using TaskInfo = Jellyfin::DTO::TaskInfo; template <> -TaskInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TaskInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TaskInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TaskInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/taskresult.cpp b/core/src/dto/taskresult.cpp index 1d2df72..a8aef7a 100644 --- a/core/src/dto/taskresult.cpp +++ b/core/src/dto/taskresult.cpp @@ -76,7 +76,7 @@ void TaskResult::setFromJson(QJsonObject source) { } -QJsonObject TaskResult::toJson() { +QJsonObject TaskResult::toJson() const { QJsonObject result; result["StartTimeUtc"] = Jellyfin::Support::toJsonValue(m_startTimeUtc); result["EndTimeUtc"] = Jellyfin::Support::toJsonValue(m_endTimeUtc); @@ -181,10 +181,15 @@ namespace Support { using TaskResult = Jellyfin::DTO::TaskResult; template <> -TaskResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TaskResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TaskResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TaskResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/taskstate.cpp b/core/src/dto/taskstate.cpp index 9264444..458042d 100644 --- a/core/src/dto/taskstate.cpp +++ b/core/src/dto/taskstate.cpp @@ -34,7 +34,6 @@ namespace DTO { TaskStateClass::TaskStateClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using TaskState = Jellyfin::DTO::TaskState; template <> -TaskState fromJsonValue(const QJsonValue &source) { +TaskState fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return TaskState::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ TaskState fromJsonValue(const QJsonValue &source) { return TaskState::EnumNotSet; } +template <> +QJsonValue toJsonValue(const TaskState &source, convertType) { + switch(source) { + case TaskState::Idle: + return QStringLiteral("Idle"); + case TaskState::Cancelling: + return QStringLiteral("Cancelling"); + case TaskState::Running: + return QStringLiteral("Running"); + + case TaskState::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/tasktriggerinfo.cpp b/core/src/dto/tasktriggerinfo.cpp index 03c27b1..bbdac76 100644 --- a/core/src/dto/tasktriggerinfo.cpp +++ b/core/src/dto/tasktriggerinfo.cpp @@ -67,7 +67,7 @@ void TaskTriggerInfo::setFromJson(QJsonObject source) { } -QJsonObject TaskTriggerInfo::toJson() { +QJsonObject TaskTriggerInfo::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["TimeOfDayTicks"] = Jellyfin::Support::toJsonValue>(m_timeOfDayTicks); @@ -144,10 +144,15 @@ namespace Support { using TaskTriggerInfo = Jellyfin::DTO::TaskTriggerInfo; template <> -TaskTriggerInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TaskTriggerInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TaskTriggerInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TaskTriggerInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/thememediaresult.cpp b/core/src/dto/thememediaresult.cpp index fcd8469..274fc0a 100644 --- a/core/src/dto/thememediaresult.cpp +++ b/core/src/dto/thememediaresult.cpp @@ -64,7 +64,7 @@ void ThemeMediaResult::setFromJson(QJsonObject source) { } -QJsonObject ThemeMediaResult::toJson() { +QJsonObject ThemeMediaResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -113,10 +113,15 @@ namespace Support { using ThemeMediaResult = Jellyfin::DTO::ThemeMediaResult; template <> -ThemeMediaResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ThemeMediaResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ThemeMediaResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ThemeMediaResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/timereventinfo.cpp b/core/src/dto/timereventinfo.cpp index ff534c4..b5ea60f 100644 --- a/core/src/dto/timereventinfo.cpp +++ b/core/src/dto/timereventinfo.cpp @@ -58,7 +58,7 @@ void TimerEventInfo::setFromJson(QJsonObject source) { } -QJsonObject TimerEventInfo::toJson() { +QJsonObject TimerEventInfo::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["ProgramId"] = Jellyfin::Support::toJsonValue(m_programId); @@ -100,10 +100,15 @@ namespace Support { using TimerEventInfo = Jellyfin::DTO::TimerEventInfo; template <> -TimerEventInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TimerEventInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TimerEventInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TimerEventInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/timerinfodto.cpp b/core/src/dto/timerinfodto.cpp index 32ca169..796dce8 100644 --- a/core/src/dto/timerinfodto.cpp +++ b/core/src/dto/timerinfodto.cpp @@ -136,7 +136,7 @@ void TimerInfoDto::setFromJson(QJsonObject source) { } -QJsonObject TimerInfoDto::toJson() { +QJsonObject TimerInfoDto::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Type"] = Jellyfin::Support::toJsonValue(m_type); @@ -465,10 +465,15 @@ namespace Support { using TimerInfoDto = Jellyfin::DTO::TimerInfoDto; template <> -TimerInfoDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TimerInfoDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TimerInfoDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TimerInfoDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/timerinfodtoqueryresult.cpp b/core/src/dto/timerinfodtoqueryresult.cpp index 0df945c..374ffeb 100644 --- a/core/src/dto/timerinfodtoqueryresult.cpp +++ b/core/src/dto/timerinfodtoqueryresult.cpp @@ -61,7 +61,7 @@ void TimerInfoDtoQueryResult::setFromJson(QJsonObject source) { } -QJsonObject TimerInfoDtoQueryResult::toJson() { +QJsonObject TimerInfoDtoQueryResult::toJson() const { QJsonObject result; result["Items"] = Jellyfin::Support::toJsonValue>(m_items); result["TotalRecordCount"] = Jellyfin::Support::toJsonValue(m_totalRecordCount); @@ -103,10 +103,15 @@ namespace Support { using TimerInfoDtoQueryResult = Jellyfin::DTO::TimerInfoDtoQueryResult; template <> -TimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TimerInfoDtoQueryResult fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TimerInfoDtoQueryResult::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TimerInfoDtoQueryResult &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/trailerinfo.cpp b/core/src/dto/trailerinfo.cpp index 473031f..5dc7b34 100644 --- a/core/src/dto/trailerinfo.cpp +++ b/core/src/dto/trailerinfo.cpp @@ -73,7 +73,7 @@ void TrailerInfo::setFromJson(QJsonObject source) { m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_metadataLanguage = Jellyfin::Support::fromJsonValue(source["MetadataLanguage"]); m_metadataCountryCode = Jellyfin::Support::fromJsonValue(source["MetadataCountryCode"]); - m_providerIds = Jellyfin::Support::fromJsonValue>(source["ProviderIds"]); + m_providerIds = Jellyfin::Support::fromJsonValue(source["ProviderIds"]); m_year = Jellyfin::Support::fromJsonValue>(source["Year"]); m_indexNumber = Jellyfin::Support::fromJsonValue>(source["IndexNumber"]); m_parentIndexNumber = Jellyfin::Support::fromJsonValue>(source["ParentIndexNumber"]); @@ -82,13 +82,13 @@ void TrailerInfo::setFromJson(QJsonObject source) { } -QJsonObject TrailerInfo::toJson() { +QJsonObject TrailerInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["MetadataLanguage"] = Jellyfin::Support::toJsonValue(m_metadataLanguage); result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue(m_metadataCountryCode); - result["ProviderIds"] = Jellyfin::Support::toJsonValue>(m_providerIds); + result["ProviderIds"] = Jellyfin::Support::toJsonValue(m_providerIds); result["Year"] = Jellyfin::Support::toJsonValue>(m_year); result["IndexNumber"] = Jellyfin::Support::toJsonValue>(m_indexNumber); result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue>(m_parentIndexNumber); @@ -150,17 +150,17 @@ void TrailerInfo::setMetadataCountryCodeNull() { m_metadataCountryCode.clear(); } -std::optional TrailerInfo::providerIds() const { return m_providerIds; } +QJsonObject TrailerInfo::providerIds() const { return m_providerIds; } -void TrailerInfo::setProviderIds(std::optional newProviderIds) { +void TrailerInfo::setProviderIds(QJsonObject newProviderIds) { m_providerIds = newProviderIds; } bool TrailerInfo::providerIdsNull() const { - return !m_providerIds.has_value(); + return m_providerIds.isEmpty(); } void TrailerInfo::setProviderIdsNull() { - m_providerIds = std::nullopt; + m_providerIds= QJsonObject(); } std::optional TrailerInfo::year() const { return m_year; } @@ -229,10 +229,15 @@ namespace Support { using TrailerInfo = Jellyfin::DTO::TrailerInfo; template <> -TrailerInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TrailerInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TrailerInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TrailerInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/trailerinforemotesearchquery.cpp b/core/src/dto/trailerinforemotesearchquery.cpp index aac5f90..aabbaa8 100644 --- a/core/src/dto/trailerinforemotesearchquery.cpp +++ b/core/src/dto/trailerinforemotesearchquery.cpp @@ -64,7 +64,7 @@ void TrailerInfoRemoteSearchQuery::setFromJson(QJsonObject source) { } -QJsonObject TrailerInfoRemoteSearchQuery::toJson() { +QJsonObject TrailerInfoRemoteSearchQuery::toJson() const { QJsonObject result; result["SearchInfo"] = Jellyfin::Support::toJsonValue>(m_searchInfo); result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); @@ -113,10 +113,15 @@ namespace Support { using TrailerInfoRemoteSearchQuery = Jellyfin::DTO::TrailerInfoRemoteSearchQuery; template <> -TrailerInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TrailerInfoRemoteSearchQuery fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TrailerInfoRemoteSearchQuery::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TrailerInfoRemoteSearchQuery &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/transcodereason.cpp b/core/src/dto/transcodereason.cpp index 6f37d5c..d96f29b 100644 --- a/core/src/dto/transcodereason.cpp +++ b/core/src/dto/transcodereason.cpp @@ -34,7 +34,6 @@ namespace DTO { TranscodeReasonClass::TranscodeReasonClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using TranscodeReason = Jellyfin::DTO::TranscodeReason; template <> -TranscodeReason fromJsonValue(const QJsonValue &source) { +TranscodeReason fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return TranscodeReason::EnumNotSet; QString str = source.toString(); @@ -119,5 +118,61 @@ TranscodeReason fromJsonValue(const QJsonValue &source) { return TranscodeReason::EnumNotSet; } +template <> +QJsonValue toJsonValue(const TranscodeReason &source, convertType) { + switch(source) { + case TranscodeReason::ContainerNotSupported: + return QStringLiteral("ContainerNotSupported"); + case TranscodeReason::VideoCodecNotSupported: + return QStringLiteral("VideoCodecNotSupported"); + case TranscodeReason::AudioCodecNotSupported: + return QStringLiteral("AudioCodecNotSupported"); + case TranscodeReason::ContainerBitrateExceedsLimit: + return QStringLiteral("ContainerBitrateExceedsLimit"); + case TranscodeReason::AudioBitrateNotSupported: + return QStringLiteral("AudioBitrateNotSupported"); + case TranscodeReason::AudioChannelsNotSupported: + return QStringLiteral("AudioChannelsNotSupported"); + case TranscodeReason::VideoResolutionNotSupported: + return QStringLiteral("VideoResolutionNotSupported"); + case TranscodeReason::UnknownVideoStreamInfo: + return QStringLiteral("UnknownVideoStreamInfo"); + case TranscodeReason::UnknownAudioStreamInfo: + return QStringLiteral("UnknownAudioStreamInfo"); + case TranscodeReason::AudioProfileNotSupported: + return QStringLiteral("AudioProfileNotSupported"); + case TranscodeReason::AudioSampleRateNotSupported: + return QStringLiteral("AudioSampleRateNotSupported"); + case TranscodeReason::AnamorphicVideoNotSupported: + return QStringLiteral("AnamorphicVideoNotSupported"); + case TranscodeReason::InterlacedVideoNotSupported: + return QStringLiteral("InterlacedVideoNotSupported"); + case TranscodeReason::SecondaryAudioNotSupported: + return QStringLiteral("SecondaryAudioNotSupported"); + case TranscodeReason::RefFramesNotSupported: + return QStringLiteral("RefFramesNotSupported"); + case TranscodeReason::VideoBitDepthNotSupported: + return QStringLiteral("VideoBitDepthNotSupported"); + case TranscodeReason::VideoBitrateNotSupported: + return QStringLiteral("VideoBitrateNotSupported"); + case TranscodeReason::VideoFramerateNotSupported: + return QStringLiteral("VideoFramerateNotSupported"); + case TranscodeReason::VideoLevelNotSupported: + return QStringLiteral("VideoLevelNotSupported"); + case TranscodeReason::VideoProfileNotSupported: + return QStringLiteral("VideoProfileNotSupported"); + case TranscodeReason::AudioBitDepthNotSupported: + return QStringLiteral("AudioBitDepthNotSupported"); + case TranscodeReason::SubtitleCodecNotSupported: + return QStringLiteral("SubtitleCodecNotSupported"); + case TranscodeReason::DirectPlayError: + return QStringLiteral("DirectPlayError"); + + case TranscodeReason::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/transcodeseekinfo.cpp b/core/src/dto/transcodeseekinfo.cpp index 3b3a45f..5545a58 100644 --- a/core/src/dto/transcodeseekinfo.cpp +++ b/core/src/dto/transcodeseekinfo.cpp @@ -34,7 +34,6 @@ namespace DTO { TranscodeSeekInfoClass::TranscodeSeekInfoClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using TranscodeSeekInfo = Jellyfin::DTO::TranscodeSeekInfo; template <> -TranscodeSeekInfo fromJsonValue(const QJsonValue &source) { +TranscodeSeekInfo fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return TranscodeSeekInfo::EnumNotSet; QString str = source.toString(); @@ -56,5 +55,19 @@ TranscodeSeekInfo fromJsonValue(const QJsonValue &source) { return TranscodeSeekInfo::EnumNotSet; } +template <> +QJsonValue toJsonValue(const TranscodeSeekInfo &source, convertType) { + switch(source) { + case TranscodeSeekInfo::Auto: + return QStringLiteral("Auto"); + case TranscodeSeekInfo::Bytes: + return QStringLiteral("Bytes"); + + case TranscodeSeekInfo::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/transcodinginfo.cpp b/core/src/dto/transcodinginfo.cpp index 846740c..016b8c7 100644 --- a/core/src/dto/transcodinginfo.cpp +++ b/core/src/dto/transcodinginfo.cpp @@ -88,7 +88,7 @@ void TranscodingInfo::setFromJson(QJsonObject source) { } -QJsonObject TranscodingInfo::toJson() { +QJsonObject TranscodingInfo::toJson() const { QJsonObject result; result["AudioCodec"] = Jellyfin::Support::toJsonValue(m_audioCodec); result["VideoCodec"] = Jellyfin::Support::toJsonValue(m_videoCodec); @@ -256,10 +256,15 @@ namespace Support { using TranscodingInfo = Jellyfin::DTO::TranscodingInfo; template <> -TranscodingInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TranscodingInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TranscodingInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TranscodingInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/transcodingprofile.cpp b/core/src/dto/transcodingprofile.cpp index a10e5e7..747503e 100644 --- a/core/src/dto/transcodingprofile.cpp +++ b/core/src/dto/transcodingprofile.cpp @@ -97,7 +97,7 @@ void TranscodingProfile::setFromJson(QJsonObject source) { } -QJsonObject TranscodingProfile::toJson() { +QJsonObject TranscodingProfile::toJson() const { QJsonObject result; result["Container"] = Jellyfin::Support::toJsonValue(m_container); result["Type"] = Jellyfin::Support::toJsonValue(m_type); @@ -251,10 +251,15 @@ namespace Support { using TranscodingProfile = Jellyfin::DTO::TranscodingProfile; template <> -TranscodingProfile fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TranscodingProfile fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TranscodingProfile::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TranscodingProfile &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/transportstreamtimestamp.cpp b/core/src/dto/transportstreamtimestamp.cpp index be2b86b..ef5234c 100644 --- a/core/src/dto/transportstreamtimestamp.cpp +++ b/core/src/dto/transportstreamtimestamp.cpp @@ -34,7 +34,6 @@ namespace DTO { TransportStreamTimestampClass::TransportStreamTimestampClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using TransportStreamTimestamp = Jellyfin::DTO::TransportStreamTimestamp; template <> -TransportStreamTimestamp fromJsonValue(const QJsonValue &source) { +TransportStreamTimestamp fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return TransportStreamTimestamp::EnumNotSet; QString str = source.toString(); @@ -59,5 +58,21 @@ TransportStreamTimestamp fromJsonValue(const QJsonValu return TransportStreamTimestamp::EnumNotSet; } +template <> +QJsonValue toJsonValue(const TransportStreamTimestamp &source, convertType) { + switch(source) { + case TransportStreamTimestamp::None: + return QStringLiteral("None"); + case TransportStreamTimestamp::Zero: + return QStringLiteral("Zero"); + case TransportStreamTimestamp::Valid: + return QStringLiteral("Valid"); + + case TransportStreamTimestamp::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/tunerchannelmapping.cpp b/core/src/dto/tunerchannelmapping.cpp index 24b1e0e..47687fa 100644 --- a/core/src/dto/tunerchannelmapping.cpp +++ b/core/src/dto/tunerchannelmapping.cpp @@ -64,7 +64,7 @@ void TunerChannelMapping::setFromJson(QJsonObject source) { } -QJsonObject TunerChannelMapping::toJson() { +QJsonObject TunerChannelMapping::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["ProviderChannelName"] = Jellyfin::Support::toJsonValue(m_providerChannelName); @@ -134,10 +134,15 @@ namespace Support { using TunerChannelMapping = Jellyfin::DTO::TunerChannelMapping; template <> -TunerChannelMapping fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TunerChannelMapping fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TunerChannelMapping::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TunerChannelMapping &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/tunerhostinfo.cpp b/core/src/dto/tunerhostinfo.cpp index c39e4b5..cc7706d 100644 --- a/core/src/dto/tunerhostinfo.cpp +++ b/core/src/dto/tunerhostinfo.cpp @@ -85,7 +85,7 @@ void TunerHostInfo::setFromJson(QJsonObject source) { } -QJsonObject TunerHostInfo::toJson() { +QJsonObject TunerHostInfo::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["Url"] = Jellyfin::Support::toJsonValue(m_url); @@ -225,10 +225,15 @@ namespace Support { using TunerHostInfo = Jellyfin::DTO::TunerHostInfo; template <> -TunerHostInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TunerHostInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TunerHostInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TunerHostInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/typeoptions.cpp b/core/src/dto/typeoptions.cpp index c71b93d..d29e37d 100644 --- a/core/src/dto/typeoptions.cpp +++ b/core/src/dto/typeoptions.cpp @@ -70,7 +70,7 @@ void TypeOptions::setFromJson(QJsonObject source) { } -QJsonObject TypeOptions::toJson() { +QJsonObject TypeOptions::toJson() const { QJsonObject result; result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["MetadataFetchers"] = Jellyfin::Support::toJsonValue(m_metadataFetchers); @@ -168,10 +168,15 @@ namespace Support { using TypeOptions = Jellyfin::DTO::TypeOptions; template <> -TypeOptions fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +TypeOptions fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return TypeOptions::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const TypeOptions &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/unrateditem.cpp b/core/src/dto/unrateditem.cpp index 5d11b7f..20e919b 100644 --- a/core/src/dto/unrateditem.cpp +++ b/core/src/dto/unrateditem.cpp @@ -34,7 +34,6 @@ namespace DTO { UnratedItemClass::UnratedItemClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using UnratedItem = Jellyfin::DTO::UnratedItem; template <> -UnratedItem fromJsonValue(const QJsonValue &source) { +UnratedItem fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return UnratedItem::EnumNotSet; QString str = source.toString(); @@ -77,5 +76,33 @@ UnratedItem fromJsonValue(const QJsonValue &source) { return UnratedItem::EnumNotSet; } +template <> +QJsonValue toJsonValue(const UnratedItem &source, convertType) { + switch(source) { + case UnratedItem::Movie: + return QStringLiteral("Movie"); + case UnratedItem::Trailer: + return QStringLiteral("Trailer"); + case UnratedItem::Series: + return QStringLiteral("Series"); + case UnratedItem::Music: + return QStringLiteral("Music"); + case UnratedItem::Book: + return QStringLiteral("Book"); + case UnratedItem::LiveTvChannel: + return QStringLiteral("LiveTvChannel"); + case UnratedItem::LiveTvProgram: + return QStringLiteral("LiveTvProgram"); + case UnratedItem::ChannelContent: + return QStringLiteral("ChannelContent"); + case UnratedItem::Other: + return QStringLiteral("Other"); + + case UnratedItem::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/updatelibraryoptionsdto.cpp b/core/src/dto/updatelibraryoptionsdto.cpp index fbf0bf8..ed1d049 100644 --- a/core/src/dto/updatelibraryoptionsdto.cpp +++ b/core/src/dto/updatelibraryoptionsdto.cpp @@ -58,7 +58,7 @@ void UpdateLibraryOptionsDto::setFromJson(QJsonObject source) { } -QJsonObject UpdateLibraryOptionsDto::toJson() { +QJsonObject UpdateLibraryOptionsDto::toJson() const { QJsonObject result; result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); result["LibraryOptions"] = Jellyfin::Support::toJsonValue>(m_libraryOptions); @@ -86,10 +86,15 @@ namespace Support { using UpdateLibraryOptionsDto = Jellyfin::DTO::UpdateLibraryOptionsDto; template <> -UpdateLibraryOptionsDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UpdateLibraryOptionsDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UpdateLibraryOptionsDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UpdateLibraryOptionsDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/updateusereasypassword.cpp b/core/src/dto/updateusereasypassword.cpp index 56859df..2a95cd9 100644 --- a/core/src/dto/updateusereasypassword.cpp +++ b/core/src/dto/updateusereasypassword.cpp @@ -61,7 +61,7 @@ void UpdateUserEasyPassword::setFromJson(QJsonObject source) { } -QJsonObject UpdateUserEasyPassword::toJson() { +QJsonObject UpdateUserEasyPassword::toJson() const { QJsonObject result; result["NewPassword"] = Jellyfin::Support::toJsonValue(m_newPassword); result["NewPw"] = Jellyfin::Support::toJsonValue(m_newPw); @@ -110,10 +110,15 @@ namespace Support { using UpdateUserEasyPassword = Jellyfin::DTO::UpdateUserEasyPassword; template <> -UpdateUserEasyPassword fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UpdateUserEasyPassword fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UpdateUserEasyPassword::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UpdateUserEasyPassword &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/updateuserpassword.cpp b/core/src/dto/updateuserpassword.cpp index dcc7681..010c539 100644 --- a/core/src/dto/updateuserpassword.cpp +++ b/core/src/dto/updateuserpassword.cpp @@ -64,7 +64,7 @@ void UpdateUserPassword::setFromJson(QJsonObject source) { } -QJsonObject UpdateUserPassword::toJson() { +QJsonObject UpdateUserPassword::toJson() const { QJsonObject result; result["CurrentPassword"] = Jellyfin::Support::toJsonValue(m_currentPassword); result["CurrentPw"] = Jellyfin::Support::toJsonValue(m_currentPw); @@ -127,10 +127,15 @@ namespace Support { using UpdateUserPassword = Jellyfin::DTO::UpdateUserPassword; template <> -UpdateUserPassword fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UpdateUserPassword fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UpdateUserPassword::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UpdateUserPassword &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/uploadsubtitledto.cpp b/core/src/dto/uploadsubtitledto.cpp index abd9d1b..2a2e166 100644 --- a/core/src/dto/uploadsubtitledto.cpp +++ b/core/src/dto/uploadsubtitledto.cpp @@ -64,7 +64,7 @@ void UploadSubtitleDto::setFromJson(QJsonObject source) { } -QJsonObject UploadSubtitleDto::toJson() { +QJsonObject UploadSubtitleDto::toJson() const { QJsonObject result; result["Language"] = Jellyfin::Support::toJsonValue(m_language); result["Format"] = Jellyfin::Support::toJsonValue(m_format); @@ -106,10 +106,15 @@ namespace Support { using UploadSubtitleDto = Jellyfin::DTO::UploadSubtitleDto; template <> -UploadSubtitleDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UploadSubtitleDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UploadSubtitleDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UploadSubtitleDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/userconfiguration.cpp b/core/src/dto/userconfiguration.cpp index 504e4fc..ead32a4 100644 --- a/core/src/dto/userconfiguration.cpp +++ b/core/src/dto/userconfiguration.cpp @@ -97,7 +97,7 @@ void UserConfiguration::setFromJson(QJsonObject source) { } -QJsonObject UserConfiguration::toJson() { +QJsonObject UserConfiguration::toJson() const { QJsonObject result; result["AudioLanguagePreference"] = Jellyfin::Support::toJsonValue(m_audioLanguagePreference); result["PlayDefaultAudioTrack"] = Jellyfin::Support::toJsonValue(m_playDefaultAudioTrack); @@ -258,10 +258,15 @@ namespace Support { using UserConfiguration = Jellyfin::DTO::UserConfiguration; template <> -UserConfiguration fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UserConfiguration fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UserConfiguration::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UserConfiguration &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/userdto.cpp b/core/src/dto/userdto.cpp index dcf706b..2edd4c1 100644 --- a/core/src/dto/userdto.cpp +++ b/core/src/dto/userdto.cpp @@ -94,7 +94,7 @@ void UserDto::setFromJson(QJsonObject source) { } -QJsonObject UserDto::toJson() { +QJsonObject UserDto::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); @@ -262,10 +262,15 @@ namespace Support { using UserDto = Jellyfin::DTO::UserDto; template <> -UserDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UserDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UserDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UserDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/useritemdatadto.cpp b/core/src/dto/useritemdatadto.cpp index d0269a0..3863abb 100644 --- a/core/src/dto/useritemdatadto.cpp +++ b/core/src/dto/useritemdatadto.cpp @@ -85,7 +85,7 @@ void UserItemDataDto::setFromJson(QJsonObject source) { } -QJsonObject UserItemDataDto::toJson() { +QJsonObject UserItemDataDto::toJson() const { QJsonObject result; result["Rating"] = Jellyfin::Support::toJsonValue>(m_rating); result["PlayedPercentage"] = Jellyfin::Support::toJsonValue>(m_playedPercentage); @@ -225,10 +225,15 @@ namespace Support { using UserItemDataDto = Jellyfin::DTO::UserItemDataDto; template <> -UserItemDataDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UserItemDataDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UserItemDataDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UserItemDataDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/userpolicy.cpp b/core/src/dto/userpolicy.cpp index dd48cfd..c558b06 100644 --- a/core/src/dto/userpolicy.cpp +++ b/core/src/dto/userpolicy.cpp @@ -169,7 +169,7 @@ void UserPolicy::setFromJson(QJsonObject source) { } -QJsonObject UserPolicy::toJson() { +QJsonObject UserPolicy::toJson() const { QJsonObject result; result["IsAdministrator"] = Jellyfin::Support::toJsonValue(m_isAdministrator); result["IsHidden"] = Jellyfin::Support::toJsonValue(m_isHidden); @@ -540,10 +540,15 @@ namespace Support { using UserPolicy = Jellyfin::DTO::UserPolicy; template <> -UserPolicy fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UserPolicy fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UserPolicy::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UserPolicy &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/utctimeresponse.cpp b/core/src/dto/utctimeresponse.cpp index 0864d2f..309eb59 100644 --- a/core/src/dto/utctimeresponse.cpp +++ b/core/src/dto/utctimeresponse.cpp @@ -58,7 +58,7 @@ void UtcTimeResponse::setFromJson(QJsonObject source) { } -QJsonObject UtcTimeResponse::toJson() { +QJsonObject UtcTimeResponse::toJson() const { QJsonObject result; result["RequestReceptionTime"] = Jellyfin::Support::toJsonValue(m_requestReceptionTime); result["ResponseTransmissionTime"] = Jellyfin::Support::toJsonValue(m_responseTransmissionTime); @@ -86,10 +86,15 @@ namespace Support { using UtcTimeResponse = Jellyfin::DTO::UtcTimeResponse; template <> -UtcTimeResponse fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +UtcTimeResponse fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return UtcTimeResponse::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const UtcTimeResponse &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/validatepathdto.cpp b/core/src/dto/validatepathdto.cpp index c27860f..9f40d8a 100644 --- a/core/src/dto/validatepathdto.cpp +++ b/core/src/dto/validatepathdto.cpp @@ -61,7 +61,7 @@ void ValidatePathDto::setFromJson(QJsonObject source) { } -QJsonObject ValidatePathDto::toJson() { +QJsonObject ValidatePathDto::toJson() const { QJsonObject result; result["ValidateWritable"] = Jellyfin::Support::toJsonValue(m_validateWritable); result["Path"] = Jellyfin::Support::toJsonValue(m_path); @@ -110,10 +110,15 @@ namespace Support { using ValidatePathDto = Jellyfin::DTO::ValidatePathDto; template <> -ValidatePathDto fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +ValidatePathDto fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return ValidatePathDto::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const ValidatePathDto &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/version.cpp b/core/src/dto/version.cpp index 3f40ec5..cbe5449 100644 --- a/core/src/dto/version.cpp +++ b/core/src/dto/version.cpp @@ -70,7 +70,7 @@ void Version::setFromJson(QJsonObject source) { } -QJsonObject Version::toJson() { +QJsonObject Version::toJson() const { QJsonObject result; result["Major"] = Jellyfin::Support::toJsonValue(m_major); result["Minor"] = Jellyfin::Support::toJsonValue(m_minor); @@ -126,10 +126,15 @@ namespace Support { using Version = Jellyfin::DTO::Version; template <> -Version fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +Version fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return Version::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const Version &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/versioninfo.cpp b/core/src/dto/versioninfo.cpp index ae31723..53bbe76 100644 --- a/core/src/dto/versioninfo.cpp +++ b/core/src/dto/versioninfo.cpp @@ -79,7 +79,7 @@ void VersionInfo::setFromJson(QJsonObject source) { } -QJsonObject VersionInfo::toJson() { +QJsonObject VersionInfo::toJson() const { QJsonObject result; result["version"] = Jellyfin::Support::toJsonValue(m_version); result["VersionNumber"] = Jellyfin::Support::toJsonValue>(m_versionNumber); @@ -212,10 +212,15 @@ namespace Support { using VersionInfo = Jellyfin::DTO::VersionInfo; template <> -VersionInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +VersionInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return VersionInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const VersionInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/video3dformat.cpp b/core/src/dto/video3dformat.cpp index d583895..7fd8126 100644 --- a/core/src/dto/video3dformat.cpp +++ b/core/src/dto/video3dformat.cpp @@ -34,7 +34,6 @@ namespace DTO { Video3DFormatClass::Video3DFormatClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using Video3DFormat = Jellyfin::DTO::Video3DFormat; template <> -Video3DFormat fromJsonValue(const QJsonValue &source) { +Video3DFormat fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return Video3DFormat::EnumNotSet; QString str = source.toString(); @@ -65,5 +64,25 @@ Video3DFormat fromJsonValue(const QJsonValue &source) { return Video3DFormat::EnumNotSet; } +template <> +QJsonValue toJsonValue(const Video3DFormat &source, convertType) { + switch(source) { + case Video3DFormat::HalfSideBySide: + return QStringLiteral("HalfSideBySide"); + case Video3DFormat::FullSideBySide: + return QStringLiteral("FullSideBySide"); + case Video3DFormat::FullTopAndBottom: + return QStringLiteral("FullTopAndBottom"); + case Video3DFormat::HalfTopAndBottom: + return QStringLiteral("HalfTopAndBottom"); + case Video3DFormat::MVC: + return QStringLiteral("MVC"); + + case Video3DFormat::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/videotype.cpp b/core/src/dto/videotype.cpp index a51081a..f8ee0cf 100644 --- a/core/src/dto/videotype.cpp +++ b/core/src/dto/videotype.cpp @@ -34,7 +34,6 @@ namespace DTO { VideoTypeClass::VideoTypeClass() {} - } // NS DTO namespace Support { @@ -42,7 +41,7 @@ namespace Support { using VideoType = Jellyfin::DTO::VideoType; template <> -VideoType fromJsonValue(const QJsonValue &source) { +VideoType fromJsonValue(const QJsonValue &source, convertType) { if (!source.isString()) return VideoType::EnumNotSet; QString str = source.toString(); @@ -62,5 +61,23 @@ VideoType fromJsonValue(const QJsonValue &source) { return VideoType::EnumNotSet; } +template <> +QJsonValue toJsonValue(const VideoType &source, convertType) { + switch(source) { + case VideoType::VideoFile: + return QStringLiteral("VideoFile"); + case VideoType::Iso: + return QStringLiteral("Iso"); + case VideoType::Dvd: + return QStringLiteral("Dvd"); + case VideoType::BluRay: + return QStringLiteral("BluRay"); + + case VideoType::EnumNotSet: // Fallthrough + default: + return QJsonValue(); + } +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/virtualfolderinfo.cpp b/core/src/dto/virtualfolderinfo.cpp index 042b0f3..2286b61 100644 --- a/core/src/dto/virtualfolderinfo.cpp +++ b/core/src/dto/virtualfolderinfo.cpp @@ -76,7 +76,7 @@ void VirtualFolderInfo::setFromJson(QJsonObject source) { } -QJsonObject VirtualFolderInfo::toJson() { +QJsonObject VirtualFolderInfo::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Locations"] = Jellyfin::Support::toJsonValue(m_locations); @@ -195,10 +195,15 @@ namespace Support { using VirtualFolderInfo = Jellyfin::DTO::VirtualFolderInfo; template <> -VirtualFolderInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +VirtualFolderInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return VirtualFolderInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const VirtualFolderInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/wakeonlaninfo.cpp b/core/src/dto/wakeonlaninfo.cpp index 86dfd09..949aa55 100644 --- a/core/src/dto/wakeonlaninfo.cpp +++ b/core/src/dto/wakeonlaninfo.cpp @@ -58,7 +58,7 @@ void WakeOnLanInfo::setFromJson(QJsonObject source) { } -QJsonObject WakeOnLanInfo::toJson() { +QJsonObject WakeOnLanInfo::toJson() const { QJsonObject result; result["MacAddress"] = Jellyfin::Support::toJsonValue(m_macAddress); result["Port"] = Jellyfin::Support::toJsonValue(m_port); @@ -93,10 +93,15 @@ namespace Support { using WakeOnLanInfo = Jellyfin::DTO::WakeOnLanInfo; template <> -WakeOnLanInfo fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +WakeOnLanInfo fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return WakeOnLanInfo::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const WakeOnLanInfo &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/dto/xmlattribute.cpp b/core/src/dto/xmlattribute.cpp index 64ea2e5..a6d52a8 100644 --- a/core/src/dto/xmlattribute.cpp +++ b/core/src/dto/xmlattribute.cpp @@ -58,7 +58,7 @@ void XmlAttribute::setFromJson(QJsonObject source) { } -QJsonObject XmlAttribute::toJson() { +QJsonObject XmlAttribute::toJson() const { QJsonObject result; result["Name"] = Jellyfin::Support::toJsonValue(m_name); result["Value"] = Jellyfin::Support::toJsonValue(m_value); @@ -100,10 +100,15 @@ namespace Support { using XmlAttribute = Jellyfin::DTO::XmlAttribute; template <> -XmlAttribute fromJsonValue(const QJsonValue &source) { - if (!source.isObject()) throw new ParseException("Expected JSON Object"); +XmlAttribute fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Expected JSON Object"); return XmlAttribute::fromJson(source.toObject()); } +template<> +QJsonValue toJsonValue(const XmlAttribute &source, convertType) { + return source.toJson(); +} + } // NS DTO } // NS Jellyfin diff --git a/core/src/jellyfin.cpp b/core/src/jellyfin.cpp index edcf197..1ae45a4 100644 --- a/core/src/jellyfin.cpp +++ b/core/src/jellyfin.cpp @@ -27,6 +27,7 @@ void registerTypes(const char *uri) { qmlRegisterUncreatableType(uri, 1, 0, "BaseApiModel", "Please use one of its subclasses"); qmlRegisterUncreatableType(uri, 1, 0, "BaseModelLoader", "Please use one of its subclasses"); qmlRegisterUncreatableType(uri, 1, 0, "ModelStatus", "Is an enum"); + qmlRegisterType(uri, 1, 0, "ItemLoader"); qmlRegisterType(uri, 1, 0, "ItemLoader"); qmlRegisterType(uri, 1, 0, "ItemModel"); qmlRegisterType(uri, 1, 0, "UsersViewLoader"); diff --git a/core/src/loader/http/addlistingprovider.cpp b/core/src/loader/http/addlistingprovider.cpp index d627423..c202a10 100644 --- a/core/src/loader/http/addlistingprovider.cpp +++ b/core/src/loader/http/addlistingprovider.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; AddListingProviderLoader::AddListingProviderLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString AddListingProviderLoader::path(const AddListingProviderParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,13 +51,13 @@ QUrlQuery AddListingProviderLoader::query(const AddListingProviderParams ¶ms // Optional parameters if (!params.pwNull()) { - result.addQueryItem("pw", Support::toString(params.pw())); + result.addQueryItem("pw", Support::toString(params.pw())); } if (!params.validateListingsNull()) { - result.addQueryItem("validateListings", Support::toString(params.validateListings())); + result.addQueryItem("validateListings", Support::toString>(params.validateListings())); } if (!params.validateLoginNull()) { - result.addQueryItem("validateLogin", Support::toString(params.validateLogin())); + result.addQueryItem("validateLogin", Support::toString>(params.validateLogin())); } return result; diff --git a/core/src/loader/http/addtunerhost.cpp b/core/src/loader/http/addtunerhost.cpp index 1c05ddf..11498d1 100644 --- a/core/src/loader/http/addtunerhost.cpp +++ b/core/src/loader/http/addtunerhost.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; AddTunerHostLoader::AddTunerHostLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString AddTunerHostLoader::path(const AddTunerHostParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/authenticateuser.cpp b/core/src/loader/http/authenticateuser.cpp index 0941e34..d100cba 100644 --- a/core/src/loader/http/authenticateuser.cpp +++ b/core/src/loader/http/authenticateuser.cpp @@ -34,24 +34,25 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; AuthenticateUserLoader::AuthenticateUserLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString AuthenticateUserLoader::path(const AuthenticateUserParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Authenticate"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Authenticate"); } QUrlQuery AuthenticateUserLoader::query(const AuthenticateUserParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("pw", params.pw()); + result.addQueryItem("pw", Support::toString(params.pw())); // Optional parameters if (!params.passwordNull()) { - result.addQueryItem("password", Support::toString(params.password())); + result.addQueryItem("password", Support::toString(params.password())); } return result; diff --git a/core/src/loader/http/authenticateuserbyname.cpp b/core/src/loader/http/authenticateuserbyname.cpp index 5b8556a..9d6de67 100644 --- a/core/src/loader/http/authenticateuserbyname.cpp +++ b/core/src/loader/http/authenticateuserbyname.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; AuthenticateUserByNameLoader::AuthenticateUserByNameLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString AuthenticateUserByNameLoader::path(const AuthenticateUserByNameParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/authenticatewithquickconnect.cpp b/core/src/loader/http/authenticatewithquickconnect.cpp index 72f7563..37122ea 100644 --- a/core/src/loader/http/authenticatewithquickconnect.cpp +++ b/core/src/loader/http/authenticatewithquickconnect.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; AuthenticateWithQuickConnectLoader::AuthenticateWithQuickConnectLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString AuthenticateWithQuickConnectLoader::path(const AuthenticateWithQuickConnectParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/authorize.cpp b/core/src/loader/http/authorize.cpp index 177ed0f..02fafc5 100644 --- a/core/src/loader/http/authorize.cpp +++ b/core/src/loader/http/authorize.cpp @@ -34,6 +34,27 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +AuthorizeLoader::AuthorizeLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString AuthorizeLoader::path(const AuthorizeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/QuickConnect/Authorize"); +} + +QUrlQuery AuthorizeLoader::query(const AuthorizeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("code", Support::toString(params.code())); + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/connect.cpp b/core/src/loader/http/connect.cpp index 1b08ef2..4d2bd0e 100644 --- a/core/src/loader/http/connect.cpp +++ b/core/src/loader/http/connect.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; ConnectLoader::ConnectLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString ConnectLoader::path(const ConnectParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -47,7 +48,7 @@ QUrlQuery ConnectLoader::query(const ConnectParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("secret", params.secret()); + result.addQueryItem("secret", Support::toString(params.secret())); // Optional parameters diff --git a/core/src/loader/http/createcollection.cpp b/core/src/loader/http/createcollection.cpp index 71ff0e1..6d5345c 100644 --- a/core/src/loader/http/createcollection.cpp +++ b/core/src/loader/http/createcollection.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; CreateCollectionLoader::CreateCollectionLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString CreateCollectionLoader::path(const CreateCollectionParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,16 +51,16 @@ QUrlQuery CreateCollectionLoader::query(const CreateCollectionParams ¶ms) co // Optional parameters if (!params.nameNull()) { - result.addQueryItem("name", Support::toString(params.name())); + result.addQueryItem("name", Support::toString(params.name())); } if (!params.idsNull()) { - result.addQueryItem("ids", Support::toString(params.ids())); + result.addQueryItem("ids", Support::toString(params.ids())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.isLockedNull()) { - result.addQueryItem("isLocked", Support::toString(params.isLocked())); + result.addQueryItem("isLocked", Support::toString>(params.isLocked())); } return result; diff --git a/core/src/loader/http/createplaylist.cpp b/core/src/loader/http/createplaylist.cpp index 0e4b8be..52b0a3b 100644 --- a/core/src/loader/http/createplaylist.cpp +++ b/core/src/loader/http/createplaylist.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; CreatePlaylistLoader::CreatePlaylistLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString CreatePlaylistLoader::path(const CreatePlaylistParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,16 +51,16 @@ QUrlQuery CreatePlaylistLoader::query(const CreatePlaylistParams ¶ms) const // Optional parameters if (!params.nameNull()) { - result.addQueryItem("name", Support::toString(params.name())); + result.addQueryItem("name", Support::toString(params.name())); } if (!params.idsNull()) { - result.addQueryItem("ids", Support::toString(params.ids())); + result.addQueryItem("ids", Support::toString(params.ids())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.mediaTypeNull()) { - result.addQueryItem("mediaType", Support::toString(params.mediaType())); + result.addQueryItem("mediaType", Support::toString(params.mediaType())); } return result; diff --git a/core/src/loader/http/createuserbyname.cpp b/core/src/loader/http/createuserbyname.cpp index eda86cf..bf5fbf0 100644 --- a/core/src/loader/http/createuserbyname.cpp +++ b/core/src/loader/http/createuserbyname.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; CreateUserByNameLoader::CreateUserByNameLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString CreateUserByNameLoader::path(const CreateUserByNameParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/deauthorize.cpp b/core/src/loader/http/deauthorize.cpp index 3a2188d..4e42759 100644 --- a/core/src/loader/http/deauthorize.cpp +++ b/core/src/loader/http/deauthorize.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +DeauthorizeLoader::DeauthorizeLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString DeauthorizeLoader::path(const DeauthorizeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/QuickConnect/Deauthorize"); +} + +QUrlQuery DeauthorizeLoader::query(const DeauthorizeParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/deleteuseritemrating.cpp b/core/src/loader/http/deleteuseritemrating.cpp index 28314cd..30ad75e 100644 --- a/core/src/loader/http/deleteuseritemrating.cpp +++ b/core/src/loader/http/deleteuseritemrating.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; DeleteUserItemRatingLoader::DeleteUserItemRatingLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString DeleteUserItemRatingLoader::path(const DeleteUserItemRatingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/Rating"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Rating"); } QUrlQuery DeleteUserItemRatingLoader::query(const DeleteUserItemRatingParams ¶ms) const { diff --git a/core/src/loader/http/discovertuners.cpp b/core/src/loader/http/discovertuners.cpp index af5df0b..c4d8ca5 100644 --- a/core/src/loader/http/discovertuners.cpp +++ b/core/src/loader/http/discovertuners.cpp @@ -34,6 +34,29 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +DiscoverTunersLoader::DiscoverTunersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, DiscoverTunersParams>(apiClient) {} + +QString DiscoverTunersLoader::path(const DiscoverTunersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Tuners/Discover"); +} + +QUrlQuery DiscoverTunersLoader::query(const DiscoverTunersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.newDevicesOnlyNull()) { + result.addQueryItem("newDevicesOnly", Support::toString>(params.newDevicesOnly())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/discvovertuners.cpp b/core/src/loader/http/discvovertuners.cpp index 24ad8c8..1829927 100644 --- a/core/src/loader/http/discvovertuners.cpp +++ b/core/src/loader/http/discvovertuners.cpp @@ -34,6 +34,29 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +DiscvoverTunersLoader::DiscvoverTunersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, DiscvoverTunersParams>(apiClient) {} + +QString DiscvoverTunersLoader::path(const DiscvoverTunersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/Tuners/Discvover"); +} + +QUrlQuery DiscvoverTunersLoader::query(const DiscvoverTunersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.newDevicesOnlyNull()) { + result.addQueryItem("newDevicesOnly", Support::toString>(params.newDevicesOnly())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/forgotpassword.cpp b/core/src/loader/http/forgotpassword.cpp index f3d90bf..96297b3 100644 --- a/core/src/loader/http/forgotpassword.cpp +++ b/core/src/loader/http/forgotpassword.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; ForgotPasswordLoader::ForgotPasswordLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString ForgotPasswordLoader::path(const ForgotPasswordParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/forgotpasswordpin.cpp b/core/src/loader/http/forgotpasswordpin.cpp index 275f0b4..9109676 100644 --- a/core/src/loader/http/forgotpasswordpin.cpp +++ b/core/src/loader/http/forgotpasswordpin.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; ForgotPasswordPinLoader::ForgotPasswordPinLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString ForgotPasswordPinLoader::path(const ForgotPasswordPinParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/get.cpp b/core/src/loader/http/get.cpp index 9ebaf1a..d598373 100644 --- a/core/src/loader/http/get.cpp +++ b/core/src/loader/http/get.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLoader::GetLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLoader::path(const GetParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -47,59 +48,59 @@ QUrlQuery GetLoader::query(const GetParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("searchTerm", params.searchTerm()); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.includePeopleNull()) { - result.addQueryItem("includePeople", Support::toString(params.includePeople())); + result.addQueryItem("includePeople", Support::toString>(params.includePeople())); } if (!params.includeMediaNull()) { - result.addQueryItem("includeMedia", Support::toString(params.includeMedia())); + result.addQueryItem("includeMedia", Support::toString>(params.includeMedia())); } if (!params.includeGenresNull()) { - result.addQueryItem("includeGenres", Support::toString(params.includeGenres())); + result.addQueryItem("includeGenres", Support::toString>(params.includeGenres())); } if (!params.includeStudiosNull()) { - result.addQueryItem("includeStudios", Support::toString(params.includeStudios())); + result.addQueryItem("includeStudios", Support::toString>(params.includeStudios())); } if (!params.includeArtistsNull()) { - result.addQueryItem("includeArtists", Support::toString(params.includeArtists())); + result.addQueryItem("includeArtists", Support::toString>(params.includeArtists())); } return result; diff --git a/core/src/loader/http/getadditionalpart.cpp b/core/src/loader/http/getadditionalpart.cpp index 03ccd8b..eda25f6 100644 --- a/core/src/loader/http/getadditionalpart.cpp +++ b/core/src/loader/http/getadditionalpart.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetAdditionalPartLoader::GetAdditionalPartLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetAdditionalPartLoader::path(const GetAdditionalPartParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Videos/") + Support::toString(params.itemId()) + QStringLiteral("/AdditionalParts"); + return QStringLiteral("/Videos/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/AdditionalParts"); } QUrlQuery GetAdditionalPartLoader::query(const GetAdditionalPartParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetAdditionalPartLoader::query(const GetAdditionalPartParams ¶ms) // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getalbumartists.cpp b/core/src/loader/http/getalbumartists.cpp index 977d5ad..940d2d0 100644 --- a/core/src/loader/http/getalbumartists.cpp +++ b/core/src/loader/http/getalbumartists.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetAlbumArtistsLoader::GetAlbumArtistsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetAlbumArtistsLoader::path(const GetAlbumArtistsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,94 +51,94 @@ QUrlQuery GetAlbumArtistsLoader::query(const GetAlbumArtistsParams ¶ms) cons // Optional parameters if (!params.minCommunityRatingNull()) { - result.addQueryItem("minCommunityRating", Support::toString(params.minCommunityRating())); + result.addQueryItem("minCommunityRating", Support::toString>(params.minCommunityRating())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.officialRatingsNull()) { - result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); + result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); } if (!params.tagsNull()) { - result.addQueryItem("tags", Support::toString(params.tags())); + result.addQueryItem("tags", Support::toString(params.tags())); } if (!params.yearsNull()) { - result.addQueryItem("years", Support::toString(params.years())); + result.addQueryItem("years", Support::toString>(params.years())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.personNull()) { - result.addQueryItem("person", Support::toString(params.person())); + result.addQueryItem("person", Support::toString(params.person())); } if (!params.personIdsNull()) { - result.addQueryItem("personIds", Support::toString(params.personIds())); + result.addQueryItem("personIds", Support::toString(params.personIds())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.studiosNull()) { - result.addQueryItem("studios", Support::toString(params.studios())); + result.addQueryItem("studios", Support::toString(params.studios())); } if (!params.studioIdsNull()) { - result.addQueryItem("studioIds", Support::toString(params.studioIds())); + result.addQueryItem("studioIds", Support::toString(params.studioIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getallchannelfeatures.cpp b/core/src/loader/http/getallchannelfeatures.cpp index bacd607..8bd4bff 100644 --- a/core/src/loader/http/getallchannelfeatures.cpp +++ b/core/src/loader/http/getallchannelfeatures.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetAllChannelFeaturesLoader::GetAllChannelFeaturesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetAllChannelFeaturesParams>(apiClient) {} + +QString GetAllChannelFeaturesLoader::path(const GetAllChannelFeaturesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Channels/Features"); +} + +QUrlQuery GetAllChannelFeaturesLoader::query(const GetAllChannelFeaturesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getancestors.cpp b/core/src/loader/http/getancestors.cpp index c824b4a..871ea8b 100644 --- a/core/src/loader/http/getancestors.cpp +++ b/core/src/loader/http/getancestors.cpp @@ -34,6 +34,29 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetAncestorsLoader::GetAncestorsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetAncestorsParams>(apiClient) {} + +QString GetAncestorsLoader::path(const GetAncestorsParams ¶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("/Ancestors"); +} + +QUrlQuery GetAncestorsLoader::query(const GetAncestorsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.userIdNull()) { + result.addQueryItem("userId", Support::toString(params.userId())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getartistbyname.cpp b/core/src/loader/http/getartistbyname.cpp index 9732ee4..16e0efc 100644 --- a/core/src/loader/http/getartistbyname.cpp +++ b/core/src/loader/http/getartistbyname.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetArtistByNameLoader::GetArtistByNameLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetArtistByNameLoader::path(const GetArtistByNameParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Artists/") + Support::toString(params.name()) ; + return QStringLiteral("/Artists/") + Support::toString< QString>(params.name()) ; } QUrlQuery GetArtistByNameLoader::query(const GetArtistByNameParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetArtistByNameLoader::query(const GetArtistByNameParams ¶ms) cons // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getartists.cpp b/core/src/loader/http/getartists.cpp index d1297ca..7893749 100644 --- a/core/src/loader/http/getartists.cpp +++ b/core/src/loader/http/getartists.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetArtistsLoader::GetArtistsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetArtistsLoader::path(const GetArtistsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,94 +51,94 @@ QUrlQuery GetArtistsLoader::query(const GetArtistsParams ¶ms) const { // Optional parameters if (!params.minCommunityRatingNull()) { - result.addQueryItem("minCommunityRating", Support::toString(params.minCommunityRating())); + result.addQueryItem("minCommunityRating", Support::toString>(params.minCommunityRating())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.officialRatingsNull()) { - result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); + result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); } if (!params.tagsNull()) { - result.addQueryItem("tags", Support::toString(params.tags())); + result.addQueryItem("tags", Support::toString(params.tags())); } if (!params.yearsNull()) { - result.addQueryItem("years", Support::toString(params.years())); + result.addQueryItem("years", Support::toString>(params.years())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.personNull()) { - result.addQueryItem("person", Support::toString(params.person())); + result.addQueryItem("person", Support::toString(params.person())); } if (!params.personIdsNull()) { - result.addQueryItem("personIds", Support::toString(params.personIds())); + result.addQueryItem("personIds", Support::toString(params.personIds())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.studiosNull()) { - result.addQueryItem("studios", Support::toString(params.studios())); + result.addQueryItem("studios", Support::toString(params.studios())); } if (!params.studioIdsNull()) { - result.addQueryItem("studioIds", Support::toString(params.studioIds())); + result.addQueryItem("studioIds", Support::toString(params.studioIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getauthproviders.cpp b/core/src/loader/http/getauthproviders.cpp index 74b6dff..008f0e0 100644 --- a/core/src/loader/http/getauthproviders.cpp +++ b/core/src/loader/http/getauthproviders.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetAuthProvidersLoader::GetAuthProvidersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetAuthProvidersParams>(apiClient) {} + +QString GetAuthProvidersLoader::path(const GetAuthProvidersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Auth/Providers"); +} + +QUrlQuery GetAuthProvidersLoader::query(const GetAuthProvidersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getbookremotesearchresults.cpp b/core/src/loader/http/getbookremotesearchresults.cpp index 89556b3..4bbd7cb 100644 --- a/core/src/loader/http/getbookremotesearchresults.cpp +++ b/core/src/loader/http/getbookremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetBookRemoteSearchResultsLoader::GetBookRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetBookRemoteSearchResultsParams>(apiClient) {} + +QString GetBookRemoteSearchResultsLoader::path(const GetBookRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Book"); +} + +QUrlQuery GetBookRemoteSearchResultsLoader::query(const GetBookRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getboxsetremotesearchresults.cpp b/core/src/loader/http/getboxsetremotesearchresults.cpp index 2250a9a..a4e9dbb 100644 --- a/core/src/loader/http/getboxsetremotesearchresults.cpp +++ b/core/src/loader/http/getboxsetremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetBoxSetRemoteSearchResultsLoader::GetBoxSetRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetBoxSetRemoteSearchResultsParams>(apiClient) {} + +QString GetBoxSetRemoteSearchResultsLoader::path(const GetBoxSetRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/BoxSet"); +} + +QUrlQuery GetBoxSetRemoteSearchResultsLoader::query(const GetBoxSetRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getbrandingcss.cpp b/core/src/loader/http/getbrandingcss.cpp index f92075b..7e377b2 100644 --- a/core/src/loader/http/getbrandingcss.cpp +++ b/core/src/loader/http/getbrandingcss.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetBrandingCssLoader::GetBrandingCssLoader(ApiClient *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 + + return QStringLiteral("/Branding/Css"); +} + +QUrlQuery GetBrandingCssLoader::query(const GetBrandingCssParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getbrandingcss_2.cpp b/core/src/loader/http/getbrandingcss_2.cpp index dd47e9d..9eb33c4 100644 --- a/core/src/loader/http/getbrandingcss_2.cpp +++ b/core/src/loader/http/getbrandingcss_2.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetBrandingCss_2Loader::GetBrandingCss_2Loader(ApiClient *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 + + return QStringLiteral("/Branding/Css.css"); +} + +QUrlQuery GetBrandingCss_2Loader::query(const GetBrandingCss_2Params ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getbrandingoptions.cpp b/core/src/loader/http/getbrandingoptions.cpp index ffb4fbd..243a44e 100644 --- a/core/src/loader/http/getbrandingoptions.cpp +++ b/core/src/loader/http/getbrandingoptions.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetBrandingOptionsLoader::GetBrandingOptionsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetBrandingOptionsLoader::path(const GetBrandingOptionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getchannel.cpp b/core/src/loader/http/getchannel.cpp index 57f559d..6651652 100644 --- a/core/src/loader/http/getchannel.cpp +++ b/core/src/loader/http/getchannel.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetChannelLoader::GetChannelLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetChannelLoader::path(const GetChannelParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/LiveTv/Channels/") + Support::toString(params.channelId()) ; + return QStringLiteral("/LiveTv/Channels/") + Support::toString< QString>(params.channelId()) ; } QUrlQuery GetChannelLoader::query(const GetChannelParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetChannelLoader::query(const GetChannelParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getchannelfeatures.cpp b/core/src/loader/http/getchannelfeatures.cpp index 59ba990..7075afc 100644 --- a/core/src/loader/http/getchannelfeatures.cpp +++ b/core/src/loader/http/getchannelfeatures.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetChannelFeaturesLoader::GetChannelFeaturesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetChannelFeaturesLoader::path(const GetChannelFeaturesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Channels/") + Support::toString(params.channelId()) + QStringLiteral("/Features"); + return QStringLiteral("/Channels/") + Support::toString< QString>(params.channelId()) + QStringLiteral("/Features"); } QUrlQuery GetChannelFeaturesLoader::query(const GetChannelFeaturesParams ¶ms) const { diff --git a/core/src/loader/http/getchannelitems.cpp b/core/src/loader/http/getchannelitems.cpp index 3632a9e..259b4fe 100644 --- a/core/src/loader/http/getchannelitems.cpp +++ b/core/src/loader/http/getchannelitems.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetChannelItemsLoader::GetChannelItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetChannelItemsLoader::path(const GetChannelItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Channels/") + Support::toString(params.channelId()) + QStringLiteral("/Items"); + return QStringLiteral("/Channels/") + Support::toString< QString>(params.channelId()) + QStringLiteral("/Items"); } QUrlQuery GetChannelItemsLoader::query(const GetChannelItemsParams ¶ms) const { @@ -50,28 +51,28 @@ QUrlQuery GetChannelItemsLoader::query(const GetChannelItemsParams ¶ms) cons // Optional parameters if (!params.folderIdNull()) { - result.addQueryItem("folderId", Support::toString(params.folderId())); + result.addQueryItem("folderId", Support::toString(params.folderId())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getchannelmappingoptions.cpp b/core/src/loader/http/getchannelmappingoptions.cpp index df6e975..d1627ee 100644 --- a/core/src/loader/http/getchannelmappingoptions.cpp +++ b/core/src/loader/http/getchannelmappingoptions.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetChannelMappingOptionsLoader::GetChannelMappingOptionsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetChannelMappingOptionsLoader::path(const GetChannelMappingOptionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,7 +51,7 @@ QUrlQuery GetChannelMappingOptionsLoader::query(const GetChannelMappingOptionsPa // Optional parameters if (!params.providerIdNull()) { - result.addQueryItem("providerId", Support::toString(params.providerId())); + result.addQueryItem("providerId", Support::toString(params.providerId())); } return result; diff --git a/core/src/loader/http/getchannels.cpp b/core/src/loader/http/getchannels.cpp index 7dd2006..5d4f15b 100644 --- a/core/src/loader/http/getchannels.cpp +++ b/core/src/loader/http/getchannels.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetChannelsLoader::GetChannelsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetChannelsLoader::path(const GetChannelsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,22 +51,22 @@ QUrlQuery GetChannelsLoader::query(const GetChannelsParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.supportsLatestItemsNull()) { - result.addQueryItem("supportsLatestItems", Support::toString(params.supportsLatestItems())); + result.addQueryItem("supportsLatestItems", Support::toString>(params.supportsLatestItems())); } if (!params.supportsMediaDeletionNull()) { - result.addQueryItem("supportsMediaDeletion", Support::toString(params.supportsMediaDeletion())); + result.addQueryItem("supportsMediaDeletion", Support::toString>(params.supportsMediaDeletion())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } return result; diff --git a/core/src/loader/http/getconfiguration.cpp b/core/src/loader/http/getconfiguration.cpp index a4afe12..eed948a 100644 --- a/core/src/loader/http/getconfiguration.cpp +++ b/core/src/loader/http/getconfiguration.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetConfigurationLoader::GetConfigurationLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetConfigurationLoader::path(const GetConfigurationParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getconfigurationpages.cpp b/core/src/loader/http/getconfigurationpages.cpp index 48a9148..cc78bef 100644 --- a/core/src/loader/http/getconfigurationpages.cpp +++ b/core/src/loader/http/getconfigurationpages.cpp @@ -34,6 +34,32 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetConfigurationPagesLoader::GetConfigurationPagesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetConfigurationPagesParams>(apiClient) {} + +QString GetConfigurationPagesLoader::path(const GetConfigurationPagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/web/ConfigurationPages"); +} + +QUrlQuery GetConfigurationPagesLoader::query(const GetConfigurationPagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.enableInMainMenuNull()) { + result.addQueryItem("enableInMainMenu", Support::toString>(params.enableInMainMenu())); + } + if (!params.pageTypeNull()) { + result.addQueryItem("pageType", Support::toString(params.pageType())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getcountries.cpp b/core/src/loader/http/getcountries.cpp index 817d8af..598ba9b 100644 --- a/core/src/loader/http/getcountries.cpp +++ b/core/src/loader/http/getcountries.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetCountriesLoader::GetCountriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetCountriesParams>(apiClient) {} + +QString GetCountriesLoader::path(const GetCountriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Localization/Countries"); +} + +QUrlQuery GetCountriesLoader::query(const GetCountriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getcriticreviews.cpp b/core/src/loader/http/getcriticreviews.cpp index 788ab54..4c0a2d1 100644 --- a/core/src/loader/http/getcriticreviews.cpp +++ b/core/src/loader/http/getcriticreviews.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetCriticReviewsLoader::GetCriticReviewsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetCriticReviewsLoader::path(const GetCriticReviewsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/CriticReviews"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/CriticReviews"); } QUrlQuery GetCriticReviewsLoader::query(const GetCriticReviewsParams ¶ms) const { diff --git a/core/src/loader/http/getcultures.cpp b/core/src/loader/http/getcultures.cpp index 7574f3b..26e5eb8 100644 --- a/core/src/loader/http/getcultures.cpp +++ b/core/src/loader/http/getcultures.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetCulturesLoader::GetCulturesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetCulturesParams>(apiClient) {} + +QString GetCulturesLoader::path(const GetCulturesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Localization/Cultures"); +} + +QUrlQuery GetCulturesLoader::query(const GetCulturesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getcurrentuser.cpp b/core/src/loader/http/getcurrentuser.cpp index 1830991..6048cf9 100644 --- a/core/src/loader/http/getcurrentuser.cpp +++ b/core/src/loader/http/getcurrentuser.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetCurrentUserLoader::GetCurrentUserLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetCurrentUserLoader::path(const GetCurrentUserParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getdefaultdirectorybrowser.cpp b/core/src/loader/http/getdefaultdirectorybrowser.cpp index f14292f..918c796 100644 --- a/core/src/loader/http/getdefaultdirectorybrowser.cpp +++ b/core/src/loader/http/getdefaultdirectorybrowser.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDefaultDirectoryBrowserLoader::GetDefaultDirectoryBrowserLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDefaultDirectoryBrowserLoader::path(const GetDefaultDirectoryBrowserParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getdefaultlistingprovider.cpp b/core/src/loader/http/getdefaultlistingprovider.cpp index dea29ca..24d5b91 100644 --- a/core/src/loader/http/getdefaultlistingprovider.cpp +++ b/core/src/loader/http/getdefaultlistingprovider.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDefaultListingProviderLoader::GetDefaultListingProviderLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDefaultListingProviderLoader::path(const GetDefaultListingProviderParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getdefaultmetadataoptions.cpp b/core/src/loader/http/getdefaultmetadataoptions.cpp index 8056dc5..2a255d3 100644 --- a/core/src/loader/http/getdefaultmetadataoptions.cpp +++ b/core/src/loader/http/getdefaultmetadataoptions.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDefaultMetadataOptionsLoader::GetDefaultMetadataOptionsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDefaultMetadataOptionsLoader::path(const GetDefaultMetadataOptionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getdefaultprofile.cpp b/core/src/loader/http/getdefaultprofile.cpp index 48a80f9..37713dc 100644 --- a/core/src/loader/http/getdefaultprofile.cpp +++ b/core/src/loader/http/getdefaultprofile.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDefaultProfileLoader::GetDefaultProfileLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDefaultProfileLoader::path(const GetDefaultProfileParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getdefaulttimer.cpp b/core/src/loader/http/getdefaulttimer.cpp index 0509f15..e5ab8c2 100644 --- a/core/src/loader/http/getdefaulttimer.cpp +++ b/core/src/loader/http/getdefaulttimer.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDefaultTimerLoader::GetDefaultTimerLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDefaultTimerLoader::path(const GetDefaultTimerParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,7 +51,7 @@ QUrlQuery GetDefaultTimerLoader::query(const GetDefaultTimerParams ¶ms) cons // Optional parameters if (!params.programIdNull()) { - result.addQueryItem("programId", Support::toString(params.programId())); + result.addQueryItem("programId", Support::toString(params.programId())); } return result; diff --git a/core/src/loader/http/getdeviceinfo.cpp b/core/src/loader/http/getdeviceinfo.cpp index fc7bbe5..8972fce 100644 --- a/core/src/loader/http/getdeviceinfo.cpp +++ b/core/src/loader/http/getdeviceinfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDeviceInfoLoader::GetDeviceInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDeviceInfoLoader::path(const GetDeviceInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -47,7 +48,7 @@ QUrlQuery GetDeviceInfoLoader::query(const GetDeviceInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("id", params.jellyfinId()); + result.addQueryItem("id", Support::toString(params.jellyfinId())); // Optional parameters diff --git a/core/src/loader/http/getdeviceoptions.cpp b/core/src/loader/http/getdeviceoptions.cpp index 71b9050..71d5dec 100644 --- a/core/src/loader/http/getdeviceoptions.cpp +++ b/core/src/loader/http/getdeviceoptions.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDeviceOptionsLoader::GetDeviceOptionsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDeviceOptionsLoader::path(const GetDeviceOptionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -47,7 +48,7 @@ QUrlQuery GetDeviceOptionsLoader::query(const GetDeviceOptionsParams ¶ms) co Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("id", params.jellyfinId()); + result.addQueryItem("id", Support::toString(params.jellyfinId())); // Optional parameters diff --git a/core/src/loader/http/getdevices.cpp b/core/src/loader/http/getdevices.cpp index 75bbcef..ac73d6b 100644 --- a/core/src/loader/http/getdevices.cpp +++ b/core/src/loader/http/getdevices.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDevicesLoader::GetDevicesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDevicesLoader::path(const GetDevicesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,10 +51,10 @@ QUrlQuery GetDevicesLoader::query(const GetDevicesParams ¶ms) const { // Optional parameters if (!params.supportsSyncNull()) { - result.addQueryItem("supportsSync", Support::toString(params.supportsSync())); + result.addQueryItem("supportsSync", Support::toString>(params.supportsSync())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getdirectorycontents.cpp b/core/src/loader/http/getdirectorycontents.cpp index c832a7f..23be1d7 100644 --- a/core/src/loader/http/getdirectorycontents.cpp +++ b/core/src/loader/http/getdirectorycontents.cpp @@ -34,6 +34,33 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetDirectoryContentsLoader::GetDirectoryContentsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetDirectoryContentsParams>(apiClient) {} + +QString GetDirectoryContentsLoader::path(const GetDirectoryContentsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Environment/DirectoryContents"); +} + +QUrlQuery GetDirectoryContentsLoader::query(const GetDirectoryContentsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("path", Support::toString(params.path())); + + // Optional parameters + if (!params.includeFilesNull()) { + result.addQueryItem("includeFiles", Support::toString>(params.includeFiles())); + } + if (!params.includeDirectoriesNull()) { + result.addQueryItem("includeDirectories", Support::toString>(params.includeDirectories())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getdisplaypreferences.cpp b/core/src/loader/http/getdisplaypreferences.cpp index 58b670f..3e4cc50 100644 --- a/core/src/loader/http/getdisplaypreferences.cpp +++ b/core/src/loader/http/getdisplaypreferences.cpp @@ -34,21 +34,22 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetDisplayPreferencesLoader::GetDisplayPreferencesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetDisplayPreferencesLoader::path(const GetDisplayPreferencesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/DisplayPreferences/") + Support::toString(params.displayPreferencesId()) ; + return QStringLiteral("/DisplayPreferences/") + Support::toString< QString>(params.displayPreferencesId()) ; } QUrlQuery GetDisplayPreferencesLoader::query(const GetDisplayPreferencesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("userId", params.userId()); - result.addQueryItem("client", params.client()); + result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("client", Support::toString(params.client())); // Optional parameters diff --git a/core/src/loader/http/getdrives.cpp b/core/src/loader/http/getdrives.cpp index d29e77d..be2936a 100644 --- a/core/src/loader/http/getdrives.cpp +++ b/core/src/loader/http/getdrives.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetDrivesLoader::GetDrivesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetDrivesParams>(apiClient) {} + +QString GetDrivesLoader::path(const GetDrivesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Environment/Drives"); +} + +QUrlQuery GetDrivesLoader::query(const GetDrivesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getendpointinfo.cpp b/core/src/loader/http/getendpointinfo.cpp index b9c283a..3188395 100644 --- a/core/src/loader/http/getendpointinfo.cpp +++ b/core/src/loader/http/getendpointinfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetEndpointInfoLoader::GetEndpointInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetEndpointInfoLoader::path(const GetEndpointInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getepisodes.cpp b/core/src/loader/http/getepisodes.cpp index 34cf193..30c4088 100644 --- a/core/src/loader/http/getepisodes.cpp +++ b/core/src/loader/http/getepisodes.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetEpisodesLoader::GetEpisodesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetEpisodesLoader::path(const GetEpisodesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Shows/") + Support::toString(params.seriesId()) + QStringLiteral("/Episodes"); + return QStringLiteral("/Shows/") + Support::toString< QString>(params.seriesId()) + QStringLiteral("/Episodes"); } QUrlQuery GetEpisodesLoader::query(const GetEpisodesParams ¶ms) const { @@ -50,46 +51,46 @@ QUrlQuery GetEpisodesLoader::query(const GetEpisodesParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.seasonNull()) { - result.addQueryItem("season", Support::toString(params.season())); + result.addQueryItem("season", Support::toString>(params.season())); } if (!params.seasonIdNull()) { - result.addQueryItem("seasonId", Support::toString(params.seasonId())); + result.addQueryItem("seasonId", Support::toString(params.seasonId())); } if (!params.isMissingNull()) { - result.addQueryItem("isMissing", Support::toString(params.isMissing())); + result.addQueryItem("isMissing", Support::toString>(params.isMissing())); } if (!params.adjacentToNull()) { - result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); + result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); } if (!params.startItemIdNull()) { - result.addQueryItem("startItemId", Support::toString(params.startItemId())); + result.addQueryItem("startItemId", Support::toString(params.startItemId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } return result; diff --git a/core/src/loader/http/getexternalidinfos.cpp b/core/src/loader/http/getexternalidinfos.cpp index 259bca0..7835ead 100644 --- a/core/src/loader/http/getexternalidinfos.cpp +++ b/core/src/loader/http/getexternalidinfos.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetExternalIdInfosLoader::GetExternalIdInfosLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetExternalIdInfosParams>(apiClient) {} + +QString GetExternalIdInfosLoader::path(const GetExternalIdInfosParams ¶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("/ExternalIdInfos"); +} + +QUrlQuery GetExternalIdInfosLoader::query(const GetExternalIdInfosParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getfallbackfontlist.cpp b/core/src/loader/http/getfallbackfontlist.cpp index 9939d47..4d82d18 100644 --- a/core/src/loader/http/getfallbackfontlist.cpp +++ b/core/src/loader/http/getfallbackfontlist.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetFallbackFontListLoader::GetFallbackFontListLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetFallbackFontListParams>(apiClient) {} + +QString GetFallbackFontListLoader::path(const GetFallbackFontListParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/FallbackFont/Fonts"); +} + +QUrlQuery GetFallbackFontListLoader::query(const GetFallbackFontListParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getfirstuser.cpp b/core/src/loader/http/getfirstuser.cpp index 9de8113..37b40f1 100644 --- a/core/src/loader/http/getfirstuser.cpp +++ b/core/src/loader/http/getfirstuser.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetFirstUserLoader::GetFirstUserLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetFirstUserLoader::path(const GetFirstUserParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getfirstuser_2.cpp b/core/src/loader/http/getfirstuser_2.cpp index e6b0894..ac6ec55 100644 --- a/core/src/loader/http/getfirstuser_2.cpp +++ b/core/src/loader/http/getfirstuser_2.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetFirstUser_2Loader::GetFirstUser_2Loader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetFirstUser_2Loader::path(const GetFirstUser_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/getgeneralimages.cpp b/core/src/loader/http/getgeneralimages.cpp index 9317b97..01c7ce8 100644 --- a/core/src/loader/http/getgeneralimages.cpp +++ b/core/src/loader/http/getgeneralimages.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetGeneralImagesLoader::GetGeneralImagesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetGeneralImagesParams>(apiClient) {} + +QString GetGeneralImagesLoader::path(const GetGeneralImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Images/General"); +} + +QUrlQuery GetGeneralImagesLoader::query(const GetGeneralImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getgenre.cpp b/core/src/loader/http/getgenre.cpp index 949e158..2d68338 100644 --- a/core/src/loader/http/getgenre.cpp +++ b/core/src/loader/http/getgenre.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetGenreLoader::GetGenreLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetGenreLoader::path(const GetGenreParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Genres/") + Support::toString(params.genreName()) ; + return QStringLiteral("/Genres/") + Support::toString< QString>(params.genreName()) ; } QUrlQuery GetGenreLoader::query(const GetGenreParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetGenreLoader::query(const GetGenreParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getgenres.cpp b/core/src/loader/http/getgenres.cpp index d04c57c..d57bf55 100644 --- a/core/src/loader/http/getgenres.cpp +++ b/core/src/loader/http/getgenres.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetGenresLoader::GetGenresLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetGenresLoader::path(const GetGenresParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,52 +51,52 @@ QUrlQuery GetGenresLoader::query(const GetGenresParams ¶ms) const { // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getgroupingoptions.cpp b/core/src/loader/http/getgroupingoptions.cpp index 3b6a97b..8a66557 100644 --- a/core/src/loader/http/getgroupingoptions.cpp +++ b/core/src/loader/http/getgroupingoptions.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetGroupingOptionsLoader::GetGroupingOptionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetGroupingOptionsParams>(apiClient) {} + +QString GetGroupingOptionsLoader::path(const GetGroupingOptionsParams ¶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("/GroupingOptions"); +} + +QUrlQuery GetGroupingOptionsLoader::query(const GetGroupingOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getguideinfo.cpp b/core/src/loader/http/getguideinfo.cpp index fc9fd59..4e7d3ea 100644 --- a/core/src/loader/http/getguideinfo.cpp +++ b/core/src/loader/http/getguideinfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetGuideInfoLoader::GetGuideInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetGuideInfoLoader::path(const GetGuideInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getinstantmixfromalbum.cpp b/core/src/loader/http/getinstantmixfromalbum.cpp index 976de37..4fc2708 100644 --- a/core/src/loader/http/getinstantmixfromalbum.cpp +++ b/core/src/loader/http/getinstantmixfromalbum.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromAlbumLoader::GetInstantMixFromAlbumLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromAlbumLoader::path(const GetInstantMixFromAlbumParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Albums/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/Albums/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromAlbumLoader::query(const GetInstantMixFromAlbumParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromAlbumLoader::query(const GetInstantMixFromAlbumParams // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfromartists.cpp b/core/src/loader/http/getinstantmixfromartists.cpp index 526934c..a03947c 100644 --- a/core/src/loader/http/getinstantmixfromartists.cpp +++ b/core/src/loader/http/getinstantmixfromartists.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromArtistsLoader::GetInstantMixFromArtistsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromArtistsLoader::path(const GetInstantMixFromArtistsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Artists/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/Artists/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromArtistsLoader::query(const GetInstantMixFromArtistsParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromArtistsLoader::query(const GetInstantMixFromArtistsPa // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfromitem.cpp b/core/src/loader/http/getinstantmixfromitem.cpp index 62f36e8..46bfe06 100644 --- a/core/src/loader/http/getinstantmixfromitem.cpp +++ b/core/src/loader/http/getinstantmixfromitem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromItemLoader::GetInstantMixFromItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromItemLoader::path(const GetInstantMixFromItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromItemLoader::query(const GetInstantMixFromItemParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromItemLoader::query(const GetInstantMixFromItemParams & // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfrommusicgenre.cpp b/core/src/loader/http/getinstantmixfrommusicgenre.cpp index 8aed5db..307aa55 100644 --- a/core/src/loader/http/getinstantmixfrommusicgenre.cpp +++ b/core/src/loader/http/getinstantmixfrommusicgenre.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromMusicGenreLoader::GetInstantMixFromMusicGenreLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromMusicGenreLoader::path(const GetInstantMixFromMusicGenreParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/MusicGenres/") + Support::toString(params.name()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/MusicGenres/") + Support::toString< QString>(params.name()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromMusicGenreLoader::query(const GetInstantMixFromMusicGenreParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromMusicGenreLoader::query(const GetInstantMixFromMusicG // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfrommusicgenres.cpp b/core/src/loader/http/getinstantmixfrommusicgenres.cpp index bdde543..663dc06 100644 --- a/core/src/loader/http/getinstantmixfrommusicgenres.cpp +++ b/core/src/loader/http/getinstantmixfrommusicgenres.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromMusicGenresLoader::GetInstantMixFromMusicGenresLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromMusicGenresLoader::path(const GetInstantMixFromMusicGenresParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/MusicGenres/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/MusicGenres/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromMusicGenresLoader::query(const GetInstantMixFromMusicGenresParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromMusicGenresLoader::query(const GetInstantMixFromMusic // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfromplaylist.cpp b/core/src/loader/http/getinstantmixfromplaylist.cpp index 3c506c0..2d72f21 100644 --- a/core/src/loader/http/getinstantmixfromplaylist.cpp +++ b/core/src/loader/http/getinstantmixfromplaylist.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromPlaylistLoader::GetInstantMixFromPlaylistLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromPlaylistLoader::path(const GetInstantMixFromPlaylistParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Playlists/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/Playlists/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromPlaylistLoader::query(const GetInstantMixFromPlaylistParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromPlaylistLoader::query(const GetInstantMixFromPlaylist // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getinstantmixfromsong.cpp b/core/src/loader/http/getinstantmixfromsong.cpp index 0fde839..eaf888a 100644 --- a/core/src/loader/http/getinstantmixfromsong.cpp +++ b/core/src/loader/http/getinstantmixfromsong.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetInstantMixFromSongLoader::GetInstantMixFromSongLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetInstantMixFromSongLoader::path(const GetInstantMixFromSongParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Songs/") + Support::toString(params.jellyfinId()) + QStringLiteral("/InstantMix"); + return QStringLiteral("/Songs/") + Support::toString< QString>(params.jellyfinId()) + QStringLiteral("/InstantMix"); } QUrlQuery GetInstantMixFromSongLoader::query(const GetInstantMixFromSongParams ¶ms) const { @@ -50,25 +51,25 @@ QUrlQuery GetInstantMixFromSongLoader::query(const GetInstantMixFromSongParams & // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getintros.cpp b/core/src/loader/http/getintros.cpp index d3121a9..5412d5a 100644 --- a/core/src/loader/http/getintros.cpp +++ b/core/src/loader/http/getintros.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetIntrosLoader::GetIntrosLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetIntrosLoader::path(const GetIntrosParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/Intros"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Intros"); } QUrlQuery GetIntrosLoader::query(const GetIntrosParams ¶ms) const { diff --git a/core/src/loader/http/getitem.cpp b/core/src/loader/http/getitem.cpp index 06a745a..8f59c28 100644 --- a/core/src/loader/http/getitem.cpp +++ b/core/src/loader/http/getitem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetItemLoader::GetItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetItemLoader::path(const GetItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/") + Support::toString(params.itemId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) ; } QUrlQuery GetItemLoader::query(const GetItemParams ¶ms) const { diff --git a/core/src/loader/http/getitemcounts.cpp b/core/src/loader/http/getitemcounts.cpp index caf7edb..1d953e3 100644 --- a/core/src/loader/http/getitemcounts.cpp +++ b/core/src/loader/http/getitemcounts.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetItemCountsLoader::GetItemCountsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetItemCountsLoader::path(const GetItemCountsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,10 +51,10 @@ QUrlQuery GetItemCountsLoader::query(const GetItemCountsParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } return result; diff --git a/core/src/loader/http/getitemimageinfos.cpp b/core/src/loader/http/getitemimageinfos.cpp index 46c4696..59979b6 100644 --- a/core/src/loader/http/getitemimageinfos.cpp +++ b/core/src/loader/http/getitemimageinfos.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetItemImageInfosLoader::GetItemImageInfosLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetItemImageInfosParams>(apiClient) {} + +QString GetItemImageInfosLoader::path(const GetItemImageInfosParams ¶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"); +} + +QUrlQuery GetItemImageInfosLoader::query(const GetItemImageInfosParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getitems.cpp b/core/src/loader/http/getitems.cpp index 741fa12..e4f76d8 100644 --- a/core/src/loader/http/getitems.cpp +++ b/core/src/loader/http/getitems.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetItemsLoader::GetItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetItemsLoader::path(const GetItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,244 +51,244 @@ QUrlQuery GetItemsLoader::query(const GetItemsParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.maxOfficialRatingNull()) { - result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); + result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); } if (!params.hasThemeSongNull()) { - result.addQueryItem("hasThemeSong", Support::toString(params.hasThemeSong())); + result.addQueryItem("hasThemeSong", Support::toString>(params.hasThemeSong())); } if (!params.hasThemeVideoNull()) { - result.addQueryItem("hasThemeVideo", Support::toString(params.hasThemeVideo())); + result.addQueryItem("hasThemeVideo", Support::toString>(params.hasThemeVideo())); } if (!params.hasSubtitlesNull()) { - result.addQueryItem("hasSubtitles", Support::toString(params.hasSubtitles())); + result.addQueryItem("hasSubtitles", Support::toString>(params.hasSubtitles())); } if (!params.hasSpecialFeatureNull()) { - result.addQueryItem("hasSpecialFeature", Support::toString(params.hasSpecialFeature())); + result.addQueryItem("hasSpecialFeature", Support::toString>(params.hasSpecialFeature())); } if (!params.hasTrailerNull()) { - result.addQueryItem("hasTrailer", Support::toString(params.hasTrailer())); + result.addQueryItem("hasTrailer", Support::toString>(params.hasTrailer())); } if (!params.adjacentToNull()) { - result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); + result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); } if (!params.parentIndexNumberNull()) { - result.addQueryItem("parentIndexNumber", Support::toString(params.parentIndexNumber())); + result.addQueryItem("parentIndexNumber", Support::toString>(params.parentIndexNumber())); } if (!params.hasParentalRatingNull()) { - result.addQueryItem("hasParentalRating", Support::toString(params.hasParentalRating())); + result.addQueryItem("hasParentalRating", Support::toString>(params.hasParentalRating())); } if (!params.isHdNull()) { - result.addQueryItem("isHd", Support::toString(params.isHd())); + result.addQueryItem("isHd", Support::toString>(params.isHd())); } if (!params.is4KNull()) { - result.addQueryItem("is4K", Support::toString(params.is4K())); + result.addQueryItem("is4K", Support::toString>(params.is4K())); } if (!params.locationTypesNull()) { - result.addQueryItem("locationTypes", Support::toString(params.locationTypes())); + result.addQueryItem("locationTypes", Support::toString>(params.locationTypes())); } if (!params.excludeLocationTypesNull()) { - result.addQueryItem("excludeLocationTypes", Support::toString(params.excludeLocationTypes())); + result.addQueryItem("excludeLocationTypes", Support::toString>(params.excludeLocationTypes())); } if (!params.isMissingNull()) { - result.addQueryItem("isMissing", Support::toString(params.isMissing())); + result.addQueryItem("isMissing", Support::toString>(params.isMissing())); } if (!params.isUnairedNull()) { - result.addQueryItem("isUnaired", Support::toString(params.isUnaired())); + result.addQueryItem("isUnaired", Support::toString>(params.isUnaired())); } if (!params.minCommunityRatingNull()) { - result.addQueryItem("minCommunityRating", Support::toString(params.minCommunityRating())); + result.addQueryItem("minCommunityRating", Support::toString>(params.minCommunityRating())); } if (!params.minCriticRatingNull()) { - result.addQueryItem("minCriticRating", Support::toString(params.minCriticRating())); + result.addQueryItem("minCriticRating", Support::toString>(params.minCriticRating())); } if (!params.minPremiereDateNull()) { - result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); + result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); } if (!params.minDateLastSavedNull()) { - result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); + result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); } if (!params.minDateLastSavedForUserNull()) { - result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); + result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); } if (!params.maxPremiereDateNull()) { - result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); + result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); } if (!params.hasOverviewNull()) { - result.addQueryItem("hasOverview", Support::toString(params.hasOverview())); + result.addQueryItem("hasOverview", Support::toString>(params.hasOverview())); } if (!params.hasImdbIdNull()) { - result.addQueryItem("hasImdbId", Support::toString(params.hasImdbId())); + result.addQueryItem("hasImdbId", Support::toString>(params.hasImdbId())); } if (!params.hasTmdbIdNull()) { - result.addQueryItem("hasTmdbId", Support::toString(params.hasTmdbId())); + result.addQueryItem("hasTmdbId", Support::toString>(params.hasTmdbId())); } if (!params.hasTvdbIdNull()) { - result.addQueryItem("hasTvdbId", Support::toString(params.hasTvdbId())); + result.addQueryItem("hasTvdbId", Support::toString>(params.hasTvdbId())); } if (!params.excludeItemIdsNull()) { - result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); + result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.recursiveNull()) { - result.addQueryItem("recursive", Support::toString(params.recursive())); + result.addQueryItem("recursive", Support::toString>(params.recursive())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.imageTypesNull()) { - result.addQueryItem("imageTypes", Support::toString(params.imageTypes())); + result.addQueryItem("imageTypes", Support::toString>(params.imageTypes())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.isPlayedNull()) { - result.addQueryItem("isPlayed", Support::toString(params.isPlayed())); + result.addQueryItem("isPlayed", Support::toString>(params.isPlayed())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.officialRatingsNull()) { - result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); + result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); } if (!params.tagsNull()) { - result.addQueryItem("tags", Support::toString(params.tags())); + result.addQueryItem("tags", Support::toString(params.tags())); } if (!params.yearsNull()) { - result.addQueryItem("years", Support::toString(params.years())); + result.addQueryItem("years", Support::toString>(params.years())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.personNull()) { - result.addQueryItem("person", Support::toString(params.person())); + result.addQueryItem("person", Support::toString(params.person())); } if (!params.personIdsNull()) { - result.addQueryItem("personIds", Support::toString(params.personIds())); + result.addQueryItem("personIds", Support::toString(params.personIds())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.studiosNull()) { - result.addQueryItem("studios", Support::toString(params.studios())); + result.addQueryItem("studios", Support::toString(params.studios())); } if (!params.artistsNull()) { - result.addQueryItem("artists", Support::toString(params.artists())); + result.addQueryItem("artists", Support::toString(params.artists())); } if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.artistIdsNull()) { - result.addQueryItem("artistIds", Support::toString(params.artistIds())); + result.addQueryItem("artistIds", Support::toString(params.artistIds())); } if (!params.albumArtistIdsNull()) { - result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); + result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); } if (!params.contributingArtistIdsNull()) { - result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); + result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); } if (!params.albumsNull()) { - result.addQueryItem("albums", Support::toString(params.albums())); + result.addQueryItem("albums", Support::toString(params.albums())); } if (!params.albumIdsNull()) { - result.addQueryItem("albumIds", Support::toString(params.albumIds())); + result.addQueryItem("albumIds", Support::toString(params.albumIds())); } if (!params.idsNull()) { - result.addQueryItem("ids", Support::toString(params.ids())); + result.addQueryItem("ids", Support::toString(params.ids())); } if (!params.videoTypesNull()) { - result.addQueryItem("videoTypes", Support::toString(params.videoTypes())); + result.addQueryItem("videoTypes", Support::toString>(params.videoTypes())); } if (!params.minOfficialRatingNull()) { - result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); + result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); } if (!params.isLockedNull()) { - result.addQueryItem("isLocked", Support::toString(params.isLocked())); + result.addQueryItem("isLocked", Support::toString>(params.isLocked())); } if (!params.isPlaceHolderNull()) { - result.addQueryItem("isPlaceHolder", Support::toString(params.isPlaceHolder())); + result.addQueryItem("isPlaceHolder", Support::toString>(params.isPlaceHolder())); } if (!params.hasOfficialRatingNull()) { - result.addQueryItem("hasOfficialRating", Support::toString(params.hasOfficialRating())); + result.addQueryItem("hasOfficialRating", Support::toString>(params.hasOfficialRating())); } if (!params.collapseBoxSetItemsNull()) { - result.addQueryItem("collapseBoxSetItems", Support::toString(params.collapseBoxSetItems())); + result.addQueryItem("collapseBoxSetItems", Support::toString>(params.collapseBoxSetItems())); } if (!params.minWidthNull()) { - result.addQueryItem("minWidth", Support::toString(params.minWidth())); + result.addQueryItem("minWidth", Support::toString>(params.minWidth())); } if (!params.minHeightNull()) { - result.addQueryItem("minHeight", Support::toString(params.minHeight())); + result.addQueryItem("minHeight", Support::toString>(params.minHeight())); } if (!params.maxWidthNull()) { - result.addQueryItem("maxWidth", Support::toString(params.maxWidth())); + result.addQueryItem("maxWidth", Support::toString>(params.maxWidth())); } if (!params.maxHeightNull()) { - result.addQueryItem("maxHeight", Support::toString(params.maxHeight())); + result.addQueryItem("maxHeight", Support::toString>(params.maxHeight())); } if (!params.is3DNull()) { - result.addQueryItem("is3D", Support::toString(params.is3D())); + result.addQueryItem("is3D", Support::toString>(params.is3D())); } if (!params.seriesStatusNull()) { - result.addQueryItem("seriesStatus", Support::toString(params.seriesStatus())); + result.addQueryItem("seriesStatus", Support::toString>(params.seriesStatus())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.studioIdsNull()) { - result.addQueryItem("studioIds", Support::toString(params.studioIds())); + result.addQueryItem("studioIds", Support::toString(params.studioIds())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/getitemsbyuserid.cpp b/core/src/loader/http/getitemsbyuserid.cpp index 0947baf..a8f09a3 100644 --- a/core/src/loader/http/getitemsbyuserid.cpp +++ b/core/src/loader/http/getitemsbyuserid.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetItemsByUserIdLoader::GetItemsByUserIdLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetItemsByUserIdLoader::path(const GetItemsByUserIdParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items"); } QUrlQuery GetItemsByUserIdLoader::query(const GetItemsByUserIdParams ¶ms) const { @@ -50,241 +51,241 @@ QUrlQuery GetItemsByUserIdLoader::query(const GetItemsByUserIdParams ¶ms) co // Optional parameters if (!params.maxOfficialRatingNull()) { - result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); + result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); } if (!params.hasThemeSongNull()) { - result.addQueryItem("hasThemeSong", Support::toString(params.hasThemeSong())); + result.addQueryItem("hasThemeSong", Support::toString>(params.hasThemeSong())); } if (!params.hasThemeVideoNull()) { - result.addQueryItem("hasThemeVideo", Support::toString(params.hasThemeVideo())); + result.addQueryItem("hasThemeVideo", Support::toString>(params.hasThemeVideo())); } if (!params.hasSubtitlesNull()) { - result.addQueryItem("hasSubtitles", Support::toString(params.hasSubtitles())); + result.addQueryItem("hasSubtitles", Support::toString>(params.hasSubtitles())); } if (!params.hasSpecialFeatureNull()) { - result.addQueryItem("hasSpecialFeature", Support::toString(params.hasSpecialFeature())); + result.addQueryItem("hasSpecialFeature", Support::toString>(params.hasSpecialFeature())); } if (!params.hasTrailerNull()) { - result.addQueryItem("hasTrailer", Support::toString(params.hasTrailer())); + result.addQueryItem("hasTrailer", Support::toString>(params.hasTrailer())); } if (!params.adjacentToNull()) { - result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); + result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); } if (!params.parentIndexNumberNull()) { - result.addQueryItem("parentIndexNumber", Support::toString(params.parentIndexNumber())); + result.addQueryItem("parentIndexNumber", Support::toString>(params.parentIndexNumber())); } if (!params.hasParentalRatingNull()) { - result.addQueryItem("hasParentalRating", Support::toString(params.hasParentalRating())); + result.addQueryItem("hasParentalRating", Support::toString>(params.hasParentalRating())); } if (!params.isHdNull()) { - result.addQueryItem("isHd", Support::toString(params.isHd())); + result.addQueryItem("isHd", Support::toString>(params.isHd())); } if (!params.is4KNull()) { - result.addQueryItem("is4K", Support::toString(params.is4K())); + result.addQueryItem("is4K", Support::toString>(params.is4K())); } if (!params.locationTypesNull()) { - result.addQueryItem("locationTypes", Support::toString(params.locationTypes())); + result.addQueryItem("locationTypes", Support::toString>(params.locationTypes())); } if (!params.excludeLocationTypesNull()) { - result.addQueryItem("excludeLocationTypes", Support::toString(params.excludeLocationTypes())); + result.addQueryItem("excludeLocationTypes", Support::toString>(params.excludeLocationTypes())); } if (!params.isMissingNull()) { - result.addQueryItem("isMissing", Support::toString(params.isMissing())); + result.addQueryItem("isMissing", Support::toString>(params.isMissing())); } if (!params.isUnairedNull()) { - result.addQueryItem("isUnaired", Support::toString(params.isUnaired())); + result.addQueryItem("isUnaired", Support::toString>(params.isUnaired())); } if (!params.minCommunityRatingNull()) { - result.addQueryItem("minCommunityRating", Support::toString(params.minCommunityRating())); + result.addQueryItem("minCommunityRating", Support::toString>(params.minCommunityRating())); } if (!params.minCriticRatingNull()) { - result.addQueryItem("minCriticRating", Support::toString(params.minCriticRating())); + result.addQueryItem("minCriticRating", Support::toString>(params.minCriticRating())); } if (!params.minPremiereDateNull()) { - result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); + result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); } if (!params.minDateLastSavedNull()) { - result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); + result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); } if (!params.minDateLastSavedForUserNull()) { - result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); + result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); } if (!params.maxPremiereDateNull()) { - result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); + result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); } if (!params.hasOverviewNull()) { - result.addQueryItem("hasOverview", Support::toString(params.hasOverview())); + result.addQueryItem("hasOverview", Support::toString>(params.hasOverview())); } if (!params.hasImdbIdNull()) { - result.addQueryItem("hasImdbId", Support::toString(params.hasImdbId())); + result.addQueryItem("hasImdbId", Support::toString>(params.hasImdbId())); } if (!params.hasTmdbIdNull()) { - result.addQueryItem("hasTmdbId", Support::toString(params.hasTmdbId())); + result.addQueryItem("hasTmdbId", Support::toString>(params.hasTmdbId())); } if (!params.hasTvdbIdNull()) { - result.addQueryItem("hasTvdbId", Support::toString(params.hasTvdbId())); + result.addQueryItem("hasTvdbId", Support::toString>(params.hasTvdbId())); } if (!params.excludeItemIdsNull()) { - result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); + result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.recursiveNull()) { - result.addQueryItem("recursive", Support::toString(params.recursive())); + result.addQueryItem("recursive", Support::toString>(params.recursive())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.imageTypesNull()) { - result.addQueryItem("imageTypes", Support::toString(params.imageTypes())); + result.addQueryItem("imageTypes", Support::toString>(params.imageTypes())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.isPlayedNull()) { - result.addQueryItem("isPlayed", Support::toString(params.isPlayed())); + result.addQueryItem("isPlayed", Support::toString>(params.isPlayed())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.officialRatingsNull()) { - result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); + result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); } if (!params.tagsNull()) { - result.addQueryItem("tags", Support::toString(params.tags())); + result.addQueryItem("tags", Support::toString(params.tags())); } if (!params.yearsNull()) { - result.addQueryItem("years", Support::toString(params.years())); + result.addQueryItem("years", Support::toString>(params.years())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.personNull()) { - result.addQueryItem("person", Support::toString(params.person())); + result.addQueryItem("person", Support::toString(params.person())); } if (!params.personIdsNull()) { - result.addQueryItem("personIds", Support::toString(params.personIds())); + result.addQueryItem("personIds", Support::toString(params.personIds())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.studiosNull()) { - result.addQueryItem("studios", Support::toString(params.studios())); + result.addQueryItem("studios", Support::toString(params.studios())); } if (!params.artistsNull()) { - result.addQueryItem("artists", Support::toString(params.artists())); + result.addQueryItem("artists", Support::toString(params.artists())); } if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.artistIdsNull()) { - result.addQueryItem("artistIds", Support::toString(params.artistIds())); + result.addQueryItem("artistIds", Support::toString(params.artistIds())); } if (!params.albumArtistIdsNull()) { - result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); + result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); } if (!params.contributingArtistIdsNull()) { - result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); + result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); } if (!params.albumsNull()) { - result.addQueryItem("albums", Support::toString(params.albums())); + result.addQueryItem("albums", Support::toString(params.albums())); } if (!params.albumIdsNull()) { - result.addQueryItem("albumIds", Support::toString(params.albumIds())); + result.addQueryItem("albumIds", Support::toString(params.albumIds())); } if (!params.idsNull()) { - result.addQueryItem("ids", Support::toString(params.ids())); + result.addQueryItem("ids", Support::toString(params.ids())); } if (!params.videoTypesNull()) { - result.addQueryItem("videoTypes", Support::toString(params.videoTypes())); + result.addQueryItem("videoTypes", Support::toString>(params.videoTypes())); } if (!params.minOfficialRatingNull()) { - result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); + result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); } if (!params.isLockedNull()) { - result.addQueryItem("isLocked", Support::toString(params.isLocked())); + result.addQueryItem("isLocked", Support::toString>(params.isLocked())); } if (!params.isPlaceHolderNull()) { - result.addQueryItem("isPlaceHolder", Support::toString(params.isPlaceHolder())); + result.addQueryItem("isPlaceHolder", Support::toString>(params.isPlaceHolder())); } if (!params.hasOfficialRatingNull()) { - result.addQueryItem("hasOfficialRating", Support::toString(params.hasOfficialRating())); + result.addQueryItem("hasOfficialRating", Support::toString>(params.hasOfficialRating())); } if (!params.collapseBoxSetItemsNull()) { - result.addQueryItem("collapseBoxSetItems", Support::toString(params.collapseBoxSetItems())); + result.addQueryItem("collapseBoxSetItems", Support::toString>(params.collapseBoxSetItems())); } if (!params.minWidthNull()) { - result.addQueryItem("minWidth", Support::toString(params.minWidth())); + result.addQueryItem("minWidth", Support::toString>(params.minWidth())); } if (!params.minHeightNull()) { - result.addQueryItem("minHeight", Support::toString(params.minHeight())); + result.addQueryItem("minHeight", Support::toString>(params.minHeight())); } if (!params.maxWidthNull()) { - result.addQueryItem("maxWidth", Support::toString(params.maxWidth())); + result.addQueryItem("maxWidth", Support::toString>(params.maxWidth())); } if (!params.maxHeightNull()) { - result.addQueryItem("maxHeight", Support::toString(params.maxHeight())); + result.addQueryItem("maxHeight", Support::toString>(params.maxHeight())); } if (!params.is3DNull()) { - result.addQueryItem("is3D", Support::toString(params.is3D())); + result.addQueryItem("is3D", Support::toString>(params.is3D())); } if (!params.seriesStatusNull()) { - result.addQueryItem("seriesStatus", Support::toString(params.seriesStatus())); + result.addQueryItem("seriesStatus", Support::toString>(params.seriesStatus())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.studioIdsNull()) { - result.addQueryItem("studioIds", Support::toString(params.studioIds())); + result.addQueryItem("studioIds", Support::toString(params.studioIds())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/getkeys.cpp b/core/src/loader/http/getkeys.cpp index 0da37dd..005452f 100644 --- a/core/src/loader/http/getkeys.cpp +++ b/core/src/loader/http/getkeys.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetKeysLoader::GetKeysLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetKeysLoader::path(const GetKeysParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getlatestchannelitems.cpp b/core/src/loader/http/getlatestchannelitems.cpp index 0657fde..6e56fd2 100644 --- a/core/src/loader/http/getlatestchannelitems.cpp +++ b/core/src/loader/http/getlatestchannelitems.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLatestChannelItemsLoader::GetLatestChannelItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLatestChannelItemsLoader::path(const GetLatestChannelItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,22 +51,22 @@ QUrlQuery GetLatestChannelItemsLoader::query(const GetLatestChannelItemsParams & // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.channelIdsNull()) { - result.addQueryItem("channelIds", Support::toString(params.channelIds())); + result.addQueryItem("channelIds", Support::toString(params.channelIds())); } return result; diff --git a/core/src/loader/http/getlatestmedia.cpp b/core/src/loader/http/getlatestmedia.cpp index 2992b0c..3688df5 100644 --- a/core/src/loader/http/getlatestmedia.cpp +++ b/core/src/loader/http/getlatestmedia.cpp @@ -34,6 +34,56 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetLatestMediaLoader::GetLatestMediaLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetLatestMediaParams>(apiClient) {} + +QString GetLatestMediaLoader::path(const GetLatestMediaParams ¶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("/Items/Latest"); +} + +QUrlQuery GetLatestMediaLoader::query(const GetLatestMediaParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.parentIdNull()) { + result.addQueryItem("parentId", Support::toString(params.parentId())); + } + if (!params.fieldsNull()) { + result.addQueryItem("fields", Support::toString>(params.fields())); + } + if (!params.includeItemTypesNull()) { + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + } + if (!params.isPlayedNull()) { + result.addQueryItem("isPlayed", Support::toString>(params.isPlayed())); + } + if (!params.enableImagesNull()) { + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); + } + if (!params.imageTypeLimitNull()) { + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); + } + if (!params.enableImageTypesNull()) { + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); + } + if (!params.enableUserDataNull()) { + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); + } + if (!params.limitNull()) { + result.addQueryItem("limit", Support::toString>(params.limit())); + } + if (!params.groupItemsNull()) { + result.addQueryItem("groupItems", Support::toString>(params.groupItems())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getlibraryoptionsinfo.cpp b/core/src/loader/http/getlibraryoptionsinfo.cpp index 8338779..cfe81f8 100644 --- a/core/src/loader/http/getlibraryoptionsinfo.cpp +++ b/core/src/loader/http/getlibraryoptionsinfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLibraryOptionsInfoLoader::GetLibraryOptionsInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLibraryOptionsInfoLoader::path(const GetLibraryOptionsInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,10 +51,10 @@ QUrlQuery GetLibraryOptionsInfoLoader::query(const GetLibraryOptionsInfoParams & // Optional parameters if (!params.libraryContentTypeNull()) { - result.addQueryItem("libraryContentType", Support::toString(params.libraryContentType())); + result.addQueryItem("libraryContentType", Support::toString(params.libraryContentType())); } if (!params.isNewLibraryNull()) { - result.addQueryItem("isNewLibrary", Support::toString(params.isNewLibrary())); + result.addQueryItem("isNewLibrary", Support::toString>(params.isNewLibrary())); } return result; diff --git a/core/src/loader/http/getlineups.cpp b/core/src/loader/http/getlineups.cpp index b88f373..5712720 100644 --- a/core/src/loader/http/getlineups.cpp +++ b/core/src/loader/http/getlineups.cpp @@ -34,6 +34,38 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetLineupsLoader::GetLineupsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetLineupsParams>(apiClient) {} + +QString GetLineupsLoader::path(const GetLineupsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/ListingProviders/Lineups"); +} + +QUrlQuery GetLineupsLoader::query(const GetLineupsParams ¶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.typeNull()) { + result.addQueryItem("type", Support::toString(params.type())); + } + if (!params.locationNull()) { + result.addQueryItem("location", Support::toString(params.location())); + } + if (!params.countryNull()) { + result.addQueryItem("country", Support::toString(params.country())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getlivetvchannels.cpp b/core/src/loader/http/getlivetvchannels.cpp index d7e3d7a..f62a4e9 100644 --- a/core/src/loader/http/getlivetvchannels.cpp +++ b/core/src/loader/http/getlivetvchannels.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLiveTvChannelsLoader::GetLiveTvChannelsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLiveTvChannelsLoader::path(const GetLiveTvChannelsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,67 +51,67 @@ QUrlQuery GetLiveTvChannelsLoader::query(const GetLiveTvChannelsParams ¶ms) // Optional parameters if (!params.typeNull()) { - result.addQueryItem("type", Support::toString(params.type())); + result.addQueryItem("type", Support::toString(params.type())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.isLikedNull()) { - result.addQueryItem("isLiked", Support::toString(params.isLiked())); + result.addQueryItem("isLiked", Support::toString>(params.isLiked())); } if (!params.isDislikedNull()) { - result.addQueryItem("isDisliked", Support::toString(params.isDisliked())); + result.addQueryItem("isDisliked", Support::toString>(params.isDisliked())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.enableFavoriteSortingNull()) { - result.addQueryItem("enableFavoriteSorting", Support::toString(params.enableFavoriteSorting())); + result.addQueryItem("enableFavoriteSorting", Support::toString>(params.enableFavoriteSorting())); } if (!params.addCurrentProgramNull()) { - result.addQueryItem("addCurrentProgram", Support::toString(params.addCurrentProgram())); + result.addQueryItem("addCurrentProgram", Support::toString>(params.addCurrentProgram())); } return result; diff --git a/core/src/loader/http/getlivetvinfo.cpp b/core/src/loader/http/getlivetvinfo.cpp index 8dac306..49036f9 100644 --- a/core/src/loader/http/getlivetvinfo.cpp +++ b/core/src/loader/http/getlivetvinfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLiveTvInfoLoader::GetLiveTvInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLiveTvInfoLoader::path(const GetLiveTvInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getlivetvprograms.cpp b/core/src/loader/http/getlivetvprograms.cpp index cf78776..960123f 100644 --- a/core/src/loader/http/getlivetvprograms.cpp +++ b/core/src/loader/http/getlivetvprograms.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLiveTvProgramsLoader::GetLiveTvProgramsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLiveTvProgramsLoader::path(const GetLiveTvProgramsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,85 +51,85 @@ QUrlQuery GetLiveTvProgramsLoader::query(const GetLiveTvProgramsParams ¶ms) // Optional parameters if (!params.channelIdsNull()) { - result.addQueryItem("channelIds", Support::toString(params.channelIds())); + result.addQueryItem("channelIds", Support::toString(params.channelIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.minStartDateNull()) { - result.addQueryItem("minStartDate", Support::toString(params.minStartDate())); + result.addQueryItem("minStartDate", Support::toString(params.minStartDate())); } if (!params.hasAiredNull()) { - result.addQueryItem("hasAired", Support::toString(params.hasAired())); + result.addQueryItem("hasAired", Support::toString>(params.hasAired())); } if (!params.isAiringNull()) { - result.addQueryItem("isAiring", Support::toString(params.isAiring())); + result.addQueryItem("isAiring", Support::toString>(params.isAiring())); } if (!params.maxStartDateNull()) { - result.addQueryItem("maxStartDate", Support::toString(params.maxStartDate())); + result.addQueryItem("maxStartDate", Support::toString(params.maxStartDate())); } if (!params.minEndDateNull()) { - result.addQueryItem("minEndDate", Support::toString(params.minEndDate())); + result.addQueryItem("minEndDate", Support::toString(params.minEndDate())); } if (!params.maxEndDateNull()) { - result.addQueryItem("maxEndDate", Support::toString(params.maxEndDate())); + result.addQueryItem("maxEndDate", Support::toString(params.maxEndDate())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.seriesTimerIdNull()) { - result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); + result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); } if (!params.librarySeriesIdNull()) { - result.addQueryItem("librarySeriesId", Support::toString(params.librarySeriesId())); + result.addQueryItem("librarySeriesId", Support::toString(params.librarySeriesId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getlocalizationoptions.cpp b/core/src/loader/http/getlocalizationoptions.cpp index 40444dd..1b74a2e 100644 --- a/core/src/loader/http/getlocalizationoptions.cpp +++ b/core/src/loader/http/getlocalizationoptions.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetLocalizationOptionsLoader::GetLocalizationOptionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetLocalizationOptionsParams>(apiClient) {} + +QString GetLocalizationOptionsLoader::path(const GetLocalizationOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Localization/Options"); +} + +QUrlQuery GetLocalizationOptionsLoader::query(const GetLocalizationOptionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getlocaltrailers.cpp b/core/src/loader/http/getlocaltrailers.cpp index a24f715..1c3a078 100644 --- a/core/src/loader/http/getlocaltrailers.cpp +++ b/core/src/loader/http/getlocaltrailers.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetLocalTrailersLoader::GetLocalTrailersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetLocalTrailersParams>(apiClient) {} + +QString GetLocalTrailersLoader::path(const GetLocalTrailersParams ¶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("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/LocalTrailers"); +} + +QUrlQuery GetLocalTrailersLoader::query(const GetLocalTrailersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getlogentries.cpp b/core/src/loader/http/getlogentries.cpp index a20d174..298219c 100644 --- a/core/src/loader/http/getlogentries.cpp +++ b/core/src/loader/http/getlogentries.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetLogEntriesLoader::GetLogEntriesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetLogEntriesLoader::path(const GetLogEntriesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,16 +51,16 @@ QUrlQuery GetLogEntriesLoader::query(const GetLogEntriesParams ¶ms) const { // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.minDateNull()) { - result.addQueryItem("minDate", Support::toString(params.minDate())); + result.addQueryItem("minDate", Support::toString(params.minDate())); } if (!params.hasUserIdNull()) { - result.addQueryItem("hasUserId", Support::toString(params.hasUserId())); + result.addQueryItem("hasUserId", Support::toString>(params.hasUserId())); } return result; diff --git a/core/src/loader/http/getmediafolders.cpp b/core/src/loader/http/getmediafolders.cpp index 46f31f9..7613f32 100644 --- a/core/src/loader/http/getmediafolders.cpp +++ b/core/src/loader/http/getmediafolders.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetMediaFoldersLoader::GetMediaFoldersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetMediaFoldersLoader::path(const GetMediaFoldersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,7 +51,7 @@ QUrlQuery GetMediaFoldersLoader::query(const GetMediaFoldersParams ¶ms) cons // Optional parameters if (!params.isHiddenNull()) { - result.addQueryItem("isHidden", Support::toString(params.isHidden())); + result.addQueryItem("isHidden", Support::toString>(params.isHidden())); } return result; diff --git a/core/src/loader/http/getmediainfoimages.cpp b/core/src/loader/http/getmediainfoimages.cpp index bced63d..58f25e9 100644 --- a/core/src/loader/http/getmediainfoimages.cpp +++ b/core/src/loader/http/getmediainfoimages.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMediaInfoImagesLoader::GetMediaInfoImagesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMediaInfoImagesParams>(apiClient) {} + +QString GetMediaInfoImagesLoader::path(const GetMediaInfoImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Images/MediaInfo"); +} + +QUrlQuery GetMediaInfoImagesLoader::query(const GetMediaInfoImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getmetadataeditorinfo.cpp b/core/src/loader/http/getmetadataeditorinfo.cpp index 6b37f7a..2617ab2 100644 --- a/core/src/loader/http/getmetadataeditorinfo.cpp +++ b/core/src/loader/http/getmetadataeditorinfo.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetMetadataEditorInfoLoader::GetMetadataEditorInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetMetadataEditorInfoLoader::path(const GetMetadataEditorInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/MetadataEditor"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/MetadataEditor"); } QUrlQuery GetMetadataEditorInfoLoader::query(const GetMetadataEditorInfoParams ¶ms) const { diff --git a/core/src/loader/http/getmovierecommendations.cpp b/core/src/loader/http/getmovierecommendations.cpp index 4f7571e..16431a7 100644 --- a/core/src/loader/http/getmovierecommendations.cpp +++ b/core/src/loader/http/getmovierecommendations.cpp @@ -34,6 +34,41 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMovieRecommendationsLoader::GetMovieRecommendationsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMovieRecommendationsParams>(apiClient) {} + +QString GetMovieRecommendationsLoader::path(const GetMovieRecommendationsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Movies/Recommendations"); +} + +QUrlQuery GetMovieRecommendationsLoader::query(const GetMovieRecommendationsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.userIdNull()) { + result.addQueryItem("userId", Support::toString(params.userId())); + } + if (!params.parentIdNull()) { + result.addQueryItem("parentId", Support::toString(params.parentId())); + } + if (!params.fieldsNull()) { + result.addQueryItem("fields", Support::toString>(params.fields())); + } + if (!params.categoryLimitNull()) { + result.addQueryItem("categoryLimit", Support::toString>(params.categoryLimit())); + } + if (!params.itemLimitNull()) { + result.addQueryItem("itemLimit", Support::toString>(params.itemLimit())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getmovieremotesearchresults.cpp b/core/src/loader/http/getmovieremotesearchresults.cpp index 46623f9..8755eab 100644 --- a/core/src/loader/http/getmovieremotesearchresults.cpp +++ b/core/src/loader/http/getmovieremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMovieRemoteSearchResultsLoader::GetMovieRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMovieRemoteSearchResultsParams>(apiClient) {} + +QString GetMovieRemoteSearchResultsLoader::path(const GetMovieRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Movie"); +} + +QUrlQuery GetMovieRemoteSearchResultsLoader::query(const GetMovieRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getmusicalbumremotesearchresults.cpp b/core/src/loader/http/getmusicalbumremotesearchresults.cpp index ca1fe01..14b0fde 100644 --- a/core/src/loader/http/getmusicalbumremotesearchresults.cpp +++ b/core/src/loader/http/getmusicalbumremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMusicAlbumRemoteSearchResultsLoader::GetMusicAlbumRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMusicAlbumRemoteSearchResultsParams>(apiClient) {} + +QString GetMusicAlbumRemoteSearchResultsLoader::path(const GetMusicAlbumRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/MusicAlbum"); +} + +QUrlQuery GetMusicAlbumRemoteSearchResultsLoader::query(const GetMusicAlbumRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getmusicartistremotesearchresults.cpp b/core/src/loader/http/getmusicartistremotesearchresults.cpp index 162f4d1..63482b2 100644 --- a/core/src/loader/http/getmusicartistremotesearchresults.cpp +++ b/core/src/loader/http/getmusicartistremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMusicArtistRemoteSearchResultsLoader::GetMusicArtistRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMusicArtistRemoteSearchResultsParams>(apiClient) {} + +QString GetMusicArtistRemoteSearchResultsLoader::path(const GetMusicArtistRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/MusicArtist"); +} + +QUrlQuery GetMusicArtistRemoteSearchResultsLoader::query(const GetMusicArtistRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getmusicgenre.cpp b/core/src/loader/http/getmusicgenre.cpp index c478f7e..95af671 100644 --- a/core/src/loader/http/getmusicgenre.cpp +++ b/core/src/loader/http/getmusicgenre.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetMusicGenreLoader::GetMusicGenreLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetMusicGenreLoader::path(const GetMusicGenreParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/MusicGenres/") + Support::toString(params.genreName()) ; + return QStringLiteral("/MusicGenres/") + Support::toString< QString>(params.genreName()) ; } QUrlQuery GetMusicGenreLoader::query(const GetMusicGenreParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetMusicGenreLoader::query(const GetMusicGenreParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getmusicgenres.cpp b/core/src/loader/http/getmusicgenres.cpp index 76348a4..c3084bf 100644 --- a/core/src/loader/http/getmusicgenres.cpp +++ b/core/src/loader/http/getmusicgenres.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetMusicGenresLoader::GetMusicGenresLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetMusicGenresLoader::path(const GetMusicGenresParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,52 +51,52 @@ QUrlQuery GetMusicGenresLoader::query(const GetMusicGenresParams ¶ms) const // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getmusicvideoremotesearchresults.cpp b/core/src/loader/http/getmusicvideoremotesearchresults.cpp index a62c34d..cb092ee 100644 --- a/core/src/loader/http/getmusicvideoremotesearchresults.cpp +++ b/core/src/loader/http/getmusicvideoremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetMusicVideoRemoteSearchResultsLoader::GetMusicVideoRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetMusicVideoRemoteSearchResultsParams>(apiClient) {} + +QString GetMusicVideoRemoteSearchResultsLoader::path(const GetMusicVideoRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/MusicVideo"); +} + +QUrlQuery GetMusicVideoRemoteSearchResultsLoader::query(const GetMusicVideoRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getnamedconfiguration.cpp b/core/src/loader/http/getnamedconfiguration.cpp index b925d6a..d8ee6f6 100644 --- a/core/src/loader/http/getnamedconfiguration.cpp +++ b/core/src/loader/http/getnamedconfiguration.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetNamedConfigurationLoader::GetNamedConfigurationLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetNamedConfigurationLoader::path(const GetNamedConfigurationParams ¶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 GetNamedConfigurationLoader::query(const GetNamedConfigurationParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getnetworkshares.cpp b/core/src/loader/http/getnetworkshares.cpp index 36b77d4..da5214a 100644 --- a/core/src/loader/http/getnetworkshares.cpp +++ b/core/src/loader/http/getnetworkshares.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetNetworkSharesLoader::GetNetworkSharesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetNetworkSharesParams>(apiClient) {} + +QString GetNetworkSharesLoader::path(const GetNetworkSharesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Environment/NetworkShares"); +} + +QUrlQuery GetNetworkSharesLoader::query(const GetNetworkSharesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getnextup.cpp b/core/src/loader/http/getnextup.cpp index 26f1996..12bbc40 100644 --- a/core/src/loader/http/getnextup.cpp +++ b/core/src/loader/http/getnextup.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetNextUpLoader::GetNextUpLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetNextUpLoader::path(const GetNextUpParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,40 +51,40 @@ QUrlQuery GetNextUpLoader::query(const GetNextUpParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.seriesIdNull()) { - result.addQueryItem("seriesId", Support::toString(params.seriesId())); + result.addQueryItem("seriesId", Support::toString(params.seriesId())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.enableImgesNull()) { - result.addQueryItem("enableImges", Support::toString(params.enableImges())); + result.addQueryItem("enableImges", Support::toString>(params.enableImges())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } if (!params.disableFirstEpisodeNull()) { - result.addQueryItem("disableFirstEpisode", Support::toString(params.disableFirstEpisode())); + result.addQueryItem("disableFirstEpisode", Support::toString>(params.disableFirstEpisode())); } return result; diff --git a/core/src/loader/http/getnotifications.cpp b/core/src/loader/http/getnotifications.cpp index 1d72952..2ea928d 100644 --- a/core/src/loader/http/getnotifications.cpp +++ b/core/src/loader/http/getnotifications.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetNotificationsLoader::GetNotificationsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetNotificationsLoader::path(const GetNotificationsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Notifications/") + Support::toString(params.userId()) ; + return QStringLiteral("/Notifications/") + Support::toString< QString>(params.userId()) ; } QUrlQuery GetNotificationsLoader::query(const GetNotificationsParams ¶ms) const { diff --git a/core/src/loader/http/getnotificationservices.cpp b/core/src/loader/http/getnotificationservices.cpp index 245b213..848756d 100644 --- a/core/src/loader/http/getnotificationservices.cpp +++ b/core/src/loader/http/getnotificationservices.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetNotificationServicesLoader::GetNotificationServicesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetNotificationServicesParams>(apiClient) {} + +QString GetNotificationServicesLoader::path(const GetNotificationServicesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Notifications/Services"); +} + +QUrlQuery GetNotificationServicesLoader::query(const GetNotificationServicesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getnotificationssummary.cpp b/core/src/loader/http/getnotificationssummary.cpp index 4765847..bec4bc0 100644 --- a/core/src/loader/http/getnotificationssummary.cpp +++ b/core/src/loader/http/getnotificationssummary.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetNotificationsSummaryLoader::GetNotificationsSummaryLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetNotificationsSummaryLoader::path(const GetNotificationsSummaryParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Notifications/") + Support::toString(params.userId()) + QStringLiteral("/Summary"); + return QStringLiteral("/Notifications/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Summary"); } QUrlQuery GetNotificationsSummaryLoader::query(const GetNotificationsSummaryParams ¶ms) const { diff --git a/core/src/loader/http/getnotificationtypes.cpp b/core/src/loader/http/getnotificationtypes.cpp index 3474a09..933489a 100644 --- a/core/src/loader/http/getnotificationtypes.cpp +++ b/core/src/loader/http/getnotificationtypes.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetNotificationTypesLoader::GetNotificationTypesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetNotificationTypesParams>(apiClient) {} + +QString GetNotificationTypesLoader::path(const GetNotificationTypesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Notifications/Types"); +} + +QUrlQuery GetNotificationTypesLoader::query(const GetNotificationTypesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getpackageinfo.cpp b/core/src/loader/http/getpackageinfo.cpp index 5baa3ae..91c4bee 100644 --- a/core/src/loader/http/getpackageinfo.cpp +++ b/core/src/loader/http/getpackageinfo.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPackageInfoLoader::GetPackageInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPackageInfoLoader::path(const GetPackageInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Packages/") + Support::toString(params.name()) ; + return QStringLiteral("/Packages/") + Support::toString< QString>(params.name()) ; } QUrlQuery GetPackageInfoLoader::query(const GetPackageInfoParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetPackageInfoLoader::query(const GetPackageInfoParams ¶ms) const // Optional parameters if (!params.assemblyGuidNull()) { - result.addQueryItem("assemblyGuid", Support::toString(params.assemblyGuid())); + result.addQueryItem("assemblyGuid", Support::toString(params.assemblyGuid())); } return result; diff --git a/core/src/loader/http/getpackages.cpp b/core/src/loader/http/getpackages.cpp index 0360698..d9725e7 100644 --- a/core/src/loader/http/getpackages.cpp +++ b/core/src/loader/http/getpackages.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPackagesLoader::GetPackagesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetPackagesParams>(apiClient) {} + +QString GetPackagesLoader::path(const GetPackagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Packages"); +} + +QUrlQuery GetPackagesLoader::query(const GetPackagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getparentalratings.cpp b/core/src/loader/http/getparentalratings.cpp index 24509ce..2007bde 100644 --- a/core/src/loader/http/getparentalratings.cpp +++ b/core/src/loader/http/getparentalratings.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetParentalRatingsLoader::GetParentalRatingsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetParentalRatingsParams>(apiClient) {} + +QString GetParentalRatingsLoader::path(const GetParentalRatingsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Localization/ParentalRatings"); +} + +QUrlQuery GetParentalRatingsLoader::query(const GetParentalRatingsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getparentpath.cpp b/core/src/loader/http/getparentpath.cpp index 08cc4a2..c4739c0 100644 --- a/core/src/loader/http/getparentpath.cpp +++ b/core/src/loader/http/getparentpath.cpp @@ -34,6 +34,27 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetParentPathLoader::GetParentPathLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetParentPathLoader::path(const GetParentPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Environment/ParentPath"); +} + +QUrlQuery GetParentPathLoader::query(const GetParentPathParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + result.addQueryItem("path", Support::toString(params.path())); + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getpasswordresetproviders.cpp b/core/src/loader/http/getpasswordresetproviders.cpp index 9c9e953..a4d03bc 100644 --- a/core/src/loader/http/getpasswordresetproviders.cpp +++ b/core/src/loader/http/getpasswordresetproviders.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPasswordResetProvidersLoader::GetPasswordResetProvidersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetPasswordResetProvidersParams>(apiClient) {} + +QString GetPasswordResetProvidersLoader::path(const GetPasswordResetProvidersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Auth/PasswordResetProviders"); +} + +QUrlQuery GetPasswordResetProvidersLoader::query(const GetPasswordResetProvidersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getperson.cpp b/core/src/loader/http/getperson.cpp index 614a5a5..8ac7cd2 100644 --- a/core/src/loader/http/getperson.cpp +++ b/core/src/loader/http/getperson.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPersonLoader::GetPersonLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPersonLoader::path(const GetPersonParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Persons/") + Support::toString(params.name()) ; + return QStringLiteral("/Persons/") + Support::toString< QString>(params.name()) ; } QUrlQuery GetPersonLoader::query(const GetPersonParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetPersonLoader::query(const GetPersonParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getpersonremotesearchresults.cpp b/core/src/loader/http/getpersonremotesearchresults.cpp index c10c000..9ed0193 100644 --- a/core/src/loader/http/getpersonremotesearchresults.cpp +++ b/core/src/loader/http/getpersonremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPersonRemoteSearchResultsLoader::GetPersonRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetPersonRemoteSearchResultsParams>(apiClient) {} + +QString GetPersonRemoteSearchResultsLoader::path(const GetPersonRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Person"); +} + +QUrlQuery GetPersonRemoteSearchResultsLoader::query(const GetPersonRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getpersons.cpp b/core/src/loader/http/getpersons.cpp index 1c86b63..9cb4373 100644 --- a/core/src/loader/http/getpersons.cpp +++ b/core/src/loader/http/getpersons.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPersonsLoader::GetPersonsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPersonsLoader::path(const GetPersonsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,43 +51,43 @@ QUrlQuery GetPersonsLoader::query(const GetPersonsParams ¶ms) const { // Optional parameters if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.excludePersonTypesNull()) { - result.addQueryItem("excludePersonTypes", Support::toString(params.excludePersonTypes())); + result.addQueryItem("excludePersonTypes", Support::toString(params.excludePersonTypes())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.appearsInItemIdNull()) { - result.addQueryItem("appearsInItemId", Support::toString(params.appearsInItemId())); + result.addQueryItem("appearsInItemId", Support::toString(params.appearsInItemId())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/getphysicalpaths.cpp b/core/src/loader/http/getphysicalpaths.cpp index 0812d45..b05c777 100644 --- a/core/src/loader/http/getphysicalpaths.cpp +++ b/core/src/loader/http/getphysicalpaths.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPhysicalPathsLoader::GetPhysicalPathsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetPhysicalPathsLoader::path(const GetPhysicalPathsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/PhysicalPaths"); +} + +QUrlQuery GetPhysicalPathsLoader::query(const GetPhysicalPathsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getpingsystem.cpp b/core/src/loader/http/getpingsystem.cpp index e772276..88edb2d 100644 --- a/core/src/loader/http/getpingsystem.cpp +++ b/core/src/loader/http/getpingsystem.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPingSystemLoader::GetPingSystemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetPingSystemLoader::path(const GetPingSystemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Ping"); +} + +QUrlQuery GetPingSystemLoader::query(const GetPingSystemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getplaybackinfo.cpp b/core/src/loader/http/getplaybackinfo.cpp index 337916f..b738f0e 100644 --- a/core/src/loader/http/getplaybackinfo.cpp +++ b/core/src/loader/http/getplaybackinfo.cpp @@ -34,20 +34,21 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPlaybackInfoLoader::GetPlaybackInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPlaybackInfoLoader::path(const GetPlaybackInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/PlaybackInfo"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/PlaybackInfo"); } QUrlQuery GetPlaybackInfoLoader::query(const GetPlaybackInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("userId", params.userId()); + result.addQueryItem("userId", Support::toString(params.userId())); // Optional parameters diff --git a/core/src/loader/http/getplaylistitems.cpp b/core/src/loader/http/getplaylistitems.cpp index 0c0618f..8f90a0c 100644 --- a/core/src/loader/http/getplaylistitems.cpp +++ b/core/src/loader/http/getplaylistitems.cpp @@ -34,42 +34,43 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPlaylistItemsLoader::GetPlaylistItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPlaylistItemsLoader::path(const GetPlaylistItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Playlists/") + Support::toString(params.playlistId()) + QStringLiteral("/Items"); + return QStringLiteral("/Playlists/") + Support::toString< QString>(params.playlistId()) + QStringLiteral("/Items"); } QUrlQuery GetPlaylistItemsLoader::query(const GetPlaylistItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; - result.addQueryItem("userId", params.userId()); + result.addQueryItem("userId", Support::toString(params.userId())); // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } return result; diff --git a/core/src/loader/http/getpluginconfiguration.cpp b/core/src/loader/http/getpluginconfiguration.cpp index 7bc5cfb..14d64cd 100644 --- a/core/src/loader/http/getpluginconfiguration.cpp +++ b/core/src/loader/http/getpluginconfiguration.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPluginConfigurationLoader::GetPluginConfigurationLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPluginConfigurationLoader::path(const GetPluginConfigurationParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Plugins/") + Support::toString(params.pluginId()) + QStringLiteral("/Configuration"); + return QStringLiteral("/Plugins/") + Support::toString< QString>(params.pluginId()) + QStringLiteral("/Configuration"); } QUrlQuery GetPluginConfigurationLoader::query(const GetPluginConfigurationParams ¶ms) const { diff --git a/core/src/loader/http/getplugins.cpp b/core/src/loader/http/getplugins.cpp index cf7c0d4..9c8ed3e 100644 --- a/core/src/loader/http/getplugins.cpp +++ b/core/src/loader/http/getplugins.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPluginsLoader::GetPluginsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetPluginsParams>(apiClient) {} + +QString GetPluginsLoader::path(const GetPluginsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Plugins"); +} + +QUrlQuery GetPluginsLoader::query(const GetPluginsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getpostedplaybackinfo.cpp b/core/src/loader/http/getpostedplaybackinfo.cpp index ac67c17..4471536 100644 --- a/core/src/loader/http/getpostedplaybackinfo.cpp +++ b/core/src/loader/http/getpostedplaybackinfo.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPostedPlaybackInfoLoader::GetPostedPlaybackInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPostedPlaybackInfoLoader::path(const GetPostedPlaybackInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/PlaybackInfo"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/PlaybackInfo"); } QUrlQuery GetPostedPlaybackInfoLoader::query(const GetPostedPlaybackInfoParams ¶ms) const { @@ -50,46 +51,46 @@ QUrlQuery GetPostedPlaybackInfoLoader::query(const GetPostedPlaybackInfoParams & // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.maxStreamingBitrateNull()) { - result.addQueryItem("maxStreamingBitrate", Support::toString(params.maxStreamingBitrate())); + result.addQueryItem("maxStreamingBitrate", Support::toString>(params.maxStreamingBitrate())); } if (!params.startTimeTicksNull()) { - result.addQueryItem("startTimeTicks", Support::toString(params.startTimeTicks())); + result.addQueryItem("startTimeTicks", Support::toString>(params.startTimeTicks())); } if (!params.audioStreamIndexNull()) { - result.addQueryItem("audioStreamIndex", Support::toString(params.audioStreamIndex())); + result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); } if (!params.subtitleStreamIndexNull()) { - result.addQueryItem("subtitleStreamIndex", Support::toString(params.subtitleStreamIndex())); + result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); } if (!params.maxAudioChannelsNull()) { - result.addQueryItem("maxAudioChannels", Support::toString(params.maxAudioChannels())); + result.addQueryItem("maxAudioChannels", Support::toString>(params.maxAudioChannels())); } if (!params.mediaSourceIdNull()) { - result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); + result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); } if (!params.liveStreamIdNull()) { - result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); + result.addQueryItem("liveStreamId", Support::toString(params.liveStreamId())); } if (!params.autoOpenLiveStreamNull()) { - result.addQueryItem("autoOpenLiveStream", Support::toString(params.autoOpenLiveStream())); + result.addQueryItem("autoOpenLiveStream", Support::toString>(params.autoOpenLiveStream())); } if (!params.enableDirectPlayNull()) { - result.addQueryItem("enableDirectPlay", Support::toString(params.enableDirectPlay())); + result.addQueryItem("enableDirectPlay", Support::toString>(params.enableDirectPlay())); } if (!params.enableDirectStreamNull()) { - result.addQueryItem("enableDirectStream", Support::toString(params.enableDirectStream())); + result.addQueryItem("enableDirectStream", Support::toString>(params.enableDirectStream())); } if (!params.enableTranscodingNull()) { - result.addQueryItem("enableTranscoding", Support::toString(params.enableTranscoding())); + result.addQueryItem("enableTranscoding", Support::toString>(params.enableTranscoding())); } if (!params.allowVideoStreamCopyNull()) { - result.addQueryItem("allowVideoStreamCopy", Support::toString(params.allowVideoStreamCopy())); + result.addQueryItem("allowVideoStreamCopy", Support::toString>(params.allowVideoStreamCopy())); } if (!params.allowAudioStreamCopyNull()) { - result.addQueryItem("allowAudioStreamCopy", Support::toString(params.allowAudioStreamCopy())); + result.addQueryItem("allowAudioStreamCopy", Support::toString>(params.allowAudioStreamCopy())); } return result; diff --git a/core/src/loader/http/getprofile.cpp b/core/src/loader/http/getprofile.cpp index 6574452..46e8674 100644 --- a/core/src/loader/http/getprofile.cpp +++ b/core/src/loader/http/getprofile.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetProfileLoader::GetProfileLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetProfileLoader::path(const GetProfileParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Dlna/Profiles/") + Support::toString(params.profileId()) ; + return QStringLiteral("/Dlna/Profiles/") + Support::toString< QString>(params.profileId()) ; } QUrlQuery GetProfileLoader::query(const GetProfileParams ¶ms) const { diff --git a/core/src/loader/http/getprofileinfos.cpp b/core/src/loader/http/getprofileinfos.cpp index 1d481cf..718dced 100644 --- a/core/src/loader/http/getprofileinfos.cpp +++ b/core/src/loader/http/getprofileinfos.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetProfileInfosLoader::GetProfileInfosLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetProfileInfosParams>(apiClient) {} + +QString GetProfileInfosLoader::path(const GetProfileInfosParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Dlna/ProfileInfos"); +} + +QUrlQuery GetProfileInfosLoader::query(const GetProfileInfosParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getprogram.cpp b/core/src/loader/http/getprogram.cpp index e647a2b..73c381c 100644 --- a/core/src/loader/http/getprogram.cpp +++ b/core/src/loader/http/getprogram.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetProgramLoader::GetProgramLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetProgramLoader::path(const GetProgramParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/LiveTv/Programs/") + Support::toString(params.programId()) ; + return QStringLiteral("/LiveTv/Programs/") + Support::toString< QString>(params.programId()) ; } QUrlQuery GetProgramLoader::query(const GetProgramParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetProgramLoader::query(const GetProgramParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getprograms.cpp b/core/src/loader/http/getprograms.cpp index f716ea9..d4455d7 100644 --- a/core/src/loader/http/getprograms.cpp +++ b/core/src/loader/http/getprograms.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetProgramsLoader::GetProgramsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetProgramsLoader::path(const GetProgramsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getpublicsysteminfo.cpp b/core/src/loader/http/getpublicsysteminfo.cpp index d615f11..b7df518 100644 --- a/core/src/loader/http/getpublicsysteminfo.cpp +++ b/core/src/loader/http/getpublicsysteminfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetPublicSystemInfoLoader::GetPublicSystemInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetPublicSystemInfoLoader::path(const GetPublicSystemInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getpublicusers.cpp b/core/src/loader/http/getpublicusers.cpp index 17cd4ec..bf5579c 100644 --- a/core/src/loader/http/getpublicusers.cpp +++ b/core/src/loader/http/getpublicusers.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetPublicUsersLoader::GetPublicUsersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetPublicUsersParams>(apiClient) {} + +QString GetPublicUsersLoader::path(const GetPublicUsersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users/Public"); +} + +QUrlQuery GetPublicUsersLoader::query(const GetPublicUsersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getqueryfilters.cpp b/core/src/loader/http/getqueryfilters.cpp index 3d9a902..02999f3 100644 --- a/core/src/loader/http/getqueryfilters.cpp +++ b/core/src/loader/http/getqueryfilters.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetQueryFiltersLoader::GetQueryFiltersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetQueryFiltersLoader::path(const GetQueryFiltersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,34 +51,34 @@ QUrlQuery GetQueryFiltersLoader::query(const GetQueryFiltersParams ¶ms) cons // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.isAiringNull()) { - result.addQueryItem("isAiring", Support::toString(params.isAiring())); + result.addQueryItem("isAiring", Support::toString>(params.isAiring())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.recursiveNull()) { - result.addQueryItem("recursive", Support::toString(params.recursive())); + result.addQueryItem("recursive", Support::toString>(params.recursive())); } return result; diff --git a/core/src/loader/http/getqueryfilterslegacy.cpp b/core/src/loader/http/getqueryfilterslegacy.cpp index 08b6aa7..d4feb8c 100644 --- a/core/src/loader/http/getqueryfilterslegacy.cpp +++ b/core/src/loader/http/getqueryfilterslegacy.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetQueryFiltersLegacyLoader::GetQueryFiltersLegacyLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetQueryFiltersLegacyLoader::path(const GetQueryFiltersLegacyParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,16 +51,16 @@ QUrlQuery GetQueryFiltersLegacyLoader::query(const GetQueryFiltersLegacyParams & // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } return result; diff --git a/core/src/loader/http/getratingimages.cpp b/core/src/loader/http/getratingimages.cpp index fddc022..f6ab1cc 100644 --- a/core/src/loader/http/getratingimages.cpp +++ b/core/src/loader/http/getratingimages.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetRatingImagesLoader::GetRatingImagesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetRatingImagesParams>(apiClient) {} + +QString GetRatingImagesLoader::path(const GetRatingImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Images/Ratings"); +} + +QUrlQuery GetRatingImagesLoader::query(const GetRatingImagesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getrecommendedprograms.cpp b/core/src/loader/http/getrecommendedprograms.cpp index 4575a55..90c6502 100644 --- a/core/src/loader/http/getrecommendedprograms.cpp +++ b/core/src/loader/http/getrecommendedprograms.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecommendedProgramsLoader::GetRecommendedProgramsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecommendedProgramsLoader::path(const GetRecommendedProgramsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,52 +51,52 @@ QUrlQuery GetRecommendedProgramsLoader::query(const GetRecommendedProgramsParams // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.isAiringNull()) { - result.addQueryItem("isAiring", Support::toString(params.isAiring())); + result.addQueryItem("isAiring", Support::toString>(params.isAiring())); } if (!params.hasAiredNull()) { - result.addQueryItem("hasAired", Support::toString(params.hasAired())); + result.addQueryItem("hasAired", Support::toString>(params.hasAired())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getrecording.cpp b/core/src/loader/http/getrecording.cpp index 864fcb0..e374b89 100644 --- a/core/src/loader/http/getrecording.cpp +++ b/core/src/loader/http/getrecording.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecordingLoader::GetRecordingLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecordingLoader::path(const GetRecordingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/LiveTv/Recordings/") + Support::toString(params.recordingId()) ; + return QStringLiteral("/LiveTv/Recordings/") + Support::toString< QString>(params.recordingId()) ; } QUrlQuery GetRecordingLoader::query(const GetRecordingParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetRecordingLoader::query(const GetRecordingParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getrecordingfolders.cpp b/core/src/loader/http/getrecordingfolders.cpp index 7ec3511..98f6fca 100644 --- a/core/src/loader/http/getrecordingfolders.cpp +++ b/core/src/loader/http/getrecordingfolders.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecordingFoldersLoader::GetRecordingFoldersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecordingFoldersLoader::path(const GetRecordingFoldersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,7 +51,7 @@ QUrlQuery GetRecordingFoldersLoader::query(const GetRecordingFoldersParams ¶ // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getrecordinggroups.cpp b/core/src/loader/http/getrecordinggroups.cpp index 63c3a1c..4924360 100644 --- a/core/src/loader/http/getrecordinggroups.cpp +++ b/core/src/loader/http/getrecordinggroups.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecordingGroupsLoader::GetRecordingGroupsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecordingGroupsLoader::path(const GetRecordingGroupsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,7 +51,7 @@ QUrlQuery GetRecordingGroupsLoader::query(const GetRecordingGroupsParams ¶ms // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getrecordings.cpp b/core/src/loader/http/getrecordings.cpp index 8d94686..3220a7c 100644 --- a/core/src/loader/http/getrecordings.cpp +++ b/core/src/loader/http/getrecordings.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecordingsLoader::GetRecordingsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecordingsLoader::path(const GetRecordingsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,61 +51,61 @@ QUrlQuery GetRecordingsLoader::query(const GetRecordingsParams ¶ms) const { // Optional parameters if (!params.channelIdNull()) { - result.addQueryItem("channelId", Support::toString(params.channelId())); + result.addQueryItem("channelId", Support::toString(params.channelId())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.statusNull()) { - result.addQueryItem("status", Support::toString(params.status())); + result.addQueryItem("status", Support::toString(params.status())); } if (!params.isInProgressNull()) { - result.addQueryItem("isInProgress", Support::toString(params.isInProgress())); + result.addQueryItem("isInProgress", Support::toString>(params.isInProgress())); } if (!params.seriesTimerIdNull()) { - result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); + result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.isMovieNull()) { - result.addQueryItem("isMovie", Support::toString(params.isMovie())); + result.addQueryItem("isMovie", Support::toString>(params.isMovie())); } if (!params.isSeriesNull()) { - result.addQueryItem("isSeries", Support::toString(params.isSeries())); + result.addQueryItem("isSeries", Support::toString>(params.isSeries())); } if (!params.isKidsNull()) { - result.addQueryItem("isKids", Support::toString(params.isKids())); + result.addQueryItem("isKids", Support::toString>(params.isKids())); } if (!params.isSportsNull()) { - result.addQueryItem("isSports", Support::toString(params.isSports())); + result.addQueryItem("isSports", Support::toString>(params.isSports())); } if (!params.isNewsNull()) { - result.addQueryItem("isNews", Support::toString(params.isNews())); + result.addQueryItem("isNews", Support::toString>(params.isNews())); } if (!params.isLibraryItemNull()) { - result.addQueryItem("isLibraryItem", Support::toString(params.isLibraryItem())); + result.addQueryItem("isLibraryItem", Support::toString>(params.isLibraryItem())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getrecordingsseries.cpp b/core/src/loader/http/getrecordingsseries.cpp index 90ddda4..2e75fbb 100644 --- a/core/src/loader/http/getrecordingsseries.cpp +++ b/core/src/loader/http/getrecordingsseries.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRecordingsSeriesLoader::GetRecordingsSeriesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRecordingsSeriesLoader::path(const GetRecordingsSeriesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,46 +51,46 @@ QUrlQuery GetRecordingsSeriesLoader::query(const GetRecordingsSeriesParams ¶ // Optional parameters if (!params.channelIdNull()) { - result.addQueryItem("channelId", Support::toString(params.channelId())); + result.addQueryItem("channelId", Support::toString(params.channelId())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.groupIdNull()) { - result.addQueryItem("groupId", Support::toString(params.groupId())); + result.addQueryItem("groupId", Support::toString(params.groupId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.statusNull()) { - result.addQueryItem("status", Support::toString(params.status())); + result.addQueryItem("status", Support::toString(params.status())); } if (!params.isInProgressNull()) { - result.addQueryItem("isInProgress", Support::toString(params.isInProgress())); + result.addQueryItem("isInProgress", Support::toString>(params.isInProgress())); } if (!params.seriesTimerIdNull()) { - result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); + result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getremoteimageproviders.cpp b/core/src/loader/http/getremoteimageproviders.cpp index ee5ad1b..83f35bd 100644 --- a/core/src/loader/http/getremoteimageproviders.cpp +++ b/core/src/loader/http/getremoteimageproviders.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetRemoteImageProvidersLoader::GetRemoteImageProvidersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetRemoteImageProvidersParams>(apiClient) {} + +QString GetRemoteImageProvidersLoader::path(const GetRemoteImageProvidersParams ¶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/Providers"); +} + +QUrlQuery GetRemoteImageProvidersLoader::query(const GetRemoteImageProvidersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getremoteimages.cpp b/core/src/loader/http/getremoteimages.cpp index 045588d..e9722d6 100644 --- a/core/src/loader/http/getremoteimages.cpp +++ b/core/src/loader/http/getremoteimages.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRemoteImagesLoader::GetRemoteImagesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRemoteImagesLoader::path(const GetRemoteImagesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/RemoteImages"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/RemoteImages"); } QUrlQuery GetRemoteImagesLoader::query(const GetRemoteImagesParams ¶ms) const { @@ -50,19 +51,19 @@ QUrlQuery GetRemoteImagesLoader::query(const GetRemoteImagesParams ¶ms) cons // Optional parameters if (!params.typeNull()) { - result.addQueryItem("type", Support::toString(params.type())); + result.addQueryItem("type", Support::toString(params.type())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.providerNameNull()) { - result.addQueryItem("providerName", Support::toString(params.providerName())); + result.addQueryItem("providerName", Support::toString(params.providerName())); } if (!params.includeAllLanguagesNull()) { - result.addQueryItem("includeAllLanguages", Support::toString(params.includeAllLanguages())); + result.addQueryItem("includeAllLanguages", Support::toString>(params.includeAllLanguages())); } return result; diff --git a/core/src/loader/http/getrepositories.cpp b/core/src/loader/http/getrepositories.cpp index b8a0274..9f61820 100644 --- a/core/src/loader/http/getrepositories.cpp +++ b/core/src/loader/http/getrepositories.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetRepositoriesLoader::GetRepositoriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetRepositoriesParams>(apiClient) {} + +QString GetRepositoriesLoader::path(const GetRepositoriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Repositories"); +} + +QUrlQuery GetRepositoriesLoader::query(const GetRepositoriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getresumeitems.cpp b/core/src/loader/http/getresumeitems.cpp index 1cd3029..7248c9b 100644 --- a/core/src/loader/http/getresumeitems.cpp +++ b/core/src/loader/http/getresumeitems.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetResumeItemsLoader::GetResumeItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetResumeItemsLoader::path(const GetResumeItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/Resume"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/Resume"); } QUrlQuery GetResumeItemsLoader::query(const GetResumeItemsParams ¶ms) const { @@ -50,43 +51,43 @@ QUrlQuery GetResumeItemsLoader::query(const GetResumeItemsParams ¶ms) const // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/getrootfolder.cpp b/core/src/loader/http/getrootfolder.cpp index 6152311..d6d6639 100644 --- a/core/src/loader/http/getrootfolder.cpp +++ b/core/src/loader/http/getrootfolder.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetRootFolderLoader::GetRootFolderLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetRootFolderLoader::path(const GetRootFolderParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/Root"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/Root"); } QUrlQuery GetRootFolderLoader::query(const GetRootFolderParams ¶ms) const { diff --git a/core/src/loader/http/getschedulesdirectcountries.cpp b/core/src/loader/http/getschedulesdirectcountries.cpp index 2807d3b..22b1096 100644 --- a/core/src/loader/http/getschedulesdirectcountries.cpp +++ b/core/src/loader/http/getschedulesdirectcountries.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetSchedulesDirectCountriesLoader::GetSchedulesDirectCountriesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString GetSchedulesDirectCountriesLoader::path(const GetSchedulesDirectCountriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/ListingProviders/SchedulesDirect/Countries"); +} + +QUrlQuery GetSchedulesDirectCountriesLoader::query(const GetSchedulesDirectCountriesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getseasons.cpp b/core/src/loader/http/getseasons.cpp index a67b208..6b3d8ec 100644 --- a/core/src/loader/http/getseasons.cpp +++ b/core/src/loader/http/getseasons.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSeasonsLoader::GetSeasonsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSeasonsLoader::path(const GetSeasonsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Shows/") + Support::toString(params.seriesId()) + QStringLiteral("/Seasons"); + return QStringLiteral("/Shows/") + Support::toString< QString>(params.seriesId()) + QStringLiteral("/Seasons"); } QUrlQuery GetSeasonsLoader::query(const GetSeasonsParams ¶ms) const { @@ -50,31 +51,31 @@ QUrlQuery GetSeasonsLoader::query(const GetSeasonsParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.isSpecialSeasonNull()) { - result.addQueryItem("isSpecialSeason", Support::toString(params.isSpecialSeason())); + result.addQueryItem("isSpecialSeason", Support::toString>(params.isSpecialSeason())); } if (!params.isMissingNull()) { - result.addQueryItem("isMissing", Support::toString(params.isMissing())); + result.addQueryItem("isMissing", Support::toString>(params.isMissing())); } if (!params.adjacentToNull()) { - result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); + result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } return result; diff --git a/core/src/loader/http/getseriesremotesearchresults.cpp b/core/src/loader/http/getseriesremotesearchresults.cpp index d0bbf93..9ce29e5 100644 --- a/core/src/loader/http/getseriesremotesearchresults.cpp +++ b/core/src/loader/http/getseriesremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetSeriesRemoteSearchResultsLoader::GetSeriesRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetSeriesRemoteSearchResultsParams>(apiClient) {} + +QString GetSeriesRemoteSearchResultsLoader::path(const GetSeriesRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Series"); +} + +QUrlQuery GetSeriesRemoteSearchResultsLoader::query(const GetSeriesRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getseriestimer.cpp b/core/src/loader/http/getseriestimer.cpp index 6567a14..e7c3de5 100644 --- a/core/src/loader/http/getseriestimer.cpp +++ b/core/src/loader/http/getseriestimer.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSeriesTimerLoader::GetSeriesTimerLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSeriesTimerLoader::path(const GetSeriesTimerParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/LiveTv/SeriesTimers/") + Support::toString(params.timerId()) ; + return QStringLiteral("/LiveTv/SeriesTimers/") + Support::toString< QString>(params.timerId()) ; } QUrlQuery GetSeriesTimerLoader::query(const GetSeriesTimerParams ¶ms) const { diff --git a/core/src/loader/http/getseriestimers.cpp b/core/src/loader/http/getseriestimers.cpp index b99d4f1..28f082d 100644 --- a/core/src/loader/http/getseriestimers.cpp +++ b/core/src/loader/http/getseriestimers.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSeriesTimersLoader::GetSeriesTimersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSeriesTimersLoader::path(const GetSeriesTimersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,10 +51,10 @@ QUrlQuery GetSeriesTimersLoader::query(const GetSeriesTimersParams ¶ms) cons // Optional parameters if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } return result; diff --git a/core/src/loader/http/getserverlogs.cpp b/core/src/loader/http/getserverlogs.cpp index 3f38f29..016193e 100644 --- a/core/src/loader/http/getserverlogs.cpp +++ b/core/src/loader/http/getserverlogs.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetServerLogsLoader::GetServerLogsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetServerLogsParams>(apiClient) {} + +QString GetServerLogsLoader::path(const GetServerLogsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Logs"); +} + +QUrlQuery GetServerLogsLoader::query(const GetServerLogsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getsessions.cpp b/core/src/loader/http/getsessions.cpp index 9d24099..3e75dba 100644 --- a/core/src/loader/http/getsessions.cpp +++ b/core/src/loader/http/getsessions.cpp @@ -34,6 +34,35 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetSessionsLoader::GetSessionsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetSessionsParams>(apiClient) {} + +QString GetSessionsLoader::path(const GetSessionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Sessions"); +} + +QUrlQuery GetSessionsLoader::query(const GetSessionsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.controllableByUserIdNull()) { + result.addQueryItem("controllableByUserId", Support::toString(params.controllableByUserId())); + } + if (!params.deviceIdNull()) { + result.addQueryItem("deviceId", Support::toString(params.deviceId())); + } + if (!params.activeWithinSecondsNull()) { + result.addQueryItem("activeWithinSeconds", Support::toString>(params.activeWithinSeconds())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getsimilaralbums.cpp b/core/src/loader/http/getsimilaralbums.cpp index 60dc5ac..fb31ec2 100644 --- a/core/src/loader/http/getsimilaralbums.cpp +++ b/core/src/loader/http/getsimilaralbums.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarAlbumsLoader::GetSimilarAlbumsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarAlbumsLoader::path(const GetSimilarAlbumsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Albums/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Albums/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarAlbumsLoader::query(const GetSimilarAlbumsParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarAlbumsLoader::query(const GetSimilarAlbumsParams ¶ms) co // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getsimilarartists.cpp b/core/src/loader/http/getsimilarartists.cpp index d965ea4..e7116b8 100644 --- a/core/src/loader/http/getsimilarartists.cpp +++ b/core/src/loader/http/getsimilarartists.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarArtistsLoader::GetSimilarArtistsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarArtistsLoader::path(const GetSimilarArtistsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Artists/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Artists/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarArtistsLoader::query(const GetSimilarArtistsParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarArtistsLoader::query(const GetSimilarArtistsParams ¶ms) // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getsimilaritems.cpp b/core/src/loader/http/getsimilaritems.cpp index a0dbe3a..ff4b625 100644 --- a/core/src/loader/http/getsimilaritems.cpp +++ b/core/src/loader/http/getsimilaritems.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarItemsLoader::GetSimilarItemsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarItemsLoader::path(const GetSimilarItemsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarItemsLoader::query(const GetSimilarItemsParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarItemsLoader::query(const GetSimilarItemsParams ¶ms) cons // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getsimilarmovies.cpp b/core/src/loader/http/getsimilarmovies.cpp index 1425abe..4cfc851 100644 --- a/core/src/loader/http/getsimilarmovies.cpp +++ b/core/src/loader/http/getsimilarmovies.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarMoviesLoader::GetSimilarMoviesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarMoviesLoader::path(const GetSimilarMoviesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Movies/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Movies/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarMoviesLoader::query(const GetSimilarMoviesParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarMoviesLoader::query(const GetSimilarMoviesParams ¶ms) co // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getsimilarshows.cpp b/core/src/loader/http/getsimilarshows.cpp index be29c16..2a45cf5 100644 --- a/core/src/loader/http/getsimilarshows.cpp +++ b/core/src/loader/http/getsimilarshows.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarShowsLoader::GetSimilarShowsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarShowsLoader::path(const GetSimilarShowsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Shows/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Shows/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarShowsLoader::query(const GetSimilarShowsParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarShowsLoader::query(const GetSimilarShowsParams ¶ms) cons // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getsimilartrailers.cpp b/core/src/loader/http/getsimilartrailers.cpp index bf2ac8a..ba0546a 100644 --- a/core/src/loader/http/getsimilartrailers.cpp +++ b/core/src/loader/http/getsimilartrailers.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSimilarTrailersLoader::GetSimilarTrailersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSimilarTrailersLoader::path(const GetSimilarTrailersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Trailers/") + Support::toString(params.itemId()) + QStringLiteral("/Similar"); + return QStringLiteral("/Trailers/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Similar"); } QUrlQuery GetSimilarTrailersLoader::query(const GetSimilarTrailersParams ¶ms) const { @@ -50,16 +51,16 @@ QUrlQuery GetSimilarTrailersLoader::query(const GetSimilarTrailersParams ¶ms // Optional parameters if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } return result; diff --git a/core/src/loader/http/getspecialfeatures.cpp b/core/src/loader/http/getspecialfeatures.cpp index b4ab4b3..9c5f21f 100644 --- a/core/src/loader/http/getspecialfeatures.cpp +++ b/core/src/loader/http/getspecialfeatures.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetSpecialFeaturesLoader::GetSpecialFeaturesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetSpecialFeaturesParams>(apiClient) {} + +QString GetSpecialFeaturesLoader::path(const GetSpecialFeaturesParams ¶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("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/SpecialFeatures"); +} + +QUrlQuery GetSpecialFeaturesLoader::query(const GetSpecialFeaturesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getstartupconfiguration.cpp b/core/src/loader/http/getstartupconfiguration.cpp index 3bf4b5b..820bfd2 100644 --- a/core/src/loader/http/getstartupconfiguration.cpp +++ b/core/src/loader/http/getstartupconfiguration.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetStartupConfigurationLoader::GetStartupConfigurationLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetStartupConfigurationLoader::path(const GetStartupConfigurationParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getstatus.cpp b/core/src/loader/http/getstatus.cpp index 6c2def7..c66dd73 100644 --- a/core/src/loader/http/getstatus.cpp +++ b/core/src/loader/http/getstatus.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetStatusLoader::GetStatusLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetStatusLoader::path(const GetStatusParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getstudio.cpp b/core/src/loader/http/getstudio.cpp index 1b10248..3ecafd0 100644 --- a/core/src/loader/http/getstudio.cpp +++ b/core/src/loader/http/getstudio.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetStudioLoader::GetStudioLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetStudioLoader::path(const GetStudioParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Studios/") + Support::toString(params.name()) ; + return QStringLiteral("/Studios/") + Support::toString< QString>(params.name()) ; } QUrlQuery GetStudioLoader::query(const GetStudioParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetStudioLoader::query(const GetStudioParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getstudios.cpp b/core/src/loader/http/getstudios.cpp index 48a5fe1..4121394 100644 --- a/core/src/loader/http/getstudios.cpp +++ b/core/src/loader/http/getstudios.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetStudiosLoader::GetStudiosLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetStudiosLoader::path(const GetStudiosParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,55 +51,55 @@ QUrlQuery GetStudiosLoader::query(const GetStudiosParams ¶ms) const { // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getsuggestions.cpp b/core/src/loader/http/getsuggestions.cpp index df30ffb..61702d5 100644 --- a/core/src/loader/http/getsuggestions.cpp +++ b/core/src/loader/http/getsuggestions.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSuggestionsLoader::GetSuggestionsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSuggestionsLoader::path(const GetSuggestionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Suggestions"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Suggestions"); } QUrlQuery GetSuggestionsLoader::query(const GetSuggestionsParams ¶ms) const { @@ -50,19 +51,19 @@ QUrlQuery GetSuggestionsLoader::query(const GetSuggestionsParams ¶ms) const // Optional parameters if (!params.mediaTypeNull()) { - result.addQueryItem("mediaType", Support::toString(params.mediaType())); + result.addQueryItem("mediaType", Support::toString(params.mediaType())); } if (!params.typeNull()) { - result.addQueryItem("type", Support::toString(params.type())); + result.addQueryItem("type", Support::toString(params.type())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } return result; diff --git a/core/src/loader/http/getsysteminfo.cpp b/core/src/loader/http/getsysteminfo.cpp index 4b20d70..f441b7c 100644 --- a/core/src/loader/http/getsysteminfo.cpp +++ b/core/src/loader/http/getsysteminfo.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetSystemInfoLoader::GetSystemInfoLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetSystemInfoLoader::path(const GetSystemInfoParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/gettask.cpp b/core/src/loader/http/gettask.cpp index b3f4b8a..716efe4 100644 --- a/core/src/loader/http/gettask.cpp +++ b/core/src/loader/http/gettask.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetTaskLoader::GetTaskLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetTaskLoader::path(const GetTaskParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/ScheduledTasks/") + Support::toString(params.taskId()) ; + return QStringLiteral("/ScheduledTasks/") + Support::toString< QString>(params.taskId()) ; } QUrlQuery GetTaskLoader::query(const GetTaskParams ¶ms) const { diff --git a/core/src/loader/http/gettasks.cpp b/core/src/loader/http/gettasks.cpp index 1e64539..14f8f9f 100644 --- a/core/src/loader/http/gettasks.cpp +++ b/core/src/loader/http/gettasks.cpp @@ -34,6 +34,32 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetTasksLoader::GetTasksLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetTasksParams>(apiClient) {} + +QString GetTasksLoader::path(const GetTasksParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/ScheduledTasks"); +} + +QUrlQuery GetTasksLoader::query(const GetTasksParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.isHiddenNull()) { + result.addQueryItem("isHidden", Support::toString>(params.isHidden())); + } + if (!params.isEnabledNull()) { + result.addQueryItem("isEnabled", Support::toString>(params.isEnabled())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getthememedia.cpp b/core/src/loader/http/getthememedia.cpp index 66499b0..226b527 100644 --- a/core/src/loader/http/getthememedia.cpp +++ b/core/src/loader/http/getthememedia.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetThemeMediaLoader::GetThemeMediaLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetThemeMediaLoader::path(const GetThemeMediaParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/ThemeMedia"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/ThemeMedia"); } QUrlQuery GetThemeMediaLoader::query(const GetThemeMediaParams ¶ms) const { @@ -50,10 +51,10 @@ QUrlQuery GetThemeMediaLoader::query(const GetThemeMediaParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.inheritFromParentNull()) { - result.addQueryItem("inheritFromParent", Support::toString(params.inheritFromParent())); + result.addQueryItem("inheritFromParent", Support::toString>(params.inheritFromParent())); } return result; diff --git a/core/src/loader/http/getthemesongs.cpp b/core/src/loader/http/getthemesongs.cpp index f5472bd..8124aaf 100644 --- a/core/src/loader/http/getthemesongs.cpp +++ b/core/src/loader/http/getthemesongs.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetThemeSongsLoader::GetThemeSongsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetThemeSongsLoader::path(const GetThemeSongsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/ThemeSongs"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/ThemeSongs"); } QUrlQuery GetThemeSongsLoader::query(const GetThemeSongsParams ¶ms) const { @@ -50,10 +51,10 @@ QUrlQuery GetThemeSongsLoader::query(const GetThemeSongsParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.inheritFromParentNull()) { - result.addQueryItem("inheritFromParent", Support::toString(params.inheritFromParent())); + result.addQueryItem("inheritFromParent", Support::toString>(params.inheritFromParent())); } return result; diff --git a/core/src/loader/http/getthemevideos.cpp b/core/src/loader/http/getthemevideos.cpp index 250aaa0..01f3b71 100644 --- a/core/src/loader/http/getthemevideos.cpp +++ b/core/src/loader/http/getthemevideos.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetThemeVideosLoader::GetThemeVideosLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetThemeVideosLoader::path(const GetThemeVideosParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/ThemeVideos"); + return QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/ThemeVideos"); } QUrlQuery GetThemeVideosLoader::query(const GetThemeVideosParams ¶ms) const { @@ -50,10 +51,10 @@ QUrlQuery GetThemeVideosLoader::query(const GetThemeVideosParams ¶ms) const // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.inheritFromParentNull()) { - result.addQueryItem("inheritFromParent", Support::toString(params.inheritFromParent())); + result.addQueryItem("inheritFromParent", Support::toString>(params.inheritFromParent())); } return result; diff --git a/core/src/loader/http/gettimer.cpp b/core/src/loader/http/gettimer.cpp index 752147d..39e04f9 100644 --- a/core/src/loader/http/gettimer.cpp +++ b/core/src/loader/http/gettimer.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetTimerLoader::GetTimerLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetTimerLoader::path(const GetTimerParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/LiveTv/Timers/") + Support::toString(params.timerId()) ; + return QStringLiteral("/LiveTv/Timers/") + Support::toString< QString>(params.timerId()) ; } QUrlQuery GetTimerLoader::query(const GetTimerParams ¶ms) const { diff --git a/core/src/loader/http/gettimers.cpp b/core/src/loader/http/gettimers.cpp index 9b331db..3d594ef 100644 --- a/core/src/loader/http/gettimers.cpp +++ b/core/src/loader/http/gettimers.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetTimersLoader::GetTimersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetTimersLoader::path(const GetTimersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,16 +51,16 @@ QUrlQuery GetTimersLoader::query(const GetTimersParams ¶ms) const { // Optional parameters if (!params.channelIdNull()) { - result.addQueryItem("channelId", Support::toString(params.channelId())); + result.addQueryItem("channelId", Support::toString(params.channelId())); } if (!params.seriesTimerIdNull()) { - result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); + result.addQueryItem("seriesTimerId", Support::toString(params.seriesTimerId())); } if (!params.isActiveNull()) { - result.addQueryItem("isActive", Support::toString(params.isActive())); + result.addQueryItem("isActive", Support::toString>(params.isActive())); } if (!params.isScheduledNull()) { - result.addQueryItem("isScheduled", Support::toString(params.isScheduled())); + result.addQueryItem("isScheduled", Support::toString>(params.isScheduled())); } return result; diff --git a/core/src/loader/http/gettrailerremotesearchresults.cpp b/core/src/loader/http/gettrailerremotesearchresults.cpp index 41b4ecc..15995a6 100644 --- a/core/src/loader/http/gettrailerremotesearchresults.cpp +++ b/core/src/loader/http/gettrailerremotesearchresults.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetTrailerRemoteSearchResultsLoader::GetTrailerRemoteSearchResultsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetTrailerRemoteSearchResultsParams>(apiClient) {} + +QString GetTrailerRemoteSearchResultsLoader::path(const GetTrailerRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Items/RemoteSearch/Trailer"); +} + +QUrlQuery GetTrailerRemoteSearchResultsLoader::query(const GetTrailerRemoteSearchResultsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/gettrailers.cpp b/core/src/loader/http/gettrailers.cpp index 4ea942a..2418887 100644 --- a/core/src/loader/http/gettrailers.cpp +++ b/core/src/loader/http/gettrailers.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetTrailersLoader::GetTrailersLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetTrailersLoader::path(const GetTrailersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,241 +51,241 @@ QUrlQuery GetTrailersLoader::query(const GetTrailersParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.maxOfficialRatingNull()) { - result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); + result.addQueryItem("maxOfficialRating", Support::toString(params.maxOfficialRating())); } if (!params.hasThemeSongNull()) { - result.addQueryItem("hasThemeSong", Support::toString(params.hasThemeSong())); + result.addQueryItem("hasThemeSong", Support::toString>(params.hasThemeSong())); } if (!params.hasThemeVideoNull()) { - result.addQueryItem("hasThemeVideo", Support::toString(params.hasThemeVideo())); + result.addQueryItem("hasThemeVideo", Support::toString>(params.hasThemeVideo())); } if (!params.hasSubtitlesNull()) { - result.addQueryItem("hasSubtitles", Support::toString(params.hasSubtitles())); + result.addQueryItem("hasSubtitles", Support::toString>(params.hasSubtitles())); } if (!params.hasSpecialFeatureNull()) { - result.addQueryItem("hasSpecialFeature", Support::toString(params.hasSpecialFeature())); + result.addQueryItem("hasSpecialFeature", Support::toString>(params.hasSpecialFeature())); } if (!params.hasTrailerNull()) { - result.addQueryItem("hasTrailer", Support::toString(params.hasTrailer())); + result.addQueryItem("hasTrailer", Support::toString>(params.hasTrailer())); } if (!params.adjacentToNull()) { - result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); + result.addQueryItem("adjacentTo", Support::toString(params.adjacentTo())); } if (!params.parentIndexNumberNull()) { - result.addQueryItem("parentIndexNumber", Support::toString(params.parentIndexNumber())); + result.addQueryItem("parentIndexNumber", Support::toString>(params.parentIndexNumber())); } if (!params.hasParentalRatingNull()) { - result.addQueryItem("hasParentalRating", Support::toString(params.hasParentalRating())); + result.addQueryItem("hasParentalRating", Support::toString>(params.hasParentalRating())); } if (!params.isHdNull()) { - result.addQueryItem("isHd", Support::toString(params.isHd())); + result.addQueryItem("isHd", Support::toString>(params.isHd())); } if (!params.is4KNull()) { - result.addQueryItem("is4K", Support::toString(params.is4K())); + result.addQueryItem("is4K", Support::toString>(params.is4K())); } if (!params.locationTypesNull()) { - result.addQueryItem("locationTypes", Support::toString(params.locationTypes())); + result.addQueryItem("locationTypes", Support::toString>(params.locationTypes())); } if (!params.excludeLocationTypesNull()) { - result.addQueryItem("excludeLocationTypes", Support::toString(params.excludeLocationTypes())); + result.addQueryItem("excludeLocationTypes", Support::toString>(params.excludeLocationTypes())); } if (!params.isMissingNull()) { - result.addQueryItem("isMissing", Support::toString(params.isMissing())); + result.addQueryItem("isMissing", Support::toString>(params.isMissing())); } if (!params.isUnairedNull()) { - result.addQueryItem("isUnaired", Support::toString(params.isUnaired())); + result.addQueryItem("isUnaired", Support::toString>(params.isUnaired())); } if (!params.minCommunityRatingNull()) { - result.addQueryItem("minCommunityRating", Support::toString(params.minCommunityRating())); + result.addQueryItem("minCommunityRating", Support::toString>(params.minCommunityRating())); } if (!params.minCriticRatingNull()) { - result.addQueryItem("minCriticRating", Support::toString(params.minCriticRating())); + result.addQueryItem("minCriticRating", Support::toString>(params.minCriticRating())); } if (!params.minPremiereDateNull()) { - result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); + result.addQueryItem("minPremiereDate", Support::toString(params.minPremiereDate())); } if (!params.minDateLastSavedNull()) { - result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); + result.addQueryItem("minDateLastSaved", Support::toString(params.minDateLastSaved())); } if (!params.minDateLastSavedForUserNull()) { - result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); + result.addQueryItem("minDateLastSavedForUser", Support::toString(params.minDateLastSavedForUser())); } if (!params.maxPremiereDateNull()) { - result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); + result.addQueryItem("maxPremiereDate", Support::toString(params.maxPremiereDate())); } if (!params.hasOverviewNull()) { - result.addQueryItem("hasOverview", Support::toString(params.hasOverview())); + result.addQueryItem("hasOverview", Support::toString>(params.hasOverview())); } if (!params.hasImdbIdNull()) { - result.addQueryItem("hasImdbId", Support::toString(params.hasImdbId())); + result.addQueryItem("hasImdbId", Support::toString>(params.hasImdbId())); } if (!params.hasTmdbIdNull()) { - result.addQueryItem("hasTmdbId", Support::toString(params.hasTmdbId())); + result.addQueryItem("hasTmdbId", Support::toString>(params.hasTmdbId())); } if (!params.hasTvdbIdNull()) { - result.addQueryItem("hasTvdbId", Support::toString(params.hasTvdbId())); + result.addQueryItem("hasTvdbId", Support::toString>(params.hasTvdbId())); } if (!params.excludeItemIdsNull()) { - result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); + result.addQueryItem("excludeItemIds", Support::toString(params.excludeItemIds())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.recursiveNull()) { - result.addQueryItem("recursive", Support::toString(params.recursive())); + result.addQueryItem("recursive", Support::toString>(params.recursive())); } if (!params.searchTermNull()) { - result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); + result.addQueryItem("searchTerm", Support::toString(params.searchTerm())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.filtersNull()) { - result.addQueryItem("filters", Support::toString(params.filters())); + result.addQueryItem("filters", Support::toString>(params.filters())); } if (!params.isFavoriteNull()) { - result.addQueryItem("isFavorite", Support::toString(params.isFavorite())); + result.addQueryItem("isFavorite", Support::toString>(params.isFavorite())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.imageTypesNull()) { - result.addQueryItem("imageTypes", Support::toString(params.imageTypes())); + result.addQueryItem("imageTypes", Support::toString>(params.imageTypes())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.isPlayedNull()) { - result.addQueryItem("isPlayed", Support::toString(params.isPlayed())); + result.addQueryItem("isPlayed", Support::toString>(params.isPlayed())); } if (!params.genresNull()) { - result.addQueryItem("genres", Support::toString(params.genres())); + result.addQueryItem("genres", Support::toString(params.genres())); } if (!params.officialRatingsNull()) { - result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); + result.addQueryItem("officialRatings", Support::toString(params.officialRatings())); } if (!params.tagsNull()) { - result.addQueryItem("tags", Support::toString(params.tags())); + result.addQueryItem("tags", Support::toString(params.tags())); } if (!params.yearsNull()) { - result.addQueryItem("years", Support::toString(params.years())); + result.addQueryItem("years", Support::toString>(params.years())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.personNull()) { - result.addQueryItem("person", Support::toString(params.person())); + result.addQueryItem("person", Support::toString(params.person())); } if (!params.personIdsNull()) { - result.addQueryItem("personIds", Support::toString(params.personIds())); + result.addQueryItem("personIds", Support::toString(params.personIds())); } if (!params.personTypesNull()) { - result.addQueryItem("personTypes", Support::toString(params.personTypes())); + result.addQueryItem("personTypes", Support::toString(params.personTypes())); } if (!params.studiosNull()) { - result.addQueryItem("studios", Support::toString(params.studios())); + result.addQueryItem("studios", Support::toString(params.studios())); } if (!params.artistsNull()) { - result.addQueryItem("artists", Support::toString(params.artists())); + result.addQueryItem("artists", Support::toString(params.artists())); } if (!params.excludeArtistIdsNull()) { - result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); + result.addQueryItem("excludeArtistIds", Support::toString(params.excludeArtistIds())); } if (!params.artistIdsNull()) { - result.addQueryItem("artistIds", Support::toString(params.artistIds())); + result.addQueryItem("artistIds", Support::toString(params.artistIds())); } if (!params.albumArtistIdsNull()) { - result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); + result.addQueryItem("albumArtistIds", Support::toString(params.albumArtistIds())); } if (!params.contributingArtistIdsNull()) { - result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); + result.addQueryItem("contributingArtistIds", Support::toString(params.contributingArtistIds())); } if (!params.albumsNull()) { - result.addQueryItem("albums", Support::toString(params.albums())); + result.addQueryItem("albums", Support::toString(params.albums())); } if (!params.albumIdsNull()) { - result.addQueryItem("albumIds", Support::toString(params.albumIds())); + result.addQueryItem("albumIds", Support::toString(params.albumIds())); } if (!params.idsNull()) { - result.addQueryItem("ids", Support::toString(params.ids())); + result.addQueryItem("ids", Support::toString(params.ids())); } if (!params.videoTypesNull()) { - result.addQueryItem("videoTypes", Support::toString(params.videoTypes())); + result.addQueryItem("videoTypes", Support::toString>(params.videoTypes())); } if (!params.minOfficialRatingNull()) { - result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); + result.addQueryItem("minOfficialRating", Support::toString(params.minOfficialRating())); } if (!params.isLockedNull()) { - result.addQueryItem("isLocked", Support::toString(params.isLocked())); + result.addQueryItem("isLocked", Support::toString>(params.isLocked())); } if (!params.isPlaceHolderNull()) { - result.addQueryItem("isPlaceHolder", Support::toString(params.isPlaceHolder())); + result.addQueryItem("isPlaceHolder", Support::toString>(params.isPlaceHolder())); } if (!params.hasOfficialRatingNull()) { - result.addQueryItem("hasOfficialRating", Support::toString(params.hasOfficialRating())); + result.addQueryItem("hasOfficialRating", Support::toString>(params.hasOfficialRating())); } if (!params.collapseBoxSetItemsNull()) { - result.addQueryItem("collapseBoxSetItems", Support::toString(params.collapseBoxSetItems())); + result.addQueryItem("collapseBoxSetItems", Support::toString>(params.collapseBoxSetItems())); } if (!params.minWidthNull()) { - result.addQueryItem("minWidth", Support::toString(params.minWidth())); + result.addQueryItem("minWidth", Support::toString>(params.minWidth())); } if (!params.minHeightNull()) { - result.addQueryItem("minHeight", Support::toString(params.minHeight())); + result.addQueryItem("minHeight", Support::toString>(params.minHeight())); } if (!params.maxWidthNull()) { - result.addQueryItem("maxWidth", Support::toString(params.maxWidth())); + result.addQueryItem("maxWidth", Support::toString>(params.maxWidth())); } if (!params.maxHeightNull()) { - result.addQueryItem("maxHeight", Support::toString(params.maxHeight())); + result.addQueryItem("maxHeight", Support::toString>(params.maxHeight())); } if (!params.is3DNull()) { - result.addQueryItem("is3D", Support::toString(params.is3D())); + result.addQueryItem("is3D", Support::toString>(params.is3D())); } if (!params.seriesStatusNull()) { - result.addQueryItem("seriesStatus", Support::toString(params.seriesStatus())); + result.addQueryItem("seriesStatus", Support::toString>(params.seriesStatus())); } if (!params.nameStartsWithOrGreaterNull()) { - result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); + result.addQueryItem("nameStartsWithOrGreater", Support::toString(params.nameStartsWithOrGreater())); } if (!params.nameStartsWithNull()) { - result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); + result.addQueryItem("nameStartsWith", Support::toString(params.nameStartsWith())); } if (!params.nameLessThanNull()) { - result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); + result.addQueryItem("nameLessThan", Support::toString(params.nameLessThan())); } if (!params.studioIdsNull()) { - result.addQueryItem("studioIds", Support::toString(params.studioIds())); + result.addQueryItem("studioIds", Support::toString(params.studioIds())); } if (!params.genreIdsNull()) { - result.addQueryItem("genreIds", Support::toString(params.genreIds())); + result.addQueryItem("genreIds", Support::toString(params.genreIds())); } if (!params.enableTotalRecordCountNull()) { - result.addQueryItem("enableTotalRecordCount", Support::toString(params.enableTotalRecordCount())); + result.addQueryItem("enableTotalRecordCount", Support::toString>(params.enableTotalRecordCount())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/gettunerhosttypes.cpp b/core/src/loader/http/gettunerhosttypes.cpp index 13bb30d..a6408d2 100644 --- a/core/src/loader/http/gettunerhosttypes.cpp +++ b/core/src/loader/http/gettunerhosttypes.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetTunerHostTypesLoader::GetTunerHostTypesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetTunerHostTypesParams>(apiClient) {} + +QString GetTunerHostTypesLoader::path(const GetTunerHostTypesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/LiveTv/TunerHosts/Types"); +} + +QUrlQuery GetTunerHostTypesLoader::query(const GetTunerHostTypesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getupcomingepisodes.cpp b/core/src/loader/http/getupcomingepisodes.cpp index a363004..8a74c17 100644 --- a/core/src/loader/http/getupcomingepisodes.cpp +++ b/core/src/loader/http/getupcomingepisodes.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetUpcomingEpisodesLoader::GetUpcomingEpisodesLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetUpcomingEpisodesLoader::path(const GetUpcomingEpisodesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,31 +51,31 @@ QUrlQuery GetUpcomingEpisodesLoader::query(const GetUpcomingEpisodesParams ¶ // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.enableImgesNull()) { - result.addQueryItem("enableImges", Support::toString(params.enableImges())); + result.addQueryItem("enableImges", Support::toString>(params.enableImges())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } return result; diff --git a/core/src/loader/http/getuserbyid.cpp b/core/src/loader/http/getuserbyid.cpp index 59b0b79..d01f7ee 100644 --- a/core/src/loader/http/getuserbyid.cpp +++ b/core/src/loader/http/getuserbyid.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetUserByIdLoader::GetUserByIdLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetUserByIdLoader::path(const GetUserByIdParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) ; } QUrlQuery GetUserByIdLoader::query(const GetUserByIdParams ¶ms) const { diff --git a/core/src/loader/http/getusers.cpp b/core/src/loader/http/getusers.cpp index 64116a8..d871719 100644 --- a/core/src/loader/http/getusers.cpp +++ b/core/src/loader/http/getusers.cpp @@ -34,6 +34,32 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetUsersLoader::GetUsersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetUsersParams>(apiClient) {} + +QString GetUsersLoader::path(const GetUsersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Users"); +} + +QUrlQuery GetUsersLoader::query(const GetUsersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.isHiddenNull()) { + result.addQueryItem("isHidden", Support::toString>(params.isHidden())); + } + if (!params.isDisabledNull()) { + result.addQueryItem("isDisabled", Support::toString>(params.isDisabled())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getuserviews.cpp b/core/src/loader/http/getuserviews.cpp index 0739174..4455932 100644 --- a/core/src/loader/http/getuserviews.cpp +++ b/core/src/loader/http/getuserviews.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetUserViewsLoader::GetUserViewsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetUserViewsLoader::path(const GetUserViewsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Views"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Views"); } QUrlQuery GetUserViewsLoader::query(const GetUserViewsParams ¶ms) const { @@ -50,13 +51,13 @@ QUrlQuery GetUserViewsLoader::query(const GetUserViewsParams ¶ms) const { // Optional parameters if (!params.includeExternalContentNull()) { - result.addQueryItem("includeExternalContent", Support::toString(params.includeExternalContent())); + result.addQueryItem("includeExternalContent", Support::toString>(params.includeExternalContent())); } if (!params.presetViewsNull()) { - result.addQueryItem("presetViews", Support::toString(params.presetViews())); + result.addQueryItem("presetViews", Support::toString(params.presetViews())); } if (!params.includeHiddenNull()) { - result.addQueryItem("includeHidden", Support::toString(params.includeHidden())); + result.addQueryItem("includeHidden", Support::toString>(params.includeHidden())); } return result; diff --git a/core/src/loader/http/getutctime.cpp b/core/src/loader/http/getutctime.cpp index 5b6d485..37bea26 100644 --- a/core/src/loader/http/getutctime.cpp +++ b/core/src/loader/http/getutctime.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetUtcTimeLoader::GetUtcTimeLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetUtcTimeLoader::path(const GetUtcTimeParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/getvirtualfolders.cpp b/core/src/loader/http/getvirtualfolders.cpp index 4e72cf5..abc8543 100644 --- a/core/src/loader/http/getvirtualfolders.cpp +++ b/core/src/loader/http/getvirtualfolders.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetVirtualFoldersLoader::GetVirtualFoldersLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetVirtualFoldersParams>(apiClient) {} + +QString GetVirtualFoldersLoader::path(const GetVirtualFoldersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/Library/VirtualFolders"); +} + +QUrlQuery GetVirtualFoldersLoader::query(const GetVirtualFoldersParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getwakeonlaninfo.cpp b/core/src/loader/http/getwakeonlaninfo.cpp index 69c72d7..b627cc7 100644 --- a/core/src/loader/http/getwakeonlaninfo.cpp +++ b/core/src/loader/http/getwakeonlaninfo.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +GetWakeOnLanInfoLoader::GetWakeOnLanInfoLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, GetWakeOnLanInfoParams>(apiClient) {} + +QString GetWakeOnLanInfoLoader::path(const GetWakeOnLanInfoParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/WakeOnLanInfo"); +} + +QUrlQuery GetWakeOnLanInfoLoader::query(const GetWakeOnLanInfoParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/getyear.cpp b/core/src/loader/http/getyear.cpp index ccd59e9..81e2f76 100644 --- a/core/src/loader/http/getyear.cpp +++ b/core/src/loader/http/getyear.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetYearLoader::GetYearLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetYearLoader::path(const GetYearParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Years/") + Support::toString(params.year()) ; + return QStringLiteral("/Years/") + Support::toString< qint32>(params.year()) ; } QUrlQuery GetYearLoader::query(const GetYearParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery GetYearLoader::query(const GetYearParams ¶ms) const { // Optional parameters if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } return result; diff --git a/core/src/loader/http/getyears.cpp b/core/src/loader/http/getyears.cpp index c46813f..23ee39f 100644 --- a/core/src/loader/http/getyears.cpp +++ b/core/src/loader/http/getyears.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; GetYearsLoader::GetYearsLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString GetYearsLoader::path(const GetYearsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,49 +51,49 @@ QUrlQuery GetYearsLoader::query(const GetYearsParams ¶ms) const { // Optional parameters if (!params.startIndexNull()) { - result.addQueryItem("startIndex", Support::toString(params.startIndex())); + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } if (!params.limitNull()) { - result.addQueryItem("limit", Support::toString(params.limit())); + result.addQueryItem("limit", Support::toString>(params.limit())); } if (!params.sortOrderNull()) { - result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); + result.addQueryItem("sortOrder", Support::toString(params.sortOrder())); } if (!params.parentIdNull()) { - result.addQueryItem("parentId", Support::toString(params.parentId())); + result.addQueryItem("parentId", Support::toString(params.parentId())); } if (!params.fieldsNull()) { - result.addQueryItem("fields", Support::toString(params.fields())); + result.addQueryItem("fields", Support::toString>(params.fields())); } if (!params.excludeItemTypesNull()) { - result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); + result.addQueryItem("excludeItemTypes", Support::toString(params.excludeItemTypes())); } if (!params.includeItemTypesNull()) { - result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); + result.addQueryItem("includeItemTypes", Support::toString(params.includeItemTypes())); } if (!params.mediaTypesNull()) { - result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); + result.addQueryItem("mediaTypes", Support::toString(params.mediaTypes())); } if (!params.sortByNull()) { - result.addQueryItem("sortBy", Support::toString(params.sortBy())); + result.addQueryItem("sortBy", Support::toString(params.sortBy())); } if (!params.enableUserDataNull()) { - result.addQueryItem("enableUserData", Support::toString(params.enableUserData())); + result.addQueryItem("enableUserData", Support::toString>(params.enableUserData())); } if (!params.imageTypeLimitNull()) { - result.addQueryItem("imageTypeLimit", Support::toString(params.imageTypeLimit())); + result.addQueryItem("imageTypeLimit", Support::toString>(params.imageTypeLimit())); } if (!params.enableImageTypesNull()) { - result.addQueryItem("enableImageTypes", Support::toString(params.enableImageTypes())); + result.addQueryItem("enableImageTypes", Support::toString>(params.enableImageTypes())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.recursiveNull()) { - result.addQueryItem("recursive", Support::toString(params.recursive())); + result.addQueryItem("recursive", Support::toString>(params.recursive())); } if (!params.enableImagesNull()) { - result.addQueryItem("enableImages", Support::toString(params.enableImages())); + result.addQueryItem("enableImages", Support::toString>(params.enableImages())); } return result; diff --git a/core/src/loader/http/initiate.cpp b/core/src/loader/http/initiate.cpp index c3c6bb8..c895fd2 100644 --- a/core/src/loader/http/initiate.cpp +++ b/core/src/loader/http/initiate.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; InitiateLoader::InitiateLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString InitiateLoader::path(const InitiateParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/markfavoriteitem.cpp b/core/src/loader/http/markfavoriteitem.cpp index 00d4254..69216d5 100644 --- a/core/src/loader/http/markfavoriteitem.cpp +++ b/core/src/loader/http/markfavoriteitem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; MarkFavoriteItemLoader::MarkFavoriteItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString MarkFavoriteItemLoader::path(const MarkFavoriteItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/FavoriteItems/") + Support::toString(params.itemId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/FavoriteItems/") + Support::toString< QString>(params.itemId()) ; } QUrlQuery MarkFavoriteItemLoader::query(const MarkFavoriteItemParams ¶ms) const { diff --git a/core/src/loader/http/markplayeditem.cpp b/core/src/loader/http/markplayeditem.cpp index db4c961..1c105f0 100644 --- a/core/src/loader/http/markplayeditem.cpp +++ b/core/src/loader/http/markplayeditem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; MarkPlayedItemLoader::MarkPlayedItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString MarkPlayedItemLoader::path(const MarkPlayedItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/PlayedItems/") + Support::toString(params.itemId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/PlayedItems/") + Support::toString< QString>(params.itemId()) ; } QUrlQuery MarkPlayedItemLoader::query(const MarkPlayedItemParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery MarkPlayedItemLoader::query(const MarkPlayedItemParams ¶ms) const // Optional parameters if (!params.datePlayedNull()) { - result.addQueryItem("datePlayed", Support::toString(params.datePlayed())); + result.addQueryItem("datePlayed", Support::toString(params.datePlayed())); } return result; diff --git a/core/src/loader/http/markunplayeditem.cpp b/core/src/loader/http/markunplayeditem.cpp index 29a349b..79ac8d2 100644 --- a/core/src/loader/http/markunplayeditem.cpp +++ b/core/src/loader/http/markunplayeditem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; MarkUnplayedItemLoader::MarkUnplayedItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString MarkUnplayedItemLoader::path(const MarkUnplayedItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/PlayedItems/") + Support::toString(params.itemId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/PlayedItems/") + Support::toString< QString>(params.itemId()) ; } QUrlQuery MarkUnplayedItemLoader::query(const MarkUnplayedItemParams ¶ms) const { diff --git a/core/src/loader/http/openlivestream.cpp b/core/src/loader/http/openlivestream.cpp index 0924b62..f23cfb9 100644 --- a/core/src/loader/http/openlivestream.cpp +++ b/core/src/loader/http/openlivestream.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; OpenLiveStreamLoader::OpenLiveStreamLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString OpenLiveStreamLoader::path(const OpenLiveStreamParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings @@ -50,37 +51,37 @@ QUrlQuery OpenLiveStreamLoader::query(const OpenLiveStreamParams ¶ms) const // Optional parameters if (!params.openTokenNull()) { - result.addQueryItem("openToken", Support::toString(params.openToken())); + result.addQueryItem("openToken", Support::toString(params.openToken())); } if (!params.userIdNull()) { - result.addQueryItem("userId", Support::toString(params.userId())); + result.addQueryItem("userId", Support::toString(params.userId())); } if (!params.playSessionIdNull()) { - result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); + result.addQueryItem("playSessionId", Support::toString(params.playSessionId())); } if (!params.maxStreamingBitrateNull()) { - result.addQueryItem("maxStreamingBitrate", Support::toString(params.maxStreamingBitrate())); + result.addQueryItem("maxStreamingBitrate", Support::toString>(params.maxStreamingBitrate())); } if (!params.startTimeTicksNull()) { - result.addQueryItem("startTimeTicks", Support::toString(params.startTimeTicks())); + result.addQueryItem("startTimeTicks", Support::toString>(params.startTimeTicks())); } if (!params.audioStreamIndexNull()) { - result.addQueryItem("audioStreamIndex", Support::toString(params.audioStreamIndex())); + result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); } if (!params.subtitleStreamIndexNull()) { - result.addQueryItem("subtitleStreamIndex", Support::toString(params.subtitleStreamIndex())); + result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); } if (!params.maxAudioChannelsNull()) { - result.addQueryItem("maxAudioChannels", Support::toString(params.maxAudioChannels())); + result.addQueryItem("maxAudioChannels", Support::toString>(params.maxAudioChannels())); } if (!params.itemIdNull()) { - result.addQueryItem("itemId", Support::toString(params.itemId())); + result.addQueryItem("itemId", Support::toString(params.itemId())); } if (!params.enableDirectPlayNull()) { - result.addQueryItem("enableDirectPlay", Support::toString(params.enableDirectPlay())); + result.addQueryItem("enableDirectPlay", Support::toString>(params.enableDirectPlay())); } if (!params.enableDirectStreamNull()) { - result.addQueryItem("enableDirectStream", Support::toString(params.enableDirectStream())); + result.addQueryItem("enableDirectStream", Support::toString>(params.enableDirectStream())); } return result; diff --git a/core/src/loader/http/postpingsystem.cpp b/core/src/loader/http/postpingsystem.cpp index 14cbf94..150ccf7 100644 --- a/core/src/loader/http/postpingsystem.cpp +++ b/core/src/loader/http/postpingsystem.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +PostPingSystemLoader::PostPingSystemLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader(apiClient) {} + +QString PostPingSystemLoader::path(const PostPingSystemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/System/Ping"); +} + +QUrlQuery PostPingSystemLoader::query(const PostPingSystemParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/searchremotesubtitles.cpp b/core/src/loader/http/searchremotesubtitles.cpp index f85fe78..4c97443 100644 --- a/core/src/loader/http/searchremotesubtitles.cpp +++ b/core/src/loader/http/searchremotesubtitles.cpp @@ -34,6 +34,29 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +SearchRemoteSubtitlesLoader::SearchRemoteSubtitlesLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, SearchRemoteSubtitlesParams>(apiClient) {} + +QString SearchRemoteSubtitlesLoader::path(const SearchRemoteSubtitlesParams ¶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.language()) ; +} + +QUrlQuery SearchRemoteSubtitlesLoader::query(const SearchRemoteSubtitlesParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + if (!params.isPerfectMatchNull()) { + result.addQueryItem("isPerfectMatch", Support::toString>(params.isPerfectMatch())); + } + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/setchannelmapping.cpp b/core/src/loader/http/setchannelmapping.cpp index f61e8b5..b62b625 100644 --- a/core/src/loader/http/setchannelmapping.cpp +++ b/core/src/loader/http/setchannelmapping.cpp @@ -34,8 +34,9 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; SetChannelMappingLoader::SetChannelMappingLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString SetChannelMappingLoader::path(const SetChannelMappingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings diff --git a/core/src/loader/http/syncplaygetgroups.cpp b/core/src/loader/http/syncplaygetgroups.cpp index 2ff08b6..2a9b6b6 100644 --- a/core/src/loader/http/syncplaygetgroups.cpp +++ b/core/src/loader/http/syncplaygetgroups.cpp @@ -34,6 +34,26 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; +SyncPlayGetGroupsLoader::SyncPlayGetGroupsLoader(ApiClient *apiClient) + : Jellyfin::Support::HttpLoader, SyncPlayGetGroupsParams>(apiClient) {} + +QString SyncPlayGetGroupsLoader::path(const SyncPlayGetGroupsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + return QStringLiteral("/SyncPlay/List"); +} + +QUrlQuery SyncPlayGetGroupsLoader::query(const SyncPlayGetGroupsParams ¶ms) const { + Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings + + QUrlQuery result; + + // Optional parameters + + return result; +} + } // NS HTTP } // NS Loader diff --git a/core/src/loader/http/unmarkfavoriteitem.cpp b/core/src/loader/http/unmarkfavoriteitem.cpp index 126e0c8..42ea099 100644 --- a/core/src/loader/http/unmarkfavoriteitem.cpp +++ b/core/src/loader/http/unmarkfavoriteitem.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; UnmarkFavoriteItemLoader::UnmarkFavoriteItemLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString UnmarkFavoriteItemLoader::path(const UnmarkFavoriteItemParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/FavoriteItems/") + Support::toString(params.itemId()) ; + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/FavoriteItems/") + Support::toString< QString>(params.itemId()) ; } QUrlQuery UnmarkFavoriteItemLoader::query(const UnmarkFavoriteItemParams ¶ms) const { diff --git a/core/src/loader/http/updateuseritemrating.cpp b/core/src/loader/http/updateuseritemrating.cpp index 0bd3d15..f355846 100644 --- a/core/src/loader/http/updateuseritemrating.cpp +++ b/core/src/loader/http/updateuseritemrating.cpp @@ -34,13 +34,14 @@ namespace Loader { namespace HTTP { +using namespace Jellyfin::DTO; UpdateUserItemRatingLoader::UpdateUserItemRatingLoader(ApiClient *apiClient) - : Jellyfin::Support::HttpLoader(apiClient) {} + : Jellyfin::Support::HttpLoader(apiClient) {} QString UpdateUserItemRatingLoader::path(const UpdateUserItemRatingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings - return QStringLiteral("/Users/") + Support::toString(params.userId()) + QStringLiteral("/Items/") + Support::toString(params.itemId()) + QStringLiteral("/Rating"); + return QStringLiteral("/Users/") + Support::toString< QString>(params.userId()) + QStringLiteral("/Items/") + Support::toString< QString>(params.itemId()) + QStringLiteral("/Rating"); } QUrlQuery UpdateUserItemRatingLoader::query(const UpdateUserItemRatingParams ¶ms) const { @@ -50,7 +51,7 @@ QUrlQuery UpdateUserItemRatingLoader::query(const UpdateUserItemRatingParams &pa // Optional parameters if (!params.likesNull()) { - result.addQueryItem("likes", Support::toString(params.likes())); + result.addQueryItem("likes", Support::toString>(params.likes())); } return result; diff --git a/core/src/loader/requesttypes.cpp b/core/src/loader/requesttypes.cpp index e62cc62..c470fa2 100644 --- a/core/src/loader/requesttypes.cpp +++ b/core/src/loader/requesttypes.cpp @@ -4251,7 +4251,7 @@ void GetAudioStreamParams::setStaticStreamingNull() { const QJsonObject &GetAudioStreamParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetAudioStreamParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -4260,14 +4260,14 @@ void GetAudioStreamParams::setStreamOptions(QJsonObject newStreamOptions) { bool GetAudioStreamParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetAudioStreamParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -5260,7 +5260,7 @@ void GetAudioStreamByContainerParams::setStaticStreamingNull() { const QJsonObject &GetAudioStreamByContainerParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetAudioStreamByContainerParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -5269,14 +5269,14 @@ void GetAudioStreamByContainerParams::setStreamOptions(QJsonObject newStreamOpti bool GetAudioStreamByContainerParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetAudioStreamByContainerParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -8601,7 +8601,7 @@ void GetHlsAudioSegmentParams::setStaticStreamingNull() { const QJsonObject &GetHlsAudioSegmentParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetHlsAudioSegmentParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -8610,14 +8610,14 @@ void GetHlsAudioSegmentParams::setStreamOptions(QJsonObject newStreamOptions) { bool GetHlsAudioSegmentParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetHlsAudioSegmentParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -9694,7 +9694,7 @@ void GetHlsVideoSegmentParams::setStaticStreamingNull() { const QJsonObject &GetHlsVideoSegmentParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetHlsVideoSegmentParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -9703,14 +9703,14 @@ void GetHlsVideoSegmentParams::setStreamOptions(QJsonObject newStreamOptions) { bool GetHlsVideoSegmentParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetHlsVideoSegmentParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -16838,7 +16838,7 @@ void GetLiveHlsStreamParams::setStaticStreamingNull() { const QJsonObject &GetLiveHlsStreamParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetLiveHlsStreamParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -16847,14 +16847,14 @@ void GetLiveHlsStreamParams::setStreamOptions(QJsonObject newStreamOptions) { bool GetLiveHlsStreamParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetLiveHlsStreamParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -19050,7 +19050,7 @@ void GetMasterHlsAudioPlaylistParams::setStaticStreamingNull() { const QJsonObject &GetMasterHlsAudioPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetMasterHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -19059,14 +19059,14 @@ void GetMasterHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOpti bool GetMasterHlsAudioPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetMasterHlsAudioPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -20059,7 +20059,7 @@ void GetMasterHlsVideoPlaylistParams::setStaticStreamingNull() { const QJsonObject &GetMasterHlsVideoPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetMasterHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -20068,14 +20068,14 @@ void GetMasterHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOpti bool GetMasterHlsVideoPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetMasterHlsVideoPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -32023,7 +32023,7 @@ void GetVariantHlsAudioPlaylistParams::setStaticStreamingNull() { const QJsonObject &GetVariantHlsAudioPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetVariantHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -32032,14 +32032,14 @@ void GetVariantHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOpt bool GetVariantHlsAudioPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetVariantHlsAudioPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -33023,7 +33023,7 @@ void GetVariantHlsVideoPlaylistParams::setStaticStreamingNull() { const QJsonObject &GetVariantHlsVideoPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetVariantHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -33032,14 +33032,14 @@ void GetVariantHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOpt bool GetVariantHlsVideoPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetVariantHlsVideoPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -34044,7 +34044,7 @@ void GetVideoStreamParams::setStaticStreamingNull() { const QJsonObject &GetVideoStreamParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetVideoStreamParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -34053,14 +34053,14 @@ void GetVideoStreamParams::setStreamOptions(QJsonObject newStreamOptions) { bool GetVideoStreamParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetVideoStreamParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -35062,7 +35062,7 @@ void GetVideoStreamByContainerParams::setStaticStreamingNull() { const QJsonObject &GetVideoStreamByContainerParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void GetVideoStreamByContainerParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -35071,14 +35071,14 @@ void GetVideoStreamByContainerParams::setStreamOptions(QJsonObject newStreamOpti bool GetVideoStreamByContainerParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void GetVideoStreamByContainerParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -36769,7 +36769,7 @@ void HeadAudioStreamParams::setStaticStreamingNull() { const QJsonObject &HeadAudioStreamParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadAudioStreamParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -36778,14 +36778,14 @@ void HeadAudioStreamParams::setStreamOptions(QJsonObject newStreamOptions) { bool HeadAudioStreamParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadAudioStreamParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -37778,7 +37778,7 @@ void HeadAudioStreamByContainerParams::setStaticStreamingNull() { const QJsonObject &HeadAudioStreamByContainerParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadAudioStreamByContainerParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -37787,14 +37787,14 @@ void HeadAudioStreamByContainerParams::setStreamOptions(QJsonObject newStreamOpt bool HeadAudioStreamByContainerParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadAudioStreamByContainerParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -40385,7 +40385,7 @@ void HeadMasterHlsAudioPlaylistParams::setStaticStreamingNull() { const QJsonObject &HeadMasterHlsAudioPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadMasterHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -40394,14 +40394,14 @@ void HeadMasterHlsAudioPlaylistParams::setStreamOptions(QJsonObject newStreamOpt bool HeadMasterHlsAudioPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadMasterHlsAudioPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -41394,7 +41394,7 @@ void HeadMasterHlsVideoPlaylistParams::setStaticStreamingNull() { const QJsonObject &HeadMasterHlsVideoPlaylistParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadMasterHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -41403,14 +41403,14 @@ void HeadMasterHlsVideoPlaylistParams::setStreamOptions(QJsonObject newStreamOpt bool HeadMasterHlsVideoPlaylistParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadMasterHlsVideoPlaylistParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -45433,7 +45433,7 @@ void HeadVideoStreamParams::setStaticStreamingNull() { const QJsonObject &HeadVideoStreamParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadVideoStreamParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -45442,14 +45442,14 @@ void HeadVideoStreamParams::setStreamOptions(QJsonObject newStreamOptions) { bool HeadVideoStreamParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadVideoStreamParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } @@ -46451,7 +46451,7 @@ void HeadVideoStreamByContainerParams::setStaticStreamingNull() { const QJsonObject &HeadVideoStreamByContainerParams::streamOptions() const { - return m_streamOptions.value(); + return m_streamOptions; } void HeadVideoStreamByContainerParams::setStreamOptions(QJsonObject newStreamOptions) { @@ -46460,14 +46460,14 @@ void HeadVideoStreamByContainerParams::setStreamOptions(QJsonObject newStreamOpt bool HeadVideoStreamByContainerParams::streamOptionsNull() const { // Nullable: true - // Type Nullable: false + // Type Nullable: true - return !m_streamOptions.has_value(); + return m_streamOptions.isEmpty(); } void HeadVideoStreamByContainerParams::setStreamOptionsNull() { - m_streamOptions = std::nullopt; + m_streamOptions= QJsonObject(); } diff --git a/core/src/deviceprofile.cpp b/core/src/model/deviceprofile.cpp similarity index 90% rename from core/src/deviceprofile.cpp rename to core/src/model/deviceprofile.cpp index 8d08715..8220a03 100644 --- a/core/src/deviceprofile.cpp +++ b/core/src/model/deviceprofile.cpp @@ -1,25 +1,26 @@ /* -Sailfin: a Jellyfin client written using Qt -Copyright (C) 2021 Chris Josten + * Sailfin: a Jellyfin client written using Qt + * Copyright (C) 2021 Chris Josten and the Sailfin contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "JellyfinQt/deviceprofile.h" +#include "JellyfinQt/model/deviceprofile.h" namespace Jellyfin { +namespace Model { bool DeviceProfile::supportsHls() { return true; @@ -234,4 +235,6 @@ QJsonObject DeviceProfile::generateProfile() { profile["MaxStreamingBitrate"] = maxStreamingBitrate(); return profile; } + +} } diff --git a/core/src/support/jsonconv.cpp b/core/src/support/jsonconv.cpp index ef942fe..5889c8d 100644 --- a/core/src/support/jsonconv.cpp +++ b/core/src/support/jsonconv.cpp @@ -18,9 +18,22 @@ */ #include "JellyfinQt/support/jsonconv.h" +#include + namespace Jellyfin { namespace Support { +const char * ParseException::what() const noexcept { + return m_message.c_str(); +} + +QException *ParseException::clone() const { + return new ParseException(*this); +} + +void ParseException::raise() const { + throw *this; +} QString uuidToString(const QUuid &source) { QString str = source.toString(); @@ -29,7 +42,7 @@ QString uuidToString(const QUuid &source) { return QString(str.mid(1, 8) + str.mid(10, 4) + str.mid(15, 4) + str.mid(20, 4) + str.mid(25 + 12)); } QUuid stringToUuid(const QString &source) { - if (source.size() != 32) throw new ParseException("Error while trying to parse JSON value as QUid: invalid length"); + if (source.size() != 32) throw ParseException("Error while trying to parse JSON value as QUid: invalid length"); // Convert xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (length: 32) // to {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (length: 38) QString qtParseableString; @@ -52,73 +65,141 @@ QUuid stringToUuid(const QString &source) { // int template <> -int fromJsonValue(const QJsonValue &source) { - if (!source.isDouble()) throw new ParseException("Error while trying to parse JSON value as integer: not an integer"); +int fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isDouble()) throw ParseException("Error while trying to parse JSON value as integer: not an integer"); return source.toInt(); } template <> -QJsonValue toJsonValue(const int &source) { +QJsonValue toJsonValue(const int &source, convertType) { return QJsonValue(source); } +// "long" +template <> +qint64 fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isDouble()) throw ParseException("Error while trying to parse JSON value as integer: not an integer"); + return static_cast(source.toDouble()); +} + +template <> +QJsonValue toJsonValue(const qint64 &source, convertType) { + return QJsonValue(static_cast(source)); +} + // bool template <> -bool fromJsonValue(const QJsonValue &source) { - if (!source.isBool()) throw new ParseException("Error while trying to parse JSON value as boolean: not a boolean"); +bool fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isBool()) throw ParseException("Error while trying to parse JSON value as boolean: not a boolean"); return source.toBool(); } template <> -QJsonValue toJsonValue(const bool &source) { +QJsonValue toJsonValue(const bool &source, convertType) { return QJsonValue(source); } // QString template <> -QString fromJsonValue(const QJsonValue &source) { - if (!source.isString()) throw new ParseException("Error while trying to parse JSON value as string: not a string"); +QString fromJsonValue(const QJsonValue &source, convertType) { + if (source.isNull()) { + return QString(); + } + if (!source.isString()) { + throw ParseException(QStringLiteral("Error while trying to parse JSON value %1 as string: not a string").arg(source.type())); + } return source.toString(); } template <> -QJsonValue toJsonValue(const QString &source) { +QJsonValue toJsonValue(const QString &source, convertType) { + return QJsonValue(source); +} + +// QStringList +template <> +QStringList fromJsonValue(const QJsonValue &source, convertType) { + switch(source.type()) { + case QJsonValue::Array: { + QJsonArray arr = source.toArray(); + QStringList result; + result.reserve(arr.size()); + for(int i = 0; i < arr.size(); i++) { + result.append(fromJsonValue(arr.at(i))); + } + return result; + } + case QJsonValue::Null: + return QStringList(); + default: + throw ParseException(QStringLiteral("Error while trying to parse JSON value %1 as stringlist: not a list of strings").arg(source.type())); + } +} + + +template <> +QJsonValue toJsonValue(const QStringList &source, convertType) { + QJsonArray result; + for (int i = 0; i < source.size(); i++) { + result.append(source[i]); + } + return result; +} + +// QJsonObject +template <> +QJsonObject fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isObject()) throw ParseException("Error parsing JSON value as object: not a double"); + return source.toObject(); +} + +template <> +QJsonValue toJsonValue(const QJsonObject &source, convertType) { return QJsonValue(source); } // Double template <> -double fromJsonValue(const QJsonValue &source) { - if (!source.isDouble()) throw new ParseException("Error while trying to parse JSON value as integer: not a double"); +double fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isDouble()) throw ParseException("Error parsing JSON value as integer: not a double"); return source.toDouble(); } template <> -QJsonValue toJsonValue(const double &source) { +QJsonValue toJsonValue(const double &source, convertType) { return QJsonValue(source); } // QDateTime template <> -QDateTime fromJsonValue(const QJsonValue &source) { - if (!source.isString()) throw new ParseException("Error while trying to parse JSON value as DateTime: not a string"); - return QDateTime::fromString(source.toString(), Qt::ISODateWithMs); +QDateTime fromJsonValue(const QJsonValue &source, convertType) { + switch (source.type()) { + case QJsonValue::Null: + return QDateTime(); + case QJsonValue::String: + return QDateTime::fromString(source.toString(), Qt::ISODateWithMs); + default: + throw ParseException("Error while trying to parse JSON value as DateTime: not a string"); + } } template <> -QJsonValue toJsonValue(const QDateTime &source) { +QJsonValue toJsonValue(const QDateTime &source, convertType) { return QJsonValue(source.toString(Qt::ISODateWithMs)); } // QUuid template <> -QUuid fromJsonValue(const QJsonValue &source) { - if (!source.isString()) throw new ParseException("Error while trying to parse JSON value as QUuid: not a string"); +QUuid fromJsonValue(const QJsonValue &source, convertType) { + if (!source.isString()) { + qCritical() << "JSON Value " << source << "is not a string"; + throw ParseException(QStringLiteral("Error while trying to parse JSON value as QUuid: not a string")); + } return stringToUuid(source.toString()); } template <> -QJsonValue toJsonValue(const QUuid &source) { +QJsonValue toJsonValue(const QUuid &source, convertType) { return uuidToString(source); } diff --git a/core/src/viewmodel/itemmodel.cpp b/core/src/viewmodel/itemmodel.cpp index 519267f..b15263d 100644 --- a/core/src/viewmodel/itemmodel.cpp +++ b/core/src/viewmodel/itemmodel.cpp @@ -26,11 +26,18 @@ namespace Jellyfin { namespace ViewModel { UserViewsLoader::UserViewsLoader(QObject *parent) - : UserViewsLoaderBase(Loader::HTTP::GetUserViewsLoader(), parent) {} + : UserViewsLoaderBase(new Jellyfin::Loader::HTTP::GetUserViewsLoader(), parent) { + connect(this, &BaseModelLoader::apiClientChanged, this, &UserViewsLoader::apiClientChanged); +} void UserViewsLoader::apiClientChanged(ApiClient *newApiClient) { if (m_apiClient != nullptr) disconnect(m_apiClient, &ApiClient::userIdChanged, this, &UserViewsLoader::userIdChanged); - if (newApiClient != nullptr) connect(newApiClient, &ApiClient::userIdChanged, this, &UserViewsLoader::userIdChanged); + if (newApiClient != nullptr) { + connect(newApiClient, &ApiClient::userIdChanged, this, &UserViewsLoader::userIdChanged); + if (!newApiClient->userId().isNull()) { + m_parameters.setUserId(newApiClient->userId()); + } + } } void UserViewsLoader::userIdChanged(const QString &newUserId) { @@ -47,6 +54,10 @@ void UserItemsLoader::userIdChanged(const QString &newUserId) { autoReloadIfNeeded(); } +bool UserItemsLoader::canReload() const { + return BaseModelLoader::canReload() && !m_parameters.userId().isNull(); +} + ItemModel::ItemModel(QObject *parent) : ApiModel(parent) { } diff --git a/qtquick/qml/main.qml b/qtquick/qml/main.qml index 9212e5c..65d9116 100644 --- a/qtquick/qml/main.qml +++ b/qtquick/qml/main.qml @@ -37,7 +37,7 @@ ApplicationWindow { Connections { target: ApiClient - onSetupRequired: pageStack.replace(Qt.resolvedUrl("pages/setup/ServerSelectPage.qml")); + onSetupRequired: { pageStack.replace(Qt.resolvedUrl("pages/setup/ServerSelectPage.qml")); } } Component.onCompleted: { diff --git a/qtquick/src/main.cpp b/qtquick/src/main.cpp index e00bee0..774f316 100644 --- a/qtquick/src/main.cpp +++ b/qtquick/src/main.cpp @@ -8,12 +8,20 @@ #include #include +#include + #include int main(int argc, char** argv) { QGuiApplication app(argc, argv); app.setApplicationDisplayName(QStringLiteral("Sailfin QtQuick")); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + // Disable Qt nagging about "implicitly defined onFoo properties in connections are deprecated", + // as we cannot yet move towards a newer version. + QLoggingCategory::setFilterRules("qt.qml.connections=false"); +#endif + qDebug() << "Creating engine"; QQmlApplicationEngine engine;