Exemplo n.º 1
0
        //process selected files to unignore
        private void unignoreSelectedFiles()
        {
            //setup array to store movie list and number of rows variable
            ArrayList selMovie = new ArrayList();
            int       rowSel   = ignoredMovieGrid.SelectedRows.Count;

            //process each selected cell and copy the movie name to the arraylist
            foreach (DataGridViewCell cellSel in ignoredMovieGrid.SelectedCells)
            {
                if (cellSel.ToolTipText.Length > 0)
                {
                    selMovie.Add(cellSel.ToolTipText);
                }
            }
            //look for all ignored DBLocalMedia and see if it was in the array build from the selectedCell list above
            foreach (DBLocalMedia currFile in DBLocalMedia.GetAll())
            {
                if (currFile.Ignored && selMovie.Contains(currFile.File.FullName))
                {
                    currFile.Delete();
                }
            }

            MovingPicturesCore.Importer.RestartScanner();
        }
Exemplo n.º 2
0
        // Gets and resturns a List<> of all ignored files
        private List <DBLocalMedia> getIgnoredFiles()
        {
            List <DBLocalMedia> hidFil = new List <DBLocalMedia>();

            foreach (DBLocalMedia currFile in DBLocalMedia.GetAll())
            {
                if (currFile.Ignored)
                {
                    hidFil.Add(currFile);
                }
            }
            return(hidFil);
        }
Exemplo n.º 3
0
        public override void Work()
        {
            if (!MovingPicturesCore.Settings.AutoRetrieveMediaInfo)
            {
                return;
            }

            logger.Info("Starting background media info update process.");

            List <DBLocalMedia> allLocalMedia = DBLocalMedia.GetAll();

            foreach (DBLocalMedia lm in allLocalMedia)
            {
                if (lm.ID != null && !lm.HasMediaInfo)
                {
                    lm.UpdateMediaInfo();
                    lm.Commit();
                }
            }

            logger.Info("Background media info update process complete.");
        }
Exemplo n.º 4
0
        public override void Work()
        {
            float count = 0;
            float total = DBTrackInfo.GetAll().Count;

            if (!mvCentralCore.Settings.AutoRetrieveMediaInfo)
            {
                return;
            }

            logger.Info("Begining background media info update process.");

            List <DBLocalMedia> allLocalMedia = DBLocalMedia.GetAll();

            foreach (DBLocalMedia lm in allLocalMedia)
            {
                if (lm.ID != null && !lm.HasMediaInfo)
                {
                    lm.UpdateMediaInfo();
                    lm.Commit();
                }
            }


            foreach (DBTrackInfo currTrack in DBTrackInfo.GetAll())
            {
                OnProgress((count * 100) / total);
                count++;
                // Check for Artist missing data
                try
                {
                    if (currTrack.ID == null)
                    {
                        continue;
                    }

                    if (currTrack.ArtistInfo[0].DisallowBackgroundUpdate && !mvCentralCore.Settings.BackgroundScanAlways)
                    {
                        continue;
                    }


                    logger.Debug("Checking for Artist missing deails " + currTrack.GetType().ToString() + " CurrMusicVideo.ID : " + currTrack.Track);
                    mvCentralCore.DataProviderManager.GetArtistDetail(currTrack);

                    // because this operation can take some time we check again
                    // if the artist/album/track was not deleted while we were getting artwork
                    if (currTrack.ID == null)
                    {
                        continue;
                    }

                    currTrack.Commit();
                }
                catch (Exception e)
                {
                    if (e is ThreadAbortException)
                    {
                        throw e;
                    }

                    logger.ErrorException("Error retrieving Artist details for " + currTrack.Basic, e);
                }
                // Check for Album missing data if album support enabled
                if (currTrack.AlbumInfo.Count > 0 && !mvCentralCore.Settings.DisableAlbumSupport)
                {
                    try
                    {
                        if (currTrack.ID == null)
                        {
                            continue;
                        }

                        if (currTrack.ArtistInfo[0].DisallowBackgroundUpdate && !mvCentralCore.Settings.BackgroundScanAlways)
                        {
                            continue;
                        }

                        logger.Debug("Checking for Album missing deails " + currTrack.GetType().ToString() + " Title : " + currTrack.AlbumInfo[0].Album);
                        mvCentralCore.DataProviderManager.GetAlbumDetail(currTrack);

                        // because this operation can take some time we check again
                        // if the artist/album/track was not deleted while we were getting artwork
                        if (currTrack.ID == null)
                        {
                            continue;
                        }

                        currTrack.Commit();
                    }
                    catch (Exception e)
                    {
                        if (e is ThreadAbortException)
                        {
                            throw e;
                        }

                        logger.ErrorException("Error retrieving Album details for " + currTrack.Basic, e);
                    }
                }

                // Prevent further background updates
                currTrack.ArtistInfo[0].DisallowBackgroundUpdate = true;
                if (currTrack.AlbumInfo.Count > 0)
                {
                    currTrack.AlbumInfo[0].DisallowBackgroundUpdate = true;
                }

                currTrack.Commit();
            }

            logger.Info("Background media info update process complete.");
            OnProgress(100.0);
        }