[confirm] Possible Code Bug in conflict mangement of TvServer business layer (1 Viewer)

huha

Extension Developer
January 3, 2008
890
556
Home Country
Germany Germany
I believe i found a bug in
http://mediaportal.svn.sourceforge....y/TVDatabase/TvBusinessLayer/BusinessLayer.cs

The function
public List<Schedule> GetConflictingSchedules(Schedule rec)
does call a loop over all schedules, but is not skipping the evaluating schedule rec in the for each loop
When i tried to use it for my plugin i got an incorrect conflict management caused by the original code. It did work out after i inserted the following red lines

public List<Schedule> GetConflictingSchedules(Schedule rec)
2864 {
2865 Log.Info("GetConflictingSchedules: Schedule = " + rec);
2866 List<Schedule> conflicts = new List<Schedule>();
2867 IList<Schedule> schedulesList = Schedule.ListAll();
2868 IList<Card> cards = Card.ListAll();
2869 if (cards.Count == 0)
2870 {
2871 return conflicts;
2872 }
2873 Log.Info("GetConflictingSchedules: Cards.Count = {0}", cards.Count);
2874
2875 List<Schedule>[] cardSchedules = new List<Schedule>[cards.Count];
2876 for (int i = 0; i < cards.Count; i++)
2877 {
2878 cardSchedules = new List<Schedule>();
2879 }
2880
2881 // GEMX: Assign all already scheduled timers to cards. Assume that even possibly overlapping schedulues are ok to the user,
2882 // as he decided to keep them before. That's why they are in the db
2883 foreach (Schedule schedule in schedulesList)
2884 {
if (schedule == rec)
{
continue;
}

2885 List<Schedule> episodes = GetRecordingTimes(schedule);
2886 foreach (Schedule episode in episodes)
2887 {
2888 if (DateTime.Now > episode.EndTime)
2889 {
2890 continue;
2891 }
2892 if (episode.IsSerieIsCanceled(episode.StartTime))
2893 {
2894 continue;
2895 }
2896 Schedule overlapping;
2897 AssignSchedulesToCard(episode, cardSchedules, out overlapping);
2898 }
2899 }





MediaPortal Version: 1.1 RC1
MediaPortal Skin: Blue3,Lcars,Xface,PureVision
Windows Version: Vista SP1
CPU Type: AMD64X2 5200 2.7GHz
HDD: samsung HD753LJ ATA
Memory: 2 x 2 GB DDR2 800 MDT
Motherboard: Elitegroup A780GM-A
Video Card: Nvidia 9400GT 512MBDDR2
Video Card Driver:
Sound Card: On Board Realtek Digital Output
Sound Card AC3: HDMI
Sound Card Driver: 6.00.5840.16387
1. TV Card: Technotrend S3200
1. TV Card Type: DVB-S TT3200
1. TV Card Driver:
2. TV Card:
2. TV Card Type:
2. TV Card Driver:
3. TV Card:
3. TV Card Type:
3. TV Card Driver:
4. TV Card:
4. TV Card Type:
4. TV Card Driver:
MPEG2 Video Codec: PDVD7.3
MPEG2 Audio Codec: PDVD7.3
h.264 Video Codec: PDVD7.3
Satelite/CableTV Provider: Astra 19.2
HTPC Case: Thermaltake
Cooling:
Power Supply:
Remote: Imon
TV: Panasonic TH46PZ85
TV - HTPC Connection:
 

Users who are viewing this thread

Top Bottom