spotifywebapiPython 1.0.76__py3-none-any.whl → 1.0.77__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of spotifywebapiPython might be problematic. Click here for more details.

Files changed (23) hide show
  1. {spotifywebapiPython-1.0.76.dist-info → spotifywebapiPython-1.0.77.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.76.dist-info → spotifywebapiPython-1.0.77.dist-info}/RECORD +23 -23
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +13 -2
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/spotifywebapiPython/const.html +3 -3
  8. spotifywebapipython/docs/spotifywebapiPython/saappmessages.html +2 -2
  9. spotifywebapipython/docs/spotifywebapiPython/sautils.html +2 -2
  10. spotifywebapipython/docs/spotifywebapiPython/spotifyapierror.html +2 -2
  11. spotifywebapipython/docs/spotifywebapiPython/spotifyapimessage.html +2 -2
  12. spotifywebapipython/docs/spotifywebapiPython/spotifyauthtoken.html +2 -2
  13. spotifywebapipython/docs/spotifywebapiPython/spotifyclient.html +109 -53
  14. spotifywebapipython/docs/spotifywebapiPython/spotifydiscovery.html +2 -2
  15. spotifywebapipython/docs/spotifywebapiPython/spotifywebapiauthenticationerror.html +2 -2
  16. spotifywebapipython/docs/spotifywebapiPython/spotifywebapierror.html +2 -2
  17. spotifywebapipython/oauthcli/authclient.py +10 -11
  18. spotifywebapipython/spotifyclient.py +282 -150
  19. spotifywebapipython/zeroconfapi/blobbuilder.py +7 -12
  20. spotifywebapipython/zeroconfapi/zeroconfconnect.py +244 -43
  21. {spotifywebapiPython-1.0.76.dist-info → spotifywebapiPython-1.0.77.dist-info}/LICENSE +0 -0
  22. {spotifywebapiPython-1.0.76.dist-info → spotifywebapiPython-1.0.77.dist-info}/WHEEL +0 -0
  23. {spotifywebapiPython-1.0.76.dist-info → spotifywebapiPython-1.0.77.dist-info}/top_level.txt +0 -0
@@ -2478,12 +2478,14 @@ class SpotifyClient:
2478
2478
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
2479
2479
 
2480
2480
 
2481
- def GetAlbumFavorites(self,
2482
- limit:int=20,
2483
- offset:int=0,
2484
- market:str=None,
2485
- limitTotal:int=None
2486
- ) -> AlbumPageSaved:
2481
+ def GetAlbumFavorites(
2482
+ self,
2483
+ limit:int=20,
2484
+ offset:int=0,
2485
+ market:str=None,
2486
+ limitTotal:int=None,
2487
+ sortResult:bool=True,
2488
+ ) -> AlbumPageSaved:
2487
2489
  """
2488
2490
  Get a list of the albums saved in the current Spotify user's 'Your Library'.
2489
2491
 
@@ -2491,7 +2493,7 @@ class SpotifyClient:
2491
2493
 
2492
2494
  Args:
2493
2495
  limit (int):
2494
- The maximum number of items to return in a page of items.
2496
+ The maximum number of items to return in a page of items when manual paging is used.
2495
2497
  Default: 20, Range: 1 to 50.
2496
2498
  offset (int):
2497
2499
  The page index offset of the first item to return.
@@ -2511,6 +2513,10 @@ class SpotifyClient:
2511
2513
  and paging is automatically used to retrieve all available items up to the
2512
2514
  maximum number specified.
2513
2515
  Default: None (disabled)
2516
+ sortResult (bool):
2517
+ True to sort the items by name; otherwise, False to leave the items in the same order they
2518
+ were returned in by the Spotify Web API.
2519
+ Default: True
2514
2520
 
2515
2521
  Returns:
2516
2522
  An `AlbumPageSaved` object that contains saved album information.
@@ -2547,6 +2553,7 @@ class SpotifyClient:
2547
2553
  apiMethodParms.AppendKeyValue("offset", offset)
2548
2554
  apiMethodParms.AppendKeyValue("market", market)
2549
2555
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
2556
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
2550
2557
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the user's album favorites", apiMethodParms)
2551
2558
 
2552
2559
  # validations.
@@ -2616,7 +2623,7 @@ class SpotifyClient:
2616
2623
  result.Total = pageObj.Total
2617
2624
 
2618
2625
  # sort items on Name property, ascending order.
2619
- if len(result.Items) > 0:
2626
+ if (len(result.Items) > 0) and (sortResult is True):
2620
2627
  result.Items.sort(key=lambda x: (x.Album.Name or "").lower(), reverse=False)
2621
2628
 
2622
2629
  # trace.
@@ -2636,19 +2643,21 @@ class SpotifyClient:
2636
2643
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
2637
2644
 
2638
2645
 
2639
- def GetAlbumNewReleases(self,
2640
- limit:int=20,
2641
- offset:int=0,
2642
- country:str=None,
2643
- limitTotal:int=None
2644
- ) -> AlbumPageSimplified:
2646
+ def GetAlbumNewReleases(
2647
+ self,
2648
+ limit:int=20,
2649
+ offset:int=0,
2650
+ country:str=None,
2651
+ limitTotal:int=None,
2652
+ sortResult:bool=True,
2653
+ ) -> AlbumPageSimplified:
2645
2654
  """
