Exemplo n.º 1
0
 private void HandleTrackRemoved(object sender, LibraryTrackRemovedArgs args)
 {
     if (args.Track != null)
     {
         args.Track.Changed -= HandleTrackChanged;
     }
 }
        private void OnLibraryTrackRemoved(object sender, LibraryTrackRemovedArgs args)
        {
            if (args.Track != null)
            {
                PodcastInfo pi = null;
                TrackInfo   ti = args.Track;

                if (BadTrackHash(ti))
                {
                    return;
                }

                lock (TrackSync)
                {
                    if (tracks_keyed.ContainsKey(ti))
                    {
                        pi = tracks_keyed [ti] as PodcastInfo;
                    }
                    else
                    {
                        return;
                    }
                }

                if (pi != null)
                {
                    Console.WriteLine(pi);
                    RemovePodcast(pi);
                }
            }
            else if (args.Tracks != null)
            {
                ArrayList podcast_remove_list = new ArrayList();

                lock (TrackSync)
                {
                    PodcastInfo tmpPi;

                    foreach (TrackInfo ti in args.Tracks)
                    {
                        if (ti != null)
                        {
                            tmpPi = null;

                            if (BadTrackHash(ti))
                            {
                                continue;
                            }

                            if (tracks_keyed.ContainsKey(ti))
                            {
                                tmpPi = tracks_keyed [ti] as PodcastInfo;
                            }

                            if (tmpPi != null)
                            {
                                podcast_remove_list.Add(tmpPi);
                            }
                        }
                    }
                }

                if (podcast_remove_list.Count > 0)
                {
                    RemovePodcasts(podcast_remove_list);
                    UpdateParentFeeds(podcast_remove_list);
                }
            }
        }
 private void HandleTrackRemoved(object sender, LibraryTrackRemovedArgs args)
 {
     if (args.Track != null)
         args.Track.Changed -= HandleTrackChanged;
 }
        private void OnLibraryTrackRemoved(object sender, LibraryTrackRemovedArgs args)
        {
            if (args.Track != null)
            {
                PodcastInfo pi = null;
                TrackInfo ti = args.Track;

                if (BadTrackHash (ti))
                {
                    return;
                }

                lock (TrackSync)
                {
                    if (tracks_keyed.ContainsKey (ti))
                    {
                        pi = tracks_keyed [ti] as PodcastInfo;
                    }
                    else
                    {
                        return;
                    }
                }

                if (pi != null)
                {
                    Console.WriteLine (pi);
                    RemovePodcast (pi);
                }

            }
            else if (args.Tracks != null)
            {
                ArrayList podcast_remove_list = new ArrayList ();

                lock (TrackSync)
                {
                    PodcastInfo tmpPi;

                    foreach (TrackInfo ti in args.Tracks)
                    {
                        if (ti != null)
                        {
                            tmpPi = null;

                            if (BadTrackHash (ti))
                            {
                                continue;
                            }

                            if (tracks_keyed.ContainsKey (ti)) {
                                tmpPi = tracks_keyed [ti] as PodcastInfo;
                            }

                            if (tmpPi != null)
                            {
                                podcast_remove_list.Add (tmpPi);
                            }
                        }
                    }
                }

                if (podcast_remove_list.Count > 0)
                {
                    RemovePodcasts (podcast_remove_list);
                    UpdateParentFeeds (podcast_remove_list);
                }
            }
        }