[gpodder] Re: Episode Rename Extension Usage

  • From: "motobiker91@xxxxxxx" <dmarc-noreply@xxxxxxxxxxxxx> ("motobiker91")
  • To: "gpodder@xxxxxxxxxxxxx" <gpodder@xxxxxxxxxxxxx>
  • Date: Tue, 23 May 2023 22:52:16 +0000 (UTC)

 This ({episode.parent.section}) didn't work but after searching a bit more 
through the source code I found out the function "sync_filename" (line 804 
/src/gpodder/model.py at the time of writing)  that is taking in this setting 
is also modifying the input a bit, to my untrained eye I think it's replacing 
instances of "episode" with "self" and "podcast" with "self.channel", so while 
{episode.parent.section) doesn't work {podcast.section} does. Unfortunately I'm 
familiar enough with the code to know exactly why but I'm responding with my 
solution to at least document for future users.
    On Tuesday, May 23, 2023 at 03:26:40 PM PDT, Brand Huntsman <alpha@xxxxxxx> 
wrote:  
 
 On 03:15 Sat 20-May-2023, motobiker91@xxxxxxx wrote:

I am trying to use the episode rename after download extension to add
the podcast's "section" to the file name. Currently I have
{episode.sortdate}_{episode.title} set as the value for
device_sync.custom_sync_name in the configuration editor.

The rename extension changes the filename on your device, you don't
need it to change filename on the device receiving the sync files.


To try and append the "section" to the filename

Try {episode.parent.section}_{episode.sortdate}_{episode.title}.

`episode.parent` is its channel object, which contains the `section`
field.


  

Other related posts: