Creating a month from the GiP filename

Chris Walker cdw_pcmail at the-walker-household.co.uk
Fri Oct 14 01:16:09 PDT 2022


On Fri, 14 Oct 2022 01:07:35 +0100
Jeremy Nicoll - ml gip <jn.ml.gti.91 at wingsandbeaks.org.uk> wrote:

> 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.

Yes, that is exactly what I want. Apologies for not explaining it more
clearly.

> 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.

I run GiP on a Ubuntu server and for both radio and tv programmes they
download into a folder of the name GiP_Downloads/radio or
GiP_Downloads/tv (as appropriate [they're on separate raid drives]) and
then some code runs to convert radio progs into MP3 and generate a .nfo
file for use by LibreElec which runs on a Pi which resides in my
lounge. For tv progs, it also generates a .hmi file for use by a Humax
machine. But both types are then moved into
GiP_Downloads/radio_downloads or tv_downloads.

Films are moved from the GiP_Downloads/tv folder and saved on a third
mount on the Ubuntu box but I do that with a preset and so your
suggestion sounds like something I could do with another preset
somehow. Not clear at this stage quite how I would do it but I think
your idea about renaming sounds workable.

I might even call it monthname to make it clear to me in the future
what it does ;-)

Thanks for the ideas.

-- 
 __ __| |_ __ __  .------------------------------------------------.
/ _/ _` \ V  V /  |  mailto:cdw_pcmail at the-walker-household.co.uk  |
\__\__,_|\_/\_/   |________________________________________________|



More information about the get_iplayer mailing list