Quote:
Originally Posted by graywolf
YES please
|
This doesn't change the file properties but here is some Groovy code that will output a list of potentially problematic files to a text file. The files outputted are files where the difference between the last modified timestamp and the end of the recording are greater than 600 seconds, or 10 minutes. Make sure you have a c:\temp folder or else it may fail. You may need to add the two Java API libraries cited to your libs folder. I run this from the Groovy Dev Environment created by Slugger but you could run it manually as a job against a file in SJQ - but it doesn't actually use any of the properties of a file.
Code:
import org.apache.commons.io.FilenameUtils
import java.text.SimpleDateFormat
def LogFile= new File("c:\\temp\\timeprobs.log")
MediaFileAPI.GetMediaFiles('T').each {
def MFType=MediaFileAPI.GetMediaFileMetadata(it,"MediaType")
def Filename=MediaFileAPI.GetFileForSegment(it, 0)
def Airing= MediaFileAPI.GetMediaFileAiring(it)
def AirEnd=AiringAPI.GetAiringEndTime(Airing)
def AirEnd2=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a").format(AirEnd)
def LastMod=Filename.lastModified()
def LastMod2= new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a").format(LastMod)
def episodename = ShowAPI.GetShowEpisode(it)
def Title= ShowAPI.GetShowTitle(it)
def timediff=(LastMod-AirEnd)/1000
def TimeProb =( timediff.abs() < 600)
if (!TimeProb) LogFile.append("$timediff, $Filename, $MFType, $Title, $episodename, $AirEnd2, $LastMod2, $TimeProb\r\n")
}