public bool OnSelectMovie(IMDBFetcher fetcher, out int selectedMovie)
        {
            DlgMovieList dlg = new DlgMovieList();

            dlg.Filename = fetcher.MovieName;
            for (int i = 0; i < fetcher.Count; ++i)
            {
                dlg.AddMovie(fetcher[i].Title);
            }
            DialogResult result = dlg.ShowDialog(this);

            this.Update();
            if (result == DialogResult.Cancel)
            {
                selectedMovie = -1;
                return(false);
            }
            selectedMovie = dlg.SelectedItem;
            if (dlg.IsNewFind)
            {
                _newMovieToFind = dlg.NewTitleToFind;
                selectedMovie   = -1;
            }
            return(true);
        }
示例#2
0
 public bool OnDetailsEnd(IMDBFetcher fetcher)
 {
     CheckIMDBDetails();
     logger.Debug("OnDetailsEnd: {0} - {1}", _status, _filename);
     Utils.SendMovieRefresh();
     return(true);
 }
        public bool OnSelectMovie(IMDBFetcher fetcher, out int selectedMovie)
        {
            GUIDialogSelect pDlgSelect = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT);

            // more then 1 movie found
            // ask user to select 1
            pDlgSelect.SetHeading(196); //select movie
            pDlgSelect.Reset();
            for (int i = 0; i < fetcher.Count; ++i)
            {
                pDlgSelect.Add(fetcher[i].Title);
            }
            pDlgSelect.EnableButton(true);
            pDlgSelect.SetButtonLabel(413); // manual
            pDlgSelect.DoModal(GUIWindowManager.ActiveWindow);

            // and wait till user selects one
            selectedMovie = pDlgSelect.SelectedLabel;
            if (selectedMovie != -1)
            {
                return(true);
            }
            if (!pDlgSelect.IsButtonPressed)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
 public bool OnDetailsEnd(IMDBFetcher fetcher)
 {
     if (_progressDialog.IsInstance(fetcher))
     {
         _progressDialog.CloseProgress();
     }
     return(true);
 }
 public bool OnDisableCancel(IMDBFetcher fetcher)
 {
     if (_progressDialog.IsInstance(fetcher))
     {
         _progressDialog.DisableCancel();
     }
     return(true);
 }
 public bool OnSearchStarting(IMDBFetcher fetcher)
 {
     _progressDialog.ResetProgress();
     _progressDialog.SetHeading("Searching IMDB...");
     _progressDialog.SetLine1(fetcher.MovieName);
     _progressDialog.SetLine2(string.Empty);
     _progressDialog.Instance = fetcher;
     return(true);
 }
 public bool OnDetailsStarting(IMDBFetcher fetcher)
 {
     _progressDialog.ResetProgress();
     _progressDialog.SetHeading("Downloading Movie details...");
     _progressDialog.SetLine1("Downloading Movie details...");
     _progressDialog.SetLine2(fetcher.MovieName);
     _progressDialog.Instance = fetcher;
     return(true);
 }
 public bool OnActorInfoStarting(IMDBFetcher fetcher)
 {
     _progressDialog.ResetProgress();
     _progressDialog.SetHeading("Downloading Actor info...");
     _progressDialog.SetLine1("Downloading Actor info...");
     _progressDialog.SetLine2(fetcher.MovieName);
     _progressDialog.Instance = fetcher;
     return(true);
 }
 public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
 {
     movieName = _newMovieToFind;
     if (movieName == string.Empty)
     {
         return(false);
     }
     return(true);
 }
        public bool OnDetailsEnd(IMDBFetcher fetcher)
        {
            GUIDialogProgress pDlgProgress =
                (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS);

            if ((pDlgProgress != null) && (pDlgProgress.IsInstance(fetcher)))
            {
                pDlgProgress.Close();
            }
            return(true);
        }
        public bool OnMovieNotFound(IMDBFetcher fetcher)
        {
            // show dialog...
            GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);

            pDlgOK.SetHeading(195);
            pDlgOK.SetLine(1, fetcher.MovieName);
            pDlgOK.SetLine(2, string.Empty);
            pDlgOK.DoModal(GUIWindowManager.ActiveWindow);
            return(true);
        }
        public bool OnDisableCancel(IMDBFetcher fetcher)
        {
            GUIDialogProgress pDlgProgress =
                (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS);

            if (pDlgProgress.IsInstance(fetcher))
            {
                pDlgProgress.DisableCancel(true);
            }
            return(true);
        }
