Skip to content

Use m_entry->title to set downloaded file name

Eamonn Rea requested to merge (removed):master into work/legible-filenames

Overview

Currently Kasts downloads files using enclosurePath, which to my understanding, generates a hash based on the download URL in order to set the filename for the enclosure path (which represents the selected/default download path). This appears to be deliberate, but I found it jarring when downloading podcasts to watch offline.

For users who want to download their podcasts, they might rely on the filename being something readable, such as having the podcast name and episode number. If they only download one episode at a time this is not much of an issue, but if they're downloading several episodes from different podcasts, this can make organizing downloaded podcasts difficult.

Implementation

This MR changes Enclosure::path to return a path containing the m_entry->title, which results in a more readable filename.

A current lingering issue with this MR is that the file extension is not preserved. I believe this comes back somewhere in the request and it is possible that this could be inferred. On my machine this does not disturb playback, but it would be cleaner imo to preserve the extension.


I am still very new to C++ and am by no means an expert with it, just a tinkerer and user of Kasts who thought this would be a nice change. So all feedback is welcome, and no worries if this is not a wanted change 😃

Merge request reports