2646
2655
  Get a list of new album releases featured in Spotify (shown, for example, on a
2647
2656
  Spotify player's "Browse" tab).
2648
2657
 
2649
2658
  Args:
2650
2659
  limit (int):
2651
- The maximum number of items to return in a page of items.
2660
+ The maximum number of items to return in a page of items when manual paging is used.
2652
2661
  Default: 20, Range: 1 to 50.
2653
2662
  offset (int):
2654
2663
  The page index offset of the first item to return.
@@ -2665,6 +2674,10 @@ class SpotifyClient:
2665
2674
  and paging is automatically used to retrieve all available items up to the
2666
2675
  maximum number specified.
2667
2676
  Default: None (disabled)
2677
+ sortResult (bool):
2678
+ True to sort the items by name; otherwise, False to leave the items in the same order they
2679
+ were returned in by the Spotify Web API.
2680
+ Default: True
2668
2681
 
2669
2682
  Returns:
2670
2683
  An `AlbumPageSimplified` object that contains simplified album information.
@@ -2701,6 +2714,7 @@ class SpotifyClient:
2701
2714
  apiMethodParms.AppendKeyValue("offset", offset)
2702
2715
  apiMethodParms.AppendKeyValue("country", country)
2703
2716
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
2717
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
2704
2718
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of new album releases", apiMethodParms)
2705
2719
 
2706
2720
  # validations.
@@ -2769,7 +2783,7 @@ class SpotifyClient:
2769
2783
  result.Total = pageObj.Total
2770
2784
 
2771
2785
  # sort items on Name property, ascending order.
2772
- if len(result.Items) > 0:
2786
+ if (len(result.Items) > 0) and (sortResult is True):
2773
2787
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
2774
2788
 
2775
2789
  # trace.
@@ -2896,7 +2910,7 @@ class SpotifyClient:
2896
2910
  The Spotify ID of the album.
2897
2911
  Example: `6vc9OTcyd3hyzabCmsdnwE`
2898
2912
  limit (int):
2899
- The maximum number of items to return in a page of items.
2913
+ The maximum number of items to return in a page of items when manual paging is used.
2900
2914
  Default: 20, Range: 1 to 50.
2901
2915
  offset (int):
2902
2916
  The index of the first item to return; use with limit to get the next set of items.
@@ -3103,14 +3117,16 @@ class SpotifyClient:
3103
3117
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
3104
3118
 
3105
3119
 
3106
- def GetArtistAlbums(self,
3107
- artistId:str,
3108
- include_groups:str='album',
3109
- limit:int=20,
3110
- offset:int=0,
3111
- market:str=None,
3112
- limitTotal:int=None
3113
- ) -> AlbumPageSimplified:
3120
+ def GetArtistAlbums(
3121
+ self,
3122
+ artistId:str,
3123
+ include_groups:str='album',
3124
+ limit:int=20,
3125
+ offset:int=0,
3126
+ market:str=None,
3127
+ limitTotal:int=None,
3128
+ sortResult:bool=True,
3129
+ ) -> AlbumPageSimplified:
3114
3130
  """
3115
3131
  Get Spotify catalog information about an artist's albums.
3116
3132
 
@@ -3124,7 +3140,7 @@ class SpotifyClient:
3124
3140
  Valid values are: `album`, `single`, `appears_on`, `compilation`
3125
3141
  Example: `single,appears_on`
3126
3142
  limit (int):
3127
- The maximum number of items to return in a page of items.
3143
+ The maximum number of items to return in a page of items when manual paging is used.
3128
3144
  Default: 20, Range: 1 to 50.
3129
3145
  offset (int):
3130
3146
  The index of the first item to return; use with limit to get the next set of items.
@@ -3143,6 +3159,10 @@ class SpotifyClient:
3143
3159
  and paging is automatically used to retrieve all available items up to the
3144
3160
  maximum number specified.
3145
3161
  Default: None (disabled)
3162
+ sortResult (bool):
3163
+ True to sort the items by name; otherwise, False to leave the items in the same order they
3164
+ were returned in by the Spotify Web API.
3165
+ Default: True
3146
3166
 
3147
3167
  Returns:
3148
3168
  An `AlbumPageSimplified` object of matching results.
@@ -3181,6 +3201,7 @@ class SpotifyClient:
3181
3201
  apiMethodParms.AppendKeyValue("offset", offset)
3182
3202
  apiMethodParms.AppendKeyValue("market", market)
3183
3203
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
3204
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
3184
3205
  _logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information about an artist's albums", apiMethodParms)
3185
3206
 
3186
3207
  # validations.
@@ -3251,7 +3272,7 @@ class SpotifyClient:
3251
3272
  result.Total = pageObj.Total
3252
3273
 
3253
3274
  # sort items on Name property, ascending order.
3254
- if len(result.Items) > 0:
3275
+ if (len(result.Items) > 0) and (sortResult is True):
3255
3276
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
3256
3277
 
3257
3278
  # trace.
@@ -3662,11 +3683,13 @@ class SpotifyClient:
3662
3683
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
3663
3684
 
3664
3685
 
3665
- def GetArtistsFollowed(self,
3666
- after:str=None,
3667
- limit:int=20,
3668
- limitTotal:int=None
3669
- ) -> ArtistPage:
3686
+ def GetArtistsFollowed(
3687
+ self,
3688
+ after:str=None,
3689
+ limit:int=20,
3690
+ limitTotal:int=None,
3691
+ sortResult:bool=True,
3692
+ ) -> ArtistPage:
3670
3693
  """
3671
3694
  Get the current user's followed artists.
3672
3695
 
@@ -3676,7 +3699,7 @@ class SpotifyClient:
3676
3699
  the first request.
3677
3700
  Example: `6APm8EjxOHSYM5B4i3vT3q`
3678
3701
  limit (int):
3679
- The maximum number of items to return in a page of items.
3702
+ The maximum number of items to return in a page of items when manual paging is used.
3680
3703
  Default: 20, Range: 1 to 50.
3681
3704
  limitTotal (int):
3682
3705
  The maximum number of items to return for the request.
@@ -3684,6 +3707,10 @@ class SpotifyClient:
3684
3707
  and paging is automatically used to retrieve all available items up to the
3685
3708
  maximum number specified.
3686
3709
  Default: None (disabled)
3710
+ sortResult (bool):
3711
+ True to sort the items by name; otherwise, False to leave the items in the same order they
3712
+ were returned in by the Spotify Web API.
3713
+ Default: True
3687
3714
 
3688
3715
  Returns:
3689
3716
  An `ArtistPage` object of matching results.
@@ -3719,6 +3746,7 @@ class SpotifyClient:
3719
3746
  apiMethodParms.AppendKeyValue("after", after)
3720
3747
  apiMethodParms.AppendKeyValue("limit", limit)
3721
3748
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
3749
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
3722
3750
  _logsi.LogMethodParmList(SILevel.Verbose, "Get the current user's followed artists", apiMethodParms)
3723
3751
 
3724
3752
  # validations.
@@ -3792,7 +3820,7 @@ class SpotifyClient:
3792
3820
  result.CursorAfter = pageObj.CursorAfter
3793
3821
 
3794
3822
  # sort items on Name property, ascending order.
3795
- if len(result.Items) > 0:
3823
+ if (len(result.Items) > 0) and (sortResult is True):
3796
3824
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
3797
3825
 
3798
3826
  # trace.
@@ -4005,7 +4033,7 @@ class SpotifyClient:
4005
4033
  The Spotify ID for the audiobook.
4006
4034
  Example: `74aydHJKgYz3AIq3jjBSv1`
4007
4035
  limit (int):
4008
- The maximum number of items to return in a page of items.
4036
+ The maximum number of items to return in a page of items when manual paging is used.
4009
4037
  Default: 20, Range: 1 to 50.
4010
4038
  offset (int):
4011
4039
  The index of the first item to return; use with limit to get the next set of items.
@@ -4148,11 +4176,13 @@ class SpotifyClient:
4148
4176
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
4149
4177
 
4150
4178
 
4151
- def GetAudiobookFavorites(self,
4152
- limit:int=20,
4153
- offset:int=0,
4154
- limitTotal:int=None
4155
- ) -> AudiobookPageSimplified:
4179
+ def GetAudiobookFavorites(
4180
+ self,
4181
+ limit:int=20,
4182
+ offset:int=0,
4183
+ limitTotal:int=None,
4184
+ sortResult:bool=True,
4185
+ ) -> AudiobookPageSimplified:
4156
4186
  """
4157
4187
  Get a list of the audiobooks saved in the current Spotify user's 'Your Library'.
4158
4188
 
@@ -4160,7 +4190,7 @@ class SpotifyClient:
4160
4190
 
4161
4191
  Args:
4162
4192
  limit (int):
4163
- The maximum number of items to return in a page of items.
4193
+ The maximum number of items to return in a page of items when manual paging is used.
4164
4194
  Default: 20, Range: 1 to 50.
4165
4195
  offset (int):
4166
4196
  The page index offset of the first item to return.
@@ -4172,6 +4202,10 @@ class SpotifyClient:
4172
4202
  and paging is automatically used to retrieve all available items up to the
4173
4203
  maximum number specified.
4174
4204
  Default: None (disabled)
4205
+ sortResult (bool):
4206
+ True to sort the items by name; otherwise, False to leave the items in the same order they
4207
+ were returned in by the Spotify Web API.
4208
+ Default: True
4175
4209
 
4176
4210
  Returns:
4177
4211
  An `AudiobookPageSimplified` object that contains saved audiobook information.
@@ -4207,6 +4241,7 @@ class SpotifyClient:
4207
4241
  apiMethodParms.AppendKeyValue("limit", limit)
4208
4242
  apiMethodParms.AppendKeyValue("offset", offset)
4209
4243
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
4244
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
4210
4245
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users audiobook favorites", apiMethodParms)
4211
4246
 
4212
4247
  # validations.
@@ -4271,7 +4306,7 @@ class SpotifyClient:
4271
4306
  result.Total = pageObj.Total
4272
4307
 
4273
4308
  # sort items on Name property, ascending order.
4274
- if len(result.Items) > 0:
4309
+ if (len(result.Items) > 0) and (sortResult is True):
4275
4310
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
4276
4311
 
4277
4312
  # trace.
@@ -4504,19 +4539,21 @@ class SpotifyClient:
4504
4539
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
4505
4540
 
4506
4541
 
4507
- def GetBrowseCategorys(self,
4508
- limit:int=20,
4509
- offset:int=0,
4510
- country:str=None,
4511
- locale:str=None,
4512
- limitTotal:int=None
4513
- ) -> CategoryPage:
4542
+ def GetBrowseCategorys(
4543
+ self,
4544
+ limit:int=20,
4545
+ offset:int=0,
4546
+ country:str=None,
4547
+ locale:str=None,
4548
+ limitTotal:int=None,
4549
+ sortResult:bool=True,
4550
+ ) -> CategoryPage:
4514
4551
  """
4515
4552
  Get a page of categories used to tag items in Spotify.
4516
4553
 
4517
4554
  Args:
4518
4555
  limit (int):
4519
- The maximum number of items to return in a page of items.
4556
+ The maximum number of items to return in a page of items when manual paging is used.
4520
4557
  Default: 20, Range: 1 to 50.
4521
4558
  offset (int):
4522
4559
  The page index offset of the first item to return.
@@ -4543,6 +4580,10 @@ class SpotifyClient:
4543
4580
  and paging is automatically used to retrieve all available items up to the
4544
4581
  maximum number specified.
4545
4582
  Default: None (disabled)
4583
+ sortResult (bool):
4584
+ True to sort the items by name; otherwise, False to leave the items in the same order they
4585
+ were returned in by the Spotify Web API.
4586
+ Default: True
4546
4587
 
4547
4588
  Returns:
4548
4589
  A `CategoryPage` object that contains a page of category details.
@@ -4580,6 +4621,7 @@ class SpotifyClient:
4580
4621
  apiMethodParms.AppendKeyValue("country", country)
4581
4622
  apiMethodParms.AppendKeyValue("locale", locale)
4582
4623
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
4624
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
4583
4625
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a page of categories used to tag items in Spotify", apiMethodParms)
4584
4626
 
4585
4627
  # validations.
@@ -4650,7 +4692,7 @@ class SpotifyClient:
4650
4692
  result.Total = pageObj.Total
4651
4693
 
4652
4694
  # sort items on Name property, ascending order.
4653
- if len(result.Items) > 0:
4695
+ if (len(result.Items) > 0) and (sortResult is True):
4654
4696
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
4655
4697
 
4656
4698
  # trace.
@@ -4769,13 +4811,15 @@ class SpotifyClient:
4769
4811
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
4770
4812
 
4771
4813
 
4772
- def GetCategoryPlaylists(self,
4773
- categoryId:str,
4774
- limit:int=20,
4775
- offset:int=0,
4776
- country:str=None,
4777
- limitTotal:int=None
4778
- ) -> Tuple[PlaylistPageSimplified, str]:
4814
+ def GetCategoryPlaylists(
4815
+ self,
4816
+ categoryId:str,
4817
+ limit:int=20,
4818
+ offset:int=0,
4819
+ country:str=None,
4820
+ limitTotal:int=None,
4821
+ sortResult:bool=True,
4822
+ ) -> Tuple[PlaylistPageSimplified, str]:
4779
4823
  """
4780
4824
  Get a list of Spotify playlists tagged with a particular category.
4781
4825
 
@@ -4784,7 +4828,7 @@ class SpotifyClient:
4784
4828
  The Spotify category ID for the category.
4785
4829
  Example: `dinner`
4786
4830
  limit (int):
4787
- The maximum number of items to return in a page of items.
4831
+ The maximum number of items to return in a page of items when manual paging is used.
4788
4832
  Default: 20, Range: 1 to 50.
4789
4833
  offset (int):
4790
4834
  The page index offset of the first item to return.
@@ -4801,6 +4845,10 @@ class SpotifyClient:
4801
4845
  and paging is automatically used to retrieve all available items up to the
4802
4846
  maximum number specified.
4803
4847
  Default: None (disabled)
4848
+ sortResult (bool):
4849
+ True to sort the items by name; otherwise, False to leave the items in the same order they
4850
+ were returned in by the Spotify Web API.
4851
+ Default: True
4804
4852
 
4805
4853
  Returns:
4806
4854
  A tuple of 2 objects:
@@ -4850,6 +4898,7 @@ class SpotifyClient:
4850
4898
  apiMethodParms.AppendKeyValue("offset", offset)
4851
4899
  apiMethodParms.AppendKeyValue("country", country)
4852
4900
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
4901
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
4853
4902
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of Spotify playlists tagged with a particular category", apiMethodParms)
4854
4903
 
4855
4904
  # validations.
@@ -4922,7 +4971,7 @@ class SpotifyClient:
4922
4971
  result.Total = pageObj.Total
4923
4972
 
4924
4973
  # sort items on Name property, ascending order.
4925
- if len(result.Items) > 0:
4974
+ if (len(result.Items) > 0) and (sortResult is True):
4926
4975
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
4927
4976
 
4928
4977
  # trace.
@@ -5217,11 +5266,13 @@ class SpotifyClient:
5217
5266
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
5218
5267
 
5219
5268
 
5220
- def GetEpisodeFavorites(self,
5221
- limit:int=20,
5222
- offset:int=0,
5223
- limitTotal:int=None
5224
- ) -> EpisodePageSaved:
5269
+ def GetEpisodeFavorites(
5270
+ self,
5271
+ limit:int=20,
5272
+ offset:int=0,
5273
+ limitTotal:int=None,
5274
+ sortResult:bool=True,
5275
+ ) -> EpisodePageSaved:
5225
5276
  """
5226
5277
  Get a list of the episodes saved in the current Spotify user's 'Your Library'.
5227
5278
 
@@ -5229,7 +5280,7 @@ class SpotifyClient:
5229
5280
 
5230
5281
  Args:
5231
5282
  limit (int):
5232
- The maximum number of items to return in a page of items.
5283
+ The maximum number of items to return in a page of items when manual paging is used.
5233
5284
  Default: 20, Range: 1 to 50.
5234
5285
  offset (int):
5235
5286
  The page index offset of the first item to return.
@@ -5241,6 +5292,10 @@ class SpotifyClient:
5241
5292
  and paging is automatically used to retrieve all available items up to the
5242
5293
  maximum number specified.
5243
5294
  Default: None (disabled)
5295
+ sortResult (bool):
5296
+ True to sort the items by name; otherwise, False to leave the items in the same order they
5297
+ were returned in by the Spotify Web API.
5298
+ Default: True
5244
5299
 
5245
5300
  Returns:
5246
5301
  An `EpisodePageSaved` object that contains saved episode information.
@@ -5276,6 +5331,7 @@ class SpotifyClient:
5276
5331
  apiMethodParms.AppendKeyValue("limit", limit)
5277
5332
  apiMethodParms.AppendKeyValue("offset", offset)
5278
5333
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
5334
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
5279
5335
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users episode favorites", apiMethodParms)
5280
5336
 
5281
5337
  # validations.
@@ -5340,7 +5396,7 @@ class SpotifyClient:
5340
5396
  result.Total = pageObj.Total
5341
5397
 
5342
5398
  # sort items on Name property, ascending order.
5343
- if len(result.Items) > 0:
5399
+ if (len(result.Items) > 0) and (sortResult is True):
5344
5400
  result.Items.sort(key=lambda x: (x.Episode.Name or "").lower(), reverse=False)
5345
5401
 
5346
5402
  # trace.
@@ -5455,20 +5511,22 @@ class SpotifyClient:
5455
5511
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
5456
5512
 
5457
5513
 
5458
- def GetFeaturedPlaylists(self,
5459
- limit:int=20,
5460
- offset:int=0,
5461
- country:str=None,
5462
- locale:str=None,
5463
- timestamp:str=None,
5464
- limitTotal:int=None
5465
- ) -> Tuple[PlaylistPageSimplified, str]:
5514
+ def GetFeaturedPlaylists(
5515
+ self,
5516
+ limit:int=20,
5517
+ offset:int=0,
5518
+ country:str=None,
5519
+ locale:str=None,
5520
+ timestamp:str=None,
5521
+ limitTotal:int=None,
5522
+ sortResult:bool=True,
5523
+ ) -> Tuple[PlaylistPageSimplified, str]:
5466
5524
  """
5467
5525
  Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab).
5468
5526
 
5469
5527
  Args:
5470
5528
  limit (int):
5471
- The maximum number of items to return in a page of items.
5529
+ The maximum number of items to return in a page of items when manual paging is used.
5472
5530
  Default: 20, Range: 1 to 50.
5473
5531
  offset (int):
5474
5532
  The page index offset of the first item to return.
@@ -5503,6 +5561,10 @@ class SpotifyClient:
5503
5561
  and paging is automatically used to retrieve all available items up to the
5504
5562
  maximum number specified.
5505
5563
  Default: None (disabled)
5564
+ sortResult (bool):
5565
+ True to sort the items by name; otherwise, False to leave the items in the same order they
5566
+ were returned in by the Spotify Web API.
5567
+ Default: True
5506
5568
 
5507
5569
  Returns:
5508
5570
  A tuple of 2 objects:
@@ -5544,6 +5606,7 @@ class SpotifyClient:
5544
5606
  apiMethodParms.AppendKeyValue("locale", locale)
5545
5607
  apiMethodParms.AppendKeyValue("timestamp", timestamp)
5546
5608
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
5609
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
5547
5610
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of Spotify featured playlists", apiMethodParms)
5548
5611
 
5549
5612
  # validations.
@@ -5617,7 +5680,7 @@ class SpotifyClient:
5617
5680
  result.Total = pageObj.Total
5618
5681
 
5619
5682
  # sort items on Name property, ascending order.
5620
- if len(result.Items) > 0:
5683
+ if (len(result.Items) > 0) and (sortResult is True):
5621
5684
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
5622
5685
 
5623
5686
  # trace.
@@ -6206,9 +6269,11 @@ class SpotifyClient:
6206
6269
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
6207
6270
 
6208
6271
 
6209
- def GetPlayerDevices(self,
6210
- refresh:bool=True
6211
- ) -> list[Device]:
6272
+ def GetPlayerDevices(
6273
+ self,
6274
+ refresh:bool=True,
6275
+ sortResult:bool=True,
6276
+ ) -> list[Device]:
6212
6277
  """
6213
6278
  Get information about a user's available Spotify Connect player devices.
6214
6279
 
@@ -6220,6 +6285,10 @@ class SpotifyClient:
6220
6285
  refresh (bool):
6221
6286
  True (default) to return real-time information from the spotify web api and
6222
6287
  update the cache; otherwise, False to just return the cached value.
6288
+ sortResult (bool):
6289
+ True to sort the items by name; otherwise, False to leave the items in the same order they
6290
+ were returned in by the Spotify Web API.
6291
+ Default: True
6223
6292
 
6224
6293
  Returns:
6225
6294
  A list of `Device` objects that contain the device details, sorted by name.
@@ -6248,15 +6317,18 @@ class SpotifyClient:
6248
6317
  </details>
6249
6318
  """
6250
6319
  apiMethodName:str = 'GetPlayerDevices'
6320
+ apiMethodParms:SIMethodParmListContext = None
6251
6321
  result:list[Device] = []
6252
6322
  cacheDesc:str = CACHE_SOURCE_CURRENT
6253
6323
 
6254
6324
  try:
6255
6325
 
6256
6326
  # trace.
6257
- _logsi.EnterMethod(SILevel.Debug, apiMethodName)
6258
- _logsi.LogVerbose("Get user's available Spotify Connect player devices")
6259
-
6327
+ apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
6328
+ apiMethodParms.AppendKeyValue("refresh", refresh)
6329
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
6330
+ _logsi.LogMethodParmList(SILevel.Verbose, "Get user's available Spotify Connect player devices", apiMethodParms)
6331
+
6260
6332
  # can we use the cached value?
6261
6333
  if (not refresh) and (apiMethodName in self._ConfigurationCache):
6262
6334
 
@@ -6277,7 +6349,7 @@ class SpotifyClient:
6277
6349
  result.append(Device(root=item))
6278
6350
 
6279
6351
  # sort items on Name property, ascending order.
6280
- if len(result) > 0:
6352
+ if (len(result) > 0) and (sortResult is True):
6281
6353
  result.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
6282
6354
 
6283
6355
  # update cache.
@@ -6554,8 +6626,8 @@ class SpotifyClient:
6554
6626
 
6555
6627
  Args:
6556
6628
  limit (int):
6557
- The maximum number of items to return in a page of items.
6558
- Default: `20`, Range: `1` to `50`.
6629
+ The maximum number of items to return in a page of items when manual paging is used.
6630
+ Default: 20, Range: 1 to 50.
6559
6631
  after (int):
6560
6632
  Returns all items after (but not including) this cursor position, which is
6561
6633
  a Unix timestamp in milliseconds.
@@ -6942,7 +7014,7 @@ class SpotifyClient:
6942
7014
  The Spotify ID of the playlist.
6943
7015
  Example: `5v5ETK9WFXAnGQ3MRubKuE`
6944
7016
  limit (int):
6945
- The maximum number of items to return in a page of items.
7017
+ The maximum number of items to return in a page of items when manual paging is used.
6946
7018
  Default: 50, Range: 1 to 50.
6947
7019
  offset (int):
6948
7020
  The page index offset of the first item to return.
@@ -7112,11 +7184,13 @@ class SpotifyClient:
7112
7184
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
7113
7185
 
7114
7186
 
7115
- def GetPlaylistFavorites(self,
7116
- limit:int=20,
7117
- offset:int=0,
7118
- limitTotal:int=None
7119
- ) -> PlaylistPageSimplified:
7187
+ def GetPlaylistFavorites(
7188
+ self,
7189
+ limit:int=20,
7190
+ offset:int=0,
7191
+ limitTotal:int=None,
7192
+ sortResult:bool=True,
7193
+ ) -> PlaylistPageSimplified:
7120
7194
  """
7121
7195
  Get a list of the playlists owned or followed by the current Spotify user.
7122
7196
 
@@ -7124,7 +7198,7 @@ class SpotifyClient:
7124
7198
 
7125
7199
  Args:
7126
7200
  limit (int):
7127
- The maximum number of items to return in a page of items.
7201
+ The maximum number of items to return in a page of items when manual paging is used.
7128
7202
  Default: 20, Range: 1 to 50.
7129
7203
  offset (int):
7130
7204
  The page index offset of the first item to return.
@@ -7136,6 +7210,10 @@ class SpotifyClient:
7136
7210
  and paging is automatically used to retrieve all available items up to the
7137
7211
  maximum number specified.
7138
7212
  Default: None (disabled)
7213
+ sortResult (bool):
7214
+ True to sort the items by name; otherwise, False to leave the items in the same order they
7215
+ were returned in by the Spotify Web API.
7216
+ Default: True
7139
7217
 
7140
7218
  Returns:
7141
7219
  An `PlaylistPageSimplified` object that contains playlist information.
@@ -7171,6 +7249,7 @@ class SpotifyClient:
7171
7249
  apiMethodParms.AppendKeyValue("limit", limit)
7172
7250
  apiMethodParms.AppendKeyValue("offset", offset)
7173
7251
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
7252
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
7174
7253
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users playlist favorites", apiMethodParms)
7175
7254
 
7176
7255
  # validations.
@@ -7235,7 +7314,7 @@ class SpotifyClient:
7235
7314
  result.Total = pageObj.Total
7236
7315
 
7237
7316
  # sort items on Name property, ascending order.
7238
- if len(result.Items) > 0:
7317
+ if (len(result.Items) > 0) and (sortResult is True):
7239
7318
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
7240
7319
 
7241
7320
  # trace.
@@ -7255,12 +7334,14 @@ class SpotifyClient:
7255
7334
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
7256
7335
 
7257
7336
 
7258
- def GetPlaylistsForUser(self,
7259
- userId:str,
7260
- limit:int=20,
7261
- offset:int=0,
7262
- limitTotal:int=None
7263
- ) -> PlaylistPageSimplified:
7337
+ def GetPlaylistsForUser(
7338
+ self,
7339
+ userId:str,
7340
+ limit:int=20,
7341
+ offset:int=0,
7342
+ limitTotal:int=None,
7343
+ sortResult:bool=True,
7344
+ ) -> PlaylistPageSimplified:
7264
7345
  """
7265
7346
  Get a list of the playlists owned or followed by a Spotify user.
7266
7347
 
@@ -7271,7 +7352,7 @@ class SpotifyClient:
7271
7352
  The user's Spotify user ID.
7272
7353
  Example: `smedjan`
7273
7354
  limit (int):
7274
- The maximum number of items to return in a page of items.
7355
+ The maximum number of items to return in a page of items when manual paging is used.
7275
7356
  Default: 20, Range: 1 to 50.
7276
7357
  offset (int):
7277
7358
  The page index offset of the first item to return.
@@ -7283,6 +7364,10 @@ class SpotifyClient:
7283
7364
  and paging is automatically used to retrieve all available items up to the
7284
7365
  maximum number specified.
7285
7366
  Default: None (disabled)
7367
+ sortResult (bool):
7368
+ True to sort the items by name; otherwise, False to leave the items in the same order they
7369
+ were returned in by the Spotify Web API.
7370
+ Default: True
7286
7371
 
7287
7372
  Returns:
7288
7373
  An `PlaylistPageSimplified` object that contains playlist information.
@@ -7319,6 +7404,7 @@ class SpotifyClient:
7319
7404
  apiMethodParms.AppendKeyValue("limit", limit)
7320
7405
  apiMethodParms.AppendKeyValue("offset", offset)
7321
7406
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
7407
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
7322
7408
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the playlists owned or followed by a Spotify user", apiMethodParms)
7323
7409
 
7324
7410
  # validations.
@@ -7384,7 +7470,7 @@ class SpotifyClient:
7384
7470
  result.Total = pageObj.Total
7385
7471
 
7386
7472
  # sort items on Name property, ascending order.
7387
- if len(result.Items) > 0:
7473
+ if (len(result.Items) > 0) and (sortResult is True):
7388
7474
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
7389
7475
 
7390
7476
  # trace.
@@ -7509,7 +7595,7 @@ class SpotifyClient:
7509
7595
  The Spotify ID for the show.
7510
7596
  Example: `6kAsbP8pxwaU2kPibKTuHE`
7511
7597
  limit (int):
7512
- The maximum number of items to return in a page of items.
7598
+ The maximum number of items to return in a page of items when manual paging is used.
7513
7599
  Default: 20, Range: 1 to 50.
7514
7600
  offset (int):
7515
7601
  The index of the first item to return; use with limit to get the next set of items.
@@ -7652,11 +7738,13 @@ class SpotifyClient:
7652
7738
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
7653
7739
 
7654
7740
 
7655
- def GetShowFavorites(self,
7656
- limit:int=20,
7657
- offset:int=0,
7658
- limitTotal:int=None
7659
- ) -> ShowPageSaved:
7741
+ def GetShowFavorites(
7742
+ self,
7743
+ limit:int=20,
7744
+ offset:int=0,
7745
+ limitTotal:int=None,
7746
+ sortResult:bool=True,
7747
+ ) -> ShowPageSaved:
7660
7748
  """
7661
7749
  Get a list of the shows saved in the current Spotify user's 'Your Library'.
7662
7750
 
@@ -7664,7 +7752,7 @@ class SpotifyClient:
7664
7752
 
7665
7753
  Args:
7666
7754
  limit (int):
7667
- The maximum number of items to return in a page of items.
7755
+ The maximum number of items to return in a page of items when manual paging is used.
7668
7756
  Default: 20, Range: 1 to 50.
7669
7757
  offset (int):
7670
7758
  The page index offset of the first item to return.
@@ -7676,6 +7764,10 @@ class SpotifyClient:
7676
7764
  and paging is automatically used to retrieve all available items up to the
7677
7765
  maximum number specified.
7678
7766
  Default: None (disabled)
7767
+ sortResult (bool):
7768
+ True to sort the items by name; otherwise, False to leave the items in the same order they
7769
+ were returned in by the Spotify Web API.
7770
+ Default: True
7679
7771
 
7680
7772
  Returns:
7681
7773
  An `ShowPageSaved` object that contains saved show information.
@@ -7711,6 +7803,7 @@ class SpotifyClient:
7711
7803
  apiMethodParms.AppendKeyValue("limit", limit)
7712
7804
  apiMethodParms.AppendKeyValue("offset", offset)
7713
7805
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
7806
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
7714
7807
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users show favorites", apiMethodParms)
7715
7808
 
7716
7809
  # validations.
@@ -7775,7 +7868,7 @@ class SpotifyClient:
7775
7868
  result.Total = pageObj.Total
7776
7869
 
7777
7870
  # sort items on Name property, ascending order.
7778
- if len(result.Items) > 0:
7871
+ if (len(result.Items) > 0) and (sortResult is True):
7779
7872
  result.Items.sort(key=lambda x: (x.Show.Name or "").lower(), reverse=False)
7780
7873
 
7781
7874
  # trace.
@@ -8217,12 +8310,14 @@ class SpotifyClient:
8217
8310
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
8218
8311
 
8219
8312
 
8220
- def GetTrackFavorites(self,
8221
- limit:int=20,
8222
- offset:int=0,
8223
- market:str=None,
8224
- limitTotal:int=None
8225
- ) -> TrackPageSaved:
8313
+ def GetTrackFavorites(
8314
+ self,
8315
+ limit:int=20,
8316
+ offset:int=0,
8317
+ market:str=None,
8318
+ limitTotal:int=None,
8319
+ sortResult:bool=True,
8320
+ ) -> TrackPageSaved:
8226
8321
  """
8227
8322
  Get a list of the tracks saved in the current Spotify user's 'Your Library'.
8228
8323
 
@@ -8230,7 +8325,7 @@ class SpotifyClient:
8230
8325
 
8231
8326
  Args:
8232
8327
  limit (int):
8233
- The maximum number of items to return in a page of items.
8328
+ The maximum number of items to return in a page of items when manual paging is used.
8234
8329
  Default: 20, Range: 1 to 50.
8235
8330
  offset (int):
8236
8331
  The page index offset of the first item to return.
@@ -8250,6 +8345,10 @@ class SpotifyClient:
8250
8345
  and paging is automatically used to retrieve all available items up to the
8251
8346
  maximum number specified.
8252
8347
  Default: None (disabled)
8348
+ sortResult (bool):
8349
+ True to sort the items by name; otherwise, False to leave the items in the same order they
8350
+ were returned in by the Spotify Web API.
8351
+ Default: True
8253
8352
 
8254
8353
  Returns:
8255
8354
  An `TrackPageSaved` object that contains saved track information.
@@ -8286,6 +8385,7 @@ class SpotifyClient:
8286
8385
  apiMethodParms.AppendKeyValue("offset", offset)
8287
8386
  apiMethodParms.AppendKeyValue("market", market)
8288
8387
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
8388
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
8289
8389
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users track favorites", apiMethodParms)
8290
8390
 
8291
8391
  # validations.
@@ -8355,7 +8455,7 @@ class SpotifyClient:
8355
8455
  result.Total = pageObj.Total
8356
8456
 
8357
8457
  # sort items on Name property, ascending order.
8358
- if len(result.Items) > 0:
8458
+ if (len(result.Items) > 0) and (sortResult is True):
8359
8459
  result.Items.sort(key=lambda x: (x.Track.Name or "").lower(), reverse=False)
8360
8460
 
8361
8461
  # trace.
@@ -9130,12 +9230,14 @@ class SpotifyClient:
9130
9230
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
9131
9231
 
9132
9232
 
9133
- def GetUsersTopArtists(self,
9134
- timeRange:str='medium_term',
9135
- limit:int=20,
9136
- offset:int=0,
9137
- limitTotal:int=None
9138
- ) -> ArtistPage:
9233
+ def GetUsersTopArtists(
9234
+ self,
9235
+ timeRange:str='medium_term',
9236
+ limit:int=20,
9237
+ offset:int=0,
9238
+ limitTotal:int=None,
9239
+ sortResult:bool=True,
9240
+ ) -> ArtistPage:
9139
9241
  """
9140
9242
  Get the current user's top artists based on calculated affinity.
9141
9243
 
@@ -9149,7 +9251,7 @@ class SpotifyClient:
9149
9251
  Default: `medium_term`
9150
9252
  Example: `long_term`
9151
9253
  limit (int):
9152
- The maximum number of items to return in a page of items.
9254
+ The maximum number of items to return in a page of items when manual paging is used.
9153
9255
  Default: 20, Range: 1 to 50.
9154
9256
  offset (int):
9155
9257
  The page index offset of the first item to return.
@@ -9161,6 +9263,10 @@ class SpotifyClient:
9161
9263
  and paging is automatically used to retrieve all available items up to the
9162
9264
  maximum number specified.
9163
9265
  Default: None (disabled)
9266
+ sortResult (bool):
9267
+ True to sort the items by name; otherwise, False to leave the items in the same order they
9268
+ were returned in by the Spotify Web API.
9269
+ Default: True
9164
9270
 
9165
9271
  Returns:
9166
9272
  An `ArtistPage` object of matching results.
@@ -9197,6 +9303,7 @@ class SpotifyClient:
9197
9303
  apiMethodParms.AppendKeyValue("limit", limit)
9198
9304
  apiMethodParms.AppendKeyValue("offset", offset)
9199
9305
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
9306
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
9200
9307
  _logsi.LogMethodParmList(SILevel.Verbose, "Get the current user's top artists", apiMethodParms)
9201
9308
 
9202
9309
  # validations.
@@ -9264,7 +9371,7 @@ class SpotifyClient:
9264
9371
  result.Total = pageObj.Total
9265
9372
 
9266
9373
  # sort items on Name property, ascending order.
9267
- if len(result.Items) > 0:
9374
+ if (len(result.Items) > 0) and (sortResult is True):
9268
9375
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
9269
9376
 
9270
9377
  # trace.
@@ -9284,12 +9391,14 @@ class SpotifyClient:
9284
9391
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
9285
9392
 
9286
9393
 
9287
- def GetUsersTopTracks(self,
9288
- timeRange:str='medium_term',
9289
- limit:int=20,
9290
- offset:int=0,
9291
- limitTotal:int=None
9292
- ) -> TrackPage:
9394
+ def GetUsersTopTracks(
9395
+ self,
9396
+ timeRange:str='medium_term',
9397
+ limit:int=20,
9398
+ offset:int=0,
9399
+ limitTotal:int=None,
9400
+ sortResult:bool=True,
9401
+ ) -> TrackPage:
9293
9402
  """
9294
9403
  Get the current user's top tracks based on calculated affinity.
9295
9404
 
@@ -9303,7 +9412,7 @@ class SpotifyClient:
9303
9412
  Default: `medium_term`
9304
9413
  Example: `long_term`
9305
9414
  limit (int):
9306
- The maximum number of items to return in a page of items.
9415
+ The maximum number of items to return in a page of items when manual paging is used.
9307
9416
  Default: 20, Range: 1 to 50.
9308
9417
  offset (int):
9309
9418
  The page index offset of the first item to return.
@@ -9315,6 +9424,10 @@ class SpotifyClient:
9315
9424
  and paging is automatically used to retrieve all available items up to the
9316
9425
  maximum number specified.
9317
9426
  Default: None (disabled)
9427
+ sortResult (bool):
9428
+ True to sort the items by name; otherwise, False to leave the items in the same order they
9429
+ were returned in by the Spotify Web API.
9430
+ Default: True
9318
9431
 
9319
9432
  Returns:
9320
9433
  An `TrackPage` object of matching results.
@@ -9351,6 +9464,7 @@ class SpotifyClient:
9351
9464
  apiMethodParms.AppendKeyValue("limit", limit)
9352
9465
  apiMethodParms.AppendKeyValue("offset", offset)
9353
9466
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
9467
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
9354
9468
  _logsi.LogMethodParmList(SILevel.Verbose, "Get the current user's top tracks", apiMethodParms)
9355
9469
 
9356
9470
  # validations.
@@ -9418,7 +9532,7 @@ class SpotifyClient:
9418
9532
  result.Total = pageObj.Total
9419
9533
 
9420
9534
  # sort items on Name property, ascending order.
9421
- if len(result.Items) > 0:
9535
+ if (len(result.Items) > 0) and (sortResult is True):
9422
9536
  result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
9423
9537
 
9424
9538
  # trace.
@@ -9722,6 +9836,7 @@ class SpotifyClient:
9722
9836
  shuffle:bool=True,
9723
9837
  delay:float=0.50,
9724
9838
  resolveDeviceId:bool=True,
9839
+ limitTotal:int=200,
9725
9840
  ) -> None:
9726
9841
  """
9727
9842
  Get a list of the tracks saved in the current Spotify user's 'Your Library'
@@ -9743,6 +9858,9 @@ class SpotifyClient:
9743
9858
  resolveDeviceId (bool):
9744
9859
  True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
9745
9860
  value as it has already been resolved.
9861
+ limitTotal (int):
9862
+ The maximum number of items to retrieve from favorites.
9863
+ Default: 200
9746
9864
 
9747
9865
  Raises:
9748
9866
  SpotifyWebApiError:
@@ -9774,13 +9892,14 @@ class SpotifyClient:
9774
9892
  apiMethodParms.AppendKeyValue("shuffle", shuffle)
9775
9893
  apiMethodParms.AppendKeyValue("delay", delay)
9776
9894
  apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
9895
+ apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
9777
9896
  _logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play track favorites", apiMethodParms)
9778
9897
 
9779
9898
  # validations.
9780
9899
  delay = validateDelay(delay, 0.50, 10)
9781
9900
 
9782
9901
  # get current users favorite tracks.
9783
- tracks:TrackPageSaved = self.GetTrackFavorites(limitTotal=200)
9902
+ tracks:TrackPageSaved = self.GetTrackFavorites(limitTotal=limitTotal)
9784
9903
  if (tracks.ItemsCount == 0):
9785
9904
  _logsi.LogVerbose("Current user has no favorite tracks; nothing to do")
9786
9905
  return
@@ -9799,7 +9918,8 @@ class SpotifyClient:
9799
9918
  deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9800
9919
 
9801
9920
  # set desired shuffle mode.
9802
- self.PlayerSetShuffleMode(shuffle, deviceId, delay)
9921
+ if shuffle is not None:
9922
+ self.PlayerSetShuffleMode(shuffle, deviceId, delay)
9803
9923
 
9804
9924
  # play the tracks.
9805
9925
  # indicate device id has already been resolved.
@@ -12489,7 +12609,7 @@ class SpotifyClient:
12489
12609
  The tag:new filter will return albums released in the past two weeks and tag:hipster
12490
12610
  can be used to return only albums with the lowest 10% popularity.
12491
12611
  limit (int):
12492
- The maximum number of items to return in a page of items.
12612
+ The maximum number of items to return in a page of items when manual paging is used.
12493
12613
  Default: 20, Range: 1 to 50.
12494
12614
  offset (int):
12495
12615
  The page index offset of the first item to return.
@@ -12679,7 +12799,7 @@ class SpotifyClient:
12679
12799
  The tag:new filter will return albums released in the past two weeks and tag:hipster
12680
12800
  can be used to return only albums with the lowest 10% popularity.
12681
12801
  limit (int):
12682
- The maximum number of items to return in a page of items.
12802
+ The maximum number of items to return in a page of items when manual paging is used.
12683
12803
  Default: 20, Range: 1 to 50.
12684
12804
  offset (int):
12685
12805
  The page index offset of the first item to return.
@@ -12869,7 +12989,7 @@ class SpotifyClient:
12869
12989
  The tag:new filter will return albums released in the past two weeks and tag:hipster
12870
12990
  can be used to return only albums with the lowest 10% popularity.
12871
12991
  limit (int):
12872
- The maximum number of items to return in a page of items.
12992
+ The maximum number of items to return in a page of items when manual paging is used.
12873
12993
  Default: 20, Range: 1 to 50.
12874
12994
  offset (int):
12875
12995
  The page index offset of the first item to return.
@@ -13061,7 +13181,7 @@ class SpotifyClient:
13061
13181
  The tag:new filter will return albums released in the past two weeks and tag:hipster
13062
13182
  can be used to return only albums with the lowest 10% popularity.
13063
13183
  limit (int):
13064
- The maximum number of items to return in a page of items.
13184
+ The maximum number of items to return in a page of items when manual paging is used.
13065
13185
  Default: 20, Range: 1 to 50.
13066
13186
  offset (int):
13067
13187
  The page index offset of the first item to return.
@@ -13251,7 +13371,7 @@ class SpotifyClient:
13251
13371
  The tag:new filter will return albums released in the past two weeks and tag:hipster
13252
13372
  can be used to return only albums with the lowest 10% popularity.
13253
13373
  limit (int):
13254
- The maximum number of items to return in a page of items.
13374
+ The maximum number of items to return in a page of items when manual paging is used.
13255
13375
  Default: 20, Range: 1 to 50.
13256
13376
  offset (int):
13257
13377
  The page index offset of the first item to return.
@@ -13441,7 +13561,7 @@ class SpotifyClient:
13441
13561
  The tag:new filter will return albums released in the past two weeks and tag:hipster
13442
13562
  can be used to return only albums with the lowest 10% popularity.
13443
13563
  limit (int):
13444
- The maximum number of items to return in a page of items.
13564
+ The maximum number of items to return in a page of items when manual paging is used.
13445
13565
  Default: 20, Range: 1 to 50.
13446
13566
  offset (int):
13447
13567
  The page index offset of the first item to return.
@@ -13631,7 +13751,7 @@ class SpotifyClient:
13631
13751
  The tag:new filter will return albums released in the past two weeks and tag:hipster
13632
13752
  can be used to return only albums with the lowest 10% popularity.
13633
13753
  limit (int):
13634
- The maximum number of items to return in a page of items.
13754
+ The maximum number of items to return in a page of items when manual paging is used.
13635
13755
  Default: 20, Range: 1 to 50.
13636
13756
  offset (int):
13637
13757
  The page index offset of the first item to return.
@@ -13802,7 +13922,8 @@ class SpotifyClient:
13802
13922
  tokenProfileId:str=None,
13803
13923
  forceAuthorize:bool=False,
13804
13924
  redirectUriHost:str='localhost',
13805
- redirectUriPort:int=8080
13925
+ redirectUriPort:int=8080,
13926
+ redirectUriPath:str='/',
13806
13927
  ) -> None:
