It's all pretty awesome really, some great work done, and I know that it's pretty tough to get people dedicated to working on 'porn' projects as a hobby to boot. This site has really altered the way I watch porn since finding it, pretty amazing really.
Ok TL;DR warning here, I thought this was an interesting problem and rambled. Hope it helps somewhat, maybe, possibly... :)
With the picture problem, deep down the best way is the way teaseai does the meta tagging of each image. I haven't played much with teaseai, but on a cursory look his tagging system was pretty slick, probably about the fastest way I could think to tag image sets.
I think it dumps those tags to a text file, might be possible then to tag an image set with tease ai, copy the txt file it is tagged into into a 'meta.txt' file to leave in your image set directory. Then denial mistress can parse it (if present) to absolutely know what kind of photo its getting to plan properly.
That might get in the way of dragging and dropping picture sets with no work, which is also what you are going for I think.
So thinking about the problem at hand, which is a pretty interesting one.
I'm not sure how much is pre determined when you start. Assuming you choose the total length of the tease say 30 minutes (1800 seconds) and know how many images are present, lets say 200.
Assume an average of 10 seconds per picture and you have 2000 seconds of needed air time for the whole set, but you are short on time by 200 seconds. But really we need to solve, how much time per picture is needed. In this case 1800/200 and we get 9 seconds on average per picture, nice, done.
Lets try another case, 1800 second tease, 1000 pictures. 1.8 seconds per picture. that sucks, so we will need some minimum average time per picture, maybe 7 seconds? So we have to cut the number of pictures we show in this set until the number shown in the set is out chosen average time:
I'm bad at math so probably there is a better way but formula wise i guess its like:
1.8* X = 7 seconds... Basically how many times do we need to reduce the slideshow by every other X to hit 7 seconds.
7/1.8 = 3.89 So we need to show every 3.89 of our photo sets. Maybe best to round up always so we end up under our time.
1000 pics / 4 = 250 photos show. Averaging 7 seconds that's 1750 seconds of show time, with 1 minute left to fill.
Psudocode: (not sure how to ceiling in javascript):
Code: Select all
var MIN_AVG_DELAY = 7; //seconds
var time_per_pic = slideshow_time / slideshow.length;
var pictures_to_skip = 1;
if( time_per_pic < MIN_AVG_DELAY )
pictures_to_skip = ceiling( MIN_AVG_DELAY / time_per_pic );
Then psudo code for the picture loop
var odd_even = random ( 0 or 1);
for(var i = odd_even; i < picturelist.length; i+=pictures_to_skip )
That way you still have a ramp up of beginning and ending speed, and some variation as you start on the odd or even numbered pictures.
Ok example 3 lets try the other way around, 1800 second tease, 10 pictures. Let's see if our new formula holds up at all.
180 seconds per pic
its over 7 seconds, but ouch. We need a max time too I think, say 15 seconds. In this case we don't have to do anything fancy, just figure out WTF to do with the remaining time. So 15 sec * 10 = a 150 sec show, ouch, have to fill in 1650 seconds.
I think from here the trick is what to do with the remaining time in each case. You know now that I have gone through all this I bet you already did all this and are at the same spot. I suck, but it was fun getting here at least :)
Ok I'd say, you can do a few things here.
1. This is based on the idea that you have the average delay on each page, but you vary it, while keeping some time pool remaining. For example if you need to average 7 seconds a picture, one picture can be up for 5 seconds, and it will increase your 'time remaining' by 4 seconds, visa versa.
I think you need to determine a number for 'these are enough seconds to go to another slideshow'. If that number is say 2 minutes, any 'extra time' you have under 2 minutes should get distributed out through the slide show. In our first example we had 50 seconds 'free' in there.
Every time you are deciding which picture is next, you can have a random increasing chance to display a random picture between the cracks. In the above example you show say index 0, 4, 8... but instead of index 12, you randomly decide between 9 and 11 and pick index 10, then go to index 12 and continue. Each time you do this you subtract from your left over time. You MUST do this enough over the course of the tease to exhaust your time limit though.
2. If you determine you have enough time left over for another slide show (in example 3) then you have to pick a good one for the time left. I think what you ought to do is loop through every directory and see how long it will take. Just do min_avg_delay * items in the dir, and keep track of the dir that is closest to the time remaining in the slide show, then run that one as normal.
Just keep selecting best fit slide shows (discarding already viewed ones) until you either run out of slide shows, or your time left in the slide show is low enough for 'bonus pics' to close out properly.
Ok lots of holes there and room for refinement, but I think the idea is solidish. Basically try to find the best fit slideshow for your missing time gaps. If you pick a good 'min_slideshow_time' value, it should hopefully always ensure you can get good coverage on the selected slideshow, otherwise you can draw out the existing slideshow long enough.
Anyway I hope this helps rather than seeming confusing, I know there is a lot more going on than assumed here but maybe will get you moving in a direction at the least.