示例#13
0
        public NewMovie()
        {
            _status        = Utils.ImporterStatus.NONE;
            _selected      = -1;
            _moviedetails  = new IMDBMovie();
            _fetcher       = new IMDBFetcher(this);
            _grabbermovies = new List <GrabberMovie>();
            _hasnearest    = false;

            _moviedetails.ID = -1;
        }
        public bool OnSearchStarted(IMDBFetcher fetcher)
        {
            DialogResult result = _progressDialog.ShowDialog(this);

            this.Update();
            if (result == DialogResult.Cancel)
            {
                return(false);
            }
            return(true);
        }
        public bool OnActorsStarted(IMDBFetcher fetcher)
        {
            _progressDialog.Instance = fetcher;
            DialogResult result = _progressDialog.ShowDialog(this);

            this.Update();
            if (result == DialogResult.Cancel)
            {
                return(false);
            }
            return(true);
        }
        public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
        {
            string strMovieName = "";

            GetStringFromKeyboard(ref strMovieName);
            movieName = strMovieName;
            if (movieName == string.Empty)
            {
                return(false);
            }
            return(true);
        }
        public bool OnActorsStarted(IMDBFetcher fetcher)
        {
            GUIDialogProgress pDlgProgress =
                (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS);

            pDlgProgress.SetObject(fetcher);
            pDlgProgress.DoModal(GUIWindowManager.ActiveWindow);
            if (pDlgProgress.IsCanceled)
            {
                return(false);
            }
            return(true);
        }
        public bool OnSearchStarting(IMDBFetcher fetcher)
        {
            GUIDialogProgress pDlgProgress =
                (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS);

            // show dialog that we're busy querying www.imdb.com
            pDlgProgress.Reset();
            pDlgProgress.SetHeading(197);
            pDlgProgress.SetLine(1, fetcher.MovieName);
            pDlgProgress.SetLine(2, string.Empty);
            pDlgProgress.SetObject(fetcher);
            pDlgProgress.StartModal(GUIWindowManager.ActiveWindow);
            return(true);
        }
        public bool OnActorsStarting(IMDBFetcher fetcher)
        {
            GUIDialogProgress pDlgProgress =
                (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS);

            // show dialog that we're downloading the actor info
            pDlgProgress.Reset();
            pDlgProgress.SetHeading(986);
            pDlgProgress.SetLine(1, fetcher.MovieName);
            pDlgProgress.SetLine(2, string.Empty);
            pDlgProgress.SetObject(fetcher);
            pDlgProgress.StartModal(GUIWindowManager.ActiveWindow);
            return(true);
        }
