2005-05-06, 06:43 AM
i have a problem in my videos where at load LoadRecordingSchedule() causes me problems and forces my videos to stop loading, and gbpvr to restart loading every plugin, trapping it in a forever loop and maxing out the cpu and ram. this problem has been in my videos for a while, and only know have i found out why. im using this code
and this is GetScheduledRecordings()
ignore the debug lines .
anyway when i run this the GetScheduledRecordings doesnt even get called it crashes somewhere before then (the same line of code, just before the method is called, found this out by useful debug lines ). im just wondering if anyone knows why this is happening and how i can fix this.
i put a temp fix on it by using a boolean LOADING, which i set to true when my vids is created and false once all the loading is done, and when LOADING=true i just skip this method.
i can use this fix without much problems, but if a entry in the myvids database doesnt exist for a file, it will check the recordingschedule to see if a description exists in there (and when loading it checks the virtual root + paused files... which is how i discovered the problem). paused files isnt a problem since that is refreshed whenever a videostopping event happens. but the root never gets refreshed (well hardly ever, it might do i have to check the code).
i think this is the same problem jeff was having with vidarch awhile ago.
anyway, long boring post has finished
TIA
reven.
Code:
foreach (ScheduledRecording scheduledRecording in GetScheduledRecordings())
{
if(scheduledRecording != null)
{
if(scheduledRecording.getFileName().ToLower().EndsWith(fullName.ToLower()) && scheduledRecording.getProgramme() != null)
{
Description = scheduledRecording.getProgramme().getDescription();
Title = scheduledRecording.getProgramme().getTitle();
Subtitle = scheduledRecording.getProgramme().getSubTitle();
TimeSpan runtime = (TimeSpan)(scheduledRecording.getProgramme().getEndTime() - scheduledRecording.getProgramme().getStartTime());
Runtime = ""+ (runtime.Hours*60 + runtime.Minutes);
if(Subtitle.Length > 0)
{
displayName = Subtitle;
}
MyVideosTask.database.AddToDatabase(new VideoInfo(fullName,description,Title,Subtitle,Runtime,"","",Seen,null),false);
break;
}
}
}
}
Code:
private IList GetScheduledRecordings()
{
Logger.Verbose("entered recording schedule");
if(ScheduledRecordings == null)
{
Logger.Verbose("debug 1");
ScheduledRecordings = ScheduleHelper.getInstance().LoadRecordingSchedule();
Logger.Verbose("debug 2");
ScheduleLoadedAt = DateTime.Now;
Logger.Verbose("debug 3");
}
else if(DateTime.Now > ScheduleLoadedAt.AddMinutes(30))
{
Logger.Verbose("debug 4");
ScheduledRecordings = ScheduleHelper.getInstance().LoadRecordingSchedule();
Logger.Verbose("debug 5");
ScheduleLoadedAt = DateTime.Now;
Logger.Verbose("debug 6");
}
Logger.Verbose("debug 7");
return ScheduledRecordings;
}
anyway when i run this the GetScheduledRecordings doesnt even get called it crashes somewhere before then (the same line of code, just before the method is called, found this out by useful debug lines ). im just wondering if anyone knows why this is happening and how i can fix this.
i put a temp fix on it by using a boolean LOADING, which i set to true when my vids is created and false once all the loading is done, and when LOADING=true i just skip this method.
i can use this fix without much problems, but if a entry in the myvids database doesnt exist for a file, it will check the recordingschedule to see if a description exists in there (and when loading it checks the virtual root + paused files... which is how i discovered the problem). paused files isnt a problem since that is refreshed whenever a videostopping event happens. but the root never gets refreshed (well hardly ever, it might do i have to check the code).
i think this is the same problem jeff was having with vidarch awhile ago.
anyway, long boring post has finished
TIA
reven.