ukdtom / WebTools.bundle

WebTools is a collection of tools for Plex Media Server. Like the Unsupported AppStore (UAS)
https://forums.plex.tv/discussion/288191
Mozilla Public License 2.0
1.3k stars 170 forks source link

SubManagement is fetching whole section in one go #446

Closed ukdtom closed 6 years ago

ukdtom commented 6 years ago

You are fetching the subs in one call

That would make a low powered PMS server, like an Arm based NAS, go to a full stop, and as such, break a playback in progress!

Line 130 in SubService.js

var url = webtoolsModel.apiV3Url + "/pms/getSection/key/" + show.key + "/start/0/size/9999/title/" + subModel.searchValue;

Correct way is to call getSectionSize to get the amount of items, and then grab them in small chunks like 40 a time

ukdtom commented 6 years ago

If doing a search, increase the start, until backend returns empty

ukdtom commented 6 years ago

Also missing the param /getsubs it seems

All in getTvShowDetails

However, done correctly in getMovieDetails

Outcome right now is no subs showing for shows, as well as draining the PMS ;)

creoludifico commented 6 years ago

It's only within a season. So unless a season has lots of episodes (like 100+?) this shouldnt be a issue?

ukdtom commented 6 years ago

Ahhh.....Okay, but you still miss the /getSub

Currently, no subs are shown for shows

creoludifico commented 6 years ago

My bad. It is shows. I'll look into it

creoludifico commented 6 years ago

Fixed the size problem but there is an issue with hide medias without sub. Try checking it and open a tv-show. No shows appear.

Tv-shows doesnt directly have a subtitle like movies have so i guess that is why it's getting filtered backend.

ukdtom commented 6 years ago

Please call me

creoludifico commented 6 years ago

Give it a check again

ukdtom commented 6 years ago

Almost ;)

In the mean time, I also fixed the GETSHOWSEASON to respect the HideWithoutSubs setting, but that reviled, that you doesn't refresh from API, when user toggle that setting

ukdtom commented 6 years ago

So merge my branch, and try from that

creoludifico commented 6 years ago

Should be fixed now

ukdtom commented 6 years ago

Perfect as always