Modify ajax timeout to be not too many slow

pull/9/head
chewbaka 7 years ago
parent 6947655002
commit 6d03a5a405

@ -222,8 +222,8 @@ class Model_Movie extends Model_Overwrite
if(!$this->_server) if(!$this->_server)
$this->getServer(); $this->getServer();
$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare].library&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl'); $curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl');
//$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare].library&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&videoResolution=576x320&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl'); //$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&videoResolution=576x320&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl');
$curl->execute(); $curl->execute();

@ -238,11 +238,25 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
event.stopPropagation();
var movie_id = $(this).data('id');
$.ajax({
url: '/rest/movie/stream',
method: 'GET',
data: {movie_id: movie_id},
dataType: 'html'
}).done(function (view) {
launchPlayer(view);
}).fail(function (data) {
console.error(data);
});
});
$('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) { $('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) {
setTimeout(function () { setTimeout(function () {
var movie_id = $(element).data('movie-id'); var movie_id = $(element).data('movie-id');
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id=' + movie_id + '&width=' + 260 + '&height=' + 146 + '&thumb=true")'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id=' + movie_id + '&width=' + 260 + '&height=' + 146 + '&thumb=true")');
}, (index + 1) * 500); }, (index + 1) * 100);
}); });
}); });
</script> </script>

@ -346,13 +346,13 @@
setTimeout(function () { setTimeout(function () {
var movie_id = $(element).data('movie-id'); var movie_id = $(element).data('movie-id');
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 126 +'&height='+189+'")'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 126 +'&height='+189+'")');
}, (index + 1) * Math.random() * (100 - 20) + 20); }, (index + 1) * Math.random() * (100 - 50) + 50);
}); });
$('.PosterCardImg-imageContainer-1Ar4M[data-tvshow-id]').each(function (index, element) { $('.PosterCardImg-imageContainer-1Ar4M[data-tvshow-id]').each(function (index, element) {
setTimeout(function () { setTimeout(function () {
var tvshow_id = $(element).data('tvshow-id'); var tvshow_id = $(element).data('tvshow-id');
$('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id='+ tvshow_id +'&width='+ 126 +'&height='+189+'")'); $('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id='+ tvshow_id +'&width='+ 126 +'&height='+189+'")');
}, (index + 1) * Math.random() * (100 - 20) + 20); }, (index + 1) * Math.random() * (100 - 50) + 50);
}); });
}); });
</script> </script>

@ -46,7 +46,7 @@
<div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div> <div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div>
</div> </div>
<button data-id="<?php echo $movie->id; ?>" tabindex="-1" <button data-id="<?php echo $movie->id; ?>" tabindex="-1"
data-qa-id="metadataPosterPlayButton" role="button" role="button"
class="MetadataPosterCardOverlay-playCoverButton-I7oU3 MetadataPosterCardOverlay-playButton-1fjhk PlayButton-playButton-3WX8X MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO" class="MetadataPosterCardOverlay-playCoverButton-I7oU3 MetadataPosterCardOverlay-playButton-1fjhk PlayButton-playButton-3WX8X MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO"
type="button"> type="button">
<div class="MetadataPosterCardOverlay-playCircle-M67q6 PlayButton-playCircle-3Evfd MetadataPosterCardOverlay-centerCircle-1Mg-s"> <div class="MetadataPosterCardOverlay-playCircle-M67q6 PlayButton-playCircle-3Evfd MetadataPosterCardOverlay-centerCircle-1Mg-s">
@ -61,10 +61,9 @@
<div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;"> <div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;">
<div> <div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw"> <div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayPrimaryTitle-primaryTitle-1r9P9" data-qa-id="preplayMainTitle"> <div class="PrePlayPrimaryTitle-primaryTitle-1r9P9">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><a data-qa-id="metadataTitleLink" <div class="PrePlayLeftTitle-leftTitle-Ev1KG"><a title="<?php echo $movie->title; ?>"
title="Timeless" href="#"
href="#!/server/df1de861fbaba243c18ed9275fd42e3248d19336/details?key=%2Flibrary%2Fmetadata%2F28082"
role="link" role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?></a> class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?></a>
</div> </div>
@ -257,7 +256,7 @@
setTimeout(function () { setTimeout(function () {
var movie_id = $(element).data('movie-id'); var movie_id = $(element).data('movie-id');
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 260 +'&height='+ 390 +'")'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 260 +'&height='+ 390 +'")');
}, (index + 1) * 500); }, (index + 1) * 100);
}); });
}); });
</script> </script>

@ -208,12 +208,12 @@
setTimeout(function () { setTimeout(function () {
var season_id = $(element).data('season-id'); var season_id = $(element).data('season-id');
$('[data-season-id="' + season_id + '"] > div').css('background-image', 'url("/cover/season?season_id='+ season_id +'&width='+ 260 +'&height='+ 390 +'")'); $('[data-season-id="' + season_id + '"] > div').css('background-image', 'url("/cover/season?season_id='+ season_id +'&width='+ 260 +'&height='+ 390 +'")');
}, (index + 1) * 500); }, (index + 1) * 100);
}); });
$('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) { $('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) {
setTimeout(function () { setTimeout(function () {
var movie_id = $(element).data('movie-id'); var movie_id = $(element).data('movie-id');
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 192 +'&height='+ 108 +'&thumb=true")'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 192 +'&height='+ 108 +'&thumb=true")');
}, (index + 1) * 500); }, (index + 1) * 100);
}); });
</script> </script>

@ -231,13 +231,13 @@
setTimeout(function () { setTimeout(function () {
var tvshow_id = $(element).data('tvshow-id'); var tvshow_id = $(element).data('tvshow-id');
$('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id=' + tvshow_id + '&width=' + 260 + '&height=' + 390 + '")'); $('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id=' + tvshow_id + '&width=' + 260 + '&height=' + 390 + '")');
}, (index + 1) * Math.random() * (100 - 20) + 20); }, (index + 1) * 100);
}); });
$('.PosterCardImg-imageContainer-1Ar4M[data-season-id]').each(function (index, element) { $('.PosterCardImg-imageContainer-1Ar4M[data-season-id]').each(function (index, element) {
setTimeout(function () { setTimeout(function () {
var season_id = $(element).data('season-id'); var season_id = $(element).data('season-id');
$('[data-season-id="' + season_id + '"] > div').css('background-image', 'url("/cover/season?season_id=' + season_id + '&width=' + 126 + '&height=' + 189 + '")'); $('[data-season-id="' + season_id + '"] > div').css('background-image', 'url("/cover/season?season_id=' + season_id + '&width=' + 126 + '&height=' + 189 + '")');
}, (index + 1) * Math.random() * (100 - 20) + 20); }, (index + 1) * 100);
}); });
}); });
</script> </script>
Loading…
Cancel
Save