Forum

Thread tagged as: Problem, Addons, Podcasts

Podcast App 1.3 — File size auto-detect not auto-detecting

Hello!

It’s been about a year since I posted about the Podcast App not auto-detecting duration of episodes. After updating a Perch installation and all the attendant add-ons to current versions in May, I thought to check and see if this was still an issue. Good news is, duration is now auto-detecting! Bad news is that file size is not (it was before) — just a "1" shows up in the file size field after saving the episode. The podcast file I’m attempting to add is an m4a, but I tested the auto-detect with an mp3-formatted podcast file and had the same result.

This is not a critical bug for my client, they haven't posted a new podcast in some time and weren’t displaying file size, anyway. But this might be an annoying/disconcerting bug for someone else managing podcast information. File size is not as straightforward to intuit and manually add, if needed, unlike duration. And any manual entry of this type of information can introduce user error. I’m not sure if iTunes relies on this information.

Diagnostics:

Perch: 3.0.4, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: FreeBSD, cgi-fcgi
Installed apps: content (3.0.4), assets (3.0.4), categories (3.0.4), perch_blog (5.5.1), perch_forms (1.9), perch_podcasts (1.3), perch_twitter (3.7)
App runtimes: <?php $apps_list = [ 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_podcasts', 'perch_twitter', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /usr/home/[REDACTED]/public_html/[REDACTED].com/perch
PERCH_CORE: /usr/home/[REDACTED]/public_html/[REDACTED].com/perch/core
PERCH_RESFILEPATH: /usr/home/[REDACTED]/public_html/[REDACTED].com/perch/resources
Image manipulation: GD
PHP limits: Max upload 4M, Max POST 8M, Memory: 128M, Total max file upload: 4M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /usr/home/[REDACTED]/public_html/[REDACTED].com
HTTP_HOST: www.[REDACTED].com

Here is my custom template code. I note that there is no field here for file size, but there isn't a field for file size in the stock template that came with the app, either.

<header class="page-header">
        <h1 class="page-parent"><a href="/podcast/"><perch:podcasts id="showTitle" type="hidden" /></a></h1>
        <h2 class="page-title"><perch:podcasts id="episodeTitle" type="text" label="Title" /></h2>
        <div class="single-item-meta">
            <span class="season-episode">
                Season 
                <span class="numeral">
                    <perch:categories id="seasons" label="Which Season?" set="Podcast" />
                        <perch:category id="catTitle" />
                    </perch:categories>
                </span>
                Episode <span class="numeral"><perch:podcasts id="seasonEpisode" type="text" label="Episode" size="s" /></span>
            </span>
            <span class="date">
                <time datetime="<perch:podcasts id="episodeDate" type="date" format="Y-m-d" />"><perch:podcasts id="episodeDate" type="date" label="Date" format="F d, Y" time="true" /></time>
            </span>
            <perch:if exists="episodeDurationHMS">
                <span class="duration">
                    Duration <span class="hms"><perch:podcasts id="episodeDurationHMS" type="hidden" /></span>
                </span>
            </perch:if>
            <div class="actions"><a href="<perch:podcasts id="itunes" type="hidden" />" title="Subscribe via iTunes">Subscribe via iTunes</a><a href="<perch:podcasts id="rss" type="hidden" />" title="Get the RSS Feed">Get the RSS Feed</a></div>
        </div>
    </header>

    <div class="page-content">      
        <div class="intro">
            <perch:podcasts id="summary" type="textarea" editor="markitup" textile="true" label="Description" size="m" import-from="itunes:summary" />
        </div>
        <div class="audio-wrap">
            <audio controls>
                <source src="<perch:podcasts id="episodeTrackedURL" type="hidden" escape="true" />" type="<perch:podcasts id="episodeFileType" type="hidden" escape="true" />" />
                <a href="<perch:podcasts id="episodeTrackedURL" type="hidden" escape="true" />">Download the audio file</a> for this episode.  
            </audio>
        </div>
    </div>

<perch:podcasts id="episodeNumber" type="text" size="s" suppress="true" label="Unique Tracking ID" help="Set automatically. Required for outputting tracking URLs." />
Abby Larsen

Abby Larsen 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is this maybe a CORS issue?

Abby Larsen

Abby Larsen 0 points
Registered Developer

I don’t think so. I’m not as familiar with CORS issues as I could be, but I would think the request would fail utterly if that were the source of the problem, wouldn't it? The media host (Libsyn) doesn't require any special CORS settings that I’m aware of, and all other aspects of the media are working as expected in the Podcast App. I see the content-length of the media accurately reported in the Response Headers when I inspect Headers in Chrome. The only thing surprising thing to me, at least, was that the status code for the media request is "206" for Partial Content. I’ve included the Headers (parsed not raw) report below, if it’s helpful.

GENERAL
Request URL:https://hwcdn.libsyn.com/p/7/5/8/[REDACTED]/S6Ep7PP7May15.m4a?c_id=9077136&expiration=1496976028&hwt=e138a883a52576cfee0598135ec7eb20
Request Method:GET
Status Code:206 Partial Content
Remote Address:205.185.208.135:80
Referrer Policy:no-referrer-when-downgrade

RESPONSE HEADERS
Accept-Ranges:bytes
Access-Control-Allow-Origin:*
Cache-Control:max-age=31450000
Connection:Keep-Alive
Content-Length:30620406
Content-Range:bytes 0-30620405/30620406
Content-Type:audio/x-m4a
Date:Fri, 09 Jun 2017 01:59:15 GMT
ETag:1460687683
Keep-Alive:timeout=10
Last-Modified:Fri, 15 Apr 2016 02:34:43 GMT
X-HW:1496973555.dop006.se1.t,1496973555.cds008.se1.c

REQUEST HEADERS
Accept:*/*
Accept-Encoding:identity;q=1, *;q=0
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Host:hwcdn.libsyn.com
Pragma:no-cache
Range:bytes=0-
Referer:https://[REDACTED]/perch/addons/apps/perch_podcasts/show/episode/?id=54
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

QUERY STRING PARAMETERS
c_id:9077136
expiration:1496976028
hwt:e138a883a52576cfee0598135ec7eb20
Drew McLellan

Drew McLellan 2638 points
Perch Support

The response contains the data (Content-Length) so I'd expect that to work. It may be that the component we're using for that needs updating.