Пример #1
0
        private bool DownloadChannelLogos(ChannelLogos logos, IServiceSet serviceSet)
        {
            try
            {
                foreach (WebChannelBasic ch in channelLogosRequired)
                {
                    try
                    {
                        Stream logoStream = serviceSet.MASStream.GetImage(WebMediaType.TV, null, ch.Id.ToString());
                        logos.WriteToCacheDirectory(ch.Title, "png", logoStream);
                        Log.Debug("Downloaded logo for channel {0}", ch.Title);
                    }
                    catch (EndpointNotFoundException)
                    {
                        Log.Trace("Logo for channel {0} not available on server", ch.Title);
                    }
                }

                return(true);
            }
            catch (MessageSecurityException)
            {
                return(false);
            }
            catch (Exception ex)
            {
                Log.Warn(String.Format("Failed to download channel logos from {0}", serviceSet), ex);
                return(false);
            }
        }
Пример #2
0
        private bool DownloadChannelLogos(ChannelLogos logos, IServiceSet serviceSet)
        {
            try
            {
                foreach (WebChannelBasic ch in channelLogosRequired)
                {
                    try
                    {
                        Stream logoStream = serviceSet.MASStream.GetImage(WebMediaType.TV, null, ch.Id.ToString());
                        Log.Trace("Downloaded logo for channel {0} (length {1})", ch.Title, logoStream.Length);
                        if (logoStream.Length > 0)
                        {
                            logos.WriteToCacheDirectory(ch.Title, "png", logoStream);
                        }
                    }
                    catch (EndpointNotFoundException)
                    {
                        Log.Trace("Logo for channel {0} not available on server", ch.Title);
                    }
                }

                return(true);
            }
            catch (MessageSecurityException)
            {
                return(false);
            }
        }
Пример #3
0
        private bool DownloadChannelLogos(ChannelLogos logos, IServiceSet serviceSet)
        {
            try
            {
                foreach (WebChannelBasic ch in channelLogosRequired)
                {
                    try
                    {
                        Stream logoStream = serviceSet.MASStream.GetImage(WebMediaType.TV, null, ch.Id.ToString());
                        logos.WriteToCacheDirectory(ch.Title, "png", logoStream);
                        Log.Debug("Downloaded logo for channel {0}", ch.Title);
                    }
                    catch (EndpointNotFoundException)
                    {
                        Log.Trace("Logo for channel {0} not available on server", ch.Title);
                    }
                }

                return true;
            }
            catch (MessageSecurityException)
            {
                return false;
            }
        }
Пример #4
0
        private static IServiceSet GetServiceSet()
        {
            if (_serviceSet == null)
            {
                var addr = new ServiceAddressSet("127.0.0.1", "127.0.0.1");
                _serviceSet = addr.Connect();
            }

            return(_serviceSet);
        }
Пример #5
0
        private void frmFillCache_Load(object sender, EventArgs e)
        {
            _services = new ServiceAddressSet("127.0.0.1", "127.0.0.1").Connect();

            movieCount   = _services.MAS.GetMovieCount(null);
            episodeCount = _services.MAS.GetTVEpisodeCount(null);

            lblMovies.Text      = "Movies (0 / " + movieCount + "):";
            prgMovies.Maximum   = movieCount;
            lblEpisodes.Text    = "Episodes (0 / " + episodeCount + "):";
            prgEpisodes.Maximum = episodeCount;
        }
Пример #6
0
        public TabActivity()
        {
            // initialize service connection
            _services = new ServiceAddressSet("127.0.0.1", null).Connect();

            // session watcher
            mSessionWatcher          = new DispatcherTimer();
            mSessionWatcher.Interval = TimeSpan.FromSeconds(2);
            mSessionWatcher.Tick    += activeSessionWatcher_Tick;

            InitializeComponent();

            // actually show the list
            lvActiveStreams.ItemsSource = mStreamingSessions;

            // start observing
            mSessionWatcher.Start();
        }
Пример #7
0
        public TabActivity()
        {
            // initialize service connection
            _services = new ServiceAddressSet("127.0.0.1", null).Connect();

            // session watcher
            mSessionWatcher = new DispatcherTimer();
            mSessionWatcher.Interval = TimeSpan.FromSeconds(2);
            mSessionWatcher.Tick += activeSessionWatcher_Tick;

            InitializeComponent();

            // actually show the list
            lvActiveStreams.ItemsSource = mStreamingSessions;

            // start observing
            mSessionWatcher.Start();
        }
Пример #8
0
        private void frmFillCache_Load(object sender, EventArgs e)
        {
            _services = new ServiceAddressSet("127.0.0.1", "127.0.0.1").Connect();

            movieCount = _services.MAS.GetMovieCount(null);
            episodeCount = _services.MAS.GetTVEpisodeCount(null);

            lblMovies.Text = "Movies (0 / " + movieCount + "):";
            prgMovies.Maximum = movieCount;
            lblEpisodes.Text = "Episodes (0 / " + episodeCount + "):";
            prgEpisodes.Maximum = episodeCount;
        }
Пример #9
0
        private static IServiceSet GetServiceSet()
        {
            if (_serviceSet == null)
            {
                var addr = new ServiceAddressSet("127.0.0.1", "127.0.0.1");
                _serviceSet = addr.Connect();
            }

            return _serviceSet;
        }
Пример #10
0
 internal static void SetUrls(string mas, string tas)
 {
     var addressSet = new ServiceAddressSet(mas, tas, null);
     serviceSet = addressSet.Connect(Configuration.WebMediaPortal.ServiceUsername, Configuration.WebMediaPortal.ServicePassword);
 }
Пример #11
0
 internal static void SetUrls(string mas, string tas)
 {
     var addressSet = new ServiceAddressSet(mas, tas, null);
     serviceSet = addressSet.Connect();
 }
Пример #12
0
        internal static void SetUrls(string mas, string tas)
        {
            var addressSet = new ServiceAddressSet(mas, tas, null);

            serviceSet = addressSet.Connect(Configuration.WebMediaPortal.ServiceUsername, Configuration.WebMediaPortal.ServicePassword);
        }
Пример #13
0
        internal static void SetUrls(string mas, string tas)
        {
            var addressSet = new ServiceAddressSet(mas, tas, null);

            serviceSet = addressSet.Connect();
        }