Bug 457848 - Offer better filenames for saved podcasts
Summary: Offer better filenames for saved podcasts
Status: RESOLVED FIXED
Alias: None
Product: kasts
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: bart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-13 17:45 UTC by tobias
Modified: 2023-07-30 19:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tobias 2022-08-13 17:45:52 UTC
SUMMARY

Right now the filename is a number or hash, it would be very useful if the filename could be the actual name of the podcast and the episode number, like:

podcastshow-ep104.mp3 

This way the files can be used inside other programs and can be opened manually etc.
Comment 1 bart 2022-08-29 19:36:32 UTC
Thanks for reporting.

I will see what can be done there.  The huge advantage of the current hash-based filenames is that there are no worries whatsoever about invalid characters in filenames.  If the podcast and/or episode titles are used, then you can get into nasty territory concerning i18n and underlying filesystems not supporting certain characters.
Comment 2 tobias 2022-09-10 19:14:45 UTC
(In reply to bart from comment #1)
> Thanks for reporting.
> 
> I will see what can be done there.  The huge advantage of the current
> hash-based filenames is that there are no worries whatsoever about invalid
> characters in filenames.  If the podcast and/or episode titles are used,
> then you can get into nasty territory concerning i18n and underlying
> filesystems not supporting certain characters.

Ok, I understand.
I just had a "crazy" idea: What about creating symbolic links?
We could have a seperate folder (e.g. called "podcasts-named") and the program would create symbolic links with the filename "structure" I suggested (podcastshow-ep104.mp3) and link to the hashed ones.
This way the program could still use the hashes and work properly in any situation.
Comment 3 Bug Janitor Service 2023-07-05 14:14:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/kasts/-/merge_requests/116
Comment 4 bart 2023-07-17 15:03:24 UTC
Git commit dc311cac7b65c0b3ee9c2be1faac0c9bed04596f by Bart De Vries, on behalf of Eamonn Rea.
Committed on 17/07/2023 at 12:52.
Pushed by bdevries into branch 'master'.

Use Entry title to set downloaded file name

Instead of using the MD5 hash of the enclosure download URL, we
create a filename which follows `feedname/entry_title.hash.ext`, where
feedname is a uniquefied feed title (stored in the DB), a truncated version
of the entry title, a shortened hash based on the download URL, and the
original file extension extracted from the download URL.

M  +83   -0    src/database.cpp
M  +1    -0    src/database.h
M  +38   -30   src/datamanager.cpp
M  +2    -2    src/enclosure.cpp
M  +14   -0    src/feed.cpp
M  +5    -0    src/feed.h
M  +2    -1    src/fetcher.h
M  +33   -7    src/storagemanager.cpp
M  +4    -1    src/storagemanager.h
M  +7    -0    src/storagemovejob.cpp
M  +76   -12   src/updatefeedjob.cpp
M  +5    -2    src/updatefeedjob.h

https://invent.kde.org/multimedia/kasts/-/commit/dc311cac7b65c0b3ee9c2be1faac0c9bed04596f
Comment 5 bart 2023-07-18 17:06:42 UTC
Git commit 2068b0515f6e78f50ff0c874aaa9bc1da4aae124 by Bart De Vries, on behalf of Eamonn Rea.
Committed on 18/07/2023 at 17:06.
Pushed by bdevries into branch 'release/23.08'.

Use Entry title to set downloaded file name

Instead of using the MD5 hash of the enclosure download URL, we
create a filename which follows `feedname/entry_title.hash.ext`, where
feedname is a uniquefied feed title (stored in the DB), a truncated version
of the entry title, a shortened hash based on the download URL, and the
original file extension extracted from the download URL.

M  +83   -0    src/database.cpp
M  +1    -0    src/database.h
M  +38   -30   src/datamanager.cpp
M  +2    -2    src/enclosure.cpp
M  +14   -0    src/feed.cpp
M  +5    -0    src/feed.h
M  +2    -1    src/fetcher.h
M  +33   -7    src/storagemanager.cpp
M  +4    -1    src/storagemanager.h
M  +7    -0    src/storagemovejob.cpp
M  +76   -12   src/updatefeedjob.cpp
M  +5    -2    src/updatefeedjob.h

https://invent.kde.org/multimedia/kasts/-/commit/2068b0515f6e78f50ff0c874aaa9bc1da4aae124
Comment 6 tobias 2023-07-30 19:07:27 UTC
Also thank you for this fix.

I got only one addional request for this:
Maybe you could add an episode number and or date to the episode name.