Compare commits

...

4 commits

4 changed files with 4 additions and 6 deletions

View file

@ -22,7 +22,7 @@ def parseXML(xmlfile):
episode['download_url'] = child.attrib['url'] episode['download_url'] = child.attrib['url']
if child.tag == 'pubDate': if child.tag == 'pubDate':
date = child.text date = child.text
episode['date'] = parsedate_to_datetime(date).isoformat() episode['date'] = parsedate_to_datetime(date).isoformat() + "-08:00"
if child.tag == "title": if child.tag == "title":
episode['title'] = child.text episode['title'] = child.text
if child.tag == "description": if child.tag == "description":

File diff suppressed because one or more lines are too long

View file

@ -35,7 +35,6 @@
</div> </div>
<script> <script>
function GetJson(url) { function GetJson(url) {
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open("GET", url, false); httpreq.open("GET", url, false);
@ -49,7 +48,8 @@
let closestEpisode = {}; let closestEpisode = {};
episodes.forEach(function (episode, index) { episodes.forEach(function (episode, index) {
let difference = Math.abs(Date.parse(episode.date) - target); let epDate = Date.parse(episode.date);
let difference = Math.abs(epDate - target);
if ( difference < minDifference ) { if ( difference < minDifference ) {
minDifference = difference; minDifference = difference;
closestEpisode = episode; closestEpisode = episode;
@ -57,7 +57,6 @@
}); });
return closestEpisode; return closestEpisode;
} }
var jsonobj = GetJson("episodes.json"); var jsonobj = GetJson("episodes.json");
@ -81,7 +80,6 @@
document.getElementById("srcID").setAttribute("src", "https://minio.andr3w.net/chompers/media/" + todaysEpisode.filename); document.getElementById("srcID").setAttribute("src", "https://minio.andr3w.net/chompers/media/" + todaysEpisode.filename);
document.getElementById("player").load(); document.getElementById("player").load();
document.getElementById("player").play();
</script> </script>
</body> </body>
</html> </html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB