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); } }
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); } }
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; } }
private static IServiceSet GetServiceSet() { if (_serviceSet == null) { var addr = new ServiceAddressSet("127.0.0.1", "127.0.0.1"); _serviceSet = addr.Connect(); } return(_serviceSet); }
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; }
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(); }
private static IServiceSet GetServiceSet() { if (_serviceSet == null) { var addr = new ServiceAddressSet("127.0.0.1", "127.0.0.1"); _serviceSet = addr.Connect(); } return _serviceSet; }
internal static void SetUrls(string mas, string tas) { var addressSet = new ServiceAddressSet(mas, tas, null); serviceSet = addressSet.Connect(Configuration.WebMediaPortal.ServiceUsername, Configuration.WebMediaPortal.ServicePassword); }
internal static void SetUrls(string mas, string tas) { var addressSet = new ServiceAddressSet(mas, tas, null); serviceSet = addressSet.Connect(); }