public ChocHelper(MediaBrowser.Library.Item Item)
 {
     this.OverviewTimer = new Timer();
     this.CurrentItem = Item;
     this.setupHelper();
     Instance = this;
 }
        public void Initialize()
        {
            _instance = Activator.CreateInstance<GoProMediaBrowser>();

            (_instance as IGeneralBrowser).Initialize(null, null);

            var browserType = _instance.GetType();
            var method=browserType.GetMethod("Parse", BindingFlags.NonPublic | BindingFlags.Instance);
            _parseDelegate= (ParseDelegate)method.CreateDelegate(typeof(ParseDelegate), _instance);
        }
Esempio n. 3
0
        public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
        {
            if (RealMovie == null) RealMovie = (Movie)Kernel.Instance.ItemRepository.RetrieveItem(RealMovieID);
            MediaBrowser.Library.Logging.Logger.ReportInfo("Refreshing trailer for " + RealMovie.Name);
            this.PrimaryImagePath = Util.CloneImage(RealMovie.PrimaryImagePath);
            this.BackdropImagePaths = new List<string>();
            if (RealMovie.BackdropImagePaths != null)
            {
                foreach (string backdrop in RealMovie.BackdropImagePaths)
                {
                    this.BackdropImagePaths.Add(backdrop);
                }
            }
            if ((options & MetadataRefreshOptions.Force) == MetadataRefreshOptions.Force)
            {
                var images = new List<MediaBrowser.Library.ImageManagement.LibraryImage>();
                images.Add(PrimaryImage);
                images.AddRange(BackdropImages);

                foreach (var image in images)
                {
                    try
                    {
                        if (image != null)
                        {
                            image.ClearLocalImages();
                            MediaBrowser.Library.Factories.LibraryImageFactory.Instance.ClearCache(image.Path);
                        }
                    }
                    catch (Exception ex)
                    {
                        MediaBrowser.Library.Logging.Logger.ReportException("Failed to clear local image (its probably in use)", ex);
                    }
                }
                //changed = RealMovie.RefreshMetadata(options);
            }

            this.Overview = RealMovie.Overview;
            this.ProductionYear = RealMovie.ProductionYear;
            this.RunningTime = RealMovie.RunningTime;
            this.Actors = RealMovie.Actors;
            this.Directors = RealMovie.Directors;
            this.Name = RealMovie.Name + " " + Plugin.PluginOptions.Instance.TrailerSuffix;
            this.SortName = RealMovie.SortName;
            this.Studios = RealMovie.Studios;
            this.Path = RealMovie.TrailerFiles.First();
            this.MediaType = MediaTypeResolver.DetermineType(Path);
            this.MediaInfo = RealMovie.MediaInfo;
            this.DateCreated = System.IO.File.GetCreationTime(this.Path);
            this.DisplayMediaType = "Trailer";
            Plugin.proxy.SetTrailerInfo(this);
            Kernel.Instance.ItemRepository.SaveItem(this);

            return true;
        }
 public PatternsLogger(MediaBrowser.Model.Logging.ILogger logger)
 {
     _logger = logger;
 }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
		{
			var rootView = inflater.Inflate (Resource.Layout.fragment_list, container, false);

			skipPrevious = rootView.FindViewById<ImageButton> (Resource.Id.skip_previous);
			skipPrevious.Enabled = false;
			skipPrevious.SetOnClickListener (buttonListener);

			skipNext = rootView.FindViewById<ImageButton> (Resource.Id.skip_next);
			skipNext.Enabled = false;
			skipNext.SetOnClickListener (buttonListener);

			playPause = rootView.FindViewById<ImageButton> (Resource.Id.play_pause);
			playPause.Enabled = true;
			playPause.SetOnClickListener (buttonListener);

			queueAdapter = new QueueAdapter (Activity);

			var listViewClickListener = new ListViewClickListener ();
			listViewClickListener.OnItemClickImpl = (parent, view, position, id) => {
				var item = queueAdapter.GetItem (position);
				transportControls.SkipToQueueItem (item.QueueId);
			};

			var listView = rootView.FindViewById<ListView> (Resource.Id.list_view);
			listView.Adapter = queueAdapter;
			listView.Focusable = true;
			listView.OnItemClickListener = listViewClickListener;

			mediaBrowser = new MediaBrowser (Activity,
				new ComponentName (Activity, Java.Lang.Class.FromType (typeof(MusicService))),
				connectionCallback, null);

			return rootView;
		}
 public void Init(MediaBrowser.Library.Kernel kernel)
 {
 }
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     // do nothing metadata is assigned externally.
     return false;
 }
Esempio n. 8
0
 public void SetTrailerInfo(MediaBrowser.Library.Entities.Show trailer)
 {
     TrailerInfo trailerInfo = new TrailerInfo(TrailerType.Local, trailer.Path.ToLower(), trailer.ParentalRating, trailer.Genres);
     using (ChannelFactory<ITrailerProxy> factory = new ChannelFactory<ITrailerProxy>(new NetNamedPipeBinding(), "net.pipe://localhost/mbtrailers"))
     {
         ITrailerProxy proxyServer = factory.CreateChannel();
         try
         {
             proxyServer.SetTrailerInfo(trailerInfo);
         }
         catch (Exception e)
         {
             Logger.ReportException("Error setting trailer info", e);
             Logger.ReportError("Inner Exception: " + e.InnerException.Message);
         }
         finally
         {
             (proxyServer as ICommunicationObject).Close();
         }
     }
 }
Esempio n. 9
0
        public void TestAddLocalDevice()
        {
            Console.WriteLine("Test to add a local upnp device.");
            UPnP u = new UPnP();
            u.SetupSockets();
            MediaBrowser mb = new MediaBrowser();
            bool wait = true;
            //     wait = false;
            mb.RootDevice.FriendlyName = "vpMediaTestserver";
            mb.BrowseRequestReceived += delegate(MediaBrowser media_browser,string object_id,string browse_flag,int starting_index,int requested_count,string sort_criteria)
            {
                Console.WriteLine("Browse request received: \nobject_id: "+object_id+"\nbrowse_flag: "+browse_flag+"\nstarting_index: "+starting_index+"\nrequested_count: "+requested_count+"\nsort_criteria: "+sort_criteria+"\n");
                MediaBrowser.BrowseResult result = new MediaBrowser.BrowseResult();
                if (object_id == "0")
                {
                    result.TotalMatches = 3;
                    result.AddFolder("Queue", "queue", "0", true, false, 3, "UNKNOWN", -1);
                    result.AddItem("test item", "pez2001", "http://www.voyagerproject.de/stuff/phat_sweet_drill_mix.wav.mp3", "audio/mpeg", "test", "0", false, -1, "UNKNOWN");
                    result.AddItem("test item 2", "pez2001", "http://www.voyagerproject.org/wp-content/uploads/2006/05/treiwund%20+%20graf%20contra2.mp3", "audio/mpeg", "test", "0", false, -1, "UNKNOWN");
                }
                else if (object_id == "queue")
                {
                    result.TotalMatches = 3;
                    result.AddFolder("Root", "0", "0", true, false, 3, "UNKNOWN", -1);
                    result.AddItem("test item b", "pez2001", "http://www.voyagerproject.de/stuff/phat_sweet_drill_mix.wav.mp3", "audio/mpeg", "test", "0", false, -1, "UNKNOWN");
                    result.AddItem("test item b 2", "pez2001", "http://www.voyagerproject.org/wp-content/uploads/2006/05/treiwund%20+%20graf%20contra2.mp3", "audio/mpeg", "test", "0", false, -1, "UNKNOWN");
                }
                return (result);
            };
            u.AddLocalDevice(mb);
            Console.WriteLine("Waiting for data");
            DateTime start = DateTime.Now;
            while (wait)
            {
                if (DateTime.Now - start > new TimeSpan(0, 0, 60))
                {
                    Console.WriteLine("");
                    Console.WriteLine("Operation took too long");
                    wait = false;
                    Assert.Fail("Operation took too long");
                }
                Console.Write(".");
                Thread.Sleep(250);
            }
            Console.WriteLine("UPnP Local Device Add Test successful.");

            u.CloseSockets();
        }
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     return false;
 }
Esempio n. 11
0
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     // metadata should not be acquired through the provider framework.
     // its all done during item validation
     return false;
 }
Esempio n. 12
0
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     bool changed = base.RefreshMetadata(options);
     if (this.Series != null && this.Series.BannerImage != null && (options & MediaBrowser.Library.Metadata.MetadataRefreshOptions.Force) == MediaBrowser.Library.Metadata.MetadataRefreshOptions.Force)
     {
         //we cleared our our series banner image - re-cache it
         var ignore = this.Series.BannerImage.GetLocalImagePath();
     }
     return changed;
 }
