@@ -136,9 +136,8 @@ def get(
136136 c ._server = server
137137 return c
138138
139- @classmethod
140- def create (
141- cls ,
139+ @staticmethod
140+ def _createArgs (
142141 server ,
143142 items ,
144143 startItem = None ,
@@ -147,28 +146,15 @@ def create(
147146 includeChapters = 1 ,
148147 includeRelated = 1 ,
149148 continuous = 0 ,
149+ ** kwargs
150150 ):
151- """Create and return a new :class:`~plexapi.playqueue.PlayQueue`.
152-
153- Parameters:
154- server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
155- items (:class:`~plexapi.base.PlexPartialObject`):
156- A media item or a list of media items.
157- startItem (:class:`~plexapi.base.Playable`, optional):
158- Media item in the PlayQueue where playback should begin.
159- shuffle (int, optional): Start the playqueue shuffled.
160- repeat (int, optional): Start the playqueue shuffled.
161- includeChapters (int, optional): include Chapters.
162- includeRelated (int, optional): include Related.
163- continuous (int, optional): include additional items after the initial item.
164- For a show this would be the next episodes, for a movie it does nothing.
165- """
166151 args = {
167152 "includeChapters" : includeChapters ,
168153 "includeRelated" : includeRelated ,
169154 "repeat" : repeat ,
170155 "shuffle" : shuffle ,
171156 "continuous" : continuous ,
157+ ** kwargs
172158 }
173159
174160 if isinstance (items , list ):
@@ -187,6 +173,48 @@ def create(
187173 if startItem :
188174 args ["key" ] = startItem .key
189175
176+ return args
177+
178+ @classmethod
179+ def create (
180+ cls ,
181+ server ,
182+ items ,
183+ startItem = None ,
184+ shuffle = 0 ,
185+ repeat = 0 ,
186+ includeChapters = 1 ,
187+ includeRelated = 1 ,
188+ continuous = 0 ,
189+ ** kwargs
190+ ):
191+ """Create and return a new :class:`~plexapi.playqueue.PlayQueue`.
192+
193+ Parameters:
194+ server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
195+ items (:class:`~plexapi.base.PlexPartialObject`):
196+ A media item or a list of media items.
197+ startItem (:class:`~plexapi.base.Playable`, optional):
198+ Media item in the PlayQueue where playback should begin.
199+ shuffle (int, optional): Start the playqueue shuffled.
200+ repeat (int, optional): Start the playqueue shuffled.
201+ includeChapters (int, optional): include Chapters.
202+ includeRelated (int, optional): include Related.
203+ continuous (int, optional): include additional items after the initial item.
204+ For a show this would be the next episodes, for a movie it does nothing.
205+ **kwargs (dict): Additional options to apply to the playqueue.
206+ """
207+ args = cls ._createArgs (
208+ server = server ,
209+ items = items ,
210+ startItem = startItem ,
211+ shuffle = shuffle ,
212+ repeat = repeat ,
213+ includeChapters = includeChapters ,
214+ includeRelated = includeRelated ,
215+ continuous = continuous ,
216+ ** kwargs
217+ )
190218 path = f"/playQueues{ utils .joinArgs (args )} "
191219 data = server .query (path , method = server ._session .post )
192220 c = cls (server , data , initpath = path )
0 commit comments