Uh oh!
There was an error while loading. Please reload this page.
Fix and update library searching - #693
Conversation
meisnate12
commented
Mar 14, 2021
saw this and started playing with the update to see what it could do and when I try this: ps=PlexServer("http://IP.IP.IP.IP:32400", "thisisnotmytoken", timeout=600)
plex=next((sforsinps.library.sections() ifs.title=="TV Shows"), None)
items=plex.search(**{"genre": "Comedy"})
print(items)i get the error if I change also, I tried specifying the |
JonnyWong16
commented
Mar 14, 2021
Try it now. Let me know if you find any other errors. |
meisnate12
commented
Mar 15, 2021
ok it works now I'm working on an update for my program for once this comes out if I find anything else I'll let you know |
meisnate12
commented
Mar 15, 2021
ok so now im trying to use the ps=PlexServer("http://IP.IP.IP.IP:32400", "thisisnotmytoken", timeout=600)
plex=next((sforsinps.library.sections() ifs.title=="Movies"), None)
print(len(plex.search(**{"genre": "Comedy"})))
print(len(plex.search(**{"genre": "Action"})))
print(len(plex.search(**{"genre": ["Comedy", "Action"]})))
print(len(plex.search(**{"genre&": ["Comedy", "Action"]})))
print(len(plex.search(**{"genre": "Comedy", "genre&": ["Action"]})))with the results: it seems to me that the |
JonnyWong16
commented
Mar 15, 2021
Fixed the |
Fixespushingkarmaorg#694 When using a PlexAPI operator, fetchItems may return zero results in the first container causing the loop to break early. This changes the break condition to check if the container exceeds the total number of items therefore there will be no more items to fetch.
Fixespushingkarmaorg#695 totalSize was getting overwritten when using search with a different libtype. This makes totalSize independant from search.
meisnate12
commented
Mar 17, 2021
|
JonnyWong16
commented
Mar 18, 2021
I cannot reproduce the issue. >>>movies=plex.library.section("Movies")
>>>len(movies.all())
1937>>>duration=5400000# 1.5 hours in milliseconds>>>len(movies.search(**{"duration<<": duration}))
288>>>len(movies.search(**{"duration>>": duration})) 1649 |
meisnate12
commented
Mar 18, 2021
ok yea that ones my mess up it does work sorry |
Hellowlol
commented
Mar 21, 2021
This looks awesome. Great work! |
Montellese
commented
Mar 23, 2021
Thanks for all these changes. I noticed that your change to split Furthermore I noticed that you changed all library section IDs from |
JonnyWong16
commented
Mar 23, 2021
Thanks. See #712. |
I was trying to do a title search using a list like so print(len(plex.search(**{"title": "Star"}))) # Worked returned 32print(len(plex.search(**{"title": "Wars"}))) # Worked returned 16print(len(plex.search(**{"title": ["Wars"]}))) # Failed returned 0print(len(plex.search(**{"title": ["Star", "Wars"]}))) # Failed returned 0print(len(plex.search(**{"title&": ["Star", "Wars"]}))) # Worked returned 13and while getting the correct results for some searches, using a list with title results in 0 items returned. Is there any way to do an OR title search? If not could it be added in? I tried similar tests with the other string I'm using, which is studio, and it was able to or together values ok |
JonnyWong16
commented
Mar 24, 2021
That's a bug I missed because This should be a workaround for title plex.search(title="Star,Wars") |
Description
This is a complete rewrite of the library search feature. See doc string for
LibrarySection.search()for complete details and examples.Deprecated methods
LibrarySection.filterFields(): uselistFields()instead.LibrarySection.listChoices(): uselistFilterChoices()instead.New methods
See doc strings for each method for complete details and examples.
LibrarySection.filterTypes()LibrarySection.getFilterType()LibrarySection.fieldTypes()LibrarySection.getFieldType()LibrarySection.listFilters()LibrarySection.listSorts()LibrarySection.listFields()LibrarySection.listOperators()LibrarySection.listFilterChoices()LibrarySection.hubSearch(): alias forPlexServer.search(query, sectionId=librarySectionID)MovieSection.searchMovies(): alias forLibrarySection.search(libtype='movie')ShowSection.searchSeasons(): alias forLibrarySection.search(libtype='season')Breaking changes
librarySectionIDis casted to aninteverywhere instead of astrLibrarySection.filtersis casted to aboolinstead of astrLibrarySection.keyis casted to aintinstead of astrCloses#598
Fixes#320
Fixes#392
Fixes#553
Fixes#595
Fixes#623
Fixes#691
Fixes#694
Fixes#695
Type of change
Please delete options that are not relevant.
Checklist: