Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Multiple sources, too many videos per page, wrong sort


  • Please log in to reply
22 replies to this topic

#1 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 08 December 2012 - 01:37 AM

I just bought the pro version specifically so I could have a gallery with multiple playlist sources, organized by date published. Eric assured me I could do this before I purchased it. Unfortunately, it's not working.

For the code on the page, I'm using: [tubepress mode="playlist" theme="youtube" orderBy="published" resultsPerPage="18" playlistValue="PLykzf464sU9-aGFUCycstq0dId-OiA5qd + PLykzf464sU9_EU8rh1qQ5J4sQvUFAI61V"] ... only with a lot more playlist numbers.

I have Ajax pagination enabled, and chose 18 videos per page in the Tubepress options (Thumbnails tab) as well. Also, on the Feed tab, I have "Order videos by" set to date published as well.

The page is http://www.humortimes.com/test-video/

Please help!

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 08 December 2012 - 05:49 PM

Hi,

A few notes...

  • If you haven't already, I strongly recommend that you enable TubePress's API cache from WP Admin > Settings > TubePress > Cache. This will dramatically improve the load time of your video gallery when using so many sources.

  • As for the unexpectedly large number of videos per page (more than 18) this is noted in the documentation:

    The resultsPerPage option will apply to each source, so expect each gallery page to contain up to resultsPerPage x videos per page.


    So in your case, there would be 18 * videos on each page of the gallery. To circumvent this, I recommend setting resultsPerPage to something much smaller. If you have 8 sources, for instance, you should set resultsPerPage="2" to get 16 videos per page (a multiple of 4 would probably look best in your gallery since you have 4 videos per column).

  • Regarding the sort order, I would suggest using orderBy="newest" and perPageSort="newest". e.g.

    [tubepress mode="playlist" theme="youtube" orderBy="newest" perPageSort="newest" ... ]
    That will correctly sort the videos in a "newest first" manner - that's what you're after, correct?
Please give this a try and let us know how it works out for you. Thanks!

#3 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 08 December 2012 - 07:05 PM

Well, that kind of negates the "intermingled" thing I was hoping for and asked about, if each playlist gets the same number of results. I was hoping to have a large group of playlists, and only the newest out of all of them made it to the top. Instead, it sounds like it'll be the newest of each.

So, it sounds like, if I have 10 playlists, the first 10 videos shown will be the newest from each playlist, etc. A couple playlists might only have pretty old videos, yet they would still make it to the top. Not what I was hoping for.

Fact is, I have over 60 playlists listed, and even with the cache on and resultsPerPage set to 1, it's too big a page, and takes a very long time to load.

Btw, why doesn't the 18 per page setting in the Tubepress sitewide options do anything?

Can you think of any other way of achieving what I'm trying to do?

I'm also noticing another problem. On another test page, www.humortimes.com/test-video-political, with only 19 playlists, after I start a video by clicking on a thumbnail, I can no longer click on any other thumbnails to get them to play. Only that one video I picked first will play.

#4 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 08 December 2012 - 07:33 PM

The more I play with this, the more frustrated I'm getting. Besides the problems I've noted in the previous post, I have resultCountCap="200" set, and yet I'm still getting 180 pages of 19 each, 3420 videos.

I could possibly try another approach, restricting the results to users, rather than playlists. I don't like this as much, as I don't have as much control. Some users will post videos I don't want, but they'll have one playlist I like.

However, if I were to try this, can I use searchResultsRestrictedToUser="someuser + anotheruser + stillanother", like you can with playlists? Or can you list only one user?

#5 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 08 December 2012 - 07:39 PM

OK, actually, the pagination thing isn't even working correctly at all. It says there are 180 pages, but when I click on any of them, even page 2, there is nothing, only the video player. No more gallery.

#6 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 12 December 2012 - 12:43 AM

Hi,

I'm sorry that I'm only getting back to you now, and I also apologize that you're still experiencing difficulty getting TubePress to do what you want it to. Comments inline...

Well, that kind of negates the "intermingled" thing I was hoping for and asked about, if each playlist gets the same number of results. I was hoping to have a large group of playlists, and only the newest out of all of them made it to the top. Instead, it sounds like it'll be the newest of each.

So, it sounds like, if I have 10 playlists, the first 10 videos shown will be the newest from each playlist, etc. A couple playlists might only have pretty old videos, yet they would still make it to the top. Not what I was hoping for.