13807
13928
  """
13808
13929
  Generates a new Authorization Code type of authorization token used to access
@@ -13836,6 +13957,10 @@ class SpotifyClient:
13836
13957
  port range is specified, then the logic will loop through the port range looking
13837
13958
  for an available port to use.
13838
13959
  Default is 8080.
13960
+ redirectUriPath (str):
13961
+ Path value to add when constructing the redirect_uri; otherwise,
13962
+ None to not add a path value.
13963
+ Default value is '/'.
13839
13964
 
13840
13965
  Raises:
13841
13966
  SpotifApiError:
@@ -13866,8 +13991,8 @@ class SpotifyClient:
13866
13991
  Note that you must have 'http://localhost:8080/' in the Redirect URI allowlist that you
13867
13992
  specified when you registered your application in the Spotify Developer Portal. The
13868
13993
  redirect URI is case-sensitive, and must contain the trailing slash. You will need to
13869
- adjust the redirect URI value if you specify custom values using the `redirectUriHost`
13870
- and `redirectUriPort` arguments.
13994
+ adjust the redirect URI value if you specify custom values using the `redirectUriHost`,
13995
+ `redirectUriPort`, and `redirectUriPath` arguments.
13871
13996
  """
13872
13997
  apiMethodName:str = 'SetAuthTokenAuthorizationCode'
13873
13998
  apiMethodParms:SIMethodParmListContext = None
@@ -13884,6 +14009,7 @@ class SpotifyClient:
13884
14009
  apiMethodParms.AppendKeyValue("forceAuthorize", forceAuthorize)
13885
14010
  apiMethodParms.AppendKeyValue("redirectUriHost", redirectUriHost)
13886
14011
  apiMethodParms.AppendKeyValue("redirectUriPort", redirectUriPort)
14012
+ apiMethodParms.AppendKeyValue("redirectUriPath", redirectUriPath)
13887
14013
  _logsi.LogMethodParmList(SILevel.Verbose, TRACE_MSG_AUTHTOKEN_CREATE % authorizationType, apiMethodParms)
13888
14014
 
13889
14015
  # validation.
@@ -13923,8 +14049,8 @@ class SpotifyClient:
13923
14049
  self._AuthClient.AuthorizeWithServer(
13924
14050
  host=redirectUriHost,
13925
14051
  port=redirectUriPort,
14052
+ redirect_uri_path=redirectUriPath,
13926
14053
  open_browser=True,
13927
- redirect_uri_trailing_slash=True,
13928
14054
  force=forceAuthorize,
13929
14055
  timeout_seconds=120
13930
14056
  )
@@ -13983,6 +14109,7 @@ class SpotifyClient:
13983
14109
  forceAuthorize:bool=False,
