BeatMachine.Model.DataModel.DiffSongs C# (CSharp) Method

DiffSongs() public method

public DiffSongs ( object state ) : void
state object
return void
        public void DiffSongs(object state)
        {
            // TODO Need to handle case where they deleted some songs locally
            // but they are still in our database and we'll attempt to play them

            if (AnalyzedSongs.Count != SongsOnDevice.Count)
            {
                logger.Debug("Found songs that need to be analyzed");

                foreach (AnalyzedSong song in SongsOnDevice)
                {
                    if (!AnalyzedSongIds.Contains(song.ItemId))
                    {
                        SongsToAnalyze.Add(song);
                        SongsToAnalyzeIds.Add(song.ItemId);
                        logger.Trace("Adding song for analysis '{0}'",
                            song.ToString());
                    }
                }
                SongsToAnalyzeLoaded = true;
            } else {
                AllDone = true;
                NewSongsAdded = true;
                logger.Info("No songs left to analyze, all done");
            }
            SongsOnDevice = null;
            AnalyzedSongs = null;
            AnalyzedSongIds = null;
            logger.Info("Completed DiffSongs");
        }