Esempio n. 13
0
        public void InstallPlugin(IPlugin plugin,
            MediaBrowser.Library.Network.WebDownload.PluginInstallUpdateCB updateCB,
            MediaBrowser.Library.Network.WebDownload.PluginInstallFinishCB doneCB,
            MediaBrowser.Library.Network.WebDownload.PluginInstallErrorCB errorCB)
        {
            //taking this check out for now - it's just too cumbersome to have to re-compile all plug-ins to change this -ebr
            //if (plugin.TestedMBVersion < Kernel.Instance.Version) {
            //    var dlgResult = MessageBox.Show("Warning - " + plugin.Name + " has not been tested with your version of MediaBrowser. \n\nInstall anyway?", "Version not Tested", MessageBoxButton.YesNo);
            //    if (dlgResult == MessageBoxResult.No) {
            //        doneCB();
            //        return;
            //    }
            //}

            if (BackupPlugin(plugin)) Logger.ReportInfo("Plugin "+plugin.Name+" v"+plugin.Version+" backed up.");

            if (plugin is RemotePlugin) {
                try {
                    Kernel.Instance.InstallPlugin((plugin as RemotePlugin).BaseUrl + "\\" + (plugin as RemotePlugin).SourceFilename, plugin.Filename, updateCB, doneCB, errorCB);
                }
                catch (Exception ex) {
                    MessageBox.Show("Cannot Install Plugin.  If MediaBrowser is running, please close it and try again.\n" + ex.Message, "Install Error");
                    doneCB();
                }
            }
            else {
                var local = plugin as Plugin;
                Debug.Assert(plugin != null);
                try {
                    Kernel.Instance.InstallPlugin(local.Filename, null, null, null);
                }
                catch (Exception ex) {
                    MessageBox.Show("Cannot Install Plugin.  If MediaBrowser is running, please close it and try again.\n" + ex.Message, "Install Error");
                    doneCB();
                }
            }
        }
Esempio n. 14
0
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     return false;
     // do nothing .. we control the metadata ... providers do nothing
 }
Esempio n. 15
0
        public void TestAnnounceDevice()
        {
            Console.WriteLine("Test to announce an upnp device.");
            UPnP u = new UPnP();
            u.SetupSockets();
            MediaBrowser mb = new MediaBrowser();

            bool wait = true;
            //     wait = false;
            u.AnnounceDevice(mb,true);
            Console.WriteLine("Waiting for data");
            DateTime start = DateTime.Now;
            while (wait)
            {
                if (DateTime.Now - start > new TimeSpan(0, 0, 60))
                {
                    Console.WriteLine("");
                    Console.WriteLine("Operation took too long");
                    wait = false;
                    Assert.Fail("Operation took too long");
                }
                Console.Write(".");
                Thread.Sleep(250);
            }
            Console.WriteLine("UPnP Device Announcing Test successful.");

            u.CloseSockets();
        }
Esempio n. 16
0
        public void InstallPlugin(IPlugin plugin,
          MediaBrowser.Library.Network.WebDownload.PluginInstallUpdateCB updateCB,
          MediaBrowser.Library.Network.WebDownload.PluginInstallFinishCB doneCB,
          MediaBrowser.Library.Network.WebDownload.PluginInstallErrorCB errorCB) {

            if (BackupPlugin(plugin)) Logger.ReportInfo("Plugin "+plugin.Name+" v"+plugin.Version+" backed up.");

            if (plugin is RemotePlugin) {
                try {
                    Kernel.Instance.InstallPlugin((plugin as RemotePlugin).SourceFilename, plugin.Filename, updateCB, doneCB, errorCB);
                }
                catch (Exception ex) {
                    MessageBox.Show("Cannot Install Plugin.  If MediaBrowser is running, please close it and try again.\n" + ex.Message, "Install Error");
                    doneCB();
                }
            }
            else {
                var local = plugin as Plugin;
                Debug.Assert(plugin != null);
                try {
                    Kernel.Instance.InstallPlugin(local.Filename, null, null, null);
                }
                catch (Exception ex) {
                    MessageBox.Show("Cannot Install Plugin.  If MediaBrowser is running, please close it and try again.\n" + ex.Message, "Install Error");
                    doneCB();
                }
            }

        }
 public MediaBrowserFilterConverter(MediaBrowser parent)
 {
     this.parent = parent;
 }
Esempio n. 18
0
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     // do nothing
     // Metadata is assigned outside the provider framework
     return false;
 }
Esempio n. 19
0
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options) {
     return shadowItem.RefreshMetadata(options);
 }
 public override bool RefreshMetadata(MediaBrowser.Library.Metadata.MetadataRefreshOptions options)
 {
     // no metadata for itunes folder please
     return false;
 }