Ejemplo n.º 1
0
        public static IProgram ToProgram(this Mediaportal.TV.Server.TVDatabase.Entities.Program tvProgram, bool includeRecordingStatus = false)
        {
            if (tvProgram == null)
            {
                return(null);
            }
            Program program = new Program
            {
                ChannelId   = tvProgram.IdChannel,
                ProgramId   = tvProgram.IdProgram,
                Title       = tvProgram.Title,
                Description = tvProgram.Description,
                // TODO: Morpheus_xx, 2017-11-25: TVE35 handles genres differently, needs to be checked and fixed.
                // Genre = tvProgram.ProgramCategory?.Category,
                StartTime     = tvProgram.StartTime,
                EndTime       = tvProgram.EndTime,
                SeasonNumber  = tvProgram.SeriesNum,
                EpisodeNumber = tvProgram.EpisodeNum,
                EpisodeTitle  = tvProgram.EpisodeName
            };

            ProgramBLL programLogic = new ProgramBLL(tvProgram);

            program.RecordingStatus = programLogic.IsRecording ? RecordingStatus.Recording : RecordingStatus.None;
            if (programLogic.IsRecordingOncePending || programLogic.IsRecordingOnce)
            {
                program.RecordingStatus |= RecordingStatus.Scheduled;
            }
            if (programLogic.IsRecordingSeriesPending || programLogic.IsRecordingSeries)
            {
                program.RecordingStatus |= RecordingStatus.SeriesScheduled;
            }

            return(program);
        }
Ejemplo n.º 2
0
        public static IProgram ToProgram(this Mediaportal.TV.Server.TVDatabase.Entities.Program tvProgram, bool includeRecordingStatus = false)
        {
            if (tvProgram == null)
            {
                return(null);
            }
            Program program = new Program
            {
                ChannelId     = tvProgram.IdChannel,
                ProgramId     = tvProgram.IdProgram,
                Title         = tvProgram.Title,
                Description   = tvProgram.Description,
                StartTime     = tvProgram.StartTime,
                EndTime       = tvProgram.EndTime,
                SeasonNumber  = tvProgram.SeriesNum,
                EpisodeNumber = tvProgram.EpisodeNum,
                EpisodeTitle  = tvProgram.EpisodeName
            };

            ProgramBLL programLogic = new ProgramBLL(tvProgram);

            program.RecordingStatus = programLogic.IsRecording ? RecordingStatus.Recording : RecordingStatus.None;
            if (programLogic.IsRecordingOncePending)
            {
                program.RecordingStatus |= RecordingStatus.Scheduled;
            }
            if (programLogic.IsRecordingSeriesPending)
            {
                program.RecordingStatus |= RecordingStatus.SeriesScheduled;
            }

            return(program);
        }
Ejemplo n.º 3
0
        public static IProgram ToProgram(this Mediaportal.TV.Server.TVDatabase.Entities.Program tvProgram, bool includeRecordingStatus = false)
        {
            if (tvProgram == null)
            {
                return(null);
            }
            Program program = new Program
            {
                ChannelId             = tvProgram.IdChannel,
                ProgramId             = tvProgram.IdProgram,
                Title                 = tvProgram.Title,
                Description           = tvProgram.Description,
                Genre                 = tvProgram.ProgramCategory?.Category,
                StartTime             = tvProgram.StartTime,
                EndTime               = tvProgram.EndTime,
                OriginalAirDate       = tvProgram.OriginalAirDate,
                Classification        = tvProgram.Classification,
                ParentalRating        = tvProgram.ParentalRating,
                StarRating            = tvProgram.StarRating,
                SeasonNumber          = tvProgram.SeriesNum,
                EpisodeNumber         = tvProgram.EpisodeNum,
                EpisodeNumberDetailed = tvProgram.EpisodeNum, // TVE3.5 doesn't have Episode.Number?
                EpisodePart           = tvProgram.EpisodePart,
                EpisodeTitle          = tvProgram.EpisodeName,
            };

            ProgramBLL programLogic = new ProgramBLL(tvProgram);

            program.RecordingStatus = programLogic.IsRecording ? RecordingStatus.Recording : RecordingStatus.None;
            if (programLogic.IsRecordingOncePending || programLogic.IsRecordingOnce)
            {
                program.RecordingStatus |= RecordingStatus.Scheduled;
            }
            if (programLogic.IsRecordingSeriesPending || programLogic.IsRecordingSeries)
            {
                program.RecordingStatus |= RecordingStatus.SeriesScheduled;
            }
            if (programLogic.IsRecordingOnce)
            {
                program.RecordingStatus |= RecordingStatus.RecordingOnce;
            }
            if (programLogic.IsRecordingSeries)
            {
                program.RecordingStatus |= RecordingStatus.RecordingSeries;
            }
            if (programLogic.IsRecordingManual)
            {
                program.RecordingStatus |= RecordingStatus.RecordingManual;
            }
            program.HasConflict = programLogic.HasConflict;

            return(program);
        }