Unfortunately as it stands, and as you've seen, TubePress will pick 10 videos from each of the 10 playlists and assemble them into the gallery. That said, I understand your scenario and I think it would be useful to add to TubePress. Version 3.0.0 introduces a whole bunch of bug fixes related to galleries from multiple sources. I'd like to see what it would take to add an option (say, multipleGallerySourcesMode="strict") that would accomplish what you're after. There are some edge cases that need to be addressed, but I think it would be doable. Give me a day or two to whip up some code and see if I can't get it done.

Fact is, I have over 60 playlists listed, and even with the cache on and resultsPerPage set to 1, it's too big a page, and takes a very long time to load.


I strongly urge you to install and configure a caching layer such as W3 Total Cache or WP Super Cache. That will eliminate any slowdown as 99% of the time your visitors will be served up the cached pages.

Btw, why doesn't the 18 per page setting in the Tubepress sitewide options do anything?


You've overriden it in your shortcode with

[tubepressresultsPerPage="1"]

Can you think of any other way of achieving what I'm trying to do?


See my first comment.

I'm also noticing another problem. On another test page, www.humortimes.com/test-video-political , with only 19 playlists, after I start a video by clicking on a thumbnail, I can no longer click on any other thumbnails to get them to play. Only that one video I picked first will play.


Another customer had an identical problem recently. Here is the workaround for the 2.x.x versions of TubePress Pro. It's a bug that has been fixed in 3.0.0. Please give the workaround a try and let us know how it works for you.

The more I play with this, the more frustrated I'm getting. Besides the problems I've noted in the previous post, I have resultCountCap="200" set, and yet I'm still getting 180 pages of 19 each, 3420 videos.


OK, actually, the pagination thing isn't even working correctly at all. It says there are 180 pages, but when I click on any of them, even page 2, there is nothing, only the video player. No more gallery.


TubePress 3.0.0 fixed a number of bugs related to pagination in galleries with multiple video sources. I would recommend trying out RC1.


Stand by for an update regarding my first comment. Thanks!

#7 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 12 December 2012 - 12:45 PM

Thanks, I hope you can come up with something as you say.

I do have WT3 Total Cache installed, AND the API cache thing enabled. It's still slow as heck.

jjames wrote:Btw, why doesn't the 18 per page setting in the Tubepress sitewide options do anything?

You've overriden it in your shortcode with

Code: Select all
[tubepress resultsPerPage="1"]



-- But when I didn't have that in there, it still wasn't limiting it to 18 per page.

I tried installing TP 3.0.0, and when I went to activate it, I got this error:

Fatal error: Can't inherit abstract function IteratorAggregate::getIterator() (previously declared abstract in ehough_fimble_api_Finder) in /home/humortimes/public_html/wp-content/plugins/tubepress/vendor/ehough/fimble/src/main/php/ehough/fimble/api/Finder.php on line 50

#8 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 12 December 2012 - 06:43 PM

I have a fixed version of TubePress 3.0.0 that I can send you in the meantime. Is it OK to send it to your jamminjames1 email address?

#9 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 18 December 2012 - 02:40 PM

Yes, please send. Sorry for the late reply.

#10 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 02 January 2013 - 02:23 PM

I've tried the new version you sent me, with the line you suggested: [tubepress mode="playlist with resultsPerPage='1'"

I've also added: theme="youtube" orderBy="newest" perPageSort="newest" resultCountCap="200"

... but i get a blank page:

http://www.humortimes.com/test-video/

Please help!

Also, I replied to your email with the below, but got no response:

What I want is a little different than you described. Rather than just the newest video from each playlist, I want all the videos sorted by date, from all sources. So, there may be more than one new video from a particular source.

For example, if source A had two videos put out today and one two days ago, and source B had two videos from yesterday, the videos would show A's two videos first, then B's two, then A's video from two days ago, etc.

#11 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 07 January 2013 - 11:19 PM

Hi,

Now it's my turn to apologize for the late response - I'm sorry! :/

OK, here's what I would suggest. First, please uninstall and disregard the custom copy of TubePress Pro 3.0.0 that I sent to you via email. Instead download a fresh copy of TubePress Pro 3.0.0.RC2 which you can find in the members area. The custom code that I had worked on got way too complex and is likely causing the "no matching videos" error that you're getting.

What I want is a little different than you described. Rather than just the newest video from each playlist, I want all the videos sorted by date, from all sources. So, there may be more than one new video from a particular source.

For example, if source A had two videos put out today and one two days ago, and source B had two videos from yesterday, the videos would show A's two videos first, then B's two, then A's video from two days ago, etc.


