Closed Bug 1554098 Opened 1 year ago Closed 1 year ago

RSS media enclosures type is not deduced from extension when missing

Categories

(MailNews Core :: Feed Reader, enhancement)

enhancement
Not set
normal

Tracking

(thunderbird68 fixed, thunderbird69 fixed)

RESOLVED FIXED
Thunderbird 69.0
Tracking Status
thunderbird68 --- fixed
thunderbird69 --- fixed

People

(Reporter: layus, Assigned: alta88)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

Subscribe to a feed with a media:content enclosure. For example this one https://www.mediapart.fr/articles/feed

Actual results:

The image was not displayed inline, as is the case with other rss feeds.
After investigation, it turns out that the stream does not provide a "type" tag in the media:content element, only the url tag.

Expected results:

As the image url ends with .jpg, Thunderbird could make a more educated guess than the default application/unknown from https://dxr.mozilla.org/comm-central/rev/2a29ee0adb310b54a6a2df72034953fed8f2b043/comm/mailnews/extensions/newsblog/content/FeedItem.js#400 . The image would thus be displayed normally.

It makes sense to perform the guess, as the type tag is not mandatory as per media-rss spec.

Attached patch mediaType.patchSplinter Review

Sure, why not.

Assignee: nobody → alta88
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9067421 - Flags: review?(mkmelin+mozilla)
Type: defect → enhancement
Component: Untriaged → Feed Reader
Product: Thunderbird → MailNews Core
Comment on attachment 9067421 [details] [diff] [review]
mediaType.patch

Review of attachment 9067421 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for providing such a quick fix !

The patch looks good to me (quite obviously), but I did not test it.
I could not find the required js interface. I was looking for nsIMime in dxr. Got bitten by case sensitivity.

Thanks again :-)
Comment on attachment 9067421 [details] [diff] [review]
mediaType.patch

Review of attachment 9067421 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM, r=mkmelin
Attachment #9067421 - Flags: review?(mkmelin+mozilla) → review+
Keywords: checkin-needed
Comment on attachment 9067421 [details] [diff] [review]
mediaType.patch

Beta material, right?
Attachment #9067421 - Flags: approval-comm-beta+

yes, thanks.

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/650172622d99
deduce RSS media enclosures type from extension when missing. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 69.0

Finally got a chance to test it. It is working perfectly, thanks !

You need to log in before you can comment on or make changes to this bug.