示例#20
0
        public bool OnSearchEnd(IMDBFetcher fetcher)
        {
            _moviedetails.SearchString = MediaPortal.Util.Utils.GetFilename(_moviedetails.File, true);

            int minDistance = int.MaxValue;
            int idxNearest  = -1;

            lock (((ICollection)_grabbermovies).SyncRoot)
            {
                if (fetcher.Count > 0)
                {
                    for (int i = 0; i < fetcher.Count; ++i)
                    {
                        GrabberMovie movie = new GrabberMovie(fetcher[i].Title, _title);
                        if (movie.Distance < minDistance)
                        {
                            minDistance = movie.Distance;
                            idxNearest  = i;
                        }
                        _grabbermovies.Add(movie);
                    }

                    if (idxNearest > -1 && idxNearest < _grabbermovies.Count && minDistance <= Utils.NearestFactor)
                    {
                        _grabbermovies[idxNearest].IsNearest = true;
                        _hasnearest = true;
                    }
                }
            }

            if (Utils.ApproveIfOne && fetcher.Count == 1)
            {
                _selected = 0;
                Status    = Utils.ImporterStatus.QUEUED_INFO;
                logger.Debug("OnSearchEnd - Approve (One): {0} - {1} - {2}", _status, _grabbermovies[_selected].Title, fetcher[_selected].Database);
            }
            else if (Utils.ApproveForNearest && _hasnearest)
            {
                _selected = idxNearest;
                Status    = Utils.ImporterStatus.QUEUED_INFO;
                logger.Debug("OnSearchEnd - Approve (Nearest): {0} - {1} - {2} <= {3} - {4}", _status, _grabbermovies[_selected].Title, _grabbermovies[_selected].Distance, Utils.NearestFactor, fetcher[_selected].Database);
            }
            else
            {
                Status = Utils.ImporterStatus.WAITING;
            }
            logger.Debug("OnSearchEnd: {0} [{1}] {2} - {3}", _status, fetcher.Count, fetcher.MovieName, _filename);
            return(true);
        }
        private void buttonFind_Click(object sender, EventArgs e)
        {
            int          index    = 0;
            ListViewItem listItem = _listView1.SelectedItems[0];

            if (_textBoxTitle.Text == string.Empty)
            {
                MessageBox.Show("Please select a movie", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                ;
                return;
            }
            _progressDialog.Total = 1;
            _progressDialog.Count = 1;

            string    file = listItem.Text;
            IMDBMovie movieDetails = new IMDBMovie();
            string    path, filename;

            Util.Utils.Split(file, out path, out filename);
            movieDetails.Path         = path;
            movieDetails.File         = filename;
            movieDetails.SearchString = _textBoxTitle.Text;
            if (IMDBFetcher.GetInfoFromIMDB(this, ref movieDetails, false, false))
            {
                if (movieDetails != null)
                {
                    index = listItem.Index;
                    _listView1.Items.Remove(listItem);
                    if (_listView1.Items.Count > 0)
                    {
                        if (index >= _listView1.Items.Count)
                        {
                            index = _listView1.Items.Count - 1;
                        }
                        _listView1.SelectedIndices.Clear();
                        _listView1.SelectedIndices.Add(index);
                        _listView1.Update();
                    }
                    else
                    {
                        this.DialogResult = DialogResult.Cancel;
                        this.Close();
                    }
                }
            }
        }
示例#22
0
 public bool OnDetailsNotFound(IMDBFetcher fetcher)
 {
     Status = Utils.ImporterStatus.NONE;
     logger.Debug("OnDetailsNotFound: {0} - {1}", _status, _filename);
     return(false);
 }
 public bool OnDetailsNotFound(IMDBFetcher fetcher)
 {
     MessageBox.Show("Movie details could not be found.", fetcher.MovieName, MessageBoxButtons.OK,
                     MessageBoxIcon.Exclamation);
     return(true);
 }
 public bool OnActorsEnd(IMDBFetcher fetcher)
 {
     return(true);
 }
示例#25
0
 public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
 {
     movieName = _moviedetails.SearchString;
     logger.Debug("OnRequestMovieTitle: {0} - {1}", _status, _filename);
     return(false);
 }
示例#26
0
 public bool OnSelectActor(IMDBFetcher fetcher, out int selected)
 {
     selected = -1;
     logger.Debug("OnSelectActor: {0} - {1}", _status, _filename);
     return(false);
 }
 public bool OnMovieNotFound(IMDBFetcher fetcher)
 {
     MessageBox.Show("No IMDB info found!", fetcher.MovieName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     return(false);
 }
示例#28
0
 public bool OnActorsEnd(IMDBFetcher fetcher)
 {
     logger.Debug("OnActorsEnd: {0} - {1}", _status, _filename);
     return(true);
 }
 public bool OnSelectActor(IMDBFetcher fetcher, out int selectedActor)
 {
     selectedActor = -1;
     return(true);
 }
        // Changed - covers and the same movie name
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            base.OnClicked(controlId, control, actionType);
            if (control == btnRefresh)
            {
                // Check Internet connection
                if (!Win32API.IsConnectedToInternet())
                {
                    GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
                    dlgOk.SetHeading(257);
                    dlgOk.SetLine(1, GUILocalizeStrings.Get(703));
                    dlgOk.DoModal(GUIWindowManager.ActiveWindow);
                    return;
                }
                string title = currentMovie.Title;
                int    id    = currentMovie.ID;
                string file  = currentMovie.Path + "\\" + currentMovie.File;
                // Delete covers
                FanArt.DeleteCovers(title, id);
                //Delete fanarts
                FanArt.DeleteFanarts(file, title);

                if (IMDBFetcher.RefreshIMDB(this, ref currentMovie, false, false, true))
                {
                    if ((imageSearchThread != null) && (imageSearchThread.IsAlive))
                    {
                        imageSearchThread.Abort();
                        imageSearchThread = null;
                    }

                    imdbCoverArtUrl = currentMovie.ThumbURL;
                    coverArtUrls    = new string[1];
                    coverArtUrls[0] = imdbCoverArtUrl;

                    ResetSpinControl();

                    Refresh(false);
                    Update();
                    // Start images search thread
                    SearchImages();
                }
                return;
            }

            if (control == spinImages)
            {
                int item = spinImages.Value - 1;
                if (item < 0 || item >= coverArtUrls.Length)
                {
                    item = 0;
                }
                if (currentMovie.ThumbURL == coverArtUrls[item])
                {
                    return;
                }

                currentMovie.ThumbURL = coverArtUrls[item];
                // Title suffix for problem with covers and movie with the same name
                string titleExt           = currentMovie.Title + "{" + currentMovie.ID + "}";
                string coverArtImage      = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, titleExt);
                string largeCoverArtImage = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
                Util.Utils.FileDelete(coverArtImage);
                //
                // 07.11.2010 Deda: Cache entry Flag change for cover thumb file
                //
                Util.Utils.DoInsertNonExistingFileIntoCache(coverArtImage);
                //
                Util.Utils.FileDelete(largeCoverArtImage);
                Refresh(false);
                Update();
                int idMovie = currentMovie.ID;
                if (idMovie >= 0)
                {
                    VideoDatabase.SetThumbURL(idMovie, currentMovie.ThumbURL);
                }
                return;
            }

            if (control == btnCast)
            {
                viewmode = ViewMode.Cast;
                Update();
            }

            if (control == btnPlot)
            {
                viewmode = ViewMode.Plot;
                Update();
            }

            if (control == btnReview)
            {
                viewmode = ViewMode.Review;
                Update();
            }

            if (control == btnWatched)
            {
                if (currentMovie.Watched > 0)
                {
                    GUIPropertyManager.SetProperty("#iswatched", "no");
                    currentMovie.Watched = 0;
                    VideoDatabase.SetMovieWatchedStatus(currentMovie.ID, false);
                    ArrayList files = new ArrayList();
                    VideoDatabase.GetFiles(currentMovie.ID, ref files);

                    foreach (string file in files)
                    {
                        int fileId = VideoDatabase.GetFileId(file);
                        VideoDatabase.DeleteMovieStopTime(fileId);
                    }
                }
                else
                {
                    GUIPropertyManager.SetProperty("#iswatched", "yes");
                    currentMovie.Watched = 1;
                    VideoDatabase.SetMovieWatchedStatus(currentMovie.ID, true);
                }
                VideoDatabase.SetWatched(currentMovie);
            }

            if (control == spinDisc)
            {
                string selectedItem = spinDisc.GetLabel();
                int    idMovie      = currentMovie.ID;
                if (idMovie > 0)
                {
                    if (selectedItem != "HD" && selectedItem != "share")
                    {
                        VideoDatabase.SetDVDLabel(idMovie, selectedItem);
                    }
                    else
                    {
                        VideoDatabase.SetDVDLabel(idMovie, "HD");
                    }
                }
            }

            if (control == btnPlay)
            {
                int id = currentMovie.ID;

                ArrayList files = new ArrayList();
                VideoDatabase.GetFiles(id, ref files);

                if (files.Count > 1)
                {
                    GUIVideoFiles._stackedMovieFiles = files;
                    GUIVideoFiles._isStacked         = true;
                    GUIVideoFiles.MovieDuration(files);
                }

                GUIVideoFiles.PlayMovie(id, false);
                return;
            }
        }