rebhichaouki / sagetv-addons

Automatically exported from code.google.com/p/sagetv-addons
0 stars 0 forks source link

SJQ4_SEASON #305

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For which plugin does this feature request apply? SJQ4

Please describe the feature request below in as much detail as possible.

If possible, based on SageTV's addition of S0xE0x naming convention, can we add 
a new metadata type of SJQ4_SEASON?

I ask in that it would now be much easier to move files using your basic move 
script with an argument for the resulting directory based on the new 
path/title/season/episode metadata.

Original issue reported on code.google.com by e...@meudt.org on 16 Sep 2011 at 1:11

GoogleCodeExporter commented 9 years ago
If you're using groovy scripts, you can access the season/episode info by API 
call:

===

def mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA['SJQ4_ID'])
def season = ShowAPI.GetShowSeasonNumber(mf)
def episode = ShowAPI.GetShowEpisodeNumber(mf)

println "The recording is for season $season, episode $episode."

===

As a matter of fact, when in groovy, you'll probably find it more convenient to 
simply pull all metadata of interest from API calls rather than using the 
SJQ4_METADATA map.  The map is really for non-Groovy users, such as batch files 
and other exes where they can't directly make API calls.  In these cases the 
map is actually injected into the external process environment as env 
variables, but in Groovy, you can simply get the object based on the SJQ4_ID 
then make any and all API calls using that object, as I've shown in the code 
example above.  This gives you access to all metadata, even that not available 
in the SJQ4_METDATA map.

I may still add those vars to the map for others, but either way, you don't 
need me to add them in order to access that data from groovy.

Original comment by de...@battams.ca on 18 Sep 2011 at 2:04

GoogleCodeExporter commented 9 years ago

Original comment by de...@battams.ca on 18 Sep 2011 at 2:05

GoogleCodeExporter commented 9 years ago
Won't fix; most people who need access to this metadata use groovy, which has 
direct access to all metadata without the need for additional env vars.

Original comment by de...@battams.ca on 21 Oct 2011 at 12:21