public void StopScrobble() { if (CurrentRecording == null) { return; } // get current progress of player bool watched = false; double progress = 0.0; if (g_Player.Duration > 0.0) { progress = Math.Round((g_Player.CurrentPosition / g_Player.Duration) * 100.0, 2); } TraktLogger.Info("Video recording has stopped, checking progress. Title = '{0}', Current Position = '{1}', Duration = '{2}', Progress = '{3}%'", CurrentRecording.Title, g_Player.CurrentPosition.ToString(), g_Player.Duration.ToString(), progress > 100.0 ? "100" : progress.ToString()); // if recording is at least 80% complete, consider watched // consider watched with invalid progress as well, we should never be exactly 0.0 if (progress == 0.0 || progress >= 80.0) { watched = true; // Show rate dialog BasicHandler.ShowRateDialog(CurrentRecording); } BasicHandler.StopScrobble(CurrentRecording, watched); CurrentRecording = null; }