mlj / castget

A simple, command-line based RSS enclosure downloader, primarily intended for automatic, unattended downloading of podcasts.
http://castget.johndal.com
GNU General Public License v2.0
103 stars 23 forks source link

add possiblity to add directory to filename templates #39

Open L0ric0 opened 4 years ago

L0ric0 commented 4 years ago

when using the filename option it would be nice if one could inclue / to add another directory which if it doesn't exist is created

mlj commented 4 years ago

Except for creating a new directory if it does not already exist, this can be achieved by setting spool for the channel (which has to be the full path name and not a relative one).

So to make this work in a predictable way we woild have to take (1) the global spool directory, or (2) the channel's spool directory if defined, and (3) decide if filename is just a filename or a directory, (4) append the directory to the spool path, and (5) create one or more non-existing directories in the path.

As things stand, castget does not create spool directories if they do not exist. I originally did this on purpose as it is better to get an error if you configure the wrong directory than have a random directory created somewhere.

But this principle may have to change if we add this feature since it will be rather inconsistent to create relative directories from filename but not those from spool. WDYT?

L0ric0 commented 4 years ago

if we wan't to retain the old beavior of the spool directory we could add a config flag to tell castget to create directorys. So by default the errors would be thrown.