13984
14110
  redirectUriHost:str='localhost',
13985
14111
  redirectUriPort:int=8080,
14112
+ redirectUriPath:str='/'
13986
14113
  ) -> None:
13987
14114
  """
13988
14115
  Generates a new Authorization Code PKCE type of authorization token used to access
@@ -14014,6 +14141,10 @@ class SpotifyClient:
14014
14141
  port range is specified, then the logic will loop through the port range looking
14015
14142
  for an available port to use.
14016
14143
  Default is 8080.
14144
+ redirectUriPath (str):
14145
+ Path value to add when constructing the redirect_uri; otherwise,
14146
+ None to not add a path value.
14147
+ Default value is '/'.
14017
14148
 
14018
14149
  Raises:
14019
14150
  SpotifApiError:
@@ -14043,8 +14174,8 @@ class SpotifyClient:
14043
14174
  Note that you must have 'http://localhost:8080/' in the Redirect URI allowlist that you
14044
14175
  specified when you registered your application in the Spotify Developer Portal. The
14045
14176
  redirect URI is case-sensitive, and must contain the trailing slash. You will need to
14046
- adjust the redirect URI value if you specify custom values using the `redirectUriHost`
14047
- and `redirectUriPort` arguments.
14177
+ adjust the redirect URI value if you specify custom values using the `redirectUriHost`,
14178
+ `redirectUriPort`, and `redirectUriPath` arguments.
14048
14179
  """
