예제 #1
0
        void IgnoreCertSongs()
        {
            try
            {
                ProgressDisableUI("Ignoring selected played songs...");
                List <TblSong> DBSongQueryList = DBCon.TblSong.ToList();
                foreach (object SelItem in lb_ScrobbleListBox.SelectedItems)
                {
                    ScrobbleSongsList SelectedItem = (ScrobbleSongsList)SelItem;
                    TblSong           DBSong       = DBSongQueryList.Where(x => x.Id == SelectedItem.Id).FirstOrDefault();
                    DBSong.Ignored = 1;
                }
                DBCon.SubmitChanges();

                if (!(bool)vApplicationSettings["LastfmReduceConfirmation"])
                {
                    Dispatcher.BeginInvoke(delegate { MessageBox.Show("Your selected played songs have successfully been ignored from scrobbling and can now be found on the Ignore tab.", "ScrobbleMe", MessageBoxButton.OK); });
                }
            }
            catch (Exception ex)
            { Dispatcher.BeginInvoke(delegate { MessageBox.Show("Failed to ignore your selected played songs.\n\nException Message: " + ex.Message, "ScrobbleMe", MessageBoxButton.OK); }); }

            Thread ThreadLoadScrobble = new Thread(() => LoadScrobbleIgnore());

            ThreadLoadScrobble.Start();
            return;
        }
예제 #2
0
        void SkipCertSongs()
        {
            try
            {
                ProgressDisableUI("Skipping selected played songs...");
                List <TblSong> DBSongQueryList = DBCon.TblSong.ToList();
                foreach (object SelItem in lb_ScrobbleListBox.SelectedItems)
                {
                    ScrobbleSongsList SelectedItem = (ScrobbleSongsList)SelItem;
                    TblSong           DBSong       = DBSongQueryList.Where(x => x.Id == SelectedItem.Id).FirstOrDefault();
                    DBSong.Scrobbles = DBSong.Plays;
                }
                DBCon.SubmitChanges();

                if (!(bool)vApplicationSettings["LastfmReduceConfirmation"])
                {
                    Dispatcher.BeginInvoke(delegate { MessageBox.Show("Your selected played songs have been skipped, it's time to scrobble the songs!", "ScrobbleMe", MessageBoxButton.OK); });
                }

                Thread ThreadLoadScrobble = new Thread(() => LoadScrobbleIgnore());
                ThreadLoadScrobble.Start();
                return;
            }
            catch (Exception ex)
            {
                Dispatcher.BeginInvoke(delegate { MessageBox.Show("Failed to skip your selected played songs.\n\nException Message: " + ex.Message, "ScrobbleMe", MessageBoxButton.OK); });
                Thread ThreadLoadScrobble = new Thread(() => LoadScrobbleIgnore());
                ThreadLoadScrobble.Start();
                return;
            }
        }