Got it. I believe TubePress Pro 3.0.0.RC2 should be able to get you to 95% of what you're after. The only catch is that you will have to set resultsPerPage to how many videos you'd like to show per playlist. In other words, let's say you have

resultsPerPage="3" orderBy="newest" perPageSort="newest" resultCountCap="200"
and have 20 playlists. In this case the first, second and third pages of the gallery will have 60 videos. The fourth and final page of the gallery will have 20 videos. 60*3 + 20 = 200. The videos will be sorted from start to finish by newest first.

Give that a try? Also, if you could enable debugging from WP Admin > Settings > TubePress > Advanced I'll be happy to take a look at the exact shortcode you're using.

Thanks again for your patience in solving this!

#12 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 09 January 2013 - 04:47 PM

Ok, we're getting closer. I've enabled debugging, but I'm using the exact code you've recommended.

However, I think we need a new approach. The problem with doing it this way is, I'm drawing from a lot of playlists, so it's still resulting in more videos per page than I'd like, making it slow at loading.

With the example of the test 'political videos' page (http://www.humortime...ideo-political/), it's not so bad, but I also want to do a 'non-politcal' video page, and it draws from a LOT more playlists. Even with this political page, however, it's too many. I'd like to limit the videos per page to 18 (three rows of six).

I could go down to resultsPerPage="2", but it would still result in too many per page, and would not help with the 'non-political' page.

True, I could limit the playlists I'm drawing from, but that would defeat the purpose of our video gallery, which is to bring what we feel are the all best funny videos to our fans.

Is there no way to limit the videos per page, while sorting for date from a large number of playlists?

Thanks for your efforts.

#13 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 09 January 2013 - 05:34 PM

I'm glad that we're getting closer!

I also agree that we might need a different approach. The problem with TubePress pulling from so many playlists is that it needs to perform a separate network operation for each playlist, the performance will continue to get worse as you add playlists to the gallery. Adding caching layers will help a little, but fundamentally it's fighting a losing battle if the intent is to have lots of gallery sources in the same gallery.

Is there no way to limit the videos per page, while sorting for date from a large number of playlists?


This is what I had tried to piece together the other week. The problem is that TubePress would still have to go out and fetch each playlist to see who has the latest videos. e.g. If you have 100 playlists and want to show only the latest 20 videos, TubePress's only way of selecting those 20 videos is to examine each of the 100 playlists. In theory a nightly operation to prime TubePress's cache would probably do the job, but we simply don't have that capability at the moment. Does that make sense?

One recommendation would be to consolidate your playlists. That may or may not be possible? That way you'd reduce the number of network operations that TubePress would have to do.

I'd like to limit the videos per page to 18 (three rows of six).


Currently the minimum videos per page is equal to the number of gallery sources. So since on your political page you have 19 playlists, even with resultsPerPage="1" you would still have 19 videos. This gets back to the limitation I described above.

Let me know what you think, and thanks as always for your patience in working this out.

#14 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 09 January 2013 - 06:28 PM

How about this: Would it be an easier operation to get the latest from each author (or their recent uploads or feed), rather than their playlists? It would compromise the results a bit, as certain playlists by certain authors are a better way to get at the videos I'm most interested in, but if it worked, it might be ok.

Or, how about using 'tag' mode (to get at 'political humor' videos, for example), but pull only the most popular of those? As I read the documentation, that looks like two separate modes, but maybe if they can be combined, I'd get good enough quality results.

Your documentation says for in tag mode, I could limit the results to a certain user:

For keyword-based galleries, or during interactive searching, this option can filter the results to videos uploaded by the given user.

... can there be multiple users listed?

The best would be to be able to pull from multiple playlists, however, since what many consider 'funny' is not what we're looking for.

In theory a nightly operation to prime TubePress's cache would probably do the job, but we simply don't have that capability at the moment.



Is that something you may be able to do in the near future?

#15 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 10 January 2013 - 06:56 PM

How about this: Would it be an easier operation to get the latest from each author (or their recent uploads or feed), rather than their playlists? It would compromise the results a bit, as certain playlists by certain authors are a better way to get at the videos I'm most interested in, but if it worked, it might be ok.


If there are significantly fewer authors than playlists that you will be pulling from, then yes this could be an alternative. But like playlists if you end up using more than a handful of authors, then you'll hit the same performance issues again.

Or, how about using 'tag' mode (to get at 'political humor' videos, for example), but pull only the most popular of those? As I read the documentation, that looks like two separate modes, but maybe if they can be combined, I'd get good enough quality results.

Your documentation says for in tag mode, I could limit the results to a certain user:

For keyword-based galleries, or during interactive searching, this option can filter the results to videos uploaded by the given user.


... can there be multiple users listed?



For a single API request to YouTube (or Vimeo), we can only submit a single video author for a search request (reference). So this option seems much less viable.

In theory a nightly operation to prime TubePress's cache would probably do the job, but we simply don't have that capability at the moment.



Is that something you may be able to do in the near future?


Adding first-class support for priming the API cache won't be here in the near future, no. We are simply swamped at the moment working on feature requests.

That said, you could very likely set up a cron job to simply visit the pages of your gallery using curl or wget. With TubePress's API cache turned on, that would have the same effect of priming the cache. It *should* dramatically speed up your existing configuration (lots of playlists) as during the day TubePress could just pull from the cache instead of going over the network. For instance you could have a nightly job that simply visits the following URLs:

  • http://www.humortimes.com/test-video-political/
  • http://www.humortimes.com/test-video-political/?tubepress_page=2
  • http://www.humortimes.com/test-video-political/?tubepress_page=3
  • ...

But even right now, as you've noted, with TubePress's cache enabled there are still performance problems. That got me wondering why exactly. I ran two performance tests on your site: one for the test-political-video page and one for just another random page from your site. Here are the results:

Some conclusions from comparing the two results:

  • The total load time of the two pages is way different (9s vs 19s). This much we've seen already.
  • The time-to-first-byte, render time, and DOM element count is about the same. This means the the performance slowdown is client-side, as the server responded in roughly the same time.
  • The page size is very different (838 KB vs 2.2 MB). This is a problem as 2.2 MB is quite a heavy load, and could certainly account for at least a good chunk of the performance issue.
Going with that last bullet point, I wanted to see what was causing the heavier payload. According to FireBug, a non-TubePress page has about 130 KB of images, but the test-political-video page has 1.3 MB. Why? You have HQ thumbnails enabled in TubePress. Each thumbnail is roughly 20 KB, so with a ton of video thumbnails that can add up quickly. In summary, I would at least experiment with either reducing the thumbs per page or switching to "regular" quality thumbnails.

I wanted to pursue the performance issue more because if we could make TubePress fast at pulling in all your playlists, I feel like we'd be much closer to what you're actually after.

Thoughts?

#16 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 10 January 2013 - 09:31 PM

In summary, I would at least experiment with either reducing the thumbs per page or switching to "regular" quality thumbnails.


I switched to regular thumbs, but reducing the thumbs per page doesn't seem possible, given the number of playlists I want to use and the way Tubepress works. It seems to me there should be some way of forcing that, however. Some simple code you could add, perhaps? That could potentially solve all my problems.

Btw, I ran the speed test for one of my live Tubepress pages, which only draw from one playlist and have only 18 thumbnails, and the time was about the same, actually a little more, 22.4 seconds. So, it seems reducing the thumbnails may not help all that much. I ran it several times, with similar results...
http://www.webpagete...11...1/details/

#17 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 12 January 2013 - 08:33 PM

I'm going to email you a TubePress add-on (undocumented for the next week or so) that you can use to "clip" the number of thumbnails per page. It's a zip file called "page-clipper.zip". To use, you simply unzip into wp-content/tubepress-content/plugins. So after unzipping you will have a directory at wp-content/tubepress-content/plugins/page-clipper.

By default, it will cap the total thumbnails to 10. You can change this by editing wp-content/tubepress-content/plugins/page-clipper/PageClipper.php. On line 20 just change it from 10 to whatever you'd like.

Caveat: this will skip some thumbnails. It's essentially skipping a certain number of videos for each page. But perhaps in your situation this could be just about right?

#18 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 15 January 2013 - 11:06 PM

Caveat: this will skip some thumbnails.


Will the skipped videos appear on the following page?

#19 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 15 January 2013 - 11:56 PM

The skipped videos will not appear on the subsequent pages, no. That would require the functionality of the code that I had naively tried to whip up quickly (and had sent your earlier).

This latest code that I just emailed you essentially just crops the number of videos per page. It's crude in that sense, but maybe still useful?

Let me know. Thanks.

#20 James Israel

James Israel

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationSacramento, CA

Posted 16 January 2013 - 07:28 PM

Well, no, not really very useful. Sounds like it would eliminate a whole lot of videos from our gallery.

Any chance you could improve the code you tried to write earlier and get it to work?