private void Queue(TrackInfo track) { if (track == null || st.PlayTime == 0 || !(actions["AudioscrobblerEnableAction"] as ToggleAction).Active) { return; } Log.DebugFormat("Track {3} had playtime of {0} msec ({4}sec), duration {1} msec, queued: {2}", st.PlayTime, track.Duration.TotalMilliseconds, queued, track, st.PlayTime / 1000); if (!queued && track.Duration.TotalSeconds > 30 && (track.MediaAttributes & TrackMediaAttributes.Music) != 0 && !String.IsNullOrEmpty(track.ArtistName) && !String.IsNullOrEmpty(track.TrackTitle) && (st.PlayTime > track.Duration.TotalMilliseconds / 2 || st.PlayTime > 240 * 1000)) { if (!connection.Started) { connection.Start(); } queue.Add(track, song_start_time); queued = true; } }
private void Queue(TrackInfo track) { if (track == null || st.PlayTime == 0 || !((ToggleAction)actions["AudioscrobblerEnableAction"]).Active) { return; } Log.DebugFormat("Track {3} had playtime of {0} msec ({4}sec), duration {1} msec, queued: {2}", st.PlayTime, track.Duration.TotalMilliseconds, queued, track, st.PlayTime / 1000); if (!queued && IsValidForSubmission(track) && (st.PlayTime > track.Duration.TotalMilliseconds / 2 || st.PlayTime > MINIMUM_TRACK_PLAYTIME.TotalMilliseconds)) { if (!connection.Started) { connection.Start(); } queue.Add(track, song_start_time); queued = true; } }