Start() public method

public Start ( ) : void
return void
Ejemplo n.º 1
0
        public void FetchCoverArt(bool force)
        {
            if (job == null && ServiceManager.Get <Network> ().Connected)
            {
                DateTime last_scan = DateTime.MinValue;

                if (!force)
                {
                    try {
                        last_scan = DatabaseConfigurationClient.Client.Get <DateTime> ("last_cover_art_scan",
                                                                                       DateTime.MinValue);
                    } catch (FormatException) {
                        Log.Warning("last_cover_art_scan is malformed, resetting to default value");
                        DatabaseConfigurationClient.Client.Set <DateTime> ("last_cover_art_scan",
                                                                           DateTime.MinValue);
                    }
                }
                job           = new CoverArtJob(last_scan);
                job.Finished += delegate {
                    if (!job.IsCancelRequested)
                    {
                        DatabaseConfigurationClient.Client.Set <DateTime> ("last_cover_art_scan", DateTime.Now);
                    }
                    job = null;
                };
                job.Start();
            }
        }
Ejemplo n.º 2
0
        public void FetchCoverArt (bool force)
        {
            if (job == null && ServiceManager.Get<Network> ().Connected) {
                DateTime last_scan = DateTime.MinValue;

                if (!force) {
                    try {
                        last_scan = DatabaseConfigurationClient.Client.Get<DateTime> ("last_cover_art_scan",
                                                                                      DateTime.MinValue);
                    } catch (FormatException) {
                        Log.Warning ("last_cover_art_scan is malformed, resetting to default value");
                        DatabaseConfigurationClient.Client.Set<DateTime> ("last_cover_art_scan",
                                                                          DateTime.MinValue);
                    }
                }
                job = new CoverArtJob (last_scan);
                job.Finished += delegate {
                    if (!job.IsCancelRequested) {
                        DatabaseConfigurationClient.Client.Set<DateTime> ("last_cover_art_scan", DateTime.Now);
                    }
                    job = null;
                };
                job.Start ();
            }
        }