Creating a month from the GiP filename

Jeremy Nicoll - ml gip jn.ml.gti.91 at wingsandbeaks.org.uk
Thu Oct 13 17:07:35 PDT 2022


On 2022-10-13 18:00, Chris Walker wrote:
> On Thu, 13 Oct 2022 16:38:54 +0100
> Jeremy Nicoll - ml gip <jn.ml.gti.91 at wingsandbeaks.org.uk> wrote:

>> What IS the format you desire?
> 
> I want the format to be <nameshort>/<firstbcastyear>/10 Oct where 10
> Oct is derived from the <firstbcastmonth>

Ah, I think I thought you meant "10 Oct" as in the 10th of Oct, but now
I think you mean "<monthnumber> <monthname>" and that's presumably as
you want folder names that sort nicely but are instantly recognisable
by month name as well.

If g_ip can't do what you want, I'd suggest you create the folders as,
say,

   <nameshort>/<firstbcastyear>/MNUM=<firstbcastmonth>

which of course isn't what you want to end up with, but it'll at least
create the folder and put files in it.

I'd then (under cron or something) run a script that looks for folders
with names containing that "/MNUM=" literal & rename them to what you
want them to be.

Hmm, that won't work ... you can't rename the folder until every file
that would be generated in that folder has been written, and i suppose
that might take a whole month or more to happen. So it'd be better if
you just generated standalone files in a "just fetched" folder, then
the cron-driven script moves those into year/month folders.

I think I'd just generate

   <nameshort>-<firstbcastdate>

in a general collection folder, and let a script rename/move them
afterwards.



-- 
Jeremy Nicoll - my opinions are my own



More information about the get_iplayer mailing list