in

andy vt's tools & blog

Automating lazy

originalAirDate varies across Actions

Last post 01-23-2009 10:52 AM by onlydarksets. 22 replies.
Page 1 of 2 (23 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-15-2008 6:13 PM

    originalAirDate varies across Actions

    RunExternal and AdvancedRename seem to parse %originalAirDate% differently.  The former uses a MM-DD-YYYY format, while the latter uses UTC/GMT format.  Am I doing something wrong?  Thanks!

    My RunExternal action uses the following arguments:

    "%OutputFile%" --overWrite --genre "TV Shows" --stik "TV Show" --TVNetwork %channelName% --TVShowName "%Title%" --TVEpisode "%originalAirDate% - %episode%" --description "%description%" --category="%category%" --artist "%Title%" --album "%Title%" --title "%originalAirDate% - %episode%" --albumArtist "%Title%"

    This produces the following output: 

    --overWrite --genre "TV Shows" --stik "TV Show" --TVNetwork WRCDT --TVShowName "The Office" --TVEpisode "2008-10-10T00:00:00.00Z - Business Ethics" --description "A business ethics seminar gets out of control when Michael lets everyone talk about their unethical behavior at work; Jim makes Dwight observe the company's ``time theft'' policy." --category="Sitcom" --artist "The Office" --album "The Office" --title "2008-10-10T00:00:00.00Z - Business Ethics" --albumArtist "The Office"

    However, I have an AdvancedRename action that uses this name pattern:

    %Title% - %originalAirDate% - %episode%

    And get this result:

    The Office - 2008-10-10 - Business Ethics

  • 10-16-2008 11:12 AM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on 10-03-2006
    • Chicago, IL

    Re: originalAirDate varies across Actions

    AdvancedRename processes dates (really attributes that have "Date" in the name) to only get the date value.  RunExternal passes the raw value.

     

  • 10-18-2008 11:47 AM In reply to

    Re: originalAirDate varies across Actions

    Thanks for the info.  I worked around it by renaming the OutputFile to just the Air Date, then creating a new context value with just the date, and then using that in my command line.  It's two extra steps, but it works perfectly.

  • 01-01-2009 7:12 AM In reply to

    Re: originalAirDate varies across Actions

    Would you mind posting your profile for this?  It looks like you are already doing the exact thing that I'm trying ot do right now.  I'd love to just have a head start and see your profile already configured.
  • 01-01-2009 7:35 AM In reply to

    Re: originalAirDate varies across Actions

    See attached.  I'm working on a writeup for it, but I'm sure you'll be able to parse out what I'm doing.  One note - the multiple calls to "AdvancedRename" are to get around a bug that Andy has since fixed.  Let me know if you have any questions!

  • 01-01-2009 10:50 AM In reply to

    Re: originalAirDate varies across Actions

    thank you this really saves me some time!  You said that the multiple "AdvancedRename" are there because of a bug.  I'm using the latest Dtb so does that mean I should be able to get away with just the one Advanced Rename with the NamePattern "%originalAirDate% - %episode%"?

     

    I'm not sure what the bug was, however, I would like to use the %origionalAirDate%, but have it as a normal date format.

     

    Thanks again for posting your work.  This is exactly what I wanted to do (although I'm not going to use mencoder to cut out the commercials - I'm leaving them in the file and marking the commercials with chapter markers).

  • 01-01-2009 11:44 AM In reply to

    Re: originalAirDate varies across Actions

    jelwood:

    thank you this really saves me some time!  You said that the multiple "AdvancedRename" are there because of a bug.  I'm using the latest Dtb so does that mean I should be able to get away with just the one Advanced Rename with the NamePattern "%originalAirDate% - %episode%"?

    Yes - the bug was that if DTb couldn't read the property, the AdvancedRename action would error out.  Andy fixed it so that it uses a blank if it can't read the property.  I worked around it by calling the action several times (see here for more info).

    jelwood:
    I'm not sure what the bug was, however, I would like to use the %origionalAirDate%, but have it as a normal date format.

    As you've noted, that's what my profile does by renaming and creating a new context.  There is probably a better way to do it (i.e., only through contexts), but I went with the path of least resistence.

    jelwood:
    Thanks again for posting your work.  This is exactly what I wanted to do (although I'm not going to use mencoder to cut out the commercials - I'm leaving them in the file and marking the commercials with chapter markers).

     

    No problem - glad it helped!  I am working on one that does just that, but I haven't gotten around to testing it yet.  Like you said, it's simply removes the mencoder RunExternal, and replaces it with two other RunExternal actions: first to reformat the EDL, second to call the MP4 tool that you found.  You could have a third action to delete the file produced by the EDL tool, but I just use a static file name and overwrite it each time.

  • 01-01-2009 12:12 PM In reply to

    Re: originalAirDate varies across Actions

    Thanks again...  By the way, if you are going to use the chapters to mark the commercials, checkout the thread below.  It looks like Erik is going to add support for this to ComSkip.

     http://forums.sagetv.com/forums/showthread.php?t=38115

  • 01-01-2009 4:22 PM In reply to

    Re: originalAirDate varies across Actions

    Attached is a updated version version of Atomic Parsley that will allow you to access the ITunes "sort" atoms.  Below is the documentation on this switch from the source code.

     

    "  --sortOrder    (type)      (str)    Sets the sort order string for that type of tag.\n"
    " (available types are: \"name\", \"artist\", \"albumartist\",\n"
    " \"album\", \"composer\", \"show\")\n"
     
    So, to set a nice sort name I used the parameter
    --sortOrder name %origionalAirDate% 

     

  • 01-02-2009 11:32 AM In reply to

    Re: originalAirDate varies across Actions

    Thanks for the heads-up on ComSkip and the AP update! Not every playback device I use supports Quicktime chapters, so I am sticking with cutting the files for now. I use the air date as part of the episode name, so it sorts correctly, but your method is the right way to do it. I just need to find time to get to it! I posted my profile here, and I did a full write-up here.
  • 01-02-2009 2:00 PM In reply to

    Re: originalAirDate varies across Actions

     By the way, I added one more step to the actions that format %origionalAirDate%.  I reformatted it so it would be MM-DD-YY.  So, using your documentation, I've added my one extra step below just incase anyone else would like to reformat the date. (this is a Regex that eagle created).


    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

    ·  AdvancedFileRename: workaround to get nicely formatted date

    1. ContextFile: OutputFile
    2. NamePattern: %originalAirDate%
    3. WhenFileExists: AppendGuid

    ·  ChangeContextValue: workaround to re-format date to MM-DD-YY

    1. SourceContext: OutputFile
    2. TargetContext: OutputFile
    3. CreateNewContext: <checked>
    4. NewContextName: DateAndEpisode
    5. FindRegex: (?=\d{2}(\d{2}))(\d{4})-(?=0?(\d+))(\d{2})-(?=0?(\d+))(\d{2})
    6. ReplaceRegex: $4-$6-$1
    7. ContinueOnFail: <unchecked>

    ·  ChangeContextValue: workaround to get a nicely formatted “original air date”

    1. SourceContext: OutputFile
    2. TargetContext: OutputFile
    3. CreateNewContext: <checked>
    4. NewContextName: DateAndEpisode
    5. FindRegex: ^((.*\\)(.*)\.(.*))\z
    6. ReplaceRegex: $3
    7. ContinueOnFail: <unchecked>

     Edit:  sorry, I forgot that I also changed the Rename action to get this to work.  So, I removed the %episode% in the Rename action, and just add it back in when I'm calling Atomic Parsley.

  • 01-04-2009 9:13 AM In reply to

    Re: originalAirDate varies across Actions

    Thanks - I should probably clean that up.  I included the episode just to ensure that there were no duplicates files created (e.g., one gets hung up and leaves the file there, then the next adds the GUID.  I guess I could just overwrite any existing files to be safe.

    My personal preference for the "original air date" is to prepend the year, since there are some series I don't watch until after the season is over.  Leaving it there makes them sort properly, but your sort method (above) would moot that.

  • 01-21-2009 5:27 AM In reply to

    Re: originalAirDate varies across Actions

    jelwood:

    Thanks again...  By the way, if you are going to use the chapters to mark the commercials, checkout the thread below.  It looks like Erik is going to add support for this to ComSkip.

     http://forums.sagetv.com/forums/showthread.php?t=38115

     

    Have you heard any more on this?

    Andy/jelwood - have you had any issues when the last commercial segment hits the end of the file?  For those, I get an error that there is an invalid chapter.  The .chap file is getting formed properly, so I think this is something only Erik can address.

  • 01-21-2009 6:42 AM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on 10-03-2006
    • Chicago, IL

    Re: originalAirDate varies across Actions

     if you alter the chap by a few sec does it work?

  • 01-21-2009 7:05 AM In reply to

    Re: originalAirDate varies across Actions

     Yep, that does it!  I tried just dropping the decimals to ".000", but that didn't work. Removing 1 second fixed it, but I'm not sure if it's the same for all files.

Page 1 of 2 (23 items) 1 2 Next >
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems