Exemplo n.º 1
0
        /// <summary>
        /// Process a single item
        /// </summary>
        /// <param name="itemsToProcess"></param>
        /// <returns></returns>
        public bool TryProcess(Mp3File itemToProcess, List <Website> targetWebsites)
        {
            var success = false;

            log.Log("Processing item " + Path.GetFileName(itemToProcess.AbsolutePath) + "\n");

            if (audioFingerprintLookup != null)
            {
                try
                {
                    log.Log("Attempting audio fingerprint lookup.\n");
                    audioFingerprintLookup.Lookup(itemToProcess);
                    log.Log("Audio fingerprint lookup successful.\n");
                    success = true;
                }
                catch
                {
                    log.Log("Audio fingerprint lookup failed.\n");
                }
            }

            if (targetWebsites != null && targetWebsites.Count > 0)
            {
                try
                {
                    log.Log("Attempting screen scraping.\n");
                    foreach (var website in targetWebsites)
                    {
                        httpScreenScrapping.Process(itemToProcess, website);
                    }
                    log.Log("Screen scraping successful.\n");
                    success = true;
                }
                catch
                {
                    log.Log("Screen scraping failed.\n");
                }
            }

            var mp3FileDialogue = new Mp3FileDialogue(itemToProcess);

            mp3FileDialogue.Show();

            return(success);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a dialogue using the Mp3File from the binded grids data source
        /// </summary>
        private void ItemsToProcessQueue_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            var mp3FileDialogue = new Mp3FileDialogue(itemsToProcess.ElementAt(e.RowIndex));

            mp3FileDialogue.Show();
        }