Add user job arguments for %season% and %episode%

What would you like to see in MythTV and why? Find others who might want to help implement your ideas!
Forum rules
Please be reasonable and positive with your feature requests, remember that all contributions to MythTV are by volunteers in their spare time. MythTV won't support piracy in any form, including torrents and use of soft cams, so to avoid embarrassment please do not ask.

* One suggestion per thread please. Do not post new suggestions in replies. *
Post Reply
skinah
Junior
Posts: 53
Joined: Sat Oct 17, 2015 11:56 pm

Add user job arguments for %season% and %episode%

Post by skinah »

If this is already supported I could not see it in the WIKI here https://www.mythtv.org/wiki/User_Jobs
I would find this feature very handy for writing my own scripts, should be easy to add. PLEASE ? thanks.

%season% would give the number of the season.
and
%episode% would give the number of the episode.

Edited to suggest two separate arguments to allow more flexible use than a single argument.
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Add user job arguments for %season% and %episode%

Post by PhilB »

Could you work out season and episode from startime and channelid with a bit of curl, API, grep and sed?

Code: Select all

#!/bin/bash
#call with StartTime and ChanId
echo "Startime is $1   Chanid is $2"
ALL=`curl -s 127.0.0.1:6544/Dvr/GetRecorded?StartTime=$1\&ChanId=$2`

SEASON=`echo $ALL | sed "s/></>\n</g" | grep 'Season' | sed "s!<[^>]*>!!g"`
echo season is $SEASON

EPISODE=`echo $ALL | sed "s/></>\n</g" | grep 'Episode' | sed "s!<[^>]*>!!g"`
echo episode is $EPISODE
Phil
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Add user job arguments for %season% and %episode%

Post by bill6502 »

Skinah,

At least in 0.28-pre %SEASON% and %EPISODE% work already.

I didn't test, but I thought upper case was required. Obviously, mythmetadatalookup
must have completed 1st (at least over here.)
skinah
Junior
Posts: 53
Joined: Sat Oct 17, 2015 11:56 pm

Re: Add user job arguments for %season% and %episode%

Post by skinah »

Great, thanks for the good news that the feature is added. I'm using 0.27 Stable so will have to check out the 0.28 soon. I'm currently doing it with a MySQL lookup, but it would be much nicer to use the job arguments. I'll post my script for others to use once it passes enough testing on my system.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Add user job arguments for %season% and %episode%

Post by bill6502 »

I think they were added in 0.25. I'd try before upgrading to 0.28-pre.
Did you try %SEASON% and %EPISODE% in 0.27 and find that
they didn't work?
skinah
Junior
Posts: 53
Joined: Sat Oct 17, 2015 11:56 pm

Re: Add user job arguments for %season% and %episode%

Post by skinah »

No I did not try as it was not documented in the wiki I linked in my first post, plus I also did a through google to try and find if someone had written about it. After finding nothing and all scripts were using MySQL lookups to fetch the information I figured it was not added since it was easy to fetch from the database directly. I'll try it this evening and see if it works as that means my script will not need editing to have the password added in.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Add user job arguments for %SEASON% and %EPISODE%

Post by bill6502 »

The Wiki got updated yesterday, just FYI.
Last edited by bill6502 on Wed Nov 04, 2015 11:37 pm, edited 1 time in total.
skinah
Junior
Posts: 53
Joined: Sat Oct 17, 2015 11:56 pm

Re: Add user job arguments for %season% and %episode%

Post by skinah »

I can confirm it is working in 0.27 both %SEASON% and %EPISODE% work. Thanks for the help and also updating the wiki. Been using mythtv for over 6 years now and love it.
Post Reply