14049
14180
  apiMethodName:str = 'SetAuthTokenAuthorizationCodePKCE'
14050
14181
  apiMethodParms:SIMethodParmListContext = None
@@ -14060,6 +14191,7 @@ class SpotifyClient:
14060
14191
  apiMethodParms.AppendKeyValue("forceAuthorize", forceAuthorize)
14061
14192
  apiMethodParms.AppendKeyValue("redirectUriHost", redirectUriHost)
14062
14193
  apiMethodParms.AppendKeyValue("redirectUriPort", redirectUriPort)
14194
+ apiMethodParms.AppendKeyValue("redirectUriPath", redirectUriPath)
14063
14195
  _logsi.LogMethodParmList(SILevel.Verbose, TRACE_MSG_AUTHTOKEN_CREATE % authorizationType, apiMethodParms)
14064
14196
 
14065
14197
  # validation.
@@ -14099,8 +14231,8 @@ class SpotifyClient:
14099
14231
  self._AuthClient.AuthorizeWithServer(
14100
14232
  host=redirectUriHost,
14101
14233
  port=redirectUriPort,
14234
+ redirect_uri_path=redirectUriPath,
14102
14235
  open_browser=True,
14103
- redirect_uri_trailing_slash=True,
14104
14236
  force=forceAuthorize,
14105
14237
  timeout_seconds=120
14106
14238
  )