Пример #1
0
        private void InfoPoster_ClickButtonArea(object Sender, MouseEventArgs e)
        {
            frmOpenPlex.form.tabBlank.Controls.Clear();

            ctrlDetails MovieDetails = new ctrlDetails();

            MovieDetails.infoTitle.Text      = infoTitle.Text;
            MovieDetails.infoYear.Text       = infoYear.Text;
            MovieDetails.infoGenre.Text      = infoGenres;
            MovieDetails.infoSynopsis.Text   = infoSynopsis;
            MovieDetails.infoRuntime.Text    = infoRuntime;
            MovieDetails.infoRated.Text      = infoRated;
            MovieDetails.infoDirector.Text   = infoDirector;
            MovieDetails.infoCast.Text       = infoCast;
            MovieDetails.infoRatingIMDb.Text = infoImdbRating;
            MovieDetails.infoImdbId          = infoImdbId;

            try
            {
                MovieDetails.imgPoster.Image = frmOpenPlex.ChangeOpacity(frmOpenPlex.LoadPicture(infoImagePoster), 1);
                MovieDetails.BackgroundImage = frmOpenPlex.ChangeOpacity(frmOpenPlex.LoadPicture(infoImageFanart), 0.2F);
            }
            catch { }

            if (infoImagePoster == "")
            {
                MovieDetails.imgPoster.Image = frmOpenPlex.ChangeOpacity(Properties.Resources.default_poster, 1);
            }

            foreach (string movieLink in infoMovieLinks)
            {
                ctrlStreamInfo ctrlInfo = new ctrlStreamInfo();
                ctrlInfo.infoFileURL       = movieLink;
                ctrlInfo.infoFileHost.Text = new Uri(movieLink).Host;
                ctrlInfo.infoFileName.Text = Path.GetFileName(new Uri(movieLink).LocalPath);
                MovieDetails.panelStreams.Controls.Add(ctrlInfo);
            }

            MovieDetails.Dock = DockStyle.Fill;
            frmOpenPlex.form.tabBlank.Controls.Clear();
            frmOpenPlex.form.tabBlank.Controls.Add(MovieDetails);
            frmOpenPlex.form.tab.SelectedTab = frmOpenPlex.form.tabBlank;
        }
Пример #2
0
        public void showFileDetails(string webFile)
        {
            ctrlDetails MovieDetails = new ctrlDetails();

            string url = "";

            string[] movieName  = getMovieAndYear(Path.GetFileNameWithoutExtension(webFile));
            string[] tvshowName = getTVShowName(Path.GetFileNameWithoutExtension(webFile));

            if (!(movieName == null))
            {
                url = "http://omdbapi.com/?apikey=c933e052&t=" + movieName[0] + "&y=" + movieName[1] + "&plot=full";
            }
            else if (!(tvshowName == null))
            {
                url = "http://omdbapi.com/?apikey=c933e052&t=" + tvshowName[0] + "&Season=" + tvshowName[1] + "&Episode=" + tvshowName[2];
            }

            if (url != "")
            {
                using (WebClient wc = new WebClient())
                {
                    var JsonOMDbAPI = wc.DownloadString(url);
                    var data        = OMDbEntity.FromJson(JsonOMDbAPI);

                    if (data.Response == "True")
                    {
                        MovieDetails.infoTitle.Text      = data.Title;
                        MovieDetails.infoYear.Text       = data.Year;
                        MovieDetails.infoGenre.Text      = data.Genre;
                        MovieDetails.infoSynopsis.Text   = data.Plot;
                        MovieDetails.infoRuntime.Text    = data.Runtime;
                        MovieDetails.infoRated.Text      = data.Rated;
                        MovieDetails.infoDirector.Text   = data.Director;
                        MovieDetails.infoCast.Text       = data.Actors;
                        MovieDetails.infoRatingIMDb.Text = data.ImdbRating;
                        MovieDetails.infoImdbId          = data.ImdbID;

                        try { MovieDetails.imgPoster.Image = ChangeOpacity(LoadPicture(data.Poster), 1); } catch { MovieDetails.imgPoster.Image = ChangeOpacity(Properties.Resources.default_poster, 0.5F); }
                    }
                    else
                    {
                        MovieDetails.infoTitle.Text         = Path.GetFileNameWithoutExtension(new Uri(webFile).LocalPath);
                        MovieDetails.infoYear.Visible       = false;
                        MovieDetails.infoGenre.Visible      = false;
                        MovieDetails.infoSynopsis.Visible   = false;
                        MovieDetails.infoRuntime.Visible    = false;
                        MovieDetails.infoRated.Visible      = false;
                        MovieDetails.infoDirector.Visible   = false;
                        MovieDetails.infoCast.Visible       = false;
                        MovieDetails.infoRatingIMDb.Visible = false;

                        MovieDetails.infoSplitter0.Visible  = false;
                        MovieDetails.infoSplitter1.Visible  = false;
                        MovieDetails.infoSplitter2.Visible  = false;
                        MovieDetails.infoSplitter3.Visible  = false;
                        MovieDetails.infoSplitter4.Visible  = false;
                        MovieDetails.imgIMDb.Visible        = false;
                        MovieDetails.lblSubDirector.Visible = false;
                        MovieDetails.lblSubCast.Visible     = false;


                        MovieDetails.imgPoster.Image = ChangeOpacity(Properties.Resources.default_poster, 0.5F);
                    }
                }
            }

            try
            {
                // Details from Popcorn Time API for Background (fanart/trailer)
                var jsonPopcornTime = client.DownloadString("https://tv-v2.api-fetch.website/movie/" + MovieDetails.infoImdbId);
                var data            = PopcornTimeEntity.FromJson(jsonPopcornTime);

                try { tabBlank.BackgroundImage = ChangeOpacity(LoadPicture(data.Images.Fanart), 0.2F); }
                catch { tabBlank.BackgroundImage = ChangeOpacity(Properties.Resources.background_original, 0.2F); }
                MovieDetails.infoFanartUrl  = data.Images.Fanart;
                MovieDetails.infoTrailerUrl = data.Trailer;
                //MovieDetails.btnFileTrailer.Visible = true;
            }
            catch
            {
                tabBlank.BackgroundImage    = ChangeOpacity(Properties.Resources.background_original, 0.4F);
                MovieDetails.infoFanartUrl  = "";
                MovieDetails.infoTrailerUrl = "";
                //MovieDetails.btnFileTrailer.Visible = false;
            }

            ctrlStreamInfo ctrlInfo = new ctrlStreamInfo();

            ctrlInfo.infoFileURL       = webFile;
            ctrlInfo.infoFileHost.Text = new Uri(webFile).Host;
            ctrlInfo.infoFileName.Text = Path.GetFileName(new Uri(webFile).LocalPath);
            MovieDetails.panelStreams.Controls.Add(ctrlInfo);
            MovieDetails.Dock = DockStyle.Fill;
            tabBlank.Controls.Clear();
            tabBlank.Controls.Add(MovieDetails);
            tab.SelectedTab = tabBlank;
        }