You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The episodes() method's sort parameter is not functioning as expected. When using either addedAt:desc or originallyAvailableAt:desc as sort parameters, the method returns an empty list, despite episodes being present and containing valid dates for both fields.
Code Snippets
fromplexapi.serverimportPlexServer# Connect to Plex serverplex=PlexServer('http://localhost:32400', 'TOKEN')
show=plex.library.section('TV Shows').get('This Week With George Stephanopoulos')
# These both return empty listsepisodes_by_added=show.episodes(sort="addedAt:desc")
episodes_by_air_date=show.episodes(sort="originallyAvailableAt:desc")
# Alternative sort syntax also returns empty listepisodes_alt_sort=show.episodes(sort="-addedAt")
Expected Behavior
The episodes() method should return a list of episodes sorted according to the specified sort parameter
For addedAt:desc, episodes should be sorted from newest to oldest based on their addition date
For originallyAvailableAt:desc, episodes should be sorted from newest to oldest based on their air date
Here's the output showing the issue:
Total number of episodes: 5
Episode list without sorting:
S2024E42 - Added: 2024-10-27 11:07:40, Aired: 2024-10-27 00:00:00
S2024E45 - Added: 2024-11-17 11:07:11, Aired: 2024-11-17 00:00:00
S2024E47 - Added: 2024-12-01 11:05:27, Aired: 2024-12-01 00:00:00
S2024E50 - Added: 2024-12-22 11:10:56, Aired: 2024-12-22 00:00:00
S2025E1 - Added: 2025-01-05 11:06:36, Aired: 2025-01-05 00:00:00
Using addedAt:desc sort:
Number of episodes returned: 0
Using originallyAvailableAt:desc sort:
Number of episodes returned: 0
Testing alternative sort syntax:
Number of episodes returned with alternative sort: 0
Additional Context
No response
Operating System and Version
Windows 11
Plex Media Server Version
1.41.3.9314-a0bfb8370
Python Version
3.11.3
PlexAPI Version
4.16.0
The text was updated successfully, but these errors were encountered:
Describe the Bug
The
episodes()
method's sort parameter is not functioning as expected. When using eitheraddedAt:desc
ororiginallyAvailableAt:desc
as sort parameters, the method returns an empty list, despite episodes being present and containing valid dates for both fields.Code Snippets
Expected Behavior
episodes()
method should return a list of episodes sorted according to the specified sort parameteraddedAt:desc
, episodes should be sorted from newest to oldest based on their addition dateoriginallyAvailableAt:desc
, episodes should be sorted from newest to oldest based on their air dateHere's the output showing the issue:
Additional Context
No response
Operating System and Version
Windows 11
Plex Media Server Version
1.41.3.9314-a0bfb8370
Python Version
3.11.3
PlexAPI Version
4.16.0
The text was updated successfully, but